diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/build-binary.sh percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/build-binary.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/build-binary.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/build-binary.sh 2017-10-19 04:25:29.000000000 +0000 @@ -95,7 +95,7 @@ CMAKE_BUILD_TYPE='Debug' BUILD_COMMENT="${BUILD_COMMENT:-}-debug" DEBUG_EXTRA="-DDEBUG_EXTNAME=ON" - SCONS_ARGS+=' debug=1' + SCONS_ARGS+=' debug=0' ;; -G | --copygalera ) shift @@ -387,8 +387,8 @@ -DWITH_SCALABILITY_METRICS=ON \ $OPENSSL_INCLUDE $OPENSSL_LIBRARY $CRYPTO_LIBRARY - make $MAKE_JFLAG $QUIET - make install + make $MAKE_JFLAG $QUIET || exit 1 + make install || exit 1 cp -v sql/mysqld-debug $TARGETDIR/usr/local/$PRODUCT_FULL_NAME/bin/mysqld echo "mysqld in build in debug mode" else @@ -412,8 +412,8 @@ -DWITH_SCALABILITY_METRICS=ON \ $OPENSSL_INCLUDE $OPENSSL_LIBRARY $CRYPTO_LIBRARY - make $MAKE_JFLAG $QUIET - make install + make $MAKE_JFLAG $QUIET || exit 1 + make install || exit 1 echo "mysqld in build in release mode" fi diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/percona-xtradb-cluster.spec percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/percona-xtradb-cluster.spec --- percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/percona-xtradb-cluster.spec 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/percona-xtradb-cluster.spec 2017-10-19 04:25:29.000000000 +0000 @@ -31,6 +31,7 @@ %define percona_server_version @@PERCONA_VERSION@@ %define revision @@REVISION@@ %define distribution rhel%{redhatversion} +%define galera_version @@GALERA_VERSION@@ # %bcond_with tokudb @@ -271,7 +272,10 @@ URL: http://www.percona.com/ Packager: Percona MySQL Development Team Vendor: %{percona_server_vendor} -Requires: %{distro_requires} Percona-XtraDB-Cluster-server%{product_suffix} Percona-XtraDB-Cluster-client%{product_suffix} Percona-XtraDB-Cluster-galera-3 +Requires: %{distro_requires} +Requires: Percona-XtraDB-Cluster-server%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-client%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-galera-3 = %{galera_version} Provides: mysql-server BuildRequires: %{distro_buildreq} pam-devel openssl-devel numactl-devel %if 0%{?systemd} @@ -303,9 +307,24 @@ Summary: Percona XtraDB Cluster - full package Group: Applications/Databases %if "%rhel" == "5" -Requires: %{distro_requires} Percona-XtraDB-Cluster-server%{product_suffix} Percona-XtraDB-Cluster-client%{product_suffix} Percona-XtraDB-Cluster-galera-3 Percona-XtraDB-Cluster-garbd-3 Percona-XtraDB-Cluster-test%{product_suffix} Percona-XtraDB-Cluster%{product_suffix}-debuginfo Percona-XtraDB-Cluster-galera-3-debuginfo -%else -Requires: %{distro_requires} Percona-XtraDB-Cluster-server%{product_suffix} Percona-XtraDB-Cluster-client%{product_suffix} Percona-XtraDB-Cluster-devel%{product_suffix} Percona-XtraDB-Cluster-galera-3 Percona-XtraDB-Cluster-garbd-3 Percona-XtraDB-Cluster-test%{product_suffix} Percona-XtraDB-Cluster%{product_suffix}-debuginfo Percona-XtraDB-Cluster-galera-3-debuginfo +Requires: %{distro_requires} +Requires: Percona-XtraDB-Cluster-server%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-client%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-galera-3 = %{galera_version} +Requires: Percona-XtraDB-Cluster-garbd-3 = %{galera_version} +Requires: Percona-XtraDB-Cluster-test%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster%{product_suffix}-debuginfo = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-galera-3-debuginfo = %{galera_version} +%else +Requires: %{distro_requires} +Requires: Percona-XtraDB-Cluster-server%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-client%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-devel%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-galera-3 = %{galera_version} +Requires: Percona-XtraDB-Cluster-garbd-3 = %{galera_version} +Requires: Percona-XtraDB-Cluster-test%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster%{product_suffix}-debuginfo = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-galera-3-debuginfo = %{galera_version} %endif %description -n Percona-XtraDB-Cluster-full%{product_suffix} @@ -316,7 +335,11 @@ %package -n Percona-XtraDB-Cluster-server%{product_suffix} Summary: Percona XtraDB Cluster - server package Group: Applications/Databases -Requires: %{distro_requires} Percona-XtraDB-Cluster-client%{product_suffix} Percona-XtraDB-Cluster-shared%{product_suffix} Percona-XtraDB-Cluster-galera-25 percona-xtrabackup >= 2.2.5 socat rsync iproute perl-DBI perl-DBD-MySQL lsof +Requires: %{distro_requires} +Requires: Percona-XtraDB-Cluster-client%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-shared%{product_suffix} = 1:%{mysql_version}-%{release} +Requires: Percona-XtraDB-Cluster-galera-3 = %{galera_version} +Requires: percona-xtrabackup >= 2.2.5 socat rsync iproute perl-DBI perl-DBD-MySQL lsof Requires: perl(Data::Dumper) %if 0%{?systemd} Requires(post): systemd @@ -559,6 +582,7 @@ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ -DWITH_WSREP=1 \ -DWITH_INNODB_DISALLOW_WRITES=ON \ + -DWITH_SCALABILITY_METRICS=ON \ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ -DWITH_PAM=ON %{TOKUDB_FLAGS} %{TOKUDB_DEBUG_ON} echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG @@ -586,6 +610,7 @@ -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ -DWITH_WSREP=1 \ -DWITH_INNODB_DISALLOW_WRITES=ON \ + -DWITH_SCALABILITY_METRICS=ON \ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ -DWITH_PAM=ON %{TOKUDB_FLAGS} %{TOKUDB_DEBUG_OFF} echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG @@ -940,18 +965,6 @@ if [ $1 -eq 1 ]; then # ---------------------------------------------------------------------- -# Create data directory if needed, check whether upgrade or install -# ---------------------------------------------------------------------- -if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi -# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START" -if [ ! -d $mysql_datadir/mysql ] ; then - echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE -else - # If the directory exists, we may assume it is an upgrade. - echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE -fi - -# ---------------------------------------------------------------------- # Create a MySQL user and group. Do not report any problems if it already # exists. # ---------------------------------------------------------------------- @@ -963,6 +976,20 @@ usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true # ---------------------------------------------------------------------- +# Create data directory if needed, check whether upgrade or install +# ---------------------------------------------------------------------- +if [ ! -d $mysql_datadir ]; then + install -d -m 0755 -o %{mysqld_user} -g %{mysqld_group} $mysql_datadir +fi +# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START" +if [ ! -d $mysql_datadir/mysql ] ; then + echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE +else + # If the directory exists, we may assume it is an upgrade. + echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE +fi + +# ---------------------------------------------------------------------- # Change permissions so that the user that will run the MySQL daemon # owns all database files. # ---------------------------------------------------------------------- diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/rpm/my.cnf percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/rpm/my.cnf --- percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/rpm/my.cnf 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/rpm/my.cnf 2017-10-19 04:25:29.000000000 +0000 @@ -21,11 +21,8 @@ wsrep_cluster_name = Cluster wsrep_node_name = Node1 -innodb_locks_unsafe_for_binlog = 1 innodb_autoinc_lock_mode = 2 - - [mysqld_safe] pid-file = /run/mysqld/mysql.pid syslog diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/rpm/mysql-systemd percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/rpm/mysql-systemd --- percona-xtradb-cluster-5.6-5.6.34-26.19/build-ps/rpm/mysql-systemd 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/build-ps/rpm/mysql-systemd 2017-10-19 04:25:29.000000000 +0000 @@ -43,9 +43,9 @@ # If log file is not specified it's put into datadir by default if [ ! -z $log ]; then - [ -e $log ] || touch $log - chmod 0640 $log - chown mysql:mysql $log || exit 1 + if [ ! -f $log ]; then + install -m 0640 -omysql -gmysql /dev/null $log + fi if [ -x /usr/sbin/restorecon ]; then /usr/sbin/restorecon $log fi @@ -242,8 +242,13 @@ if [[ -s $pid_path ]];then mysql_pid=$(cat $pid_path) if [[ -n ${mysql_pid:-} ]] && kill -0 $mysql_pid 2>/dev/null;then - log_warning_msg "Another instance of mysqld running on $mysql_pid, exiting.." - exit 1 + mysql_existed_pid=$(ps wwaux | grep mysql | grep "wsrep-provider" | awk '{print $2}') + if [[ ${mysql_pid} == ${mysql_existed_pid} ]]; then + log_warning_msg "PXC is in bootstrap mode. To switch to normal operation, first stop the mysql@bootstrap.service then start the mysql service" + else + log_warning_msg "Another instance of mysqld running on $mysql_pid, exiting.." + fi + exit 1 fi fi } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/client_priv.h percona-xtradb-cluster-5.6-5.6.37-26.21/client/client_priv.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/client_priv.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/client_priv.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -111,6 +111,7 @@ OPT_ENABLE_COMPRESSED_COLUMNS, OPT_ENABLE_COMPRESSED_COLUMNS_WITH_DICTIONARIES, OPT_DROP_COMPRESSION_DICTIONARY, + OPT_ORDER_BY_PRIMARY_DESC, OPT_MAX_CLIENT_OPTION }; @@ -137,13 +138,15 @@ /** Wrapper for mysql_real_connect() that checks if SSL connection is establised. - The function calls mysql_real_connect() first, then if given ssl_required==TRUE - argument (i.e. --ssl-mode=REQUIRED option used) checks current SSL chiper to - ensure that SSL is used for current connection. - Otherwise it returns NULL and sets errno to CR_SSL_CONNECTION_ERROR. - - All clients (except mysqlbinlog which disregards SSL options) use this function - instead of mysql_real_connect() to handle --ssl-mode=REQUIRED option. + The function calls mysql_real_connect() first. Then, if the ssl_required + argument is TRUE (i.e., the --ssl-mode=REQUIRED option was specified), it + checks the current SSL cipher to ensure that SSL is used for the current + connection. Otherwise, it returns NULL and sets errno to + CR_SSL_CONNECTION_ERROR. + + All clients (except mysqlbinlog, which disregards SSL options) use this + function instead of mysql_real_connect() to handle the --ssl-mode=REQUIRED + option. */ MYSQL *mysql_connect_ssl_check(MYSQL *mysql_arg, const char *host, const char *user, const char *passwd, @@ -151,8 +154,22 @@ const char *unix_socket, ulong client_flag, my_bool ssl_required MY_ATTRIBUTE((unused))) { - MYSQL *mysql= mysql_real_connect(mysql_arg, host, user, passwd, db, port, - unix_socket, client_flag); + MYSQL *mysql; + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + enum mysql_ssl_mode opt_ssl_mode= SSL_MODE_REQUIRED; + if (ssl_required && + mysql_options(mysql_arg, MYSQL_OPT_SSL_MODE, (char *) &opt_ssl_mode)) + { + NET *net= &mysql_arg->net; + net->last_errno= CR_SSL_CONNECTION_ERROR; + strmov(net->last_error, "Client library doesn't support MYSQL_SSL_REQUIRED option"); + strmov(net->sqlstate, "HY000"); + return NULL; + } +#endif + mysql= mysql_real_connect(mysql_arg, host, user, passwd, db, port, + unix_socket, client_flag); #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) if (mysql && /* connection established. */ ssl_required && /* --ssl-mode=REQUIRED. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqladmin.cc percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqladmin.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqladmin.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqladmin.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -552,8 +552,8 @@ for (;;) { if (mysql_connect_ssl_check(mysql, host, user, opt_password, NullS, - tcp_port, unix_port, - CLIENT_REMEMBER_OPTIONS, opt_ssl_required)) + tcp_port, unix_port, CLIENT_REMEMBER_OPTIONS, + opt_ssl_mode == SSL_MODE_REQUIRED)) { mysql->reconnect= 1; if (info) @@ -1564,8 +1564,10 @@ if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'")) { - my_printf_error(0, "query failed; error: '%s'", error_flags, - mysql_error(mysql)); + my_printf_error(mysql_errno(mysql), + "The query to get the server's pid file failed," + " error: '%s'. Continuing.", error_flags, + mysql_error(mysql)); } result = mysql_store_result(mysql); if (result) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlbinlog.cc percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlbinlog.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlbinlog.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlbinlog.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,21 +60,6 @@ using std::min; using std::max; -/** - The function represents Log_event delete wrapper - to reset possibly active temp_buf member. - It's to be invoked in context where the member is - not bound with dynamically allocated memory and therefore can - be reset as simple as with plain assignment to NULL. - - @param ev a pointer to Log_event instance -*/ -inline void reset_temp_buf_and_delete(Log_event *ev) -{ - ev->temp_buf= NULL; - delete ev; -} - /* Needed for Rpl_filter */ CHARSET_INFO *table_alias_charset= &my_charset_bin; @@ -96,6 +81,21 @@ #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES) #include +/** + The function represents Log_event delete wrapper + to reset possibly active temp_buf member. + It's to be invoked in context where the member is + not bound with dynamically allocated memory and therefore can + be reset as simple as with plain assignment to NULL. + + @param ev a pointer to Log_event instance +*/ +inline void reset_temp_buf_and_delete(Log_event *ev) +{ + ev->temp_buf= NULL; + delete ev; +} + char server_version[SERVER_VERSION_LENGTH]; ulong filter_server_id = 0; /* @@ -301,6 +301,10 @@ O_CREAT|O_EXCL|O_BINARY|O_WRONLY,MYF(0)))!=-1) return res; } + char errbuf[MYSYS_STRERROR_SIZE]; + error("create_unique_file: " + "my_create failed on filename %s, my_errno %d (%s)", + filename, my_errno, my_strerror(errbuf, sizeof(errbuf), my_errno)); return -1; } @@ -2683,10 +2687,9 @@ retval= ERROR_STOP; } if (ev) - { - ev->temp_buf=0; - delete ev; - } + reset_temp_buf_and_delete(ev); + /* Flush result_file after every event */ + fflush(result_file); } else { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysql.cc percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysql.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysql.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysql.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -159,7 +159,7 @@ default_pager_set= 0, opt_sigint_ignore= 0, auto_vertical_output= 0, show_warnings= 0, executing_query= 0, interrupted_query= 0, - ignore_spaces= 0, opt_syslog= 0; + ignore_spaces= 0, opt_binhex= 0, opt_syslog= 0; static my_bool debug_info_flag, debug_check_flag; static my_bool column_types_flag; static my_bool preserve_comments= 0; @@ -1489,7 +1489,8 @@ "program_name", "mysql"); if (!mysql_connect_ssl_check(kill_mysql, current_host, current_user, opt_password, "", opt_mysql_port, - opt_mysql_unix_port, 0, opt_ssl_required)) + opt_mysql_unix_port, 0, + opt_ssl_mode == SSL_MODE_REQUIRED)) { tee_fprintf(stdout, "%s -- sorry, cannot connect to server to kill query, giving up ...\n", reason); goto err; @@ -1568,6 +1569,8 @@ {"bind-address", 0, "IP address to bind to.", (uchar**) &opt_bind_addr, (uchar**) &opt_bind_addr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"binary-as-hex", 'b', "Print binary data as hex", &opt_binhex, &opt_binhex, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"character-sets-dir", OPT_CHARSETS_DIR, "Directory for character set files.", &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -2675,7 +2678,7 @@ if not. */ -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_XLINE_INTERFACE) static int fake_magic_space(int, int); extern "C" char *no_completion(const char*,int) #elif defined(USE_LIBEDIT_INTERFACE) @@ -2757,7 +2760,7 @@ } -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_XLINE_INTERFACE) static int fake_magic_space(int, int) #else static int fake_magic_space(const char *, int) @@ -2774,7 +2777,7 @@ rl_readline_name = name; /* Tell the completer that we want a crack first. */ -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_XLINE_INTERFACE) rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion; rl_completion_entry_function= (rl_compentry_func_t*)&no_completion; @@ -2804,7 +2807,7 @@ int end MY_ATTRIBUTE((unused))) { if (!status.batch && !quick) -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_XLINE_INTERFACE) return rl_completion_matches(text, new_command_generator); #else return completion_matches((char *)text, (CPFunction *)new_command_generator); @@ -3738,6 +3741,39 @@ tee_puts("", PAGER); } +/* Used to determine if we should invoke print_as_hex for this field */ + +static bool +is_binary_field(MYSQL_FIELD *field) +{ + if ((field->charsetnr == 63) && + (field->type == MYSQL_TYPE_BIT || + field->type == MYSQL_TYPE_BLOB || + field->type == MYSQL_TYPE_LONG_BLOB || + field->type == MYSQL_TYPE_MEDIUM_BLOB || + field->type == MYSQL_TYPE_TINY_BLOB || + field->type == MYSQL_TYPE_VAR_STRING || + field->type == MYSQL_TYPE_STRING || + field->type == MYSQL_TYPE_VARCHAR || + field->type == MYSQL_TYPE_GEOMETRY)) + return 1; + return 0; +} + + +/* Print binary value as hex literal (0x ...) */ + +static void +print_as_hex(FILE *output_file, const char *str, ulong len, ulong total_bytes_to_send) +{ + const char *ptr= str, *end= ptr+len; + ulong i; + fprintf(output_file, "0x"); + for(; ptr < end; ptr++) + fprintf(output_file, "%02X", *((uchar*)ptr)); + for (i= 2*len+2; i < total_bytes_to_send; i++) + tee_putc((int)' ', output_file); +} static void print_table_data(MYSQL_RES *result) @@ -3767,7 +3803,9 @@ length= max(length, field->max_length); if (length < 4 && !IS_NOT_NULL(field->flags)) length=4; // Room for "NULL" - field->max_length=length; + if (opt_binhex && is_binary_field(field)) + length= 2 + length * 2; + field->max_length=(ulong) length; separator.fill(separator.length()+length+2,'-'); separator.append('+'); } @@ -3834,9 +3872,11 @@ many extra padding-characters we should send with the printing function. */ visible_length= charset_info->cset->numcells(charset_info, buffer, buffer + data_length); - extra_padding= data_length - visible_length; + extra_padding= (uint) (data_length - visible_length); - if (field_max_length > MAX_COLUMN_LENGTH) + if (opt_binhex && is_binary_field(field)) + print_as_hex(PAGER, cur[off], lengths[off], field_max_length); + else if (field_max_length > MAX_COLUMN_LENGTH) tee_print_sized_data(buffer, data_length, MAX_COLUMN_LENGTH+extra_padding, FALSE); else { @@ -3962,11 +4002,15 @@ if (interrupted_query) break; ulong *lengths=mysql_fetch_lengths(result); + field= mysql_fetch_fields(result); (void) tee_fputs("", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { (void) tee_fputs("", PAGER); - xmlencode_print(cur[i], lengths[i]); + if (opt_binhex && is_binary_field(&field[i])) + print_as_hex(PAGER, cur[i], lengths[i], lengths[i]); + else + xmlencode_print(cur[i], lengths[i]); (void) tee_fputs("", PAGER); } (void) tee_fputs("", PAGER); @@ -3974,7 +4018,6 @@ (void) tee_fputs("", PAGER); } - static void print_table_data_xml(MYSQL_RES *result) { @@ -4002,7 +4045,10 @@ if (cur[i]) { tee_fprintf(PAGER, "\">"); - xmlencode_print(cur[i], lengths[i]); + if (opt_binhex && is_binary_field(&fields[i])) + print_as_hex(PAGER, cur[i], lengths[i], lengths[i]); + else + xmlencode_print(cur[i], lengths[i]); tee_fprintf(PAGER, "\n"); } else @@ -4047,7 +4093,10 @@ tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name); if (cur[off]) { - tee_write(PAGER, cur[off], lengths[off], MY_PRINT_SPS_0 | MY_PRINT_MB); + if (opt_binhex && is_binary_field(field)) + print_as_hex(PAGER, cur[off], lengths[off], lengths[off]); + else + tee_write(PAGER, cur[off], lengths[off], MY_PRINT_SPS_0 | MY_PRINT_MB); tee_putc('\n', PAGER); } else @@ -4156,11 +4205,21 @@ while ((cur = mysql_fetch_row(result))) { lengths=mysql_fetch_lengths(result); - safe_put_field(cur[0],lengths[0]); + + field= mysql_fetch_fields(result); + if (opt_binhex && is_binary_field(&field[0])) + print_as_hex(PAGER, cur[0], lengths[0], lengths[0]); + else + safe_put_field(cur[0],lengths[0]); + for (uint off=1 ; off < mysql_num_fields(result); off++) { (void) tee_fputs("\t", PAGER); - safe_put_field(cur[off], lengths[off]); + + if (opt_binhex && field && is_binary_field(&field[off])) + print_as_hex(PAGER, cur[off], lengths[off], lengths[off]); + else + safe_put_field(cur[off], lengths[off]); } (void) tee_fputs("\n", PAGER); } @@ -4536,10 +4595,9 @@ memset(buff, 0, sizeof(buff)); /* - In case number of quotes exceed 2, we try to get - the normalized db name. + In case of quotes used, try to get the normalized db name. */ - if (get_quote_count(line) > 2) + if (get_quote_count(line) > 0) { if (normalize_dbname(line, buff, sizeof(buff))) return put_error(&mysql); @@ -4757,11 +4815,13 @@ static int get_quote_count(const char *line) { - int quote_count; - const char *ptr= line; + int quote_count= 0; + const char *quote= line; - for(quote_count= 0; ptr ++ && *ptr; ptr= strpbrk(ptr, "\"\'`")) - quote_count ++; + while ((quote= strpbrk(quote, "'`\"")) != NULL) { + quote_count++; + quote++; + } return quote_count; } @@ -4868,7 +4928,7 @@ if (!mysql_connect_ssl_check(&mysql, host, user, password, database, opt_mysql_port, opt_mysql_unix_port, connect_flag | CLIENT_MULTI_STATEMENTS, - opt_ssl_required)) + opt_ssl_mode == SSL_MODE_REQUIRED)) { if (!silent || (mysql_errno(&mysql) != CR_CONN_HOST_ERROR && diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlcheck.c percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlcheck.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlcheck.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlcheck.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -938,7 +938,7 @@ if (!(sock = mysql_connect_ssl_check(&mysql_connection, host, user, passwd, NULL, opt_mysql_port, opt_mysql_unix_port, 0, - opt_ssl_required))) + opt_ssl_mode == SSL_MODE_REQUIRED))) { DBerror(&mysql_connection, "when trying to connect"); DBUG_RETURN(1); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqldump.c percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqldump.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqldump.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqldump.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -123,7 +123,9 @@ opt_secure_auth= 1, opt_compressed_columns= 0, opt_compressed_columns_with_dictionaries= 0, - opt_drop_compression_dictionary= 1; + opt_drop_compression_dictionary= 1, + opt_order_by_primary_desc= 0; + static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*mysql=0; @@ -469,6 +471,9 @@ {"order-by-primary", OPT_ORDER_BY_PRIMARY, "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.", &opt_order_by_primary, &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"order-by-primary-desc", OPT_ORDER_BY_PRIMARY_DESC, + "Taking backup ORDER BY primary key DESC.", + &opt_order_by_primary_desc, &opt_order_by_primary_desc, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's solicited on the tty.", 0, 0, 0, GET_PASSWORD, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -620,7 +625,7 @@ static int dump_all_databases(); static char *quote_name(const char *name, char *buff, my_bool force); char check_if_ignore_table(const char *table_name, char *table_type); -static char *primary_key_fields(const char *table_name); +static char *primary_key_fields(const char *table_name, const my_bool desc); static my_bool get_view_structure(char *table, char* db); static my_bool dump_all_views_in_db(char *database); static int dump_all_tablespaces(); @@ -629,6 +634,7 @@ static int dump_tablespaces(char* ts_where); static void print_comment(FILE *sql_file, my_bool is_error, const char *format, ...); +static const char* fix_identifier_with_newline(char*); /* @@ -729,7 +735,7 @@ MACHINE_TYPE); print_comment(sql_file, 0, "-- Host: %s Database: %s\n", current_host ? current_host : "localhost", - db_name ? db_name : ""); + db_name ? fix_identifier_with_newline(db_name) : ""); print_comment(sql_file, 0, "-- ------------------------------------------------------\n" ); @@ -761,6 +767,23 @@ "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); + fprintf(sql_file, + "/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM" + " INFORMATION_SCHEMA.SESSION_VARIABLES WHERE" + " VARIABLE_NAME='rocksdb_bulk_load' */;\n" + "/*!50112 SET @save_old_rocksdb_bulk_load =" + " IF (@is_rocksdb_supported," + " 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load'," + " 'SET @dummy_old_rocksdb_bulk_load = 0') */;\n" + "/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */;\n" + "/*!50112 EXECUTE s */;\n" + "/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported," + " 'SET SESSION rocksdb_bulk_load = 1'," + " 'SET @dummy_rocksdb_bulk_load = 0') */;\n" + "/*!50112 PREPARE s FROM @enable_bulk_load */;\n" + "/*!50112 EXECUTE s */;\n" + "/*!50112 DEALLOCATE PREPARE s */;\n"); + check_io(sql_file); } } /* write_header */ @@ -775,6 +798,15 @@ } else if (!opt_compact) { + fprintf(sql_file, + "/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported," + " 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load'," + " 'SET @dummy_rocksdb_bulk_load = 0') */;\n" + "/*!50112 PREPARE s FROM @disable_bulk_load */;\n" + "/*!50112 EXECUTE s */;\n" + "/*!50112 DEALLOCATE PREPARE s */;\n"); + + if (opt_tz_utc) fprintf(sql_file,"/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\n"); @@ -1667,7 +1699,7 @@ if (!(mysql= mysql_connect_ssl_check(&mysql_connection, host, user, passwd, NULL, opt_mysql_port, opt_mysql_unix_port, 0, - opt_ssl_required))) + opt_ssl_mode == SSL_MODE_REQUIRED))) { DB_error(&mysql_connection, "when trying to connect"); DBUG_RETURN(1); @@ -2192,6 +2224,30 @@ print_xml_comment(sql_file, strlen(comment_buff), comment_buff); } +/* + This function accepts object names and prefixes -- wherever \n + character is found. + + @param[in] object_name + + @return + @retval fixed object name. +*/ + +static const char* fix_identifier_with_newline(char* object_name) +{ + static char buff[COMMENT_LENGTH]= {0}; + char *ptr= buff; + memset(buff, 0, 255); + while(*object_name) + { + *ptr++ = *object_name; + if (*object_name == '\n') + ptr= strmov(ptr, "-- "); + object_name++; + } + return buff; +} /* create_delimiter @@ -2260,7 +2316,8 @@ /* nice comments */ print_comment(sql_file, 0, - "\n--\n-- Dumping events for database '%s'\n--\n", db); + "\n--\n-- Dumping events for database '%s'\n--\n", + fix_identifier_with_newline(db)); /* not using "mysql_query_with_error_report" because we may have not @@ -2477,7 +2534,8 @@ /* nice comments */ print_comment(sql_file, 0, - "\n--\n-- Dumping routines for database '%s'\n--\n", db); + "\n--\n-- Dumping routines for database '%s'\n--\n", + fix_identifier_with_newline(db)); /* not using "mysql_query_with_error_report" because we may have not @@ -2536,7 +2594,7 @@ query_buff); print_comment(sql_file, 1, "-- does %s have permissions on mysql.proc?\n\n", - current_user); + fix_identifier_with_newline(current_user)); maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!", current_user, query_buff); } else if (strlen(row[2])) @@ -3297,8 +3355,9 @@ if (opt_innodb_optimize_keys && !strcmp(table_type, "InnoDB")) has_pk= has_primary_key(table); - if (opt_order_by_primary) - order_by= primary_key_fields(result_table); + if (opt_order_by_primary || opt_order_by_primary_desc) + order_by= primary_key_fields(result_table, + opt_order_by_primary_desc ? TRUE : FALSE); if (!opt_xml && !mysql_query_with_error_report(mysql, 0, query_buff)) { @@ -3334,12 +3393,12 @@ if (strcmp (table_type, "VIEW") == 0) /* view */ print_comment(sql_file, 0, - "\n--\n-- Temporary view structure for view %s\n--\n\n", - result_table); + "\n--\n-- Temporary table structure for view %s\n--\n\n", + fix_identifier_with_newline(result_table)); else print_comment(sql_file, 0, "\n--\n-- Table structure for table %s\n--\n\n", - result_table); + fix_identifier_with_newline(result_table)); field= mysql_fetch_field_direct(result, 0); if (strcmp(field->name, "View") == 0) @@ -3594,7 +3653,7 @@ print_comment(sql_file, 0, "\n--\n-- Table structure for table %s\n--\n\n", - result_table); + fix_identifier_with_newline(result_table)); if (opt_drop) fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table); if (!opt_xml) @@ -4360,21 +4419,23 @@ { print_comment(md_result_file, 0, "\n--\n-- Dumping data for table %s\n--\n", - result_table); + fix_identifier_with_newline(result_table)); dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM "); dynstr_append_checked(&query_string, result_table); if (where) { - print_comment(md_result_file, 0, "-- WHERE: %s\n", where); + print_comment(md_result_file, 0, "-- WHERE: %s\n", + fix_identifier_with_newline(where)); dynstr_append_checked(&query_string, " WHERE "); dynstr_append_checked(&query_string, where); } if (order_by) { - print_comment(md_result_file, 0, "-- ORDER BY: %s\n", order_by); + print_comment(md_result_file, 0, "-- ORDER BY: %s\n", + fix_identifier_with_newline(order_by)); dynstr_append_checked(&query_string, " ORDER BY "); dynstr_append_checked(&query_string, order_by); @@ -5208,7 +5269,8 @@ char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted); print_comment(md_result_file, 0, - "\n--\n-- Current Database: %s\n--\n", qdatabase); + "\n--\n-- Current Database: %s\n--\n", + fix_identifier_with_newline(qdatabase)); /* Call the view or table specific function */ init_func(qdatabase); @@ -6139,7 +6201,7 @@ the table unsorted, rather than exit without dumping the data. */ -static char *primary_key_fields(const char *table_name) +static char *primary_key_fields(const char *table_name, const my_bool desc) { MYSQL_RES *res= NULL; MYSQL_ROW row; @@ -6149,6 +6211,7 @@ char *result= 0; char buff[NAME_LEN * 2 + 3]; char *quoted_field; + static const char *desc_index= " DESC"; my_snprintf(show_keys_buff, sizeof(show_keys_buff), "SHOW KEYS FROM %s", table_name); @@ -6175,6 +6238,10 @@ { quoted_field= quote_name(row[4], buff, 0); result_length+= strlen(quoted_field) + 1; /* + 1 for ',' or \0 */ + if (desc) + { + result_length+= strlen(desc_index); + } } while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1); } @@ -6196,7 +6263,11 @@ while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1) { quoted_field= quote_name(row[4], buff, 0); - end= strxmov(end, ",", quoted_field, NullS); + end= strxmov(end, desc ? " DESC," : ",", quoted_field, NullS); + } + if (desc) + { + end= strmov(end, " DESC"); } } @@ -6478,7 +6549,7 @@ print_comment(sql_file, 0, "\n--\n-- Final view structure for view %s\n--\n\n", - result_table); + fix_identifier_with_newline(result_table)); verbose_msg("-- Dropping the temporary view structure created\n"); fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", opt_quoted_table); @@ -6651,6 +6722,27 @@ die(EX_MYSQLERR, DYNAMIC_STR_ERROR_MSG); } +static my_bool has_session_variables_like(MYSQL *mysql_con, const char *var_name) +{ + MYSQL_RES *res; + MYSQL_ROW row; + char *val= 0; + char buf[32], query[256]; + my_bool has_var= FALSE; + + my_snprintf(query, sizeof(query), "SELECT COUNT(*) FROM" + " INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE" + " %s", quote_for_like(var_name, buf)); + if (mysql_query_with_error_report(mysql_con, &res, query)) + return FALSE; + + row = mysql_fetch_row(res); + val = row ? (char*)row[0] : NULL; + has_var = val && strcmp(val, "0") != 0; + mysql_free_result(res); + return has_var; +} + /** Check if the server supports LOCK TABLES FOR BACKUP. @@ -6780,6 +6872,10 @@ goto err; } + if (has_session_variables_like(mysql, "rocksdb_skip_fill_cache")) + mysql_query_with_error_report(mysql, 0, + "SET SESSION rocksdb_skip_fill_cache=1"); + if (opt_single_transaction && start_transaction(mysql)) goto err; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlimport.c percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlimport.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlimport.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlimport.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -482,7 +482,7 @@ "program_name", "mysqlimport"); if (!(mysql_connect_ssl_check(mysql, host, user, passwd, database, opt_mysql_port, opt_mysql_unix_port, - 0, opt_ssl_required))) + 0, opt_ssl_mode == SSL_MODE_REQUIRED))) { ignore_errors=0; /* NO RETURN FROM db_error */ db_error(mysql); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlshow.c percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlshow.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlshow.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlshow.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -159,7 +159,7 @@ if (!(mysql_connect_ssl_check(&mysql, host, user, opt_password, (first_argument_uses_wildcards) ? "" : argv[0], opt_mysql_port, opt_mysql_unix_port, - 0, opt_ssl_required))) + 0, opt_ssl_mode == SSL_MODE_REQUIRED))) { fprintf(stderr,"%s: %s\n",my_progname,mysql_error(&mysql)); exit(1); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlslap.c percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlslap.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqlslap.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqlslap.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -371,7 +371,8 @@ { if (!(mysql_connect_ssl_check(&mysql, host, user, opt_password, NULL, opt_mysql_port, opt_mysql_unix_port, - connect_flags, opt_ssl_required))) + connect_flags, + opt_ssl_mode == SSL_MODE_REQUIRED))) { fprintf(stderr,"%s: Error when connecting to server: %s\n", my_progname,mysql_error(&mysql)); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqltest.cc percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqltest.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysqltest.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysqltest.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "my_regex.h" /* Our own version of regex */ #ifdef HAVE_SYS_WAIT_H @@ -52,6 +53,7 @@ using std::min; using std::max; +using std::string; #ifdef __WIN__ #include @@ -3046,7 +3048,23 @@ str_to_file(tmp_sh_name, ds_cmd->str, ds_cmd->length); return popen(tmp_sh_cmd, mode); #else - return popen(ds_cmd->str, mode); + errno= 0; + FILE *file= popen(ds_cmd->str, mode); + if (file == NULL) + { + if (errno != 0) + { + fprintf(stderr, "mysqltest: popen failed with errno %d (%s)\n", errno, + strerror(errno)); + } + else + { + fprintf(stderr, + "mysqltest: popen returned NULL without setting errno " + "(out-of-memory?)\n"); + } + } + return file; #endif } @@ -4239,7 +4257,11 @@ die("Failed to create temporary file for perl command"); my_close(fd, MYF(0)); - str_to_file(temp_file_path, ds_script.str, ds_script.length); + /* Compatibility for Perl 5.24 and newer. */ + string script = "push @INC, \".\";\n"; + script.append(ds_script.str, ds_script.length); + + str_to_file(temp_file_path, &script[0], script.size()); /* Format the "perl " command */ my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path); @@ -4767,7 +4789,13 @@ CloseHandle(proc); return 1; #else - return kill(pid, sig); + int result= kill(pid, sig); + if (result == -1 && errno != ESRCH) + { + log_msg("kill(%d, %d) returned errno %d (%s)", pid, sig, errno, + strerror(errno)); + } + return result; #endif } @@ -4859,8 +4887,9 @@ DBUG_PRINT("info", ("Killing server, pid: %d", pid)); if (orig_timeout != 0) { - log_msg("shutdown_server timeout %ld exceeded, SIGABRT sent to the server", - orig_timeout); + log_msg("shutdown_server timeout %ld exceeded, " + "SIGABRT sent to the server PID %d", + orig_timeout, pid); } (void)my_kill(pid, (orig_timeout != 0) ? SIGABRT : SIGKILL); @@ -5326,7 +5355,7 @@ &can_handle_expired_passwords); while(!mysql_connect_ssl_check(mysql, host,user, pass, db, port, sock, CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS, - opt_ssl_required)) + opt_ssl_mode == SSL_MODE_REQUIRED)) { /* Connect failed @@ -5432,7 +5461,7 @@ &can_handle_expired_passwords); while (!mysql_connect_ssl_check(con, host, user, pass, db, port, sock ? sock: 0, CLIENT_MULTI_STATEMENTS, - opt_ssl_required)) + opt_ssl_mode == SSL_MODE_REQUIRED)) { /* If we have used up all our connections check whether this diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysql_upgrade.c percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysql_upgrade.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/client/mysql_upgrade.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/client/mysql_upgrade.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -343,7 +343,10 @@ fflush(stderr); } if (!(res_file= popen(cmd, "r"))) - die("popen(\"%s\", \"r\") failed", cmd); + { + die("popen(\"%s\", \"r\") failed, error: %s (errno = %d)", cmd, + strerror(errno), errno); + } while (fgets(buf, sizeof(buf), res_file)) { @@ -366,8 +369,33 @@ fflush(stderr); } + if (ferror(res_file)) + { + fprintf(stderr, + "%s: fgets from popen(\"%s\", \"r\") failed, error: %s (errno = %d)", + my_progname, cmd, strerror(errno), errno); + } + error= pclose(res_file); - return WEXITSTATUS(error); + if (error == -1) + { + fprintf(stderr, "%s: pclose for popen(\"%s\", \"r\") failed, error: %s " + "(errno = %d)\n", + my_progname, cmd, strerror(errno), errno); + return -1; + } + if (WIFEXITED(error)) + return WEXITSTATUS(error); + if (WIFSIGNALED(error)) { + fprintf(stderr, "%s: child process of popen(\"%s\", \"r\") terminated " + "with signal %d\n", my_progname, cmd, WTERMSIG(error)); + return -1; + } + else { + fprintf(stderr, "%s: child process of popen(\"%s\", \"r\") unknown " + "termination status %d\n", my_progname, cmd, error); + return -1; + } } @@ -401,9 +429,11 @@ va_end(args); +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) /* If given --ssl-mode=REQUIRED propagate it to the tool. */ - if (opt_ssl_required) + if (opt_ssl_mode == SSL_MODE_REQUIRED) dynstr_append(&ds_cmdline, "--ssl-mode=REQUIRED"); +#endif #ifdef __WIN__ dynstr_append(&ds_cmdline, "\""); @@ -427,6 +457,7 @@ { char *last_fn_libchar; DYNAMIC_STRING ds_tmp; + int error; DBUG_ENTER("find_tool"); DBUG_PRINT("enter", ("progname: %s", my_progname)); @@ -479,14 +510,15 @@ /* Make sure it can be executed */ - if (run_tool(tool_executable_name, + error= run_tool(tool_executable_name, &ds_tmp, /* Get output from command, discard*/ "--no-defaults", "--help", "2>&1", IF_WIN("> NUL", "> /dev/null"), - NULL)) - die("Can't execute '%s'", tool_executable_name); + NULL); + if (error) + die("Can't execute '%s', returned %d", tool_executable_name, error); dynstr_free(&ds_tmp); @@ -554,6 +586,13 @@ my_close(fd, MYF(0)); my_delete(query_file_path, MYF(0)); + if (ret) + { + fprintf(stderr, + "mysql_upgrade: running mysql with query \"%s\" returned %d\n", + query, ret); + } + DBUG_RETURN(ret); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/install_layout.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/install_layout.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/install_layout.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/install_layout.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -414,7 +414,7 @@ SET(INSTALL_SQLBENCHDIR_DEB ".") SET(INSTALL_SUPPORTFILESDIR_DEB "support-files") # -SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql") +SET(INSTALL_MYSQLDATADIR_DEB "data") SET(INSTALL_PLUGINTESTDIR_DEB ${plugin_tests}) SET(INSTALL_SECURE_FILE_PRIVDIR_DEB ${secure_file_priv_path}) SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_DEB ${secure_file_priv_embedded_path}) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/os/SunOS.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/os/SunOS.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/os/SunOS.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/os/SunOS.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,6 +17,34 @@ INCLUDE(CheckCSourceRuns) INCLUDE(CheckCSourceCompiles) +# We require SunStudio 12u2 (CC 5.11) +IF(NOT FORCE_UNSUPPORTED_COMPILER) + IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") + # CC -V yields + # CC: Studio 12.6 Sun C++ 5.15 SunOS_sparc Beta 2016/12/19 + # 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 + EXECUTE_PROCESS( + COMMAND ${CMAKE_CXX_COMPILER} "-V" + OUTPUT_VARIABLE stdout + ERROR_VARIABLE stderr + RESULT_VARIABLE result + ) + 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\\.[56] Sun C\\+\\+ 5\\.([0-9]+)" + VERSION_STRING ${stderr}) + ENDIF() + SET(CC_MINOR_VERSION ${CMAKE_MATCH_1}) + IF(${CC_MINOR_VERSION} LESS 11) + MESSAGE(FATAL_ERROR "SunStudio 12u2 or newer is required!") + ENDIF() + ELSE() + MESSAGE(FATAL_ERROR "Unsupported compiler!") + ENDIF() +ENDIF() + # Enable 64 bit file offsets SET(_FILE_OFFSET_BITS 64) @@ -29,7 +57,7 @@ # CMake defined -lthread as thread flag. This crashes in dlopen # when trying to load plugins workaround with -lpthread -SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE) +SET(CMAKE_THREAD_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE) # Solaris specific large page support CHECK_SYMBOL_EXISTS(MHA_MAPSIZE_VA sys/mman.h HAVE_DECL_MHA_MAPSIZE_VA) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/os/WindowsCache.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/os/WindowsCache.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/os/WindowsCache.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/os/WindowsCache.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -34,7 +34,6 @@ SET(HAVE_BMOVE CACHE INTERNAL "") SET(HAVE_BSD_SIGNALS CACHE INTERNAL "") SET(HAVE_BSEARCH 1 CACHE INTERNAL "") -SET(HAVE_BSS_START CACHE INTERNAL "") SET(HAVE_CHOWN CACHE INTERNAL "") SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "") SET(HAVE_COMPRESS CACHE INTERNAL "") @@ -45,7 +44,6 @@ SET(HAVE_CXXABI_H CACHE INTERNAL "") SET(HAVE_DECL_MADVISE CACHE INTERNAL "") SET(HAVE_DIRECTIO CACHE INTERNAL "") -SET(HAVE_DIRENT_H CACHE INTERNAL "") SET(HAVE_DLERROR CACHE INTERNAL "") SET(HAVE_DLFCN_H CACHE INTERNAL "") SET(HAVE_DLOPEN CACHE INTERNAL "") @@ -164,7 +162,6 @@ SET(HAVE_PUTENV 1 CACHE INTERNAL "") SET(HAVE_PWD_H CACHE INTERNAL "") SET(HAVE_RDTSCLL CACHE INTERNAL "") -SET(HAVE_READDIR_R CACHE INTERNAL "") SET(HAVE_READLINK CACHE INTERNAL "") SET(HAVE_READ_REAL_TIME CACHE INTERNAL "") SET(HAVE_REALPATH CACHE INTERNAL "") diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/os/Windows.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/os/Windows.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/os/Windows.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/os/Windows.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -65,6 +65,7 @@ ENDIF() IF(MSVC) + OPTION(LINK_STATIC_RUNTIME_LIBRARIES "Link with /MT" OFF) # Enable debug info also in Release build, # and create PDB to be able to analyze crashes. FOREACH(type EXE SHARED MODULE) @@ -94,7 +95,9 @@ CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT) - STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + IF(LINK_STATIC_RUNTIME_LIBRARIES) + STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + ENDIF() STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}") SET("${flag}" "${${flag}} /EHsc") ENDFOREACH() diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/readline.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/readline.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/readline.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/readline.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -181,12 +181,28 @@ completion_matches(0,0); return res; }" - EDITLINE_HAVE_COMPLETION) + EDITLINE_HAVE_COMPLETION_INT) - IF(EDITLINE_HAVE_COMPLETION) + CHECK_CXX_SOURCE_COMPILES(" + #include + #include + int main(int argc, char **argv) + { + typedef char* MYFunction(const char*, int); + MYFunction* myf= rl_completion_entry_function; + char *res= (myf)(NULL, 0); + completion_matches(0,0); + return res != NULL; + }" + EDITLINE_HAVE_COMPLETION_CHAR) + + IF(EDITLINE_HAVE_COMPLETION_INT OR EDITLINE_HAVE_COMPLETION_CHAR) SET(HAVE_HIST_ENTRY ${EDITLINE_HAVE_HIST_ENTRY}) SET(USE_LIBEDIT_INTERFACE 1) SET(EDITLINE_FOUND 1) + IF(EDITLINE_HAVE_COMPLETION_CHAR) + SET(USE_NEW_XLINE_INTERFACE 1) + ENDIF() ENDIF() ENDIF() ENDMACRO() @@ -249,7 +265,7 @@ SET(READLINE_INCLUDE_DIR ${READLINE_INCLUDE_DIR}) SET(HAVE_HIST_ENTRY ${READLINE_HAVE_HIST_ENTRY}) SET(USE_LIBEDIT_INTERFACE ${READLINE_USE_LIBEDIT_INTERFACE}) - SET(USE_NEW_READLINE_INTERFACE ${READLINE_USE_NEW_READLINE_INTERFACE}) + SET(USE_NEW_XLINE_INTERFACE ${READLINE_USE_NEW_READLINE_INTERFACE}) SET(READLINE_FOUND 1) ENDIF() ENDIF() diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/ssl.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/ssl.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/ssl.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/ssl.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -58,6 +58,8 @@ SET(SSL_INCLUDE_DIRS ${INC_DIRS}) SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL) SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED") + SET(HAVE_X509_CHECK_HOST OFF CACHE INTERNAL "yassl doesn't support HAVE_X509_check_host") + SET(HAVE_X509_CHECK_IP OFF CACHE INTERNAL "yassl doesn't support HAVE_X509_check_ip") CHANGE_SSL_SETTINGS("bundled") ADD_SUBDIRECTORY(extra/yassl) ADD_SUBDIRECTORY(extra/yassl/taocrypt) @@ -228,6 +230,13 @@ SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) SET(SSL_INTERNAL_INCLUDE_DIRS "") SET(SSL_DEFINES "-DHAVE_OPENSSL") + INCLUDE(CMakePushCheckState) + cmake_push_check_state() + SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${MY_OPENSSL_LIBRARY} ${MY_CRYPTO_LIBRARY}) + CHECK_SYMBOL_EXISTS(X509_check_host "openssl/x509v3.h" HAVE_X509_CHECK_HOST) + CHECK_SYMBOL_EXISTS(X509_check_ip "openssl/x509v3.h" HAVE_X509_CHECK_IP) + cmake_pop_check_state() ELSE() UNSET(WITH_SSL_PATH) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/wsrep.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/wsrep.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/cmake/wsrep.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/cmake/wsrep.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -17,7 +17,7 @@ # so WSREP_VERSION is produced regardless # Set the patch version -SET(WSREP_PATCH_VERSION "19") +SET(WSREP_PATCH_VERSION "21") # PXC needs this because it still support execvpe approach for forking # while initiating SST. INCLUDE(CheckFunctionExists) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -295,12 +295,9 @@ ENDIF() ENDIF() - -OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON) -IF(ENABLE_DEBUG_SYNC) - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") -ENDIF() +# Always enable debug sync for debug builds. +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") # Older versions of ccache must be disabled: export CCACHE_DISABLE=1 # See http://www.cmake.org/Wiki/CTest/Coverage @@ -324,6 +321,36 @@ "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -pg") ENDIF() +IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + OPTION(REPRODUCIBLE_BUILD "Take extra pains to make build result independent of build location and time" OFF) +ENDIF() +IF(REPRODUCIBLE_BUILD) + SET(DEBUG_PREFIX_FLAGS + "-fdebug-prefix-map=${CMAKE_SOURCE_DIR}/=./ -fdebug-prefix-map=${CMAKE_CURRENT_BINARY_DIR}=./obj") + + # See if -fdebug-prefix= commands are included in the debug output, + # making the build unreproducible with switches recorded. + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69821. + EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -g3 -x c -S -fdebug-prefix-map=foo=bar -o - - + INPUT_FILE /dev/null OUTPUT_VARIABLE DEBUG_PREFIX_MAP_RESULT) + IF(DEBUG_PREFIX_MAP_RESULT MATCHES "foo=bar") + SET(DEBUG_PREFIX_FLAGS "${DEBUG_PREFIX_FLAGS} -gno-record-gcc-switches") + ENDIF() + + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_PREFIX_FLAGS}") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO + "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${DEBUG_PREFIX_FLAGS}") + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_PREFIX_FLAGS}") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${DEBUG_PREFIX_FLAGS}") + + SET(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--build-id=none") + SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--build-id=none") + + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE + "${CMAKE_SOURCE_DIR}/scripts/invoke-with-relative-paths.pl") +ENDIF() + OPTION(ENABLED_LOCAL_INFILE "If we should should enable LOAD DATA LOCAL by default" ${IF_WIN}) MARK_AS_ADVANCED(ENABLED_LOCAL_INFILE) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/codership-debian/patches/fix-mysqlhotcopy-test-failure.patch percona-xtradb-cluster-5.6-5.6.37-26.21/codership-debian/patches/fix-mysqlhotcopy-test-failure.patch --- percona-xtradb-cluster-5.6-5.6.34-26.19/codership-debian/patches/fix-mysqlhotcopy-test-failure.patch 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/codership-debian/patches/fix-mysqlhotcopy-test-failure.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: Include return code 255 in list of valid error codes - Perl 5.20 changed the behaviour of mysqlhotcopy to return 255 on error - . - Add this error code to the list of allowable return codes -Author: James Page -Forwarded: no - ---- a/mysql-test/include/mysqlhotcopy.inc -+++ b/mysql-test/include/mysqlhotcopy.inc -@@ -107,7 +107,7 @@ DROP DATABASE hotcopy_save; - --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR - --list_files $MYSQLD_DATADIR/hotcopy_save - --replace_result $MASTER_MYSOCK MASTER_MYSOCK ----error 9,11,110,2304 -+--error 9,11,110,255,2304 - --exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save - --replace_result $MASTER_MYSOCK MASTER_MYSOCK - --exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/codership-debian/patches/series percona-xtradb-cluster-5.6-5.6.37-26.21/codership-debian/patches/series --- percona-xtradb-cluster-5.6-5.6.34-26.19/codership-debian/patches/series 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/codership-debian/patches/series 2017-10-19 04:25:29.000000000 +0000 @@ -2,4 +2,3 @@ scripts__mysqld_safe.sh__signals.patch fix_standalone_tests.patch kfreebsd_tests.patch -fix-mysqlhotcopy-test-failure.patch diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/config.h.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/config.h.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/config.h.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/config.h.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,6 @@ #cmakedefine HAVE_CXXABI_H 1 #cmakedefine HAVE_NCURSES_H 1 #cmakedefine HAVE_NDIR_H 1 -#cmakedefine HAVE_DIRENT_H 1 #cmakedefine HAVE_DLFCN_H 1 #cmakedefine HAVE_EXECINFO_H 1 #cmakedefine HAVE_FCNTL_H 1 @@ -120,8 +119,8 @@ /* Readline */ #cmakedefine HAVE_HIST_ENTRY 1 +#cmakedefine USE_NEW_XLINE_INTERFACE 1 #cmakedefine USE_LIBEDIT_INTERFACE 1 -#cmakedefine USE_NEW_READLINE_INTERFACE 1 #cmakedefine HAVE_READLINE_HISTORY_H 1 #cmakedefine FIONREAD_IN_SYS_IOCTL 1 @@ -236,7 +235,6 @@ #cmakedefine HAVE_PUTENV 1 #cmakedefine HAVE_RE_COMP 1 #cmakedefine HAVE_REGCOMP 1 -#cmakedefine HAVE_READDIR_R 1 #cmakedefine HAVE_READLINK 1 #cmakedefine HAVE_REALPATH 1 #cmakedefine HAVE_RENAME 1 @@ -293,7 +291,6 @@ #cmakedefine HAVE_AIO_READ 1 /* Symbols we may use */ /* used by stacktrace functions */ -#cmakedefine HAVE_BSS_START 1 #cmakedefine HAVE_BACKTRACE 1 #cmakedefine HAVE_BACKTRACE_SYMBOLS 1 #cmakedefine HAVE_BACKTRACE_SYMBOLS_FD 1 @@ -611,6 +608,9 @@ #cmakedefine HAVE_CHARSET_utf32 1 #cmakedefine HAVE_UCA_COLLATIONS 1 #cmakedefine HAVE_COMPRESS 1 +#cmakedefine HAVE_X509_CHECK_HOST 1 +#cmakedefine HAVE_X509_CHECK_IP 1 + #cmakedefine COMPILE_FLAG_WERROR 1 /* diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/configure.cmake percona-xtradb-cluster-5.6-5.6.37-26.21/configure.cmake --- percona-xtradb-cluster-5.6-5.6.34-26.19/configure.cmake 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/configure.cmake 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -153,6 +153,7 @@ GET_FILENAME_COMPONENT(CXX_REALPATH ${CMAKE_CXX_COMPILER} REALPATH) # CC -V yields + # CC: Studio 12.6 Sun C++ 5.15 SunOS_sparc Beta 2016/12/19 # 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 @@ -169,7 +170,7 @@ 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]+)" + STRING(REGEX MATCH "CC: Studio 12\\.[56] Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr}) ENDIF() SET(CC_MINOR_VERSION ${CMAKE_MATCH_1}) @@ -290,10 +291,14 @@ MY_SEARCH_LIBS(clock_gettime rt LIBRT) ENDIF() MY_SEARCH_LIBS(timer_create rt LIBRT) + MY_SEARCH_LIBS(backtrace execinfo LIBEXECINFO) + FIND_PACKAGE(Threads) SET(CMAKE_REQUIRED_LIBRARIES - ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT}) + ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} + ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO} + ) # Need explicit pthread for gcc -fsanitize=address IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=") SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread) @@ -344,7 +349,6 @@ CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) CHECK_INCLUDE_FILES (cxxabi.h HAVE_CXXABI_H) -CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H) CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H) @@ -566,7 +570,6 @@ CHECK_FUNCTION_EXISTS (pthread_threadmask HAVE_PTHREAD_THREADMASK) CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP) CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV) -CHECK_FUNCTION_EXISTS (readdir_r HAVE_READDIR_R) CHECK_FUNCTION_EXISTS (readlink HAVE_READLINK) CHECK_FUNCTION_EXISTS (re_comp HAVE_RE_COMP) CHECK_FUNCTION_EXISTS (regcomp HAVE_REGCOMP) @@ -1097,14 +1100,6 @@ ENDIF() CHECK_C_SOURCE_COMPILES(" - int main(int argc, char **argv) - { - extern char *__bss_start; - return __bss_start ? 1 : 0; - }" -HAVE_BSS_START) - -CHECK_C_SOURCE_COMPILES(" int main() { extern void __attribute__((weak)) foo(void); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/debian/changelog percona-xtradb-cluster-5.6-5.6.37-26.21/debian/changelog --- percona-xtradb-cluster-5.6-5.6.34-26.19/debian/changelog 2017-10-24 06:40:09.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/debian/changelog 2017-12-04 09:19:12.000000000 +0000 @@ -1,13 +1,38 @@ -percona-xtradb-cluster-5.6 (5.6.34-26.19-0ubuntu0.16.04.2) xenial; urgency=high +percona-xtradb-cluster-5.6 (5.6.37-26.21-0ubuntu0.16.04.1) xenial-security; urgency=medium - * d/p/ibuf-uses-full-memory-barrier-powerpc.patch: This patch implements - a full memory barrier for InnoDB mutex entry/exit on PowerPC. - (LP: #1657256). + * SECURITY UPDATE: Update to 5.6.37-26.21 to fix security issues + (LP: #1735691): + - CVE-2016-5617 + - CVE-2016-8327 + - CVE-2017-15365 + - CVE-2017-3238 + - CVE-2017-3244 + - CVE-2017-3251 + - CVE-2017-3256 + - CVE-2017-3257 + - CVE-2017-3258 + - CVE-2017-3265 + - CVE-2017-3273 + - CVE-2017-3291 + - CVE-2017-3305 + - CVE-2017-3308 + - CVE-2017-3309 + - CVE-2017-3313 + - CVE-2017-3317 + - CVE-2017-3318 + - CVE-2017-3329 + - CVE-2017-3450 + - CVE-2017-3452 + - CVE-2017-3453 + - CVE-2017-3461 + - CVE-2017-3462 + - CVE-2017-3463 + - CVE-2017-3464 + - CVE-2017-3599 + - CVE-2017-3600 + - d/control: Bump minimum galera version to 3.21. - * d/p/weak-memory-compat.patch: Removed as is covered by the new patch - ibuf-uses-full-memory-barrier-ppc64.patch. - - -- Jorge Niedbalski Mon, 23 Oct 2017 20:56:17 -0300 + -- James Page Mon, 04 Dec 2017 09:19:12 +0000 percona-xtradb-cluster-5.6 (5.6.34-26.19-0ubuntu0.16.04.1) xenial-security; urgency=medium diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/debian/control percona-xtradb-cluster-5.6-5.6.37-26.21/debian/control --- percona-xtradb-cluster-5.6-5.6.34-26.19/debian/control 2017-10-24 06:40:09.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/debian/control 2017-12-04 09:19:05.000000000 +0000 @@ -46,7 +46,7 @@ mysql-client, mysql-common (>= 5.6.19-1~exp2), passwd, - percona-galera-3 (>= 3.19), + percona-galera-3 (>= 3.21), percona-xtrabackup (>= 2.3.5), perl (>= 5.6), psmisc, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/debian/patches/ibuf-mutex-use-full-memory-barrier-powerpc.patch percona-xtradb-cluster-5.6-5.6.37-26.21/debian/patches/ibuf-mutex-use-full-memory-barrier-powerpc.patch --- percona-xtradb-cluster-5.6-5.6.34-26.19/debian/patches/ibuf-mutex-use-full-memory-barrier-powerpc.patch 2017-10-24 06:40:09.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/debian/patches/ibuf-mutex-use-full-memory-barrier-powerpc.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,309 +0,0 @@ -Description: This patch is a combination of different upstream MariaDB -patches for fixing the behavior of memory barriers when acquiring and -releasing mutexes on PowerPC machines. - -* Commit 6ea41f1e84eb6b864cac17ad0b862bde9820dc33: Implements -the os_fast_mutex(unlock_full_barrier/trylock_full_barrier) which -implies a full memory barrier. - -It also implements the os_mb OS memory barrier primitives for the -different architectures which is guaranteed to act as -full acquire-release barrier. - -* Commit 5ad02062d928cccbd29c0a2db6f0f7ceb33195d1: Based on the -previous commit, it adds a memory barrier on the mutex_exit -to prevent reading the number of waiters before releasing the lock, -this is completed with a modification on mutex_set_waiters that adds -a os_mb to make sure waiters store won't pass over mutex_test_and_set. - -* Commit 40497577ffd9f85557b15e08ad913f627b2e9530: The ib mutex set_and_test -function and acquires the lock by calling the os_atomic_test_and_set_byte_acquire -method which should be safe in PowerPC, at the same time the mutex unlock method -will call the os_atomic_test_and_set_byte_release which is implemented as a -__sync_lock_release + a __sync_synchronize call in PowerPC. - - -Bug-Ubuntu: https://launchpad.net/bugs/1657256 -Original-Author: Kristian Nielsen -Original-Author: Vicențiu Ciorbaru -Original-Author: Sergey Vojtovich -Author: Jorge Niedbalski - ---- percona-xtradb-cluster-5.6-5.6.34-26.19.orig/storage/innobase/include/os0sync.h -+++ percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0sync.h -@@ -393,12 +393,32 @@ pfs_os_fast_mutex_unlock( - #endif /* UNIV_PFS_MUTEX */ - - /**********************************************************//** -+Acquires ownership of a fast mutex. Implies a full memory barrier even on -+platforms such as PowerPC where this is not normally required. -+@return 0 if success, != 0 if was reserved by another thread */ -+UNIV_INLINE -+ulint -+os_fast_mutex_trylock_full_barrier( -+/*==================*/ -+ os_fast_mutex_t* fast_mutex); /*!< in: mutex to acquire */ -+ -+/**********************************************************//** - Releases ownership of a fast mutex. */ - UNIV_INTERN - void - os_fast_mutex_unlock_func( - /*======================*/ - fast_mutex_t* fast_mutex); /*!< in: mutex to release */ -+ -+/**********************************************************//** -+Releases ownership of a fast mutex. Implies a full memory barrier even on -+platforms such as PowerPC where this is not normally required. */ -+UNIV_INTERN -+void -+os_fast_mutex_unlock_full_barrier( -+/*=================*/ -+ os_fast_mutex_t* fast_mutex); /*!< in: mutex to release */ -+ - /*********************************************************//** - Initializes an operating system fast mutex semaphore. */ - UNIV_INTERN -@@ -500,7 +520,7 @@ amount to decrement. */ - # define os_atomic_decrement_uint64(ptr, amount) \ - os_atomic_decrement(ptr, amount) - --# if defined(IB_STRONG_MEMORY_MODEL) -+# if defined(HAVE_ATOMIC_BUILTINS) - - /** Do an atomic test and set. - @param[in,out] ptr Memory location to set to non-zero -@@ -514,19 +534,13 @@ os_atomic_test_and_set(volatile lock_wor - - /** Do an atomic release. - --In theory __sync_lock_release should be used to release the lock. --Unfortunately, it does not work properly alone. The workaround is --that more conservative __sync_lock_test_and_set is used instead. -- --Performance regression was observed at some conditions for Intel --architecture. Disable release barrier on Intel architecture for now. - @param[in,out] ptr Memory location to write to - @return the previous value */ - inline --lock_word_t -+void - os_atomic_clear(volatile lock_word_t* ptr) - { -- return(__sync_lock_test_and_set(ptr, 0)); -+ __sync_lock_release(ptr); - } - - # elif defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) -@@ -556,6 +570,29 @@ os_atomic_clear(volatile lock_word_t* pt - - # endif /* HAVE_IB_GCC_ATOMIC_TEST_AND_SET */ - -+#if defined(__powerpc__) || defined(__aarch64__) -+/* -+ os_atomic_test_and_set_byte_release() should imply a release barrier before -+ setting, and a full barrier after. But __sync_lock_test_and_set() is only -+ documented as an aquire barrier. So on PowerPC we need to add the full -+ barrier explicitly. */ -+# define os_atomic_test_and_set_byte_release(ptr, new_val) \ -+ do { __sync_lock_release(ptr); \ -+ __sync_synchronize(); } while (0) -+#else -+/* -+ On x86, __sync_lock_test_and_set() happens to be full barrier, due to -+ LOCK prefix. -+*/ -+# define os_atomic_test_and_set_byte_release(ptr, new_val) \ -+ __sync_lock_test_and_set(ptr, (byte) new_val) -+#endif -+/* -+ os_atomic_test_and_set_byte_acquire() is a full memory barrier on x86. But -+ in general, just an aquire barrier should be sufficient. */ -+# define os_atomic_test_and_set_byte_acquire(ptr, new_val) \ -+ __sync_lock_test_and_set(ptr, (byte) new_val) -+ - #elif defined(HAVE_IB_SOLARIS_ATOMICS) - - # define HAVE_ATOMIC_BUILTINS -@@ -810,6 +847,9 @@ os_atomic_clear(volatile lock_word_t* pt - return(InterlockedExchange(ptr, 0)); - } - -+# define os_atomic_lock_release_byte(ptr) \ -+ (void) InterlockedExchange(ptr, 0) -+ - #else - # define IB_ATOMICS_STARTUP_MSG \ - "Mutexes and rw_locks use InnoDB's own implementation" -@@ -863,12 +903,14 @@ for synchronization */ - architecture. Disable memory barrier for Intel architecture for now. */ - # define os_rmb - # define os_wmb -+# define os_mb - # define IB_MEMORY_BARRIER_STARTUP_MSG \ - "Memory barrier is not used" - #elif defined(HAVE_IB_GCC_ATOMIC_THREAD_FENCE) - # define HAVE_MEMORY_BARRIER - # define os_rmb __atomic_thread_fence(__ATOMIC_ACQUIRE) - # define os_wmb __atomic_thread_fence(__ATOMIC_RELEASE) -+# define os_mb __atomic_thread_fence(__ATOMIC_SEQ_CST) - # define IB_MEMORY_BARRIER_STARTUP_MSG \ - "GCC builtin __atomic_thread_fence() is used for memory barrier" - -@@ -876,6 +918,7 @@ architecture. Disable memory barrier for - # define HAVE_MEMORY_BARRIER - # define os_rmb __sync_synchronize() - # define os_wmb __sync_synchronize() -+# define os_mb __sync_synchronize() - # define IB_MEMORY_BARRIER_STARTUP_MSG \ - "GCC builtin __sync_synchronize() is used for memory barrier" - -@@ -884,6 +927,7 @@ architecture. Disable memory barrier for - # include - # define os_rmb __machine_r_barrier() - # define os_wmb __machine_w_barrier() -+# define os_mb __machine_rw_barrier() - # define IB_MEMORY_BARRIER_STARTUP_MSG \ - "Solaris memory ordering functions are used for memory barrier" - -@@ -892,12 +936,14 @@ architecture. Disable memory barrier for - # include - # define os_rmb _mm_lfence() - # define os_wmb _mm_sfence() -+# define os_mb _mm_mfence() - # define IB_MEMORY_BARRIER_STARTUP_MSG \ - "_mm_lfence() and _mm_sfence() are used for memory barrier" - - #else - # define os_rmb - # define os_wmb -+# define os_mb do {} while(0) - # define IB_MEMORY_BARRIER_STARTUP_MSG \ - "Memory barrier is not used" - #endif ---- percona-xtradb-cluster-5.6-5.6.34-26.19.orig/storage/innobase/include/os0sync.ic -+++ percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0sync.ic -@@ -232,3 +232,34 @@ win_cmp_and_xchg_dword( - - #endif /* HAVE_WINDOWS_ATOMICS */ - -+/**********************************************************//** -+Acquires ownership of a fast mutex. Implies a full memory barrier even on -+platforms such as PowerPC where this is not normally required. -+@return 0 if success, != 0 if was reserved by another thread */ -+UNIV_INLINE -+ulint -+os_fast_mutex_trylock_full_barrier( -+/*==================*/ -+ os_fast_mutex_t* fast_mutex) /*!< in: mutex to acquire */ -+{ -+#ifdef __WIN__ -+ if (TryEnterCriticalSection(&fast_mutex->mutex)) { -+ -+ return(0); -+ } else { -+ -+ return(1); -+ } -+#else -+ /* NOTE that the MySQL my_pthread.h redefines pthread_mutex_trylock -+ so that it returns 0 on success. In the operating system -+ libraries, HP-UX-10.20 follows the old Posix 1003.4a Draft 4 and -+ returns 1 on success (but MySQL remaps that to 0), while Linux, -+ FreeBSD, Solaris, AIX, Tru64 Unix, HP-UX-11.0 return 0 on success. */ -+ -+#if defined(__powerpc__) -+ os_mb; -+#endif -+ return((ulint) pthread_mutex_trylock(&fast_mutex->mutex)); -+#endif -+} ---- percona-xtradb-cluster-5.6-5.6.34-26.19.orig/storage/innobase/include/sync0sync.ic -+++ percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/sync0sync.ic -@@ -83,7 +83,7 @@ ib_mutex_test_and_set( - ib_mutex_t* mutex) /*!< in: mutex */ - { - #if defined(HAVE_ATOMIC_BUILTINS) -- return(os_atomic_test_and_set(&mutex->lock_word)); -+ return(os_atomic_test_and_set_byte_acquire(&mutex->lock_word, 1)); - #else - ibool ret; - -@@ -93,9 +93,7 @@ ib_mutex_test_and_set( - /* We check that os_fast_mutex_trylock does not leak - and allow race conditions */ - ut_a(mutex->lock_word == 0); -- - mutex->lock_word = 1; -- os_wmb; - } - - return((byte) ret); -@@ -112,11 +110,11 @@ mutex_reset_lock_word( - ib_mutex_t* mutex) /*!< in: mutex */ - { - #if defined(HAVE_ATOMIC_BUILTINS) -- os_atomic_clear(&mutex->lock_word); -+ os_atomic_test_and_set_byte_release(&mutex->lock_word, 0); - #else - mutex->lock_word = 0; - -- os_fast_mutex_unlock(&(mutex->os_fast_mutex)); -+ os_fast_mutex_unlock_full_barrier(&(mutex->os_fast_mutex)); - #endif /* HAVE_ATOMIC_BUILTINS */ - } - -@@ -182,7 +180,11 @@ mutex_exit_func( - to wake up possible hanging threads if - they are missed in mutex_signal_object. */ - -- if (mutex_get_waiters(mutex) != 0) { -+ /* We add a memory barrier to prevent reading of the -+ number of waiters before releasing the lock. */ -+ os_mb; -+ -+ if (mutex_get_waiters(mutex) != 0) { - - mutex_signal_object(mutex); - } ---- percona-xtradb-cluster-5.6-5.6.34-26.19.orig/storage/innobase/os/os0sync.cc -+++ percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/os/os0sync.cc -@@ -724,6 +724,25 @@ os_fast_mutex_unlock_func( - } - - /**********************************************************//** -+Releases ownership of a fast mutex. Implies a full memory barrier even on -+platforms such as PowerPC where this is not normally required. */ -+UNIV_INTERN -+void -+os_fast_mutex_unlock_full_barrier( -+/*=================*/ -+ os_fast_mutex_t* fast_mutex) /*!< in: mutex to release */ -+{ -+#ifdef __WIN__ -+ LeaveCriticalSection(&fast_mutex->mutex); -+#else -+ pthread_mutex_unlock(&fast_mutex->mutex); -+#if defined(__powerpc__) -+ os_mb; -+#endif -+#endif -+} -+ -+/**********************************************************//** - Frees a mutex object. */ - UNIV_INTERN - void ---- percona-xtradb-cluster-5.6-5.6.34-26.19.orig/storage/innobase/sync/sync0sync.cc -+++ percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/sync/sync0sync.cc -@@ -636,6 +636,10 @@ spin_loop: - mutex_set_waiters(mutex, 1); - } - -+/* Make sure waiters store won't pass over mutex_test_and_set */ -+#if defined(__powerpc__) -+ os_mb; -+#endif - /* Try to reserve still a few times */ - for (i = 0; i < 4; i++) { - if (ib_mutex_test_and_set(mutex) == 0) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/debian/patches/series percona-xtradb-cluster-5.6-5.6.37-26.21/debian/patches/series --- percona-xtradb-cluster-5.6-5.6.34-26.19/debian/patches/series 2017-10-24 06:40:09.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/debian/patches/series 2017-12-04 09:19:05.000000000 +0000 @@ -1,3 +1,3 @@ scripts__mysqld_safe.sh__signals.patch fix_tc_log_initialization_on_ppc64.patch -ibuf-mutex-use-full-memory-barrier-powerpc.patch +weak-memory-compat.patch diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/debian/patches/weak-memory-compat.patch percona-xtradb-cluster-5.6-5.6.37-26.21/debian/patches/weak-memory-compat.patch --- percona-xtradb-cluster-5.6-5.6.34-26.19/debian/patches/weak-memory-compat.patch 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/debian/patches/weak-memory-compat.patch 2017-12-04 09:17:56.000000000 +0000 @@ -0,0 +1,23 @@ +From f31a89191f6b1679d9f8b584aa95fe006182ee7d Mon Sep 17 00:00:00 2001 +From: Sergey Vojtovich +Date: Wed, 18 Nov 2015 15:51:20 +0400 +Subject: [PATCH] MDEV-9128 - Compiling on IBM System Z fails + +Provided IBM System Z have outdated compiler version, which supports gcc sync +builtins but not gcc atomic builtins. It also has weak memory model. + +InnoDB attempted to verify if __sync_lock_test_and_set() is available by +checking IB_STRONG_MEMORY_MODEL. This macro has nothing to do with availability +of __sync_lock_test_and_set(), the right one is HAVE_ATOMIC_BUILTINS. + +--- a/storage/innobase/include/os0sync.h ++++ b/storage/innobase/include/os0sync.h +@@ -500,7 +500,7 @@ amount to decrement. */ + # define os_atomic_decrement_uint64(ptr, amount) \ + os_atomic_decrement(ptr, amount) + +-# if defined(IB_STRONG_MEMORY_MODEL) ++# if defined(HAVE_ATOMIC_BUILTINS) + + /** Do an atomic test and set. + @param[in,out] ptr Memory location to set to non-zero diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/DEB-VERSION percona-xtradb-cluster-5.6-5.6.37-26.21/DEB-VERSION --- percona-xtradb-cluster-5.6-5.6.34-26.19/DEB-VERSION 2017-03-01 09:58:52.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/DEB-VERSION 2017-11-30 14:34:15.000000000 +0000 @@ -1,8 +1,8 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=6 -MYSQL_VERSION_PATCH=34 -MYSQL_VERSION_EXTRA=79.1 -PERCONA_XTRADB_CLUSTER_FULLNAME=Percona-XtraDB-Cluster-5.6.34-79.1 -PERCONA_XTRADB_CLUSTER_DEBNAME=percona-xtradb-cluster-5.6_5.6.34-26.19 -WSREP_VERSION=26.19 -WSREP_REV=4c779b7 +MYSQL_VERSION_PATCH=37 +MYSQL_VERSION_EXTRA=82.2 +PERCONA_XTRADB_CLUSTER_FULLNAME=Percona-XtraDB-Cluster-5.6.37-82.2 +PERCONA_XTRADB_CLUSTER_DEBNAME=percona-xtradb-cluster-5.6_5.6.37-26.21 +WSREP_VERSION=26.21 +WSREP_REV=c70c68b diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/.gitignore percona-xtradb-cluster-5.6-5.6.37-26.21/doc/.gitignore --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/.gitignore 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -build/ -source/ext/psdom.pyc -source/percona-theme/ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/Makefile percona-xtradb-cluster-5.6-5.6.37-26.21/doc/Makefile --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/Makefile 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/Makefile 2017-10-19 04:25:29.000000000 +0000 @@ -40,11 +40,11 @@ source/percona-theme/built: @echo "Downloading percona-theme ..." - @wget -O percona-theme.tar.gz http://percona.com/docs/theme/percona-xtradb-cluster/5.6/ + @wget -O percona-theme.tar.gz https://www.percona.com/docs/theme-1-4/percona-xtradb-cluster/5.6/ @echo "Extracting theme." @tar -zxf percona-theme.tar.gz @rm -rf source/percona-theme - @mv percona-theme source/percona-theme + @mv percona-theme-1-4 source/percona-theme @rm percona-theme.tar.gz @touch source/percona-theme/built diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/conf.py percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/conf.py --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/conf.py 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/conf.py 2017-10-19 04:25:29.000000000 +0000 @@ -46,16 +46,16 @@ # General information about the project. project = u'Percona XtraDB Cluster' -copyright = u'Percona LLC and/or its affiliates 2009-2016' +copyright = u'Percona LLC and/or its affiliates 2009-2017' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '5.6.32' +version = '5.6.36' # The full version, including alpha/beta/rc tags. -release = '5.6.32-25.17' +release = '5.6.36-26.20' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -142,11 +142,12 @@ ''' -extlinks = {'bug': ('https://bugs.launchpad.net/percona-xtradb-cluster/+bug/%s', - '#'), 'mysqlbug': ('http://bugs.mysql.com/bug.php?id=%s', - '#'), 'githubbug': ('https://github.com/codership/galera/issues/%s', - '#'), 'wsrepbug': ('https://github.com/codership/mysql-wsrep/issues/%s', - '#')} +extlinks = { +'bug': ('https://bugs.launchpad.net/percona-xtradb-cluster/+bug/%s', '#'), +'mysqlbug': ('http://bugs.mysql.com/bug.php?id=%s', '#'), +'githubbug': ('https://github.com/codership/galera/issues/%s', '#'), +'wsrepbug': ('https://github.com/codership/mysql-wsrep/issues/%s', '#'), +'jirabug': ('https://jira.percona.com/browse/%s', '')} # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] @@ -248,7 +249,7 @@ # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'PerconaXtraDBCluster-5.6.tex', u'Percona XtraDB Cluster Documentation', - u'Percona LLC and/or its affiliates 2009-2016', 'manual'), + u'Percona LLC and/or its affiliates 2009-2017', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -258,6 +259,7 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False +latex_toplevel_sectioning = 'part' # If true, show page references after internal links. #latex_show_pagerefs = False @@ -281,5 +283,5 @@ # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'perconaxtradbcluster', u'Percona XtraDB Cluster Documentation', - [u'Percona LLC and/or its affiliates 2009-2016'], 1) + [u'Percona LLC and/or its affiliates 2009-2017'], 1) ] diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/ext/psdom.py percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/ext/psdom.py --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/ext/psdom.py 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/ext/psdom.py 2017-10-19 04:25:29.000000000 +0000 @@ -142,7 +142,7 @@ indextext = self.get_index_text(name) if indextext: - self.indexnode['entries'].append(('single', indextext, name, '')) + self.indexnode['entries'].append(('single', indextext, name, '',None)) class PSconfigObject(ObjectDescription): @@ -194,7 +194,7 @@ indextext = self.get_index_text(name) if indextext: - self.indexnode['entries'].append(('single', indextext, name, '')) + self.indexnode['entries'].append(('single', indextext, name, '', None)) class PSTable(PSschemaObject): @@ -296,7 +296,7 @@ ret.append(targetnode) indextext = _('%s (release notes)') % rnname inode = addnodes.index(entries=[('single', indextext, - 'module-' + rnname, '')]) + 'module-' + rnname, '', None)]) ret.append(inode) return ret diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/flexibility/compressed_columns.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/flexibility/compressed_columns.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/flexibility/compressed_columns.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/flexibility/compressed_columns.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,306 +0,0 @@ -.. _compressed_columns: - -==================================== -Compressed columns with dictionaries -==================================== - -In :rn:`5.6.33-79.0` |Percona Server| has been extended with a new per-column -compression feature. It is a data type modifier, independent from user-level -SQL and |InnoDB| data compression, that causes the data stored in the column to -be compressed on writing to storage and decompressed on read. For all other -purposes the data type is identical to the one without modifier, i.e. no new -data types are created. Compression is done by using the ``zlib`` library. - -Additionally it is possible to pre-define a set of strings for each compressed -column to achieve a better compression ratio on a relatively small individual -data items. - -This feature provides: - -* a better compression ratio for text data which consist of a large number of - predefined words (e.g. JSON or XML) using compression methods with static - dictionaries, -* in contrast to |InnoDB| row compression method it provides a way to select - which columns in the table must be compressed. - -This feature is based on a patch provided by Weixiang Zhai. - -Specifications -============== - -The feature is limited to InnoDB/XtraDB storage engine and to: - -* ``BLOB`` (including ``TINYBLOB``, ``MEDIUMBLOB``, ``LONGBLOG``), - -* ``TEXT`` (including ``LONGTEXT``), - -* ``VARCHAR`` (including ``NATIONAL VARCHAR``), and - -* ``VARBINARY`` columns. - -The syntax to declare a compressed column is using an extension of an existing -``COLUMN_FORMAT`` modifier: ``COLUMN_FORMAT COMPRESSED``. If this modifier is -applied on an unsupported column type or storage engine, an error is returned. - -The compression can be specified: - -* at the table create time: - ``CREATE TABLE ... (..., foo BLOB COLUMN_FORMAT COMPRESSED, ...);`` - -* or a table can be modified to compress/decompress a column later: - ``ALTER TABLE ... MODIFY [COLUMN] ... COLUMN_FORMAT COMPRESSED``, or - ``ALTER TABLE ... CHANGE [COLUMN] ... COLUMN_FORMAT COMPRESSED``. - -To decompress a column, a ``COLUMN_FORMAT`` value any other than ``COMPRESSED`` -can be specified: ``FIXED``, ``DYNAMIC``, or ``DEFAULT``. If there is a column -compression/decompression request in an ``ALTER TABLE``, it is forced to the -``COPY`` algorithm. - -Two new variables: :variable:`innodb_compressed_columns_zip_level` and -:variable:`innodb_compressed_columns_threshold` have been implemented. - -Compression dictionary support -============================== - -To achieve better compression ration on relatively small individual data items, -it is possible to pre-define compression dictionary, which is a set of strings -for each compressed column. - -Compression dictionaries can be represented as a list of words in a form of a -string (comma or any other character can be used as a delimiter although not -required). In other words, ``a,bb,ccc``, ``a bb ccc`` and ``abbccc`` will have -the same effect. However, the latter is more space-efficient. Quote symbol -quoting is handled by regular SQL quoting. Maximum supported dictionary length -is 32506 bytes (``zlib`` limitation). - -The compression dictionary is stored in a new system |InnoDB| table. -As this table is of the data dictionary kind, concurrent reads are -allowed, but writes are serialized, and reads are blocked by writes. Table read -through old read views are unsupported, similarly to |InnoDB| internal DDL -transactions. - -Example -------- - -In order to use the compression dictionary you'll need first to create it. This -can be done by running: - -.. code-block:: mysql - - mysql> SET @dictionary_data = 'one' 'two' 'three' 'four'; - Query OK, 0 rows affected (0.00 sec) - - mysql> CREATE COMPRESSION_DICTIONARY numbers (@dictionary_data); - Query OK, 0 rows affected (0.00 sec) - -To create a table that has both compression and compressed dictionary support -you should run: - -.. code-block:: mysql - - mysql> CREATE TABLE t1( - id INT, - a BLOB COLUMN_FORMAT COMPRESSED, - b BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY numbers - ) ENGINE=InnoDB; - -Following example shows how to insert a sample of JSON data into the table: - -.. code-block:: mysql - - SET @json_value = - '[\n' - ' {\n' - ' "one" = 0,\n' - ' "two" = 0,\n' - ' "three" = 0,\n' - ' "four" = 0\n' - ' },\n' - ' {\n' - ' "one" = 0,\n' - ' "two" = 0,\n' - ' "three" = 0,\n' - ' "four" = 0\n' - ' },\n' - ' {\n' - ' "one" = 0,\n' - ' "two" = 0,\n' - ' "three" = 0,\n' - ' "four" = 0\n' - ' },\n' - ' {\n' - ' "one" = 0,\n' - ' "two" = 0,\n' - ' "three" = 0,\n' - ' "four" = 0\n' - ' }\n' - ']\n' - ; - -.. code-block:: mysql - - mysql> INSERT INTO t1 VALUES(0, @json_value, @json_value); - Query OK, 1 row affected (0.01 sec) - - -INFORMATION_SCHEMA Tables -========================= - -This feature implemented two new ``INFORMATION_SCHEMA`` tables. - -.. table:: INFORMATION_SCHEMA.XTRADB_ZIP_DICT - - :column BIGINT(21)_UNSIGNED id: dictionary ID - :column VARCHAR(64) name: dictionary name - :column BLOB zip_dict: compression dictionary string - -This table provides a view over the internal compression dictionary table. -``SUPER`` privilege is required to query it. - -.. table:: INFORMATION_SCHEMA.XTRADB_ZIP_DICT_COLS - - :column BIGINT(21)_UNSIGNED table_id: table ID from ``INFORMATION_SCHEMA.INNODB_SYS_TABLES`` - :column BIGINT(21)_UNSIGNED column_pos: column position (starts from ``0`` as in ``INFORMATION_SCHEMA.INNODB_SYS_COLUMNS``) - :column BIGINT(21)_UNSIGNED dict_id: dictionary ID - -This table provides a view over the internal table that stores the mapping -between the compression dictionaries and the columns using them. ``SUPER`` -privilege is require to query it. - -Limitations -=========== - -Compressed columns cannot be used in indices (neither on their own nor as parts -of composite keys). - -.. note:: - - ``CREATE TABLE t2 AS SELECT * FROM t1`` will create a new table with a - compressed column, whereas ``CREATE TABLE t2 AS SELECT CONCAT(a,'') AS a FROM - t1`` will not create compressed columns. - - At the same time, after executing ``CREATE TABLE t2 LIKE t1`` statement, - ``t2.a`` will have ``COMPRESSED`` attribute. - -``ALTER TABLE ... DISCARD/IMPORT TABLESPACE`` is not supported for tables with -compressed columns. To export and import tablespaces with compressed columns, -you need to uncompress them first with: ``ALTER TABLE ... MODIFY ... -COLUMN_FORMAT DEFAULT``. - -mysqldump command line parameters -================================= - -By default, with no additional options, ``mysqldump`` will generate a |MySQL| -compatible SQL output. - -All ``/*!50633 COLUMN_FORMAT COMPRESSED */`` and ``/*!50633 COLUMN_FORMAT -COMPRESSED WITH COMPRESSION_DICTIONARY */`` won't be in the dump. - -When a new option :option:`enable-compressed-columns` is specified, all -``/*!50633 COLUMN_FORMAT COMPRESSED */`` will be left intact and all ``/*!50633 -COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY */`` will be -transformed into ``/*!50633 COLUMN_FORMAT COMPRESSED */``. In this mode the -dump will contain the necessary SQL statements to create compressed columns, -but without dictionaries. - -When a new :option:`enable-compressed-columns-with-dictionaries` option is -specified, dump will contain all compressed column attributes and compression -dictionary. - -Moreover, the following dictionary creation fragments will be added before -``CREATE TABLE`` statements which are going to use these dictionaries for the -first time. - -.. code-block:: mysql - - /*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS ; */ - /*!50633 CREATE COMPRESSION_DICTIONARY (...); */ - -Two new options :option:`add-drop-compression-dictionary` and -:option:`skip-add-drop-compression-dictionary` will control if ``/*!50633 DROP -COMPRESSION_DICTIONARY IF EXISTS */`` part from previous paragraph -will be skipped or not. By default, :option:`add-drop-compression-dictionary` -mode will be used. - -When both :option:`enable-compressed-columns-with-dictionaries` and -``--tab=`` (separate file for each table) options are specified, necessary -compression dictionaries will be created in each output file using the -following fragment (regardless of the values of -:option:`add-drop-compression-dictionary` and -:option:`skip-add-drop-compression-dictionary` options). - -.. code-block:: mysql - - /*!50633 CREATE COMPRESSION_DICTIONARY IF NOT EXISTS (...); */ - -Downgrade scenario -================== - -If it is necessary to perform |Percona Server| downgrade from a version -:rn:`5.6.33-79.0` (or newer) to a version older than :rn:`5.6.33-79.0` and if -user databases have one or more table with compressed columns, there are two -options to do this safely: - -1. Use ``mysqldump`` in compatible mode (no compressed columns extensions must - be specified). - -2. Manually remove the ``COMPRESSED`` attribute from all columns which have it - via ``ALTER TABLE ... MODIFY ... COLUMN_FORMAT DEFAULT`` before updating - server binaries. - In this case, the downgraded server can start safely with old data files. - -Version Specific Information -============================ - - * :rn:`5.6.33-79.0` - Feature implemented in |Percona Server| 5.6 - -System Variables -================ - -.. variable:: innodb_compressed_columns_zip_level - - :cli: Yes - :conf: Yes - :scope: Global - :dyn: Yes - :vartype: Numeric - :default: 6 - :range: ``0``-``9`` - -This variable is used to specify the compression level used for compressed -columns. Specifying ``0`` will use no compression, ``1`` the fastest and ``9`` -the best compression. Default value is ``6``. - -.. variable:: innodb_compressed_columns_threshold - - :cli: Yes - :conf: Yes - :scope: Global - :dyn: Yes - :vartype: Numeric - :default: 96 - :range: ``1`` - ``2^64-1`` (or ``2^32-1`` for 32-bit release) - -By default a value being inserted will be compressed if its length exceeds -:variable:`innodb_compressed_columns_threshold` bytes. Otherwise, it will be -stored in raw (uncompressed) form. - -Please also notice that because of the nature of some data, its compressed -representation can be longer than the original value. In this case it does not -make sense to store such values in compressed form as |Percona Server| would -have to waste both memory space and CPU resources for unnecessary -decompression. Therefore, even if the length of such non-compressible values -exceeds :variable:`innodb_compressed_columns_threshold`, they will be stored in -an uncompressed form (however, an attempt to compress them will still be made). - -This parameter can be tuned in order to skip unnecessary attempts of data -compression for values that are known in advance by the user to have bad -compression ratio of their first N bytes. - -Other reading -============= - -* `How to find a good/optimal dictionary for zlib 'setDictionary' when - processing a given set of data? - `_ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/howtos/encrypt-traffic.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/howtos/encrypt-traffic.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/howtos/encrypt-traffic.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/howtos/encrypt-traffic.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,310 @@ +.. _encrypt-traffic: + +====================== +Encrypting PXC Traffic +====================== + +|PXC| supports encryption for all traffic involved in cluster operation. + +.. contents:: + :local: + :depth: 1 + +.. _client-server-encryption: + +Securing Client-Server Communication Traffic +============================================ + +This refers to communication between client applications and cluster nodes. +To secure client connections, +you need to generate and use SSL keys and certificates. + +The following example shows :file:`my.cnf` configuration +for server nodes and client instances to use SSL: + +.. code-block:: text + + [mysqld] + ssl-ca=ca.pem + ssl-cert=server-cert.pem + ssl-key=server-key.pem + + [client] + ssl-ca=ca.pem + ssl-cert=client-cert.pem + ssl-key=client-key.pem + +For more information, see the relevant sections about SSL certificates +in `Galera Cluster Documentation +`_. +and `MySQL Server Documentation +`_. + +Securing SST Traffic +==================== + +This refers to full data transfer +that usually occurs when a new node (JOINER) joins the cluster +and receives data from an existing node (DONOR). + +For more information, see :ref:`state_snapshot_transfer`. + +The following SST methods are available: +``rsync``, ``mysqldump``, and ``xtrabackup``. + +rsync +----- + +This SST method does not support encryption. +Avoid using this method if you need to secure traffic +between DONOR and JOINER nodes. + +mysqldump +--------- + +This SST method dumps data from DONOR and imports it to JOINER. +Encryption in this case is performed using the SSL certificates configured +for :ref:`secure MySQL client-server communication `. + +Here is how to perform secure SST using ``mysqldump``: + +1. Ensure that the DONOR node is configured for SSL encryption + (both ``[mysqld]`` and ``[client]`` sections). + For more information, see :ref:`client-server-encryption`. + +#. Create an SSL user on the DONOR node. + + .. code-block:: sql + + mysql> GRANT USAGE ON *.* TO 'sslsst' REQUIRE SSL; + +#. Specify the DONOR superuser credentials + in the :variable:`wsrep_sst_auth` variable. + +#. Start the JOINER node without Galera library (``--wsrep_provider=none``) + and create an SSL user with the same name and grants as on the DONOR node. + +#. Configure SSL encryption on JOINER node with the same parameters as DONOR + (both ``[mysqld]`` and ``[client]`` sections). + +#. Restart JOINER node with Galera library. + +If you do everything correctly, +``mysqldump`` will connect to DONOR using SSL user, +generate a dump file, and import it to JOINER node. + +For more information, see `the relevant section in Galera Cluster documentation `_. + +xtrabackup +---------- + +This is the default SST method. +It uses Percona XtraBackup to perform non-blocking transfer of files. +For more information, see :ref:`xtrabackup_sst`. + +Encryption mode for this method is selected using the :option:`encrypt` option. +Depending on the mode you select, other options will be required: + +* ``encrypt=0`` is the default value, meaning that encryption is disabled. + +* ``encrypt=1`` enables built-in XtraBackup encryption. + + .. note:: This mode has been deprecated. + + .. code-block:: text + + [sst] + encrypt=1 + encrypt-algo=AES256 + encrypt-key=A1EDC73815467C083B0869508406637E + + In this example, you can set ``encrypt-key-file`` instead of ``encrypt-key``. + + For more information, + see `Encrypted Backups `_. + +* ``encrypt=2`` enables SST encryption based on OpenSSL + with the certificate authority (``tca``) and certificate (``tcert``) files. + + .. note:: This mode has been deprecated. + + .. code-block:: text + + [sst] + encrypt=2 + tcert=/path/to/server.pem + tca=/path/to/server.crt + + For more information, see + `Securing Traffic Between two Socat Instances Using SSL + `. + +* ``encrypt=3`` enables SST encryption based on OpenSSL + with the key (``tkey``) and certificate (``tcert``) files. + + .. note:: This mode has been deprecated. + + .. code-block:: text + + [sst] + encrypt=3 + tcert=/path/to/server.pem + tkey=/path/to/server.key + + Certificate verification is not performed in this mode, + meaning that the validity of the joining nodes is not checked. + +* ``encrypt=4`` enables SST encryption based on SSL files generated by MySQL. + + .. note:: This is the recommended mode. + + .. code-block:: text + + [sst] + encrypt=4 + ssl-ca=ca.pem + ssl-cert=server-cert.pem + ssl-key=server-key.pem + + For more information, see + http://dev.mysql.com/doc/refman/5.6/en/creating-ssl-files-using-openssl.html + + The following procedure shows how to generate the :file:`ca.pem`, + :file:`server-cert.pem`, and :file:`server-key.pem` files. + + 1. To generate the CA certificate:: + + openssl genrsa 2048 > ca-key.pem + openssl req -new -x509 -nodes -days 3600 -key ca-key.pem -out ca.pem + + #. To generate the server certificate, remove passphrase, and sign it:: + + openssl req -newkey rsa:2048 -days 3600 -nodes -keyout server-key.pem -out server-req.pem + openssl rsa -in server-key.pem -out server-key.pem + openssl x509 -req -in server-req.pem -days 3600 -CA ca.pem -CAkey ca-key.pem -set_serial -1 -out server-cert.pem + + #. (Optional) To generate the client certificate, + remove passphrase, and sign it:: + + openssl req -newkey rsa:2048 -days 3600 -nodes -keyout client-key.pem -out client-req.pem + openssl rsa -in client-key.pem -out client-key.pem + openssl x509 -req -in client-req.pem -days 3600 -CA ca.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem + + There are two ways to deploy SSL files across the cluster: + + * (Preferred) Use the same files for all machines in the configuration. + Generate the files on one machine (or use the MySQL-generated files), + and copy the files to each node in the cluster. + Follow steps (1) and (2) in the previous procedure + to manually generate the files. + + * (Alternative) Generate one CA file with separate server certificates + signed by that one CA file. + Do step (1) to generate the CA file + and then do step (2) for each server using the same CA file. + So each server will have different :file:`server-cert.pem` files, + but they will all share the same :file:`ca.pem` file. + + .. note:: Whatever method you use to generate the certificate and key files, + the ``Common Name`` value used for the server and client certificates/keys + must each differ from that value used for the CA certificate. + Otherwise, the certificate and key files will not work for servers + compiled using OpenSSL. + + The easiest way to do this is to give the CA file a common name (CN) + as follows:: + + openssl req -new -x509 -nodes -days 3600 -key ca-key.pem -out ca.pem -subj “/CN=my_cluster_name†+ +.. note:: SSL clients require DH parameters to be at least 1024 bits, + due to the `logjam vulnearability + `. + However, versions of ``socat`` earlier than 1.7.3 use 512-bit parameters. + If a :file:`dhparams.pem` file of required length is not found during SST + in the data directory, + it is generated with 2048 bits, which can take several minutes. + To avoid this delay, create the :file:`dhparams.pem` file manually + and place it in the data directory before joining the node to the cluster:: + + openssl dhparam -out dhparams.pem 2048 + +Securing IST Traffic, Write-Set Replication, and Service Messages +================================================================= + +IST refers to transferring only missing transactions from DONOR to JOINER node. +Write-set replication is the main workload in |PXC| +whenever a transaction is performed on one node, +it is replicated to all other nodes. +Service messages ensure that all nodes are synchronized. + +All of this traffic is transferred via the same underlying communication +channel used by Galera (``gcomm``). +Securing this channel will ensure that IST traffic, write-set replication, +and service messages are encypted. + +To enable SSL for all internal node processes, +define the paths to the key, certificate and certificate authority files +using the following parameters: + +* |socket.ssl_key|_ +* |socket.ssl_cert|_ +* |socket.ssl_ca|_ + +.. |socket.ssl_key| replace:: ``socket.ssl_key`` +.. _socket.ssl_key: http://galeracluster.com/documentation-webpages/galeraparameters.html#socket-ssl-key + +.. |socket.ssl_cert| replace:: ``socket.ssl_cert`` +.. _socket.ssl_cert: http://galeracluster.com/documentation-webpages/galeraparameters.html#socket-ssl-cert + +.. |socket.ssl_ca| replace:: ``socket.ssl_ca`` +.. _socket.ssl_ca: http://galeracluster.com/documentation-webpages/galeraparameters.html#socket-ssl-ca + +To set these parameters, use the :variable:`wsrep_provider_options` variable. + +.. code-block:: text + + wsrep_provider_options="socket.ssl=yes;socket.ssl_key=/path/to/server-key.pem;socket.ssl_cert=/path/to/server-cert.pem;socket.ssl_ca=/path/to/cacert.pem" + +For more information, see `Index of wsrep provider options `_. + +.. note:: You must use the same server key and certificate files on all nodes, + preferably those used for :ref:`client-server-encryption`. + +Upgrading Certificates +---------------------- + +The following example shows how to upgrade certificates +used for securing IST traffic, write-set replication, and service messages, +assumig there are two nodes in the cluster: + +1. Restart Node 1 with a ``socket.ssl_ca`` + that includes both the new and the old certificates in a single file. + + For example, you can merge contents of ``old-ca.pem`` and ``new-ca.pem`` + into ``upgrade-ca.pem`` as follows: + + .. code-block:: bash + + cat old-ca.pem > upgrade-ca.pem && cat new-ca.pem >> upgrade-ca.pem + + Set the :variable:`wsrep_provider_options` variable similar to the following: + + .. code-block:: text + + wsrep_provider_options=socket.ssl=yes;socket.ssl_ca=/path/to/upgrade-ca.pem;socket.ssl_cert=path/to/old-cert.pem;socket.ssl_key=/path/to/old-key.pem + +#. Restart Node 2 with the new ``socket.ssl_ca``, ``socket.ssl_cert``, + and ``socket.ssl_key``. + + .. code-block:: text + + wsrep_provider_options=socket.ssl=yes;socket.ssl_ca=/path/to/upgrade-ca.pem;socket.ssl_cert=/path/to/new-cert.pem;socket.ssl_key=/path/to/new-key.pem + +#. Restart Node 1 with the new ``socket.ssl_ca``, ``socket.ssl_cert``, + and ``socket.ssl_key``. + + .. code-block:: text + + wsrep_provider_options=socket.ssl=yes;socket.ssl_ca=/path/to/upgrade-ca.pem;socket.ssl_cert=/path/to/new-cert.pem;socket.ssl_key=/path/to/new-key.pem + + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/howtos/garbd_howto.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/howtos/garbd_howto.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/howtos/garbd_howto.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/howtos/garbd_howto.rst 2017-10-19 04:25:29.000000000 +0000 @@ -5,11 +5,13 @@ ============================ `Galera Arbitrator -` is a member -of the |Percona XtraDB Cluster| which is used for voting in -case you have a small number of servers (usually two) and don't want to add any -more resources. For example arbitrator can be set up on existing application -server or on load balancer. +` +is a member of |Percona XtraDB Cluster| which is used for voting +in case you have a small number of servers (usually two) +and don't want to add any more resources. +Galera Arbitrator does not need a dedicated server. +It can be installed on a machine running some other application. +Just make sure it has good network connectivity. Galera Arbitrator is a member of the cluster which participates in the voting, but not in the actual replication (although it receives the same data as other diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/index.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/index.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/index.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/index.rst 2017-10-19 04:25:29.000000000 +0000 @@ -90,6 +90,7 @@ howtos/garbd_howto howtos/singlebox howtos/3nodesec2 + howtos/encrypt-traffic howtos/haproxy howtos/virt_sandbox howtos/bugreport diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/installation/apt_repo.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/installation/apt_repo.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/installation/apt_repo.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/installation/apt_repo.rst 2017-10-19 04:25:29.000000000 +0000 @@ -11,8 +11,9 @@ * Debian 8 ("jessie") * Ubuntu 12.04 LTS (Precise Pangolin) * Ubuntu 14.04 LTS (Trusty Tahr) -* Ubuntu 15.10 (Wily Werewolf) -* Ubuntu 16.04 (Xenial Xerus) +* Ubuntu 16.04 LTS (Xenial Xerus) +* Ubuntu 16.10 (Yakkety Yak) +* Ubuntu 17.04 (Zesty Zapus) .. note:: |PXC| should work on other DEB-based distributions, @@ -23,123 +24,53 @@ `download page `_. It is recommended to install |PXC| from repositories using :command:`apt`. -.. contents:: - :local: - Installing from Repositories ============================ -1. Fetch the repository packages from Percona web: - -.. code-block:: bash - - wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb - -#. Install the downloaded package with :program:`dpkg`. - To do that, run the following command as root or with :program:`sudo`: - -.. code-block:: bash - - sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb - -Once you install this package, the Percona repositories should be added. -You can check the repository configuration -in the :file:`/etc/apt/sources.list.d/percona-release.list` file. +Make sure to remove existing |PXC| 5.5 packages +and any |Percona Server| packages before proceeding. -#. Update the local cache: - -.. code-block:: bash - - sudo apt-get update - -#. Install the server package: - -.. note:: - - Make sure to remove existing |Percona XtraDB Cluster| 5.5 and |Percona - Server| 5.5/5.6 packages before proceeding. +1. Configure Percona repositories as described in + `Percona Software Repositories Documentation + `_. +#. Install the required |PXC| package using :command:`apt-get`. + For example, to install the base package, run the following: -.. code-block:: bash - - sudo apt-get install percona-xtradb-cluster-56 + .. code-block:: bash -.. note:: + sudo apt-get install percona-xtradb-cluster-56 - Alternatively, you can install - the ``percona-xtradb-cluster-full-56`` meta package, - which contains the following additional packages: - - * ``percona-xtradb-cluster-5.6-dbg`` - * ``percona-xtradb-cluster-galera-3.x-dbg`` - * ``percona-xtradb-cluster-galera3-dbg`` - * ``percona-xtradb-cluster-garbd-3`` - * ``percona-xtradb-cluster-garbd-3.x`` - * ``percona-xtradb-cluster-garbd-3.x-dbg`` - * ``percona-xtradb-cluster-server-debug-5.6`` - * ``percona-xtradb-cluster-test-5.6`` + .. note:: Alternatively, you can install + the ``percona-xtradb-cluster-full-56`` meta package, + which contains the following additional packages: + + * ``percona-xtradb-cluster-5.6-dbg`` + * ``percona-xtradb-cluster-galera-3.x-dbg`` + * ``percona-xtradb-cluster-galera3-dbg`` + * ``percona-xtradb-cluster-garbd-3`` + * ``percona-xtradb-cluster-garbd-3.x`` + * ``percona-xtradb-cluster-garbd-3.x-dbg`` + * ``percona-xtradb-cluster-server-debug-5.6`` + * ``percona-xtradb-cluster-test-5.6`` For more information on how to bootstrap the cluster please check :ref:`ubuntu_howto`. - .. note:: - Garbd is packaged separately as part of debian split packaging. The garbd - Debian package is ``percona-xtradb-cluster-garbd-3.x``. The package - contains, garbd, daemon init script and related config files. This package - will be installed if you install the ``percona-xtradb-cluster-full-56`` - meta package. + Garbd is packaged separately as part of Debian split packaging. + The ``garbd`` package in Debian is ``percona-xtradb-cluster-garbd-3.x``. + The package contains ``garbd``, daemon init script and related config files. + This package will be installed, + if you install the ``percona-xtradb-cluster-full-56`` meta package. .. note:: - On *Debian Jessie (8.0)* and *Ubuntu Xenial (16.04)* in order to stop or - reload the node bootstrapped with ``service mysql bootstrap-pxc`` command, - you'll need to use ``service mysql stop-bootstrap`` or ``service mysql - reload-bootstrap`` respectively. Also, status of the bootstrapped node - should be checked with ``service mysql status-bootstrap``. - -.. _apt-testing-repo: - -Testing and Experimental Repositories -------------------------------------- - -Percona offers pre-release builds from the testing repo, -and early-stage development builds from the experimental repo. -To enable them, add either ``testing`` or ``experimental`` -at the end of the Percona repository definition in your repository file -(by default, :file:`/etc/apt/sources.list.d/percona-release.list`). - -For example, if you are running Debian 8 ("jessie") -and want to install the latest testing builds, -the definitions should look like this: - -.. code-block:: text - - deb http://repo.percona.com/apt jessie main testing - deb-src http://repo.percona.com/apt jessie main testing - -If you are running Ubuntu 14.04 LTS (Trusty Tahr) -and want to install the latest experimental builds, -the definitions should look like this: - -.. code-block:: text - - deb http://repo.percona.com/apt trusty main experimental - deb-src http://repo.percona.com/apt trusty main experimental - -Pinning the Packages --------------------- - -If you want to pin your packages to avoid upgrades, -create a new file :file:`/etc/apt/preferences.d/00percona.pref` -and add the following lines to it: - -.. code-block:: text - - Package: * - Pin: release o=Percona Development Team - Pin-Priority: 1001 + On *Debian Jessie (8.0)* and *Ubuntu Xenial (16.04)*, + to stop or reload the node bootstrapped with ``service mysql bootstrap-pxc``, + you'll need to use ``service mysql stop-bootstrap`` + or ``service mysql reload-bootstrap`` respectively. + To check the status of the bootstrapped node, + run ``service mysql status-bootstrap``. -For more information about pinning, -refer to the official `Debian Wiki `_. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/installation/yum_repo.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/installation/yum_repo.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/installation/yum_repo.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/installation/yum_repo.rst 2017-10-19 04:25:29.000000000 +0000 @@ -1,48 +1,64 @@ .. _yum-repo: -=========================================== - Percona :program:`yum` Repository -=========================================== +=================================== +Installing |PXC| on RHEL and CentOS +=================================== + +Percona provides :file:`.rpm` packages for 64-bit versions +of the following distributions: + +* Red Hat Enterprise Linux and CentOS 5 +* Red Hat Enterprise Linux and CentOS 6 +* Red Hat Enterprise Linux and CentOS 7 + +.. note:: + |PXC| should work on other RPM-based distributions + (such as Oracle Linux and Amazon Linux AMI), + but it is tested only on platforms listed above. + +The packages are available in the official Percona software repositories +and on the +`download page `_. +It is recommended to install |PXC| from repositories using :command:`yum`. + +Installing from Repositories +============================ + +Make sure to remove existing |PXC| 5.5 packages +and any |Percona Server| packages before proceeding. + +1. Configure Percona repositories as described in + `Percona Software Repositories Documentation + `_. + +#. Install the required |PXC| package using :command:`yum`. + For example, to install the base package, run the following: + + .. code-block:: bash + + sudo yum install Percona-XtraDB-Cluster-56 + + .. note:: Alternatively, you can install + the ``Percona-XtraDB-Cluster-full-56`` meta package, + which contains the following additional packages: + + * ``Percona-XtraDB-Cluster-devel-56`` + * ``Percona-XtraDB-Cluster-test-56`` + * ``Percona-XtraDB-Cluster-debuginfo-56`` + * ``Percona-XtraDB-Cluster-galera-3-debuginfo`` + * ``Percona-XtraDB-Cluster-shared-56`` -The |Percona| :program:`yum` repository supports popular *RPM*-based operating systems, including the *Amazon Linux AMI*. - -The easiest way to install the *Percona Yum* repository is to install an *RPM* that configures :program:`yum` and installs the `Percona GPG key `_. Installation can also be done manually. - -Automatic Installation -======================= - -Execute the following command as a ``root`` user: :: - - $ yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm - -You should see some output such as the following: :: - - Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm - Preparing... ########################################### [100%] - 1:percona-release ########################################### [100%] - -Install XtraDB Cluster -======================= - -Make sure to remove existing PXC-5.5 and PS-5.5/5.6 packages before proceeding. - -Following command will install Cluster packages: :: - - $ yum install Percona-XtraDB-Cluster-56 - -Instead of ``Percona-XtraDB-Cluster-56`` you can install ``Percona-XtraDB-Cluster-full-56`` meta-package which will install ``Percona-XtraDB-Cluster-devel-56``, ``Percona-XtraDB-Cluster-test-56``, ``Percona-XtraDB-Cluster-debuginfo-56``, ``Percona-XtraDB-Cluster-galera-3-debuginfo``, and ``Percona-XtraDB-Cluster-shared-56`` packages in addition. +For more information on how to bootstrap the cluster please check +:ref:`ubuntu_howto`. .. warning:: - In order to sucessfully install |Percona XtraDB Cluster| ``socat`` package will need to be installed first. ``socat`` package can be installed from the `EPEL `_ repositories. - - -Percona `yum` Testing repository -================================= - -Percona offers pre-release builds from the testing repository. To subscribe to the testing repository, you'll need to enable the testing repository in :file:`/etc/yum.repos.d/percona-release.repo`. **NOTE:** You'll need to install the Percona repository first if this hasn't been done already. - -Resolving package conflicts -=========================== + |PXC| requires the ``socat`` package, + which can be installed from the + `EPEL `_ repositories. + +In CentOS, ``mysql-libs`` conflicts +with the ``Percona-XtraDB-Cluster-server-56`` package. +To avoid this, remove the ``mysql-libs`` package before installing |PXC|. +The ``Percona-Server-shared-56`` provides that dependency if required. -In CentOS ``mysql-libs`` conflicts with ``Percona-XtraDB-Cluster-server-56.x86_64`` package. To avoid this you need to remove the ``mysql-libs`` package before installing |Percona XtraDB Cluster|. Package ``Percona-Server-shared-51.x86_64`` provides that dependency during installation if required. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/installation.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/installation.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/installation.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/installation.rst 2017-10-19 04:25:29.000000000 +0000 @@ -11,12 +11,21 @@ * Debian 8 ("jessie") * Ubuntu 12.04 LTS (Precise Pangolin) * Ubuntu 14.04 LTS (Trusty Tahr) -* Ubuntu 15.10 (Wily Werewolf) -* Ubuntu 16.04 (Xenial Xerus) +* Ubuntu 16.04 LTS (Xenial Xerus) +* Ubuntu 16.10 (Yakkety Yak) * Red Hat Enterprise Linux / CentOS 5 * Red Hat Enterprise Linux / CentOS 6 * Red Hat Enterprise Linux / CentOS 7 +.. note:: CentOS 5 includes ``openssl-0.9.8`` + that doesn't support TLS 1.1/1.2, + which is a requirement as of Galera 3.19. + This means PXC 5.6.34 and later versions + do not support SSL encryption on CentOS 5. + + We recommend upgrading from CentOS 5 anyway, + because it already reached EOL on March 31, 2017. + Prerequisites ============= diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/manual/state_snapshot_transfer.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/manual/state_snapshot_transfer.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/manual/state_snapshot_transfer.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/manual/state_snapshot_transfer.rst 2017-10-19 04:25:29.000000000 +0000 @@ -43,6 +43,42 @@ Script used for this method can be found in :file:`/usr/bin/wsrep_sst_rsync` and it's provided with the |Percona XtraDB Cluster| binary packages. +SST for tables with tablespaces that are not in the data directory +================================================================== + +For example: + +.. code-block:: sql + + CREATE TABLE t1 (c1 INT PRIMARY KEY) DATA DIRECTORY = '/alternative/directory'; + +The result depends on the SST method: + +* SST using ``rsync`` + + SST will report success, however the table's data will not be copied over, + since ``rsync`` just copies the files. + You will not be able to access the table on the joiner node: + + .. code-block:: sql + + mysql> select * from t1; + ERROR 1812 (HY000): Tablespace is missing for table `sbtest`.`t1`. + +* SST using ``mysqldump`` + + Works as expected. + If the file does not exist, it will be created. + Otherwise it will attempt to use the file + (if the file doesn't have the expected format, an error is returned). + +* SST using Percona XtraBackup + + XtraBackup will restore the table to the same location on the joiner node. + If the target directory does not exist, it will be created. + If the target file already exists, an error will be returned, + because XtraBackup cannot clear tablespaces not in the data directory. + Other Reading ============= diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/manual/xtrabackup_sst.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/manual/xtrabackup_sst.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/manual/xtrabackup_sst.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/manual/xtrabackup_sst.rst 2017-10-19 04:25:29.000000000 +0000 @@ -17,16 +17,13 @@ * In case of |IST|, it proceeds as before. -.. note:: +.. note:: To maintain compatibility with |Percona XtraDB Cluster| + older than 5.5.33-23.7.6, use ``xtrabackup`` as SST method. + For newer versions, ``xtrabackup-v2`` is recommended + and also the default SST method. - To maintain compatibility with |Percona XtraDB Cluster| older than - 5.5.33-23.7.6, use ``xtrabackup`` as SST method. For newer versions, - ``xtrabackup-v2`` is recommended and also the default SST method. - -.. note:: - - |Percona Xtrabackup| 2.3.x and later is strongly recommended for - XtraBackup SST. +.. note:: |Percona Xtrabackup| 2.3.x and later is strongly recommended + for XtraBackup SST. SST Options ----------- @@ -34,7 +31,7 @@ The following options specific to |SST| can be used in :file:`my.cnf` under ``[sst]``. -.. note:: +.. note:: Considerations: * Non-integer options which have no default value are disabled if not set. @@ -59,15 +56,22 @@ .. option:: transferfmt - :Values: socat, nc - :Default: socat + :Values: ``socat``, ``nc`` + :Default: ``socat`` :Match: Yes -Used to specify the data transfer format. The recommended value is -``transferfmt=socat`` because it allows for socket options, such as transfer -buffer sizes. For more information, see `socat(1) +Used to specify the data transfer format. +The recommended value is the default ``transferfmt=socat`` +because it allows for socket options, +such as transfer buffer sizes. +For more information, see `socat(1) `_. +.. note:: Using ``transferfmt=nc`` does not support + any of the SSL-based encryption modes + (values ``2``, ``3``, and ``4`` for the :option:`encrypt` option). + Only ``encrypt=1`` is supported. + .. option:: tca :Example: tca=~/etc/ssl/certs/mycert.crt @@ -82,9 +86,7 @@ Used to specify the full path to the certificate file in PEM format for ``socat`` encryption based on OpenSSL. -.. note:: - - For more information about ``tca`` and ``tcert``, refer to +.. note:: For more information about ``tca`` and ``tcert``, refer to http://www.dest-unreach.org/socat/doc/socat-openssltunnel.html. The ``tca`` is essentially the self-signed certificate in that example, and ``tcert`` is the PEM file generated after concatenation of the key and the certificate @@ -93,35 +95,46 @@ testing you can also download certificates from `Github `_. -.. note:: - - Irrespective of what is shown in the example, you can use the same +.. note:: Irrespective of what is shown in the example, you can use the same :file:`.crt` and :file:`.pem` files on all nodes and it will work, since there is no server-client paradigm here but a cluster with homogeneous nodes. +.. option:: tkey + +Used to specify the full path to the key file for SST encryption +based on OpenSSL. + .. option:: encrypt - :Values: 0, 1, 2, 3 - :Default: 0 + :Values: ``0``, ``1``, ``2``, ``3``, ``4`` + :Default: ``0`` :Match: Yes +.. note:: Modes ``1``, ``2``, and ``3`` have been deprecated + in favor of mode ``4``. + Used to enable and specify SST encryption mode: * Set ``encrypt=0`` to disable SST encryption. This is the default value. * Set ``encrypt=1`` to perform symmetric SST encryption based on XtraBackup. + .. note:: This mode has been deprecated. + * Set ``encrypt=2`` to perform SST encryption based on OpenSSL with ``socat``. Ensure that ``socat`` is built with OpenSSL: ``socat -V | grep OPENSSL``. This is recommended if your nodes are over WAN and security constraints are higher. + .. note:: This mode has been deprecated. + * Set ``encrypt=3`` to perform SST encryption based on SSL for just the key and certificate files as implemented in `Galera `_. - The latter has been implemented in :rn:`5.6.14-25.1` for compatibility with - Galera. It does not provide certificate validation. In order to work + .. note:: This mode has been deprecated. + + It does not provide certificate validation. In order to work correctly, paths to the key and certificate files need to be specified as well, for example: :: @@ -135,9 +148,22 @@ The ``encrypt=3`` option can only be used when :variable:`wsrep_sst_method` is set to ``xtrabackup-v2`` (which is the default now). +* Set ``encrypt=4`` for SST encryption with SSL files generated by MySQL. + This is the recommended mode. + + Considering that you have all three necessary files:: + + [sst] + encrypt=4 + ssl-ca=ca.pem + ssl-cert=server-cert.pem + ssl-key=server-key.pem + +For more information, see :ref:`encrypt-traffic`. + .. option:: encrypt-algo - :Values: AES128, AES192, AES256 + :Values: ``AES128``, ``AES192``, ``AES256`` Used to specify the SST encryption algorithm. It uses the same values as the ``--encryption`` option for |Percona XtraBackup| (see `this document @@ -147,75 +173,82 @@ .. option:: sockopt -Used to specify key/value pairs of socket options, separated by commas. Must -begin with a comma. You can use the ``tcpwrap`` option to blacklist or -whitelist clients. For more information about socket options, see -`socat (1) `_. +Used to specify key/value pairs of socket options, separated by commas, +for example:: + + [sst] + sockopt="retry=2,interval=3" + +The previous example causes socat to try to connect three times +(initial attempt and two retries with a 3-second interval between attempts). + +.. note:: For versions of |PXC| before 5.6.35-26.20-3, + the value must begin with a comma, for example:: -.. note:: + [sst] + sockopt=",cipher=AES128" + +You can use the ``tcpwrap`` option to blacklist or whitelist clients. +For more information about socket options, see +`socat (1) `_. - You can also enable SSL based compression with :option:`sockopt`. This can - be used in place of the Percona XtraBackup ``compress`` option. +.. note:: You can also enable SSL based compression with :option:`sockopt`. + This can be used instead of the Percona XtraBackup ``compress`` option. .. option:: progress - :Values: 1, path/to/file + :Values: ``1`` or path to file Used to specify where to write SST progress. If set to ``1``, it writes to MySQL ``stderr``. Alternatively, you can specify the full path to a file. If this is a FIFO, it needs to exist and be open on reader end before itself, otherwise ``wsrep_sst_xtrabackup`` will block indefinitely. -.. note:: - - Value of 0 is not valid. +.. note:: Value of ``0`` is not valid. .. option:: rebuild - :Values: 0, 1 - :Default: 0 + :Values: ``0``, ``1`` + :Default: ``0`` Used to enable rebuilding of index on joiner node. Set to ``1`` to enable. This is independent of compaction, though compaction enables it. Rebuild of indexes may be used as an optimization. -.. note:: - - Bug :bug:`1192834` affects this option. +.. note:: Bug :bug:`1192834` affects this option. .. option:: time - :Values: 0, 1 - :Default: 0 + :Values: ``0``, ``1`` + :Default: ``0`` Enabling this option instruments key stages of backup and restore in SST. .. option:: rlimit - :Example: rlimit=128k + :Example: ``rlimit=128k`` Used to set a ratelimit in bytes. Add a suffix (k, m, g, t) to specify other units. For example, ``128k`` is 128 kilobytes. Refer to `pv(1) `_ for details. -.. note:: - - Rate is limited on donor node. The rationale behind this is to not allow SST - to saturate the donor's regular cluster operations or to limit the rate for - other purposes. +.. note:: Rate is limited on donor node. + The rationale behind this is to not allow SST + to saturate the donor's regular cluster operations + or to limit the rate for other purposes. .. option:: incremental - :Values: 0, 1 - :Default: 0 + :Values: ``0``, ``1`` + :Default: ``0`` Used to supersede IST on joiner node. Requires manual setup and is not supported currently. .. option:: use_extra - :Values: 0, 1 - :Default: 0 + :Values: ``0``, ``1`` + :Default: ``0`` Used to force SST to use the thread pool's `extra_port @@ -225,44 +258,25 @@ .. option:: cpat -Used to define the files that need to be deleted in the :term:`datadir` before +Used to define the files that need to be retained in the :term:`datadir` before running SST, so that the state of the other node can be restored cleanly. For example: :: [sst] cpat='.*galera\.cache$\|.*sst_in_progress$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$\|.*\.xyz$' -.. note:: - - This option can only be used when :variable:`wsrep_sst_method` is set to - ``xtrabackup-v2``. - -.. option:: sst_special_dirs - - :Values: 0, 1 - :Default: 1 - -This option was introduced in |Percona XtraDB Cluster| :rn:`5.6.15-25.2` to -enable XtraBackup SST to support :variable:`innodb_data_home_dir` and -:variable:`innodb_log_home_dir` variables in the configuration file. |Percona -Xtrabackup| 2.1.6 or later is required for this option to work. **NOTE:** This -variable has been removed and deprecated in |Percona XtraDB Cluster| -:rn:`5.6.22-25.8`. - -.. note:: - - This option can only be used when :variable:`wsrep_sst_method` is set to - ``xtrabackup-v2``. +.. note:: This option can only be used when :variable:`wsrep_sst_method` + is set to ``xtrabackup-v2``. .. option:: compressor :Default: not set (disabled) - :Example: compressor='gzip' + :Example: ``compressor=gzip`` .. option:: decompressor :Default: not set (disabled) - :Example: decompressor='gzip -dc' + :Example: ``decompressor='gzip -dc'`` Two previous options enable stream-based compression/decompression. When these options are set, compression/decompression is performed on stream, in contrast @@ -290,15 +304,13 @@ This group of options can be used to pass innobackupex options for backup, apply, and move stages. -.. note:: - - Although these options are related to XtraBackup SST, they cannot be - specified in :file:`my.cnf`, because they are for passing innobackupex - options. +.. note:: Although these options are related to XtraBackup SST, + they cannot be specified in :file:`my.cnf`, + because they are for passing innobackupex options. .. option:: sst-initial-timeout - :Default: 100 + :Default: ``100`` :Unit: seconds This option is used to configure initial timeout (in seconds) to receive the @@ -311,18 +323,36 @@ you can set it appropriately for your cluster. To disable initial SST timeout, set ``sst-initial-timeout=0``. -.. note:: +.. note:: If you are using :variable:`wsrep_sst_donor` + and you want the joiner node to strictly wait for donors + listed in the variable and not fall back + (that is, without a terminating comma at the end), + **and** there is a possibility of **all** nodes in that variable + to be unavailable, disable initial SST timeout or set it to a higher value + (maximum threshold that you want the joiner node to wait). + You can also disable this option (or set it to a higher value) + if you believe all other nodes in the cluster + can potentially become unavailable at any point in time + (mostly in small clusters) or there is a high network latency + or network disturbance + (which can cause donor selection to take longer than 100 seconds). - If you are using :variable:`wsrep_sst_donor`, and you want the joiner node to - strictly wait for donors listed in the variable and not fall back (that is, - without a terminating comma at the end), **and** there is a possibility of - **all** nodes in that variable to be unavailable, disable initial SST timeout - or set it to a higher value (maximum threshold that you want the joiner node - to wait). You can also disable this option (or set it to a higher value) if - you believe all other nodes in the cluster can potentially become unavailable - at any point in time (mostly in small clusters) or there is a high network - latency / network disturbance (which can cause donor selection to take longer - than 100 seconds). +.. option:: tmpdir + + :Version: Introduced in 5.6.35-26.20-3 + :Default: Empty + :Example: /path/to/tmp/dir + +This option specifies the location for storing the temporary file +where the transaction log is stored +before streaming or copying it to a remote host. + +The ``tmpdir`` option can be set in the following :file:`my.cnf` groups: + +* ``[sst]`` is the primary location (others are ignored) +* ``[xtrabackup]`` is the secondary location + (if not specified under ``[sst]``) +* ``[mysqld]`` is used if it is not specified in either of the above XtraBackup SST Dependencies --------------------------- @@ -383,16 +413,39 @@ OpenSSL-based for SST with ``encrypt=2``), then don't provide any |Percona XtraBackup| encryption options in :file:`my.cnf`. -.. note:: +.. note:: The :option:`encrypt` option under ``[sst]`` is different + from the one under ``[xtrabackup]``. + The former is for disabling/changing encryption mode, + while the latter is to provide an encryption algorithm. + To disambiguate, if you need to provide the latter under ``[sst]`` + (for example, in cases 1 and 2 above), + it should be specified as :option:`encrypt-algo`. + +.. warning:: An implication of the above is that + if you specify any of the |Percona XtraBackup| encryption options, + and ``encrypt=0`` under ``[sst]``, it will still be encrypted + and SST will fail. Look at case 3 above for resolution. + +Memory Allocation +----------------- + +The amount of memory for XtraBackup +is defined by the ``--use-memory`` option. +You can pass it using the :option:`inno-apply-opts` option +under ``[sst]`` as follows:: + + [sst] + inno-apply-opts="--use-memory=500M" + +If it is not specified, +the ``use-memory`` option under ``[xtrabackup]`` will be used:: + + [xtrabackup] + use-memory=32M + +If neither of the above are specified, +the size of the InnoDB memory buffer will be used:: + + [mysqld] + innodb_buffer_pool_size=24M - The :option:`encrypt` option under ``[sst]`` is different from the one under - ``[xtrabackup]``. The former is for disabling/changing encryption mode, while - the latter is to provide an encryption algorithm. To disambiguate, if you - need to provide the latter under ``[sst]`` (for example, in cases 1 and 2 - above), it should be specified as :option:`encrypt-algo`. - -.. warning:: - - An implication of the above is that if you specify any of the |Percona - XtraBackup| encryption options, and ``encrypt=0`` under ``[sst]``, it will - still be encrypted and SST will fail. Look at case 3 above for resolution. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/performance/prefix_index_queries_optimization.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/performance/prefix_index_queries_optimization.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/performance/prefix_index_queries_optimization.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/performance/prefix_index_queries_optimization.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,34 @@ +.. _prefix_index_queries_optimization: + +================================= +Prefix Index Queries Optimization +================================= + +|Percona Server| has ported Prefix Index Queries Optimization feature from +Facebook patch for |MySQL|. + +Prior to this |InnoDB| would always fetch the clustered index for all prefix +columns in an index, even when the value of a particular record was smaller +than the prefix length. This implementation optimizes that case to use the +record from the secondary index and avoid the extra lookup. + +Status Variables +================ + +.. variable:: Innodb_secondary_index_triggered_cluster_reads + + :version 5.6.36-82.0: Implemented + :vartype: Numeric + :scope: Global + +This variable shows the number of times secondary index lookup triggered +cluster lookup. + +.. variable:: Innodb_secondary_index_triggered_cluster_reads_avoided + + :version 5.6.36-82.0: Implemented + :vartype: Numeric + :scope: Global + +This variable shows the number of times prefix optimization avoided +triggering cluster lookup. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.32-78.0.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.32-78.0.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.32-78.0.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.32-78.0.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -.. rn:: 5.6.32-78.0 - -============================ -|Percona Server| 5.6.32-78.0 -============================ - -Percona is glad to announce the release of |Percona Server| 5.6.32-78.0 on -August 22th, 2016 (Downloads are available `here -`_ -and from the :doc:`Percona Software Repositories `). - -Based on `MySQL 5.6.32 -`_, including -all the bug fixes in it, |Percona Server| 5.6.32-78.0 is the current GA release -in the |Percona Server| 5.6 series. All of |Percona|'s software is open-source -and free, all the details of the release can be found in the `5.6.32-78.0 -milestone at Launchpad -`_. - -New Features -============ - - |Percona Server| :ref:`audit_log_plugin` now supports filtering by :ref:`user - ` and :ref:`sql_command `. - - |Percona Server| now supports `tree map file block allocation strategy - `_ - for |TokuDB|. - -Bugs Fixed -========== - - Fixed potential cardinality ``0`` issue for |TokuDB| tables if ``ANALYZE - TABLE`` finds only deleted rows and no actual logical rows before it times - out. Bug fixed :bug:`1607300` (:tokubug:`1006`, :ftbug:`732`). - - |TokuDB| ``database.table.index`` names longer than 256 characters could cause - server crash if :ref:`background analyze table - ` status was checked while running. Bug fixed - :tokubug:`1005`. - - :ref:`pam_plugin` would abort authentication while checking UNIX user group - membership if there were more than a thousand members. Bug fixed - :bug:`1608902`. - - If ``DROP DATABASE`` would fail to delete some of the tables in the database, - the partially-executed command is logged in the binlog as ``DROP TABLE t1, t2, - ...`` for the tables for which drop succeeded. A slave might fail to - replicate such ``DROP TABLE`` statement if there exist foreign key - relationships to any of the dropped tables and the slave has a different - schema from master. Fix by checking, on the master, whether any of the - database to be dropped tables participate in a Foreign Key relationship, and - fail the ``DROP DATABASE`` statement immediately. Bug fixed :bug:`1525407` - (upstream :mysqlbug:`79610`). - - :ref:`pam_plugin` didn't support spaces in the UNIX user group names. Bug - fixed :bug:`1544443`. - - Due to security reasons ``ld_preload`` libraries can now only be loaded from - the system directories (:file:`/usr/lib64`, :file:`/usr/lib`) and the MySQL - installation base directory. - - |Percona Server| 5.6 could not be built with the - ``-DMYSQL_MAINTAINER_MODE=ON`` option. Bug fixed :bug:`1590454`. - - In the client library, any EINTR received during network I/O was not handled - correctly. Bug fixed :bug:`1591202` (upstream :mysqlbug:`82019`). - - The included :file:`.gitignore` in the percona-server source distribution had - a line ``*.spec``, which means someone trying to check in a copy of the - percona-server source would be missing the spec file required to build the - RPMs. Bug fixed :bug:`1600051`. - - :ref:`audit_log_plugin` did not transcode queries. Bug fixed :bug:`1602986`. - - LeakSanitizer-enabled build failed to bootstrap server for MTR. Bug fixed - :bug:`1603978` (upstream :mysqlbug:`81674`). - - Fixed ``MYSQL_SERVER_PUBLIC_KEY`` connection option memory leak. Bug fixed - :bug:`1604419`. - - The fix for bug :bug:`1341067` added a call to free some of the heap memory - allocated by OpenSSL. This is not safe for repeated calls if OpenSSL is - linked twice through different libraries and each is trying to free the same. - Bug fixed :bug:`1604676`. - - If the changed page bitmap redo log tracking thread stops due to any reason, - then shutdown will wait for a long time for the log tracker thread to quit, - which it never does. Bug fixed :bug:`1606821`. - - :ref:`audit_log_plugin` events did not report the default database. Bug fixed - :bug:`1435099`. - - Canceling the :ref:`tokudb_background_analyze_table` job twice or while it was - in the queue could lead to server assertion. Bug fixed :tokubug:`1004`. - - Fixed various spelling errors in comments and function names. Bug fixed - :ftbug:`728` (*Otto Kekäläinen*). - - Implemented set of fixes to make PerconaFT build and run on the AArch64 - (64-bit ARMv8) architecture. Bug fixed :ftbug:`726` (*Alexey Kopytov*). - -Other bugs fixed: :bug:`1603073`, :bug:`1604323`, :bug:`1604364`, -:bug:`1604462`, :bug:`1604774`, :bug:`1606782`, :bug:`1607224`, :bug:`1607359`, -:bug:`1607606`, :bug:`1607607`, :bug:`1607671`, :bug:`1608385`, :bug:`1608437`, -:bug:`1608845`, :bug:`1609422`, :bug:`1610858`, :bug:`1612084`, :bug:`1612551`, -:bug:`1455430`, :bug:`1455432`, :bug:`1610242`, :tokubug:`998`, -:tokubug:`1003`, :ftbug:`729`, and :ftbug:`730`. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.32-78.1.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.32-78.1.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.32-78.1.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.32-78.1.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -.. rn:: 5.6.32-78.1 - -============================ -|Percona Server| 5.6.32-78.1 -============================ - -Percona is glad to announce the release of |Percona Server| 5.6.32-78.1 on -September 21st, 2016 (Downloads are available `here -`_ -and from the :doc:`Percona Software Repositories `). - -Based on `MySQL 5.6.32 -`_, including -all the bug fixes in it, |Percona Server| 5.6.32-78.1 is the current GA release -in the |Percona Server| 5.6 series. All of |Percona|'s software is open-source -and free, all the details of the release can be found in the `5.6.32-78.1 -milestone at Launchpad -`_. - -Bugs Fixed -========== - - Limiting ``ld_preload`` libraries to be loaded from specific directories in - ``mysqld_safe`` didn't work correctly for relative paths. Bug fixed - :bug:`1624247`. - - Fixed possible privilege escalation that could be used when running ``REPAIR - TABLE`` on a ``MyISAM`` table. Bug fixed :bug:`1624397`. - - The general query log and slow query log cannot be written to files ending in - :file:`.ini` and :file:`.cnf` anymore. Bug fixed :bug:`1624400`. - - Implemented restrictions on symlinked files (:file:`error_log`, - :file:`pid_file`) that can't be used with ``mysqld_safe``. Bug fixed - :bug:`1624449`. - -Other bugs fixed: :bug:`1553938`. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.33-79.0.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.33-79.0.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.33-79.0.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.33-79.0.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -.. rn:: 5.6.33-79.0 - -============================ -|Percona Server| 5.6.33-79.0 -============================ - -Percona is glad to announce the release of |Percona Server| 5.6.33-79.0 on -October 18th, 2016 (Downloads are available `here -`_ -and from the :doc:`Percona Software Repositories `). - -Based on `MySQL 5.6.33 -`_, including -all the bug fixes in it, |Percona Server| 5.6.33-79.0 is the current GA release -in the |Percona Server| 5.6 series. All of |Percona|'s software is open-source -and free, all the details of the release can be found in the `5.6.33-79.0 -milestone at Launchpad -`_. - -New Features -============ - - |Percona Server| has implemented support for per-column ``VARCHAR/BLOB`` - :ref:`compression ` for the |XtraDB| storage engine. This - also features compression dictionary support, to improve compression ratio for - relatively short individual rows, such as JSON data. - - A new |TokuDB| :variable:`tokudb_dir_per_db` option has been introduced to - address two |TokuDB| shortcomings, the :ref:`renaming of data files - ` on table/index rename, and the - ability to :ref:`group data files together - ` within a directory that represents - a single database. This feature is disabled by default. - -Bugs Fixed -========== - - After fixing bug :bug:`1540338`, system table engine validation check is no - longer skipped for tables that don't have an explicit ``ENGINE`` clause in - a ``CREATE TABLE`` statement. If |MySQL| upgrade statements are replicated, - and slave does not have the |MyISAM| set as a default storage engine, then - the ``CREATE TABLE mysql.server`` statement would attempt to create an - |InnoDB| table and fail because ``mysql_system_tables.sql`` script omitted - explicit engine setting for this table. Bug fixed :bug:`1600056`. - - :ref:`audit_log_plugin` malformed record could be written after - :variable:`audit_log_flush` was set to ``ON`` in ``ASYNC`` and ``PERFORMANCE`` - modes. Bug fixed :bug:`1613650`. - - A race condition between :ref:`handlersocket_page` and server shutdown could - lead to a server stall if shutdown was issued immediately after - :ref:`handlersocket_page` startup. Bug fixed :bug:`1617198`. - - :ref:`handlersocket_page` could access freed memory on startup. Bug fixed - :bug:`1617998`. - - Workloads with statements that take non-transactional locks (``LOCK TABLES``, - global read lock, and similar) could have caused deadlocks when running - under :ref:`threadpool` with high priority queue enabled and - :variable:`thread_pool_high_prio_mode` set to ``transactions``. Fixed by - placing such statements into the high priority queue even with the above - :variable:`thread_pool_high_prio_mode` setting. Bugs fixed :bug:`1619559` and - :bug:`1374930`. - - Fixed memory leaks in :ref:`audit_log_plugin`. Bug fixed :bug:`1620152` - (upstream :mysqlbug:`71759`). - - Server could crash due to a ``glibc`` bug in handling short-lived detached - threads. Bug fixed :bug:`1621012` (upstream :mysqlbug:`82886`). - - ``QUERY_RESPONSE_TIME_READ`` and ``QUERY_RESPONSE_TIME_WRITE`` were returning - ``QUERY_RESPONSE_TIME`` table data if accessed through a name that is not - full uppercase. Bug fixed :bug:`1552428`. - - Fixed memory leaks in :ref:`handlersocket_page`. Bug fixed :bug:`1617949`. - - ``KILL QUERY`` was not behaving consistently and it would hang in some cases. - Bug fixed :bug:`1621046` (upstream :mysqlbug:`45679`). - - Cipher ``ECDHE-RSA-AES128-GCM-SHA256`` was listed in the `list - `_ - of supported ciphers but it wasn't supported. Bug fixed :bug:`1622034` - (upstream :mysqlbug:`82935`). - - Successful doublewrite recovery was showed as a warning in the error log. Bug - fixed :bug:`1622985`. - - Variable :variable:`query_cache_type` couldn't be set to ``0`` if it was - already set to that value. Bug fixed :bug:`1625501` (upstream - :mysqlbug:`69396`). - - LRU manager thread could run too long on a server shutdown, causing a server - crash. Bug fixed :bug:`1626069`. - - ``tokudb_default`` was not recognized by |Percona Server| as a valid row - format. Bug fixed :bug:`1626206`. - - |InnoDB| ``ANALYZE TABLE`` didn't remove its table from the background - statistics processing queue. Bug fixed :bug:`1626441` (upstream - :mysqlbug:`71761`). - - Upstream merge for :mysqlbug:`81657` to 5.6 was incorrect. Bug fixed - :bug:`1626936` (upstream :mysqlbug:`83124`). - - Fixed multi-threaded slave thread leaks that happened in case of thread create - failure. Bug fixed :bug:`1619622` (upstream :mysqlbug:`82980`). - - Shutdown waiting for a purge to complete was undiagnosed for the first minute. - Bug fixed :bug:`1616785`. - - Unnecessary |InnoDB| change buffer merge attempts are now skipped upon reading - disk pages of non-applying types. Bug fixed :bug:`1618393` (upstream - :mysqlbug:`75235`). - -Other bugs fixed: :bug:`1614439`, :bug:`1614949`, :bug:`1616392` (upstream -:mysqlbug:`82798`), :bug:`1624993` (:ftbug:`736`), :bug:`1613647`, -:bug:`1626002` (upstream :mysqlbug:`83073`), :bug:`904714`, :bug:`1610102`, -:bug:`1610110`, :bug:`1613663`, :bug:`1613728`, :bug:`1613986`, :bug:`1614885`, -:bug:`1615959`, :bug:`1615970`, :bug:`1616333`, :bug:`1616404`, :bug:`1616768`, -:bug:`1617150`, :bug:`1617216`, :bug:`1617267`, :bug:`1618478`, :bug:`1618811`, -:bug:`1618819`, :bug:`1619547`, :bug:`1619572`, :bug:`1620583`, :bug:`1622449`, -:bug:`1622456`, :bug:`1622977`, :bug:`1623011`, :bug:`1624992` -(:tokubug:`1014`), :bug:`1625176`, :bug:`1625187`, :bug:`1626500`, -:bug:`1628417`, :tokubug:`964`, and :ftbug:`735`. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.36-82.0.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.36-82.0.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.36-82.0.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.36-82.0.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,86 @@ +.. rn:: 5.6.36-82.0 + +============================ +|Percona Server| 5.6.36-82.0 +============================ + +Percona is glad to announce the release of |Percona Server| 5.6.36-82.0 on +May 12, 2017 (Downloads are available `here +`_ +and from the :doc:`Percona Software Repositories `). + +Based on `MySQL 5.6.36 +`_, including +all the bug fixes in it, |Percona Server| 5.6.34-79.1 is the current GA release +in the |Percona Server| 5.6 series. All of |Percona|'s software is open-source +and free, all the details of the release can be found in the `5.6.36-82.0 +milestone at Launchpad +`_. + +New Features +============ + + |Percona Server| 5.6 packages are now available for Ubuntu 17.04 (*Zesty + Zapus*). + + |Percona Server| now supports :ref:`prefix_index_queries_optimization`. + + :variable:`tokudb_dir_cmd` can now be used to :ref:`edit the TokuDB + ` files. + +Bugs Fixed +========== + + Deadlock could occur in I/O-bound workloads when server was using several + small buffer pool instances in combination with small redo log files and + variable :variable:`innodb_empty_free_list_algorithm` set to ``backoff`` + algorithm. Bug fixed :bug:`1651657`. + + Querying :table:`TABLE_STATISTICS` in combination with a stored function could + lead to a server crash. Bug fixed :bug:`1659992`. + + :file:`tokubackup_slave_info` file was created for a master server after + taking the backup with :ref:`toku_backup`. Bug fixed :bkpbug:`135`. + + Fixed a memory leak in :ref:`toku_backup`. Bug fixed :bug:`1669005`. + + :ref:`compressed_columns` could not be added to a partitioned table by using + ``ALTER TABLE``. Bug fixed :bug:`1671492`. + + Fixed a memory leak that happened in case of failure to create + a multi-threaded slave worker thread. Bug fixed :bug:`1675716`. + + Combination of using any audit API-using plugin, like :ref:`audit_log_plugin` + and :ref:`response_time_distribution`, with multi-byte collation connection + and ``PREPARE`` statement with a parse error could lead to a server crash. Bug + fixed :bug:`1688698` (upstream :mysqlbug:`86209`). + + Fix for a :bug:`1433432` bug in |Percona Server| :rn:`5.6.28-76.1` caused a + performance regression due to suboptimal LRU manager thread flushing + heuristics. Bug fixed :bug:`1631309`. + + Creating :ref:`compressed_columns` in |MyISAM| tables by specifying partition + engines would not result in error. Bug fixed :bug:`1631954`. + + It was not possible to configure basedir as a symlink. Bug fixed + :bug:`1639735`. + + Replication slave did not report ``Seconds_Behind_Master`` correctly when + running in multi-threaded slave mode. Bug fixed :bug:`1654091` + (upstream :mysqlbug:`84415`). + + ``DROP TEMPORARY TABLE`` would create a transaction in binary log on a + read-only server. Bug fixed :bug:`1668602` (upstream :mysqlbug:`85258`). + + Creating a compression dictionary with :variable:`innodb_fake_changes` enabled + could lead to a server crash. Bug fixed :bug:`1629257`. + +Other bugs fixed: :bug:`1660828` (upstream :mysqlbug:`84786`), :bug:`1664519` +(upstream :mysqlbug:`84940`), :bug:`1674299`, :bug:`1683456`, :bug:`1670588` +(upstream :mysqlbug:`84173`), :bug:`1672389`, :bug:`1674507`, :bug:`1674867`, +:bug:`1675623`, :bug:`1650294`, :bug:`1659224`, :bug:`1660565`, :bug:`1662908`, +:bug:`1669002`, :bug:`1671473`, :bug:`1673800`, :bug:`1674284`, :bug:`1676441`, +:bug:`1676705`, :bug:`1676847` (upstream :mysqlbug:`85671`), :bug:`1677130` +(upstream :mysqlbug:`85678`), :bug:`1677162`, :bug:`1678692`, :bug:`1678792`, +:bug:`1680510` (upstream :mysqlbug:`85838`), :bug:`1683993`, :bug:`1684012`, +:bug:`1684078`, :bug:`1684264`, and :bug:`1674281`. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.36-82.1.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.36-82.1.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-Server-5.6.36-82.1.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-Server-5.6.36-82.1.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,105 @@ +.. rn:: 5.6.36-82.1 + +============================ +|Percona Server| 5.6.36-82.1 +============================ + +Percona is glad to announce the release of |Percona Server| 5.6.36-82.1 on +August 1, 2017 (Downloads are available `here +`_ +and from the :doc:`Percona Software Repositories `). + +Based on `MySQL 5.6.36 +`_, including +all the bug fixes in it, |Percona Server| 5.6.34-79.1 is the current GA release +in the |Percona Server| 5.6 series. All of |Percona|'s software is open-source +and free, all the details of the release can be found in the `5.6.36-82.1 +milestone at Launchpad +`_. + +New Features +============ + +|Percona Server| can now be built with support of OpenSSL 1.1. + +|Percona Server| is now available on Debian 9 (stretch). The support only covers +the ``amd64`` architecture. + +|TokuDB| enables to kill a query that is awaiting an FT locktree lock. + + +Bugs Fixed +========== + + Row counts in |TokuDB| could be lost intermittently after restarts. Bug fixed + :tdbbug:`2`. + + In |TokuDB|, two races in the fractal tree lock manager could significantly + affect transactional throughput for some applications that used a small number + of concurrent transactions. These races manifested as transactions + unnecessarily waiting for an available lock. Bug fixed :tdbbug:`3`. + + |TokuDB| could assert when opening a dictionary with no useful information + to error log. Bug fixed :tdbbug:`23`. + + |TokuDB| could assert for various reasons deserializing nodes with no useful + error output. Bug fixed :tdbbug:`24`. + + |Percona Server| could crash when running a query over a partitioned table that + uses an index to read a range of rows if this range was not covered by any + existing partition. Bug fixed :bug:`1657941` (upstream :mysqlbug:`76418`). + + With two client connections to a server (debug server build), the server could + crash after one of the clients set the global option ``userstat`` and flushed + the client statistics (``FLUSH CLIENT_STATISTICS``) and then both clients were + closed. Bug fixed :bug:`1661488`. + + |TokuDB| did not pass cmake flags on to snappy cmake. Bug fixed + :tdbbug:`41`. The progress status for partitioned TokuDB table ALTERs was + misleading. Bug fixed :tdbbug:`42`. + + When a client application connecting to the Aurora cluster end point + using SSL (``--ssl-verify-server-cert`` or + ``--ssl-mode=VERIFY_IDENTITY`` option), wildcard and :abbr:`SAN + (Subject Alternative Name)` enabled SSL certificates were ignored. See + also :ref:`compatibility-matrix`. Note that the + ``--ssl-verify-server-cert`` option is deprecated in |Percona Server| + 5.7. Bug fixed :bug:`1673656` (upstream :mysqlbug:`68052`). + + Killing a stored procedure execution could result in an assert failure on a + debug server build. Bug fixed :bug:`1689736` (upstream :mysqlbug:`86260`). + + It was not possible to build |Percona Server| on Debian 9 (stretch) due to + issues with OpenSSL 1.1. Bug fixed :bug:`1702903` (upstream :mysqlbug:`83814`). + + The ``SET STATEMENT .. FOR`` statement changed the global instead of the session + value of a variable if the statement occurred immediately after the ``SET + GLOBAL`` or ``SHOW GLOBAL STATUS`` command. Bug fixed :bug:`1385352`. + + The synchronization between the LRU manager and page cleaner threads was not + done at shutdown. Bug fixed :bug:`1689552`. + +Other bugs fixed: +:tdbbug:`6`, +:tdbbug:`44`, +:tdbbug:`65`, +:bug:`1160986`, +:bug:`1676740`, +:bug:`1689989`, +:bug:`1689998`, +:bug:`1690012`, +:bug:`1699788`, and +:bug:`1684601` (upstream :mysqlbug:`86016`). + +.. _compatibility-matrix: + +Compatibility Matrix +==================== + +======================= ======= ================== ==================== +Feature YaSSL OpenSSL < 1.0.2 OpenSSL >= 1.0.2 +======================= ======= ================== ==================== +'commonName' validation Yes Yes Yes +SAN validation No Yes Yes +Wildcards support No No Yes +======================= ======= ================== ==================== diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.32-25.17.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.32-25.17.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.32-25.17.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.32-25.17.rst 2017-10-19 04:25:29.000000000 +0000 @@ -5,9 +5,10 @@ =================================== Percona is glad to announce the release of -|Percona XtraDB Cluster| 5.6.32-25.17 on June 10, 2016. +|Percona XtraDB Cluster| 5.6.32-25.17 on October 4, 2016. Binaries are available from the -`downloads section `_ +`downloads section +`_ or from our :ref:`software repositories `. Percona XtraDB Cluster 5.6.32-25.17 is now the current release, @@ -22,7 +23,7 @@ All Percona software is open-source and free. Details of this release can be found in the `5.6.32-25.17 milestone on Launchpad -`_. +`_. For more information about relevant Codership releases, see `this announcement `_. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.34-26.19.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.34-26.19.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.34-26.19.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.34-26.19.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,107 @@ +.. rn:: 5.6.34-26.19 + +=================================== +Percona XtraDB Cluster 5.6.34-26.19 +=================================== + +Percona is glad to announce the release of +|Percona XtraDB Cluster| 5.6.34-26.19 on December 14, 2016. +Binaries are available from the `downloads section +`_ +or from our :ref:`software repositories `. + +Percona XtraDB Cluster 5.6.34-26.19 is now the current release, +based on the following: + +* `Percona Server 5.6.34-79.1 `_ + +* Galera Replication library 3.19 + +* wsrep API version 26 + +All Percona software is open-source and free. +Details of this release can be found in the +`5.6.34-26.19 milestone on Launchpad +`_. + +Deprecated +========== + +* The following encryption modes are now deprecated: + + * ``encrypt=1`` + * ``encrypt=2`` + * ``encrypt=3`` + + The default is ``encrypt=0`` with encryption disabled. + The recommended mode now is the new ``encrypt=4``, + which uses SSL files generated by MySQL. + + For more information, see :ref:`encrypt-traffic`. + +New Features +============ + +* Added ``encrypt=4`` mode for SST encryption + that uses SSL files generated by MySQL. + Modes ``1``, ``2``, and ``3`` are now deprecated. + +Fixed Bugs +========== + +* Optimized IST donor selection logic to avoid SST. + Child processes are now cleaned-up and node state is resumed if SST fails. + +* Added ``init.ok`` to the list of files that do not get removed during SST. + +* Fixed error with ASIO library not acknowledging an ``EPOLLIN`` event + when building Galera. + +* Fixed stalling of DML workload on slave node + caused by ``FLUSH TABLE`` executed on master. + + For more information, see :bug:`1629296`. + +* Fixed ``super_read_only`` to not apply to Galera replication applier. + + For more information, see :bug:`1634295`. + +* Redirected ``netcat`` output to ``stdout`` to avoid it in the log. + + For more information, see :bug:`1625968`. + +* Enabled replication of ``ALTER USER`` statements. + + For more information, see :bug:`1376269`. + +* Changed the :variable:`wsrep_max_ws_rows` variable + to ignore non-replicated write-sets generated by DML action + on temporary tables (explict or implicit). + + For more information, see :bug:`1638138`. + +* Fixed SST to fail with an error if SSL is not supported by ``socat``, + instead of switching to unencrypted mode. + +* Fixed SST with SSL to auto-generate a 2048-bit :file:`dhparams` file + for versions of ``socat`` before 1.7.3. + These older versions use 512-bit :file:`dhparams` file by default + that get rejected by newer clients with ``dh key too small`` error. + +* :jirabug:`PXC-731`: Changed the :variable:`wsrep_cluster_name` variable + to read-only, because changing it dynamically leads to high overhead. + + For more information, see :bug:`1620439`. + +* :jirabug:`PXC-732`: Improved error message + when any of the SSL files required for SST are missing. + +* :jirabug:`PXC-735`: Fixed SST to fail with an error when ``netcat`` is used + (:option:`transferfmt` set to ``nc``) with SSL encryption + (:option:`encrypt` set to ``2``, ``3`` or ``4``), + instead of silently switching to unencrypted mode. + +* Fixed faulty switch case that caused cluster to stall + when the :variable:`repl.commit_order` variable was set to ``2`` + (``LOCAL_OOOC`` mode that should allow out-of-order committing + for local transactions). diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20-3.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20-3.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20-3.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20-3.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,73 @@ +.. rn:: 5.6.35-26.20-3 + +===================================== +Percona XtraDB Cluster 5.6.35-26.20-3 +===================================== + +Percona is glad to announce the release of +|Percona XtraDB Cluster| 5.6.35-26.20-3 on April 19, 2017. +Binaries are available from the `downloads section +`_ +or from our :ref:`software repositories `. + +Percona XtraDB Cluster 5.6.35-26.20-3 is now the current release, +based on the following: + +* `Percona Server 5.6.35-81.0 `_ + +* Galera Replication library 3.20 + +* wsrep API version 26 + +All Percona software is open-source and free. +Details of this release can be found in the +`5.6.35-26.20-3 milestone on Launchpad +`_. + +.. note:: Due to end of life, + Percona will stop producing packages for the following distributions + after July 31, 2017: + + * Red Hat Enterprise Linux 5 (Tikanga) + * Ubuntu 12.04 LTS (Precise Pangolin) + + You are strongly advised to upgrade to latest stable versions + if you want to continue using Percona software. + +Fixed Bugs +========== + +* Updated semantics for gcache page cleanup + to trigger when either :option:`gcache.keep_pages_size` + or :option:`gcache.keep_pages_count` exceeds the limit, + instead of both at the same time. + +* Added support for passing the XtraBackup buffer pool size + with the ``use-memory`` option under ``[xtrabackup]`` + and the ``innodb_buffer_pool_size`` option under ``[mysqld]`` + when the ``--use-memory`` option is not passed + with the ``inno-apply-opts`` option under ``[sst]``. + +* Fixed gcache page cleanup not triggering + when limits are exceeded. + +* :jirabug:`PXC-782`: Updated ``xtrabackup-v2`` script + to use the :option:`tmpdir` option + (if it is set under ``[sst]``, ``[xtrabackup]`` or ``[mysqld]``, + in that order). + +* :jirabug:`PXC-784`: Fixed the ``pc.recovery`` procedure to abort + if the :file:`gvwstate.dat` file is empty or invalid, + and fall back to normal joining process. + For more information, see :bug:`1669333`. + +* :jirabug:`PXC-794`: Updated the :option:`sockopt` option + to include a comma at the beginning if it is not set by the user. + +* :jirabug:`PXC-797`: Blocked :option:`wsrep_desync` toggling + while node is paused + to avoid halting the cluster when running ``FLUSH TABLES WITH READ LOCK``. + For more information, see :bug:`1370532`. + +* Fixed several packaging and dependency issues. + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.35-26.20.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,42 @@ +.. rn:: 5.6.35-26.20 + +=================================== +Percona XtraDB Cluster 5.6.35-26.20 +=================================== + +Percona is glad to announce the release of +|Percona XtraDB Cluster| 5.6.35-26.20 on March 10, 2017. +Binaries are available from the `downloads section +`_ +or from our :ref:`software repositories `. + +Percona XtraDB Cluster 5.6.35-26.20 is now the current release, +based on the following: + +* `Percona Server 5.6.35-80.0 `_ + +* Galera Replication library 3.20 + +* wsrep API version 26 + +All Percona software is open-source and free. +Details of this release can be found in the +`5.6.35-26.20 milestone on Launchpad +`_. + +Fixed Bugs +========== + +* :jirabug:`BLD-593`: Limited the use of ``rm`` and ``chown`` + by ``mysqld_safe`` to avoid exploits of the CVE-2016-5617 vulnerability. + For more information, see :bug:`1660265`. + + Credit to Dawid Golunski (https://legalhackers.com). + +* :jirabug:`BLD-610`: Added version number to the dependency requirements + of the full RPM package. + +* :jirabug:`BLD-645`: Fixed ``mysqld_safe`` to support options + with a forward slash (``/``). + For more information, see :bug:`1652838`. + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.36-26.20.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.36-26.20.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.36-26.20.rst 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/Percona-XtraDB-Cluster-5.6.36-26.20.rst 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,44 @@ +.. rn:: 5.6.36-26.20 + +=================================== +Percona XtraDB Cluster 5.6.36-26.20 +=================================== + +Percona is glad to announce the release of +|Percona XtraDB Cluster| 5.6.36-26.20 on June 2, 2017. +Binaries are available from the `downloads section +`_ +or from our :ref:`software repositories `. + +Percona XtraDB Cluster 5.6.36-26.20 is now the current release, +based on the following: + +* `Percona Server 5.6.36-82.0 `_ + +* Galera Replication library 3.20 + +* wsrep API version 26 + +All Percona software is open-source and free. +Details of this release can be found in the +`5.6.36-26.20 milestone on Launchpad +`_. + +Fixed Bugs +========== + +* :jirabug:`PXC-749`: Fixed memory leak when running ``INSERT`` + on a table without primary key defined + and :variable:`wsrep_certify_nonPK` disabled (set to ``0``). + + .. note:: It is recommended to have primary keys defined on all tables + for correct write set replication. + +* :jirabug:`PXC-813`: Fixed SST script to use UTC time format. + +* :jirabug:`PXC-823`: Fixed SST flow to gracefully shut down JOINER node + if SST fails because DONOR leaves the cluster due to network failure. + This ensures that the DONOR is then able to recover to synced state + when network connectivity is restored + For more information, see :bug:`1684810`. + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/release-notes_index.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/release-notes_index.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/release-notes/release-notes_index.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/release-notes/release-notes_index.rst 2017-10-19 04:25:29.000000000 +0000 @@ -6,6 +6,10 @@ :maxdepth: 1 :glob: + Percona-XtraDB-Cluster-5.6.36-26.20 + Percona-XtraDB-Cluster-5.6.35-26.20-3 + Percona-XtraDB-Cluster-5.6.35-26.20 + Percona-XtraDB-Cluster-5.6.34-26.19 Percona-XtraDB-Cluster-5.6.32-25.17 Percona-XtraDB-Cluster-5.6.30-25.16.3 Percona-XtraDB-Cluster-5.6.30-25.16.2 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/tokudb/tokudb_file_management.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/tokudb/tokudb_file_management.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/tokudb/tokudb_file_management.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/tokudb/tokudb_file_management.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,194 +0,0 @@ -.. _tokudb_file_management: - -====================== -TokuDB file management -====================== - -As mentioned in the :ref:`tokudb_files_and_file_types` |Percona FT| is -extremely pedantic about validating its data set. If a file goes missing or -can't be accessed, or seems to contain some nonsensical data, it will -assert, abort or fail to start. It does this not to annoy you, but to try to -protect you from doing any further damage to your data. - -This document contains examples of common file maintenance operations and -instructions on how to safely execute these operations. - -Beginning in Percona Server :rn:`5.6.33-79.0` a new server option was -introduced called :variable:`tokudb_dir_per_db`. This feature addressed two -shortcomings the :ref:`renaming of data files -` on table/index rename, and the ability -to :ref:`group data files together ` -within a directory that represents a single database. This feature is disabled -by default. - -Moving TokuDB data files to a location outside of the default MySQL datadir ---------------------------------------------------------------------------- - -|TokuDB| uses the location specified by the :variable:`tokudb_data_dir` -variable for all of its data files. If the :variable:`tokudb_data_dir` variable -is not explicitly set, |TokuDB| will use the location specified by the servers -:term:`datadir` for these files. - -The |TokuDB| data files are protected from concurrent process access by the -``__tokudb_lock_dont_delete_me_data`` file that is located in the same -directory as the |TokuDB| data files. - -|TokuDB| data files may be moved to other locations with symlinks left behind -in their place. If those symlinks refer to files on other physical data -volumes, the :variable:`tokudb_fs_reserve_percent` monitor will not traverse -the symlink and monitor the real location for adequate space in the file -system. - -To safely move your TokuDB data files: - -1. Shut the server down cleanly. - -#. Change the :variable:`tokudb_data_dir` in your :file:`my.cnf` configuration - file to the location where you wish to store your |TokuDB| data files. - -#. Create your new target directory. - -#. Move your ``*.tokudb`` files and your ``__tokudb_lock_dont_delete_me_data`` - from the current location to the new location. - -#. Restart your server. - -Moving TokuDB temporary files to a location outside of the default MySQL datadir --------------------------------------------------------------------------------- - -|TokuDB| will use the location specified by the :variable:`tokudb_tmp_dir` -variable for all of its temporary files. If :variable:`tokudb_tmp_dir` variable -is not explicitly set, |TokuDB| will use the location specified by the -:variable:`tokudb_data_dir` variable. If the :variable:`tokudb_data_dir` -variable is also not explicitly set, |TokuDB| will use the location specified -by the servers :term:`datadir` for these files. - -|TokuDB| temporary files are protected from concurrent process access by the -``__tokudb_lock_dont_delete_me_temp`` file that is located in the same -directory as the |TokuDB| temporary files. - -If you locate your |TokuDB| temporary files on a physical volume that is -different from where your |TokuDB| data files or recovery log files are -located, the :variable:`tokudb_fs_reserve_percent` monitor will not monitor -their location for adequate space in the file system. - -To safely move your |TokuDB| temporary files: - -1. Shut the server down cleanly. A clean shutdown will ensure that there are no - temporary files that need to be relocated. - -#. Change the :variable:`tokudb_tmp_dir` variable in your :file:`my.cnf` - configuration file to the location where you wish to store your new |TokuDB| - temporary files. - -#. Create your new target directory. - -#. Move your ``__tokudb_lock_dont_delete_me_temp`` file from the current - location to the new location. - -#. Restart your server. - -Moving TokuDB recovery log files to a location outside of the default MySQL datadir ------------------------------------------------------------------------------------ - -|TokuDB| will use the location specified by the :variable:`tokudb_log_dir` -variable for all of its recovery log files. If the :variable:`tokudb_log_dir` -variable is not explicitly set, |TokuDB| will use the location specified by the -servers :term:`datadir` for these files. - -The |TokuDB| recovery log files are protected from concurrent process access by -the ``__tokudb_lock_dont_delete_me_logs`` file that is located in the same -directory as the |TokuDB| recovery log files. - -|TokuDB| recovery log files may be moved to another location with symlinks left -behind in place of the :variable:`tokudb_log_dir`. If that symlink refers to a -directory on another physical data volume, the -:variable:`tokudb_fs_reserve_percent` monitor will not traverse the symlink and -monitor the real location for adequate space in the file system. - -To safely move your |TokuDB| recovery log files: - -1. Shut the server down cleanly. - -#. Change the :variable:`tokudb_log_dir` in your :file:`my.cnf` configuration - file to the location where you wish to store your |TokuDB| recovery log - files. - -#. Create your new target directory. - -#. Move your ``log*.tokulog*`` files and your - ``__tokudb_lock_dont_delete_me_logs`` file from the current location to the - new location. - -#. Restart your server. - -.. _improved_table_renaming_functionality: - -Improved table renaming functionality -------------------------------------- - -When you rename a |TokuDB| table via SQL, the data files on disk keep their -original names and only the mapping in the |Percona FT| directory file is -changed to map the new dictionary name to the original internal file names. -This makes it difficult to quickly match database/table/index names to their -actual files on disk, requiring you to use the -:table:`INFORMATION_SCHEMA.TOKUDB_FILE_MAP` table to cross reference. - -Beginning with |Percona Server| :rn:`5.6.33-79.0` a new server option was -introduced called :variable:`tokudb_dir_per_db` to address this issue. - -When :variable:`tokudb_dir_per_db` is enabled (``OFF`` by default), this is no -longer the case. When you rename a table, the mapping in the |Percona FT| -directory file will be updated and the files will be renamed on disk to reflect -the new table name. - -.. _improved_directory_layout_functionality: - -Improved directory layout functionality ---------------------------------------- - -Many users have had issues with managing the huge volume of individual files -that |TokuDB| and |Percona FT| use. - -Beginning with |Percona Server| :rn:`5.6.33-79.0` a new server option was -introduced called :variable:`tokudb_dir_per_db` to address this issue. - -When :variable:`tokudb_dir_per_db` variable is enabled (``OFF`` by default), -all new tables and indices will be placed within their corresponding database -directory within the :file:`tokudb_data_dir` or server :term:`datadir`. - -If you have :variable:`tokudb_data_dir` variable set to something other than -the server :term:`datadir`, |TokuDB| will create a directory matching the name -of the database, but upon dropping of the database, this directory will remain -behind. - -Existing table files will not be automatically relocated to their corresponding -database directory. - -You can easily move a tables data files into the new scheme and proper database -directory with a few steps: - -.. code-block:: mysql - - mysql> SET GLOBAL tokudb_dir_per_db=true; - mysql> RENAME TABLE TO ; - mysql> RENAME TABLE TO
; - -.. note:: - - Two renames are needed because |MySQL| doesn't allow you to rename a table to - itself. The first rename, renames the table to the temporary name and moves - the table files into the owning database directory. The second rename sets the - table name back to the original name. Tables can also be renamed/moved across - databases and will be placed correctly into the corresponding database - directory. - -.. warning:: - - You must be careful with renaming tables in case you have used any tricks to - create symlinks of the database directories on different storage volumes, the - move is not a simple directory move on the same volume but a physical copy - across volumes. This can take quite some time and prevent access to the table - being moved during the copy. - - diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/tokudb/tokudb_files_and_file_types.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/tokudb/tokudb_files_and_file_types.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/tokudb/tokudb_files_and_file_types.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/tokudb/tokudb_files_and_file_types.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -.. _tokudb_files_and_file_types: - -=========================== -TokuDB files and file types -=========================== - -The |TokuDB| file set consists of many different files that all serve various -purposes. - -If you have any |TokuDB| data your data directory should look similar to this: - -.. code-block:: bash - - root@server:/var/lib/mysql# ls -lah - ... - -rw-rw---- 1 mysql mysql 76M Oct 13 18:45 ibdata1 - ... - -rw-rw---- 1 mysql mysql 16K Oct 13 15:52 tokudb.directory - -rw-rw---- 1 mysql mysql 16K Oct 13 15:52 tokudb.environment - -rw------- 1 mysql mysql 0 Oct 13 15:52 __tokudb_lock_dont_delete_me_data - -rw------- 1 mysql mysql 0 Oct 13 15:52 __tokudb_lock_dont_delete_me_environment - -rw------- 1 mysql mysql 0 Oct 13 15:52 __tokudb_lock_dont_delete_me_logs - -rw------- 1 mysql mysql 0 Oct 13 15:52 __tokudb_lock_dont_delete_me_recovery - -rw------- 1 mysql mysql 0 Oct 13 15:52 __tokudb_lock_dont_delete_me_temp - -rw-rw---- 1 mysql mysql 16K Oct 13 15:52 tokudb.rollback - ... - -This document lists the different types of |TokuDB| and *Percona Fractal Tree* -files, explains their purpose, shows their location and how to move them -around. - -tokudb.environment ------------------- - -This file is the root of the |Percona FT| file set and contains various bits of -metadata about the system, such as creation times, current file format -versions, etc. - -|Percona FT| will create/expect this file in the directory specified by the -|MySQL| :term:`datadir`. - -tokudb.rollback ---------------- - -Every transaction within |Percona FT| maintains its own transaction rollback -log. These logs are stored together within a single |Percona FT| dictionary -file and take up space within the |Percona FT| cachetable (just like any other -|Percona FT| dictionary). - -The transaction rollback logs will ``undo`` any changes made by a transaction -if the transaction is explicitly rolled back, or rolled back via recovery as a -result of an uncommitted transaction when a crash occurs. - -|Percona FT| will create/expect this file in the directory specified by the -|MySQL| :term:`datadir`. - -tokudb.directory ----------------- - -|Percona FT| maintains a mapping of a dictionary name (example: -``sbtest.sbtest1.main``) to an internal file name (example: -``_sbtest_sbtest1_main_xx_x_xx.tokudb``). This mapping is stored within this -single |Percona FT| dictionary file and takes up space within the |Percona FT| -cachetable just like any other |Percona FT| dictionary. - -|Percona FT| will create/expect this file in the directory specified by the -|MySQL| :term:`datadir`. - -Dictionary files ----------------- - -|TokuDB| dictionary (data) files store actual user data. For each |MySQL| -table there will be: - -* One ``status`` dictionary that contains metadata about the table. - -* One ``main`` dictionary that stores the full primary key (an imaginary key is - used if one was not explicitly specified) and full row data. - -* One ``key`` dictionary for each additional key/index on the table. - -These are typically named: -``__
__.tokudb`` - -|Percona FT| creates/expects these files in the directory specified by -:variable:`tokudb_data_dir` if set, otherwise the |MySQL| ``datadir`` is used. - -Recovery log files ------------------- - -The |Percona FT| recovery log records every operation that modifies a -|Percona FT| dictionary. Periodically, the system will take a snapshot of the -system called a checkpoint. This checkpoint ensures that the modifications -recorded within the |Percona FT| recovery logs have been applied to the -appropriate dictionary files up to a known point in time and synced to disk. - -These files have a rolling naming convention, but use: -``log.tokulog``. - -|Percona FT| creates/expects these files in the directory specified by -:variable:`tokudb_log_dir` if set, otherwise the |MySQL| :term:`datadir` is -used. - -|Percona FT| does not track what log files should or shouldn't be present. Upon -startup, it discovers the logs in the log directory, and replays them in order. -If the wrong logs are present, the recovery aborts and possibly damages the -dictionaries. - -Temporary files ---------------- - -|Percona FT| might need to create some temporary files in order to perform some -operations. When the bulk loader is active, these temporary files might grow to -be quite large. - -As different operations start and finish, the files will come and go. - -There are no temporary files left behind upon a clean shutdown, - -|Percona FT| creates/expects these files in the directory specified by -:variable:`tokudb_tmp_dir` if set. If not, the :variable:`tokudb_data_dir` is -used if set, otherwise the |MySQL| :term:`datadir` is used. - -Lock files ----------- - -|Percona FT| uses lock files to prevent multiple processes from accessing and -writing to the files in the assorted |Percona FT| functionality areas. Each -lock file will be in the same directory as the file(s) that it is protecting. - -These empty files are only used as semaphores across processes. They are safe -to delete/ignore as long as no server instances are currently running and using -the data set. - -``__tokudb_lock_dont_delete_me_environment`` - -``__tokudb_lock_dont_delete_me_recovery`` - -``__tokudb_lock_dont_delete_me_logs`` - -``__tokudb_lock_dont_delete_me_data`` - -``__tokudb_lock_dont_delete_me_temp`` - -|Percona FT| is extremely pedantic about validating its data set. If a file -goes missing or unfound, or seems to contain some nonsensical data, it will -assert, abort or fail to start. It does this not to annoy you, but to try to -protect you from doing any further damage to your data. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/wsrep-provider-index.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/wsrep-provider-index.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/wsrep-provider-index.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/wsrep-provider-index.rst 2017-10-19 04:25:29.000000000 +0000 @@ -333,7 +333,16 @@ :dyn: Yes :default: 0 -This variable is used to limit the number of overflow pages rather than the total memory occupied by all overflow pages. Whenever either this or :variable:`gcache.keep_pages_size` variables are updated at runtime to a non-zero value, cleanup is called on excess overflow pages to delete them. +This variable is used to limit the number of overflow pages +rather than the total memory occupied by all overflow pages. +Whenever ``gcache.keep_pages_count`` is set to a non-zero value, +excess overflow pages will be deleted +(starting from the oldest to the newest). + +Whenever either the ``gcache.keep_pages_count`` +or the :variable:`gcache.keep_pages_size` variable +is updated at runtime to a non-zero value, +cleanup is called on excess overflow pages to delete them. .. variable:: gcache.keep_pages_size @@ -343,7 +352,17 @@ :dyn: No :default: 0 -This variable is used to specify total size of the pages in storage to keep for caching purposes. If only page storage is enabled, one page is always present. +This variable is used to limit the total size of overflow pages +rather than the count of all overflow pages. +Whenever ``gcache.keep_pages_size`` is set to a non-zero value, +excess overflow pages will be deleted +(starting from the oldest to the newest) +until the total size is below the specified value. + +Whenever either the :variable:`gcache.keep_pages_count` +or the ``gcache.keep_pages_size`` variable +is updated at runtime to a non-zero value, +cleanup is called on excess overflow pages to delete them. .. variable:: gcache.mem_size @@ -403,7 +422,7 @@ :cli: Yes :conf: Yes :scope: Global - :dyn: No + :dyn: Yes :default: 1 This variable is used for replication flow control. Replication is resumed when the slave queue drops below :variable:`gcs.fc_factor` * :variable:`gcs.fc_limit`. @@ -413,7 +432,7 @@ :cli: Yes :conf: Yes :scope: Global - :dyn: No + :dyn: Yes :default: 16 This variable is used for replication flow control. Replication is paused when the slave queue exceeds this limit. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/wsrep-status-index.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/wsrep-status-index.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/wsrep-status-index.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/wsrep-status-index.rst 2017-10-19 04:25:29.000000000 +0000 @@ -47,9 +47,10 @@ .. variable:: wsrep_cluster_status Status of the cluster component. Possible values are: - * ``Primary`` - * ``Non-Primary`` - * ``Disconnected`` + * ``Primary`` - Node has a quorum, + * ``Non-Primary`` - Node has lost a quorum (for example 2 out 4 nodes get + partitioned and see each other but don't have a quorum), + * ``Disconnected`` - Node is unable to connect to other nodes/cluster. .. variable:: wsrep_commit_oooe diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/wsrep-system-index.rst percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/wsrep-system-index.rst --- percona-xtradb-cluster-5.6-5.6.34-26.19/doc/source/wsrep-system-index.rst 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/doc/source/wsrep-system-index.rst 2017-10-19 04:25:29.000000000 +0000 @@ -4,76 +4,129 @@ Index of wsrep system variables =============================== +|PXC| introduces a number of MySQL system variables +related to write-set replication. + .. variable:: wsrep_auto_increment_control - :cli: Yes + :cli: ``--wsrep-auto-increment-control`` :conf: Yes :scope: Global :dyn: Yes - :default: ON + :default: ``ON`` + +Enables automatic adjustment of auto-increment system variables +depending on the size of the cluster: + +* ``auto_increment_increment`` controls the interval + between successive ``AUTO_INCREMENT`` column values + +* ``auto_increment_offset`` determines the starting point + for the ``AUTO_INCREMENT`` column value + +This helps prevent auto-increment replication conflicts across the cluster +by giving each node its own range of auto-increment values. +It is enabled by default. -This variable manages the :variable:`auto_increment_increment` and :variable:`auto_increment_offset` variables automatically depending on the size of the cluster. This helps prevent ``auto_increment`` replication conflicts across the cluster by giving each node it's own range of ``auto_increment`` values.   -This may not be desirable depending on application's use and assumptions of auto-increments. It can be turned off in Master/Slave clusters. +Automatic adjustment may not be desirable depending on application's use +and assumptions of auto-increments. +It can be disabled in master-slave clusters. .. variable:: wsrep_causal_reads - :version 5.6.20-25.7: Variable deprecated by :variable:`wsrep_sync_wait` - :cli: Yes + :version 5.6.20-25.7: Variable deprecated + :cli: ``--wsrep-causal-reads`` :conf: Yes :scope: Global, Session :dyn: Yes - :default: OFF + :default: ``OFF`` -In some cases, master may apply event faster than a slave, which can cause master and slave to become out of sync for a brief moment. When this variable is set to ``ON``, slave will wait until that event is applied before doing any other queries. Enabling this variable will also result in larger latencies. +In some cases, master may apply events faster than a slave, +which can cause master and slave to become out of sync for a brief moment. +When this variable is set to ``ON``, the slave will wait +until that event is applied before doing any other queries. +Enabling this variable will also result in larger latencies. + +.. note:: This variable was deprecated because enabling it + is the equivalent of setting :variable:`wsrep_sync_wait` to ``1``. .. variable:: wsrep_certify_nonPK - :cli: Yes + :cli: ``--wsrep-certify-nonpk`` :conf: Yes :scope: Global :dyn: Yes - :default: ON + :default: ``ON`` -When this variable is enabled, primary keys will be generated automatically for rows that don't have them. Using tables without primary keys is not recommended. +Enables automatic generation of primary keys for rows that don't have them. +Write set replication requires primary keys on all tables +to allow for parallel applying of transactions. +This variable is enabled by default. +As a rule, make sure that all tables have primary keys. .. variable:: wsrep_cluster_address - :cli: Yes + :cli: ``--wsrep-cluster-address`` :conf: Yes :scope: Global :dyn: Yes -This variable needs to specify at least one other node's address that is alive and a member of the cluster. In practice, it is best (but not necessary) to provide a complete list of all possible cluster nodes. The value should be of the following format: :: +Defines the back-end schema, IP addresses, ports, and options +that the node uses when connecting to the cluster. +This variable needs to specify at least one other node's address, +which is alive and a member of the cluster. +In practice, it is best (but not necessary) to provide a complete list +of all possible cluster nodes. +The value should be of the following format:: + + ://
[?=[&=]],... - gcomm://,, +The only back-end schema currently supported is ``gcomm``. +The IP address can contain a port number after a colon. +Options are specified after ``?`` and separated by ``&``. +You can specify multiple addresses separated by commas. -Besides the IP address of the node, you can also specify port and options, for example: :: +For example:: - gcomm://192.168.0.1:4567?gmcast.listen_addr=0.0.0.0:5678 + wsrep_cluster_address="gcomm://192.168.0.1:4567?gmcast.listen_addr=0.0.0.0:5678" -If an empty ``gcomm:/ /`` is provided, the node will bootstrap itself (that is, form a new cluster). This is not recommended for production after the cluster has been bootstrapped initially. If you want to bootstrap a new cluster, you should pass the ``--wsrep-new-cluster`` option when starting. +If an empty ``gcomm://`` is provided, the node will bootstrap itself +(that is, form a new cluster). +It is not recommended to have empty cluster address in production config +after the cluster has been bootstrapped initially. +If you want to bootstrap a new cluster with a node, +you should pass the ``--wsrep-new-cluster`` option when starting. .. variable:: wsrep_cluster_name - :cli: Yes + :cli: ``--wsrep-cluster-name`` :conf: Yes :scope: Global :dyn: Yes - :default: my_wsrep_cluster + :default: ``my_wsrep_cluster`` -This is the name of the cluster and should be identical on all nodes belonging to the same cluster. +Specifies the name of the cluster and should be identical on all nodes. .. note:: It should not exceed 32 characters. .. variable:: wsrep_convert_lock_to_trx - :cli: Yes + :cli: ``--wsrep-convert-lock-to-trx`` :conf: Yes :scope: Global :dyn: Yes - :default: OFF + :default: ``OFF`` + +Defines whether locking sessions should be converted into transactions. +By default, this is disabled. -This variable is used to convert ``LOCK/UNLOCK TABLES`` statements to ``BEGIN/COMMIT``. Although this can help some older applications to work with multi-master setup it can also result in having huge writesets. +Enabling this variable can help older applications to work +in a multi-master setup by converting ``LOCK/UNLOCK TABLES`` statements +into ``BEGIN/COMMIT`` statements. +It is not the same as support for locking sessions, +but it does prevent the database from ending up +in a logically inconsistent state. +Enabling this variable can also result in having huge write-sets. .. variable:: wsrep_data_home_dir @@ -81,28 +134,36 @@ :conf: Yes :scope: Global :dyn: No - :default: mysql :term:`datadir` + :default: ``/var/lib/mysql`` + (or whatever path is specified by :term:`datadir`) -This variable can be used to set up the directory where wsrep provider will store its files (like ``grastate.dat``). +Specifies the path to the directory where the wsrep provider stores its files +(such as :file:`grastate.dat`). .. variable:: wsrep_dbug_option - :cli: Yes + :cli: ``--wsrep-dbug-option`` :conf: Yes :scope: Global :dyn: Yes -This variable is used to send the ``DBUG`` option to the wsrep provider. +Defines ``DBUG`` options to pass to the wsrep provider. .. variable:: wsrep_debug - :cli: Yes + :cli: ``--wsrep-debug`` :conf: Yes :scope: Global :dyn: Yes - :default: OFF + :default: ``OFF`` -When this variable is set to ``ON``, debug messages will also be logged to the ``error_log``. This can be used when trying to diagnose problems or when submitting a bug. +Enables additional debugging output for the database server error log. +By default, it is disabled. +This variable can be used when trying to diagnose problems +or when submitting a bug. + +.. note:: Do not enable debugging in production environments, + because it logs authentication info (that is, passwords). .. variable:: wsrep_desync @@ -110,177 +171,263 @@ :conf: Yes :scope: Global :dyn: Yes - :default: OFF - -This variable controls whether the node participates in Flow Control. -Setting this variable to ``ON`` does not automatically mean -that a node will be out of sync with the cluster. -It will continue to replicate the writesets as usual. -The only difference is that flow control will no longer -take care of the desynced node. -The result is that if :variable:`wsrep_local_recv_queue` -gets higher than maximum allowed, -all the other nodes will ignore the replication lag on the desynced node. -Toggling this back to ``OFF`` will require an IST or an SST, -depending on how long it was desynchronized. -This is similar to cluster desynchronization, -which occurs during RSU TOI. - -It's not a good idea to keep desync set for a long period of time, -nor should you desync several nodes at once. -Also, you'll need to desync a node before it starts -causing flow control for it to have any effect. - -A node can also be desynchronized with ``/*! WSREP_DESYNC */`` query comment. - -The following logic applies to desynced nodes: + :default: ``OFF`` -* If a node is explicitly desynced, - then implicitly desyncing a node using RSU/FTWRL is allowed. +Defines whether the node should participate in Flow Control. +By default, this variable is disabled, +meaning that if the receive queue becomes too big, +the node engages in Flow Control: +it works through the receive queue until it reaches a more manageable size. +For more information, see :variable:`wsrep_local_recv_queue` +and :variable:`wsrep_flow_control_interval`. + +Enabling this variable will disable Flow Control for the node. +It will continue to receive write-sets that it is not able to apply, +the receive queue will keep growing, +and the node will keep falling behind the cluster indefinitely. -* If a node is implicitly desynced using RSU/FTWRL, - then explicitly desyncing a node is blocked - until implicit desync is complete. +Toggling this back to ``OFF`` will require an IST or an SST, +depending on how long it was desynchronized. +This is similar to cluster desynchronization, which occurs during RSU TOI. +Because of this, it's not a good idea to enable ``wsrep_desync`` +for a long period of time or for several nodes at once. -* If a node is explicitly desynced and then implicitly desycned using RSU/FTWRL, - then any request for another implicit desync is blocked - until the former implicit desync is complete. +.. note:: You can also desync a node + using the ``/*! WSREP_DESYNC */`` query comment. .. variable:: wsrep_dirty_reads :version 5.6.24-25.11: Variable introduced :version 5.6.26-25.12: Variable available both on session and global scope - :cli: Yes + :cli: ``--wsrep-dirty-reads`` :conf: Yes :scope: Session, Global :dyn: Yes - :default: OFF + :default: ``OFF`` -This variable is boolean and is ``OFF`` by default. When set to ``ON``, a |Percona XtraDB Cluster| node accepts queries that only read, but not modify data even if the node is in the non-PRIM state +Defines whether the node accepts read queries when in a non-operational state, +that is, when it loses connection to the Primary Component. +By default, this variable is disabled and the node rejects all queries, +because there is no way to tell if the data is correct. + +If you enable this variable, the node will permit read queries +(``USE``, ``SELECT``, ``LOCK TABLE``, and ``UNLOCK TABLES``), +but any command that modifies or updates the database +on a non-operational node will still be rejected +(including DDL and DML statements, +such as ``INSERT``, ``DELETE``, and ``UPDATE``). + +To avoid deadlock errors, +set the :variable:`wsrep_sync_wait` variable to ``0`` +if you enable ``wsrep_dirty_reads``. .. variable:: wsrep_drupal_282555_workaround - :cli: Yes + :cli: ``--wsrep-drupal-282555-workaround`` :conf: Yes :scope: Global :dyn: Yes - :default: OFF + :default: ``OFF`` -This variable was introduced as a workaround for Drupal/MySQL bug `#282555 `_. In some cases, duplicate key errors would occur when inserting the ``default`` value into the ``auto_increment`` field. +Enables a workaround for MySQL InnoDB bug that affects Drupal +(`Drupal bug #282555 `_ +and `MySQL bug #41984 `_). +In some cases, duplicate key errors would occur +when inserting the ``DEFAULT`` value into an ``AUTO_INCREMENT`` column. .. variable:: wsrep_forced_binlog_format - :cli: Yes + :cli: ``--wsrep-forced-binlog-format`` :conf: Yes :scope: Global :dyn: Yes - :default: NONE + :default: ``NONE`` + +Defines a binary log format that will always be effective, +regardless of the client session |binlog_format|_ variable value. + +Possible values for this variable are: -This variable defines a binlog format that will always be effective regardless of session binlog format setting. Possible values for this variable are: - * ``ROW`` - * ``STATEMENT`` - * ``MIXED`` - * ``NONE``: Resets the forced state of the binlog format (default) + * ``ROW``: Force row-based logging format + * ``STATEMENT``: Force statement-based logging format + * ``MIXED``: Force mixed logging format + * ``NONE``: Do not force the binary log format + and use whatever is set by the |binlog_format| variable (default) + +.. |binlog_format| replace:: ``binlog_format`` +.. _binlog_format: https://dev.mysql.com/doc/refman/5.7/en/binary-log-setting.html .. variable:: wsrep_load_data_splitting - :cli: Yes + :cli: ``--wsrep-load-data-splitting`` :conf: Yes :scope: Global :dyn: Yes - :default: ON + :default: ``ON`` + +Defines whether the node should split large ``LOAD DATA`` transactions. +This variable is enabled by default, meaning that ``LOAD DATA`` commands +are split into transactions of 10 000 rows or less. + +If you disable this variable, then huge data loads may prevent the node +from completely rolling the operation back in the event of a conflict, +and whatever gets committed stays committed. -This variable controls whether ``LOAD DATA`` transaction splitting is wanted or not. It doesn't work as expected with ``autocommit=0`` when enabled. +.. note:: It doesn't work as expected with ``autocommit=0`` when enabled. .. variable:: wsrep_log_conflicts - :cli: Yes + :cli: ``--wsrep-log-conflicts`` :conf: Yes :scope: Global - :dyn: Yes - :default: OFF + :dyn: No + :default: ``OFF`` -This variable is used to control whether sole cluster conflicts should be logged. When enabled, details of conflicting |InnoDB| lock will be logged. +Defines whether the node should log additional information about conflicts. +By default, this variable is disabled +and |PXC| uses standard logging features in MySQL. + +If you enable this variable, it will also log table and schema +where the conflict occurred, as well as the actual values for keys +that produced the conflict. .. variable:: wsrep_max_ws_rows - :cli: Yes + :cli: ``--wsrep-max-ws-rows`` :conf: Yes :scope: Global :dyn: Yes - :default: 131072 (128K) + :default: ``0`` (no limit) -**This variable has no effect!** +Defines the maximum number of rows each write-set can contain. -By design, -it was supposed to control the maximum number of rows each writeset can contain. -However, it is hard to predict the number of rows -because of the writeset size limit enforced by :variable:`wsrep_max_ws_size`. - -Codership decided to not implement the limit by rows for now. -Correct behavior may be implemented in a future release. -There is a discussion open at https://github.com/codership/mysql-wsrep/issues/257 +By default, there is no limit for the maximum number of rows in a write-set. +The maximum allowed value is ``1048576``. .. variable:: wsrep_max_ws_size - :cli: Yes + :cli: ``--wsrep_max_ws_size`` :conf: Yes :scope: Global :dyn: Yes - :default: 1073741824 (1G) + :default: ``2147483647`` (2 GB) + +Defines the maximum write-set size (in bytes). +Anything bigger than the specified value will be rejected. -This variable is used to control maximum writeset size (in bytes). Anything bigger than the specified value will be rejected. +You can set it to any value between ``1024`` and the default ``2147483647``. .. variable:: wsrep_mysql_replication_bundle - :cli: Yes + :cli: ``--wsrep-mysql-replication-bundle`` :conf: Yes :scope: Global :dyn: No - :default: 0 (no grouping) - :range: 0-1000 + :default: ``0`` (no grouping) + :range: From ``0`` to ``1000`` + +Specifies the number of replication events to group together. +By default, it is set to ``0``, which means there is no grouping. -This variable controls how many replication events will be grouped together. Replication events are grouped in SQL slave thread by skipping events which may cause commit. This way the wsrep node acting in |MySQL| slave role and all other wsrep nodes in provider replication group, will see same (huge) transactions. The implementation is still experimental. This may help with the bottleneck of having only one |MySQL| slave facing commit time delay of synchronous provider. +Replication events are grouped in SQL slave thread by skipping events, +which may cause commit. +In this case, the wsrep node acting as a slave node +and all other wsrep nodes in provider replication group, +will see the same (huge) transactions. +The implementation of grouping is experimental. +It may help with the bottleneck of having only one slave +facing commit time delay of synchronous provider. +You can set it up to group up to 1000 events. + +.. note:: This feature and variable + is not available in latest versions of |PXC| 5.7. .. variable:: wsrep_node_address - :cli: Yes + :cli: ``--wsrep-node-address`` :conf: Yes :scope: Global :dyn: No - :format: [:port] - :default: Usually set up as primary network interface (``eth0``) + :default: IP of the first network interface (``eth0``) + and default port (``4567``) + +Specifies the network address of the node. +By default, this variable is set to the IP address +of the first network interface (usually ``eth0`` or ``enp2s0``) +and the default port (``4567``). -This variable is used to specify the network address of the node. In some cases, when there are multiple NICs available, state transfer might not work if the default NIC is on different network. Setting this variable explicitly to the correct value will make SST and IST work correctly out of the box. Even in multi-network setups, IST/SST can be configured to use other interfaces/addresses. +While default value should be correct in most cases, +there are situations when you need to specify it manually. +For example: + +* Servers with multiple network interfaces +* Servers that run multiple nodes +* Network Address Translation (NAT) +* Clusters with nodes in more than one region +* Container deployments, such as Docker +* Cloud deployments, such as Amazon EC2 + (use the global DNS name instead of the local IP address) + +The value should be specified in the following format:: + + [:port] + +For example:: + + 192.168.0.1:4567 + +.. note:: The value of this variable is also used as the default value + for the :variable:`wsrep_sst_receive_address` variable + and the :variable:`ist.recv_addr` option. .. variable:: wsrep_node_incoming_address - :cli: Yes + :cli: ``--wsrep-node-incoming-address`` :conf: Yes :scope: Global :dyn: No - :default: <:variable:`wsrep_node_address`>:3306 + :default: ``AUTO`` + +Specifies the network address from which the node expects client connections. +By default, it uses the IP address from :variable:`wsrep_node_address` +and port number 3306. -This is the address at which the node accepts client connections. This information is used for status variable :variable:`wsrep_incoming_addresses` which shows all the active cluster nodes. +This information is used for the :variable:`wsrep_incoming_addresses` variable, +which shows all active cluster nodes. .. variable:: wsrep_node_name - :cli: Yes + :cli: ``--wsrep-node-name`` :conf: Yes :scope: Global :dyn: Yes - :default: Host name + :default: The node's host name -Unique name of the node. Defaults to the host name. +Defines a unique name for the node. Defaults to the host name. + +The name is used for convenience, +to help you identify nodes in the cluster +by means other than the node address. .. variable:: wsrep_notify_cmd - :cli: Yes + :cli: ``--wsrep-notify-cmd`` :conf: Yes :scope: Global :dyn: Yes -This variable is used to set the `notification command `_ that the server should execute every time cluster membership or local node status changes. +Specifies the `notification command +`_ +that the node should execute +whenever cluster membership or local node status changes. +This can be used for alerting or to reconfigure load balancers. + +.. note:: The node will block and wait + until the command or script completes and returns before it can proceed. + If the script performs any potentially blocking + or long-running operations, such as network communication, + you should consider initiating such operations in the background + and have the script return immediately. .. variable:: wsrep_on @@ -289,70 +436,131 @@ :conf: No :scope: Session :dyn: Yes - :default: ON + :default: ``ON`` -This variable is used to enable/disable wsrep replication. When set to ``OFF``, server will stop replication and behave like standalone |MySQL| server. +Defines whether updates from the current session should be replicated. +If disabled, it does not cause the node to leave the cluster +and the node continues to communicate with other nodes. .. variable:: wsrep_OSU_method :version 5.6.24-25.11: Variable available both in global and session scope - :cli: Yes + :cli: ``--wsrep-OSU-method`` :conf: Yes :scope: Global and Session :dyn: Yes - :default: TOI + :default: ``TOI`` -This variable can be used to select schema upgrade method. Available values are: - -* ``TOI``: When the *Total Order Isolation* method is selected, data definition language (DDL) statements are processed in the same order with regards to other transactions in each cluster node. This guarantees data consistency. In case of DDL statements, cluster will have parts of database locked and it will behave like a single server. In some cases (like big ``ALTER TABLE``) this could have impact on cluster's performance and high availability, but it could be fine for quick changes that happen almost instantly (like fast index changes). When DDL statements are processed under TOI, the DDL statement will be replicated up front to the cluster. That is, cluster will assign global transaction ID for the DDL statement before DDL processing begins. Then every node in the cluster has the responsibility to execute the DDL statement in the given slot in the sequence of incoming transactions, and this DDL execution has to happen with high priority. - -* ``RSU``: When the *Rolling Schema Upgrade* method is selected, DDL statements won't be replicated across the cluster, instead it's up to the user to run them on each node separately. The node applying the changes will desynchronize from the cluster briefly, while normal work happens on all the other nodes. When a DDL statement is processed, node will apply delayed replication events. The schema changes **must** be backwards compatible for this method to work, otherwise the node that receives the change will likely break Galera replication. If replication breaks, SST will be triggered when the node tries to join again but the change will be undone. - -For more information, see :variable:`wsrep_desync`. - -.. note:: Prior to |Percona XtraDB Cluster| :rn:`5.6.24-25.11`, :variable:`wsrep_OSU_method` was only a global variable. Current behavior is now consistent with |MySQL| behavior for variables that have both global and session scope. This means if you want to change the variable in current session, you need to do it with: ``SET wsrep_OSU_method`` (without the ``GLOBAL`` keyword). Setting the variable with ``SET GLOBAL wsrep_OSU_method`` will change the variable globally but it won't have effect on the current session. +Defines the method for Online Schema Upgrade +that the node uses to replicate DDL statements. +The following methods are available: + +* ``TOI``: When the *Total Order Isolation* method is selected, + data definition language (DDL) statements are processed in the same order + with regards to other transactions in each node. + This guarantees data consistency. + + In the case of DDL statements, + the cluster will have parts of the database locked + and it will behave like a single server. + In some cases (like big ``ALTER TABLE``) + this could have impact on cluster's performance and availability, + but it could be fine for quick changes that happen almost instantly + (like fast index changes). + + When DDL statements are processed under TOI, + the DDL statement will be replicated up front to the cluster. + That is, the cluster will assign global transaction ID + for the DDL statement before DDL processing begins. + Then every node in the cluster has the responsibility + to execute the DDL statement in the given slot + in the sequence of incoming transactions, + and this DDL execution has to happen with high priority. + +* ``RSU``: When the *Rolling Schema Upgrade* method is selected, + DDL statements won't be replicated across the cluster. + Instead, it's up to the user to run them on each node separately. + + The node applying the changes will desynchronize from the cluster briefly, + while normal work happens on all the other nodes. + When a DDL statement is processed, + the node will apply delayed replication events. + + The schema changes must be backwards compatible for this method to work, + otherwise, the node that receives the change + will likely break Galera replication. + If replication breaks, SST will be triggered + when the node tries to join again but the change will be undone. + +.. note:: This variable's behavior is consistent with MySQL behavior + for variables that have both global and session scope. + This means if you want to change the variable in current session, + you need to do it with ``SET wsrep_OSU_method`` + (without the ``GLOBAL`` keyword). + Setting the variable with ``SET GLOBAL wsrep_OSU_method`` + will change the variable globally + but it won't have effect on the current session. .. variable:: wsrep_preordered - :cli: Yes + :cli: ``--wsrep-preordered`` :conf: Yes :scope: Global :dyn: Yes - :default: OFF + :default: ``OFF`` + +Defines whether the node should use transparent handling +of preordered replication events (like replication from traditional master). +By default, this is disabled. -Use this variable to enable new, transparent handling of preordered replication events (like replication from traditional master). When this variable is enabled, such events will be applied locally first before being replicated to the other nodes of the cluster. This could increase the rate at which they can be processed, which would be otherwise limited by the latency between the nodes in the cluster. +If you enable this variable, such events will be applied locally first +before being replicated to other nodes in the cluster. +This could increase the rate at which they can be processed, +which would be otherwise limited by the latency +between the nodes in the cluster. -Preordered events should not interfere with events that originate on the local node. Therefore, you should not run local update queries on a table that is also being updated through asynchronous replication. +Preordered events should not interfere with events +that originate on the local node. +Therefore, you should not run local update queries on a table +that is also being updated through asynchronous replication. .. variable:: wsrep_provider - :cli: Yes + :cli: ``--wsrep-provider`` :conf: Yes :scope: Global :dyn: Yes - :default: None -This variable should contain the path to the Galera library (like :file:`/usr/lib64/libgalera_smm.so` on *CentOS*/*RHEL* and :file:`/usr/lib/libgalera_smm.so` on *Debian*/*Ubuntu*). +Specifies the path to the Galera library. +This is usually +:file:`/usr/lib64/libgalera_smm.so` on *CentOS*/*RHEL* and +:file:`/usr/lib/libgalera_smm.so` on *Debian*/*Ubuntu*. + +If you do not specify a path or the value is not valid, +the node will behave as standalone instance of MySQL. .. variable:: wsrep_provider_options - :cli: Yes + :cli: ``--wsrep-provider-options`` :conf: Yes :scope: Global :dyn: No -This variable contains settings currently used by Galera library. +Specifies optional settings for the replication provider +documented in :ref:`wsrep_provider_index`. +These options affect how various situations are handled during replication. .. variable:: wsrep_recover - :cli: No + :cli: ``--wsrep-recover`` :conf: Yes :scope: Global :dyn: No - :default: OFF - :location: mysqld_safe + :default: ``OFF`` + :location: ``mysqld_safe`` -When server is started with this variable, it will parse Global Transaction ID (GTID) from log, and if the GTID is found, assign it as initial position for actual server start. This option is used to recover GTID. +Recovers database state after crash by parsing GTID from the log. +If the GTID is found, it will be assigned as the initial position for server. .. variable:: wsrep_reject_queries @@ -360,192 +568,341 @@ :conf: Yes :scope: Global :dyn: Yes - :default: NONE - -This variable can be used to reject queries for the node. This can be useful during upgrades for keeping node up (with provider enabled) without accepting queries. Using read-only is recommended here unless you want to kill existing queries. This variable accepts the following values: - -* ``NONE``: Nothing is rejected (default) -* ``ALL``: All queries are rejected with ``Error 1047: Unknown command`` -* ``ALL_KILL``: All queries are rejected and existing client connections are also killed without waiting - -.. note:: This variable doesn't affect Galera replication in any way, only the applications which connect to database are affected. If you want to desync a node, then use :variable:`wsrep_desync`. + :default: ``NONE`` + +Defines whether the node should reject queries from clients. +Rejecting queries can be useful during upgrades, +when you want to keep the node up and apply write-sets +without accepting queries. + +When a query is rejected, the following error is returned:: + + Error 1047: Unknown command + +The following values are available: + +* ``NONE``: Accept all queries from clients (default) + +* ``ALL``: Reject all new queries from clients, + but maintain existing client connections + +* ``ALL_KILL``: Reject all new queries from clients + and kill existing client connections + +.. note:: This variable doesn't affect Galera replication in any way, + only the applications that connect to the database are affected. + If you want to desync a node, use :variable:`wsrep_desync`. .. variable:: wsrep_replicate_myisam :version 5.6.24-25.11: Variable available both in global and session scope - :cli: Yes + :cli: ``--wsrep-replicate-myisam`` :conf: Yes :scope: Session, Global :dyn: No - :default: OFF - -This variable defines whether MyISAM should be replicated or not. It is disabled by default, because MyISAM replication is still experimental. + :default: ``OFF`` -On the global level, :variable:`wsrep_replicate_myisam` can be set only before boot-up. On session level, you can change it during runtime as well. +Defines whether DML statements for MyISAM tables should be replicated. +It is disabled by default, because MyISAM replication is still experimental. -For older nodes in the cluster, :variable:`wsrep_replicate_myisam` should work since the TOI decision (for MyISAM DDL) is done on origin node. Mixing of non-MyISAM and MyISAM tables in the same DDL statement is not recommended when :variable:`wsrep_replicate_myisam` is disabled, since if any table in the list is MyISAM, the whole DDL statement is not put under TOI. +On the global level, :variable:`wsrep_replicate_myisam` +can be set only during startup. +On session level, you can change it during runtime as well. + +For older nodes in the cluster, :variable:`wsrep_replicate_myisam` should work +since the TOI decision (for MyISAM DDL) is done on origin node. +Mixing of non-MyISAM and MyISAM tables in the same DDL statement +is not recommended when :variable:`wsrep_replicate_myisam` is disabled, +since if any table in the list is MyISAM, +the whole DDL statement is not put under TOI. .. note:: You should keep in mind the following when using MyISAM replication: - * DDL (CREATE/DROP/TRUNCATE) statements on MyISAM will be replicated irrespective of :variable:`wsrep_replicate_miysam` value - * DML (INSERT/UPDATE/DELETE) statements on MyISAM will be replicated only if :variable:`wsrep_replicate_myisam` is enabled - * SST will get full transfer irrespective of :variable:`wsrep_replicate_myisam` value (it will get MyISAM tables from donor) - * Difference in configuration of ``pxc-cluster`` node on `enforce_storage_engine `_ front may result in picking up different engine for same table on different nodes - * ``CREATE TABLE AS SELECT`` (CTAS) statements use non-TOI replication and are replicated only if there is involvement of InnoDB table that needs transactions (involvement of MyISAM table will cause CTAS statement to skip replication) - + * DDL (CREATE/DROP/TRUNCATE) statements on MyISAM will be replicated + irrespective of :variable:`wsrep_replicate_miysam` value + * DML (INSERT/UPDATE/DELETE) statements on MyISAM will be replicated only if + :variable:`wsrep_replicate_myisam` is enabled + * SST will get full transfer irrespective of + :variable:`wsrep_replicate_myisam` value + (it will get MyISAM tables from donor) + * Difference in configuration of ``pxc-cluster`` node + on `enforce_storage_engine + `_ + front may result in picking up different engine for the same table + on different nodes + * ``CREATE TABLE AS SELECT`` (CTAS) statements use non-TOI replication + and are replicated only if there is involvement of InnoDB table + that needs transactions + (in case of MyISAM table, CTAS statements will not be replicated). .. variable:: wsrep_restart_slave - :cli: Yes + :cli: ``--wsrep-restart-slave`` :conf: Yes :scope: Global :dyn: Yes - :default: OFF + :default: ``OFF`` -This variable controls if |MySQL| slave should be restarted automatically when node joins back to cluster, because asynchronous replication slave thread is stopped when the node tries to apply next replication event while the node is in non-primary state. +Defines whether replication slave should be restarted +when the node joins back to the cluster. +Enabling this can be useful because asynchronous replication slave thread +is stopped when the node tries to apply the next replication event +while the node is in non-primary state. .. variable:: wsrep_retry_autocommit - :cli: Yes + :cli: ``--wsrep-retry-autocommit`` :conf: Yes :scope: Global :dyn: No - :default: 1 + :default: ``1`` + +Specifies the number of times autocommit transactions will be retried +in the cluster if it encounters certification errors. +In case there is a conflict, it should be safe for the cluster node +to simply retry the statement without returning an error to the client, +hoping that it will pass next time. + +This can be useful to help an application using autocommit +to avoid deadlock errors that can be triggered by replication conflicts. -This variable sets the number of times autocommitted transactions will be tried in the cluster if it encounters certification errors. In case there is a conflict, it should be safe for the cluster node to simply retry the statement without the client's knowledge hoping that it will pass next time. This can be useful to help an application using autocommit to avoid deadlock errors that can be triggered by replication conflicts. If this variable is set to ``0`` transaction won't be retried and if it is set to ``1``, it will be retried once. +If this variable is set to ``0``, +autocommit transactions won't be retried. .. variable:: wsrep_slave_FK_checks - :cli: Yes + :cli: ``--wsrep-slave-FK-checks`` :conf: Yes :scope: Global :dyn: Yes - :default: ON + :default: ``ON`` -This variable is used to control if Foreign Key checking is done for applier threads. +Defines whether foreign key checking is done for applier threads. +This is enabled by default. .. variable:: wsrep_slave_threads - :cli: Yes + :cli: ``--wsrep-slave-threads`` :conf: Yes :scope: Global :dyn: Yes - :default: 1 + :default: ``1`` -This variable controls the number of threads that can apply replication transactions in parallel. Galera supports true parallel replication, replication that applies transactions in parallel only when it is safe to do so. The variable is dynamic, you can increase/decrease it at any time. +Specifies the number of threads +that can apply replication transactions in parallel. +Galera supports true parallel replication +that applies transactions in parallel only when it is safe to do so. +This variable is dynamic. +You can increase/decrease it at any time. -.. note:: When you decrease it, it won't kill the threads immediately but stop them after they are done applying current transaction (the effect with increase is immediate though). +.. note:: When you decrease the number of threads, + it won't kill the threads immediately, + but stop them after they are done applying current transaction + (the effect with an increase is immediate though). -If any replication consistency problems are encountered, it's recommended to set this back to ``1`` to see if that resolves the issue. The default value can be increased for better throughput. +If any replication consistency problems are encountered, +it's recommended to set this back to ``1`` to see if that resolves the issue. +The default value can be increased for better throughput. -You may want to increase it as suggested `in Codership documentation `_, in ``JOINED`` state for instance to speed up the catchup process to ``SYNCED``. +You may want to increase it as suggested +`in Codership documentation for flow control +`_: +when the node is in ``JOINED`` state, +increasing the number of slave threads can speed up the catchup to ``SYNCED``. -You can also estimate the optimal value for this from :variable:`wsrep_cert_deps_distance` as suggested `on this page `_. +You can also estimate the optimal value for this from +:variable:`wsrep_cert_deps_distance` as suggested `on this page +`_. -You can also refer to `this `_ for more configuration tips. +For more configuration tips, see `this document +`_. .. variable:: wsrep_slave_UK_checks - :cli: Yes + :cli: ``--wsrep-slave-UK-checks`` :conf: Yes :scope: Global :dyn: Yes - :default: OFF + :default: ``OFF`` -This variable is used to control if Unique Key checking is done for applier threads. +Defines whether unique key checking is done for applier threads. +This is disabled by default. .. variable:: wsrep_sst_auth - :cli: Yes + :cli: ``--wsrep-sst-auth`` :conf: Yes :scope: Global :dyn: Yes - :format: : + :format: ``:`` + +Specifies authentication information for State Snapshot Transfer (SST). +Required information depends on the method +specified in the :variable:`wsrep_sst_method` variable. + +For more information about SST authentication, +see :ref:`state_snapshot_transfer`. -This variable should contain the authentication information needed for State Snapshot Transfer (SST). Required information depends on the method selected in the :variable:`wsrep_sst_method`. More information about required authentication can be found in the :ref:`state_snapshot_transfer` documentation. This variable will appear masked in the logs and in the ``SHOW VARIABLES`` query. +.. note:: Value of this variable is masked in the log + and in the ``SHOW VARIABLES`` query output. .. variable:: wsrep_sst_donor - :cli: Yes + :cli: ``--wsrep-sst-donor`` :conf: Yes :scope: Global :dyn: Yes -This variable contains the name (:variable:`wsrep_node_name`) of the preferred donor for SST. If no node is selected as a preferred donor, it will be chosen from one of the available nodes automatically **if and only if** there is a terminating comma at the end (like 'node1,node2,'). Otherwise, if there is no terminating comma, the list of nodes in :variable:`wsrep_sst_donor` is considered absolute, and thus it won't fall back even if other nodes are available. Please check the note for :option:`sst-initial-timeout` if you are using it without terminating comma or want joiner to wait more than default 100 seconds. +Specifies a list of nodes (using their :variable:`wsrep_node_name` values) +that the current node should prefer as donors for SST and IST. +If the value is empty, the first node in SYNCED state in the index +becomes the donor and will not be able to serve requests during state transfer. + +If you want to consider other nodes when listed ones are not available, +add a comma at the end of the list, for example:: + + wsrep_sst_donor=node1,node2, + +If you remove the trailing comma from the previous example, +then the joining node will consider *only* ``node1`` and ``node2``. + +.. note:: By default, the joiner node does not wait for more than 100 seconds + to receive the first packet from a donor. + This is implemented via the :option:`sst-initial-timeout` option. + If you set the list of preferred donors without a terminating comma + or believe that all nodes in the cluster can often be unavailable for SST + (this is common for small clusters), + then you may want to increase the initial timeout + (or disable it completely + if you don't mind joiner node waiting for state transfer indefinitely). .. variable:: wsrep_sst_donor_rejects_queries - :cli: Yes + :cli: ``--wsrep-sst-donor-rejects-queries`` :conf: Yes :scope: Global :dyn: Yes - :default: OFF + :default: ``OFF`` + +Defines whether the node should reject blocking client sessions +when it is serving as a donor during a blocking state transfer method +(when :variable:`wsrep_sst_method` is set to ``mysqldump`` or ``rsync``). +This is disabled by default, meaning that the node accepts such queries. -When this variable is enabled, SST donor node will not accept incoming queries, instead it will reject queries with ``UNKNOWN COMMAND`` error code. This can be used to signal load-balancer that the node isn't available. +If you enable this variable, queries will return the ``Unknown command`` error. +This can be used to signal load-balancer that the node isn't available. .. variable:: wsrep_sst_method - :cli: Yes + :cli: ``--wsrep-sst-method`` :conf: Yes :scope: Global :dyn: Yes - :default: xtrabackup-v2 - :recommended: xtrabackup-v2 + :default: ``xtrabackup-v2`` -This variable sets up the method for taking the State Snapshot Transfer (SST). Available values are: +Defines the method or script for :ref:`state_snapshot_transfer` (SST). -* ``xtrabackup``: Uses Percona XtraBackup to perform the SST, this method requires :variable:`wsrep_sst_auth` to be set up with : which |XtraBackup| will use on donor. Privileges and permissions needed for running |XtraBackup| can be found `here `_. +Available values are: -* ``xtrabackup-v2``: This is the same as ``xtrabackup``, except that it uses newer protocol, hence is not compatible. This is the **recommended** option for PXC 5.5.34 and above. For more details, please check :ref:`xtrabackup_sst` and :ref:`errata`. This is also the default SST method. For SST with older nodes (< 5.5.34), use ``xtrabackup`` as the SST method. +* ``xtrabackup-v2``: Uses |Percona XtraBackup| to perform SST. + This method requires :variable:`wsrep_sst_auth` + to be set up with credentials (``:``) on the donor node. + Privileges and perimssions for running |Percona XtraBackup| + can be found `in Percona XtraBackup documentation + `_. - .. note:: This method is currently recommended if you have ``innodb-log-group_home-dir/innodb-data-home-dir`` in your config. Refer to :option:`sst-special-dirs` for more information. + .. note:: This is the **recommended** and default method for |PXC|. + For more information, see :ref:`xtrabackup_sst`. -* ``rsync``: Uses ``rsync`` to perform the SST, this method doesn't use the :variable:`wsrep_sst_auth` +* ``rsync``: Uses ``rsync`` to perform SST. + This method doesn't use the :variable:`wsrep_sst_auth` variable. -* ``mysqldump``: Uses ``mysqldump`` to perform the SST, this method requires :variable:`wsrep_sst_auth` to be set up with :, where user has root privileges on the server. +* ``mysqldump``: Uses ``mysqldump`` to perform SST + This method requires superuser credentials for the donor node + to be specified in the :variable:`wsrep_sst_auth` variable. - .. note:: This mehotd is not recommended unless it is required for specific reasons. Also, it is not compatible with ``bind_address`` set to ``127.0.0.1`` or ``localhost``, and will cause startup to fail if set so. + .. note:: This method is not recommended + unless it is required for specific reasons. + Also, it is not compatible with ``bind_address`` set to ``127.0.0.1`` + or ``localhost``, and will cause startup to fail in this case. -* ````: Galera supports `Scriptable State Snapshot Transfer `_. This enables users to create their own custom script for performing an SST. For example, you can create a script :file:`/usr/bin/wsrep_MySST.sh` and specify ``MySST`` for this variable to run your custom SST script. +* ````: Galera supports `Scriptable State Snapshot Transfer + `_. + This enables users to create their own custom scripts for performing SST. + For example, you can create a script :file:`/usr/bin/wsrep_MySST.sh` + and specify ``MySST`` for this variable to run your custom SST script. -* ``skip``: Use this to skip SST, it can be used when initially starting the cluster and manually restoring the same data to all nodes. It shouldn't be used as permanent setting because it could lead to data inconsistency across the nodes. +* ``skip``: Use this to skip SST. + This can be used when initially starting the cluster + and manually restoring the same data to all nodes. + It shouldn't be used permanently + because it could lead to data inconsistency across the nodes. -.. note:: Only ``xtrabackup-v2`` and ``rsync`` provide ``gtid_mode async-slave`` support during SST. +.. note:: Only ``xtrabackup-v2`` and ``rsync`` provide support + for clusters with GTIDs and async slaves. .. variable:: wsrep_sst_receive_address - :cli: Yes + :cli: ``--wsrep-sst-receive-address`` :conf: Yes :scope: Global :dyn: Yes - :default: AUTO + :default: ``AUTO`` -This variable is used to configure address on which the node expects SST. +Specifies the network address where donor node should send state transfers. +By default, this variable is set to ``AUTO``, +meaning that the IP address from :variable:`wsrep_node_address` is used. .. variable:: wsrep_start_position - :cli: Yes + :cli: ``--wsrep-start-position`` :conf: Yes :scope: Global :dyn: Yes + :default: ``00000000-0000-0000-0000-00000000000000:-1`` -This variable contains the ``UUID:seqno`` value. By setting all the nodes to have the same value for this option, cluster can be set up without the state transfer. +Specifies the node's start position as ``UUID:seqno``. +By setting all the nodes to have the same value for this variable, +the cluster can be set up without the state transfer. .. variable:: wsrep_sync_wait :version 5.6.20-25.7: Variable introduced - :cli: Yes + :cli: ``--wsrep-sync-wait`` :conf: Yes - :scope: Global, Session + :scope: Session :dyn: Yes + :default: ``0`` + +Controls cluster-wide causality checks on certain statements. +Checks ensure that the statement is executed on a node +that is fully synced with the cluster. + +.. note:: Causality checks of any type can result in increased latency. + +The type of statements to undergo checks +is determined by bitmask: + +* ``0``: Do not run causality checks for any statements. + This is the default. + +* ``1``: Perform checks for ``READ`` statements + (including ``SELECT``, ``SHOW``, and ``BEGIN`` or ``START TRANSACTION``). + +* ``2``: Perform checks for ``UPDATE`` and ``DELETE`` statements. + +* ``3``: Perform checks for ``READ``, ``UPDATE``, and ``DELETE`` statements. -This variable is used to control causality checks on some SQL statements, such as ``SELECT``, ``BEGIN``/``END``, ``SHOW STATUS``, but not on some autocommit SQL statements ``UPDATE`` and ``INSERT``. Causality check is determined by bitmask: +* ``4``: Perform checks for ``INSERT`` and ``REPLACE`` statements. - * ``1`` Indicates check on ``READ`` statements, including ``SELECT``, ``SHOW``, ``BEGIN``/``START TRANSACTION``. +* ``5``: Perform checks for ``READ``, ``INSERT``, and ``REPLACE`` statements. - * ``2`` Indicates check on ``UPDATE`` and ``DELETE`` statements. +* ``6``: Perform checks for ``UPDATE``, ``DELETE``, ``INSERT``, + and ``REPLACE`` statements. - * ``4`` Indicates check on ``INSERT`` and ``REPLACE`` statements +* ``7``: Perform checks for ``READ``, ``UPDATE``, ``DELETE``, ``INSERT``, + and ``REPLACE`` statements. -This variable replaced the :variable:`wsrep_causal_reads` variable. Setting :variable:`wsrep_sync_wait` to ``1`` is the equivalent of setting :variable:`wsrep_causal_reads` to ``ON``. +.. note:: Setting :variable:`wsrep_sync_wait` to ``1`` is the equivalent + of setting the deprecated :variable:`wsrep_causal_reads` to ``ON``. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/.gitignore percona-xtradb-cluster-5.6-5.6.37-26.21/.gitignore --- percona-xtradb-cluster-5.6-5.6.34-26.19/.gitignore 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,3143 +0,0 @@ -*-t -*_test -*.Plo -*.Po -*.a -*.bb -*.bbg -*.bin -*.cdf -*.core -*.d -*.da -*.dir -*.dll -*.dylib -*.exe -*.exp -*.gcda -*.gcno -*.gcov -*.idb -*.ilk -*.la -*.lai -*.lib -*.lo -*.manifest -*.map -*.o -*.obj -*.old -*.pch -*.pdb -*.reject -*.res -*.rule -*.sbr -*.so -*.so.* -*.user -*.vcproj -*.vcproj.cmake -*.vcxproj -*.vcxproj.filters -*/*.dir/* -Debug -MySql.sdf -Win32 -*/*_pure_*warnings -*/.deps -*/.libs/* -*/.pure -*/debug/* -*/minsizerel/* -*/release/* -RelWithDebInfo -*~ -.*.swp -./CMakeCache.txt -./MySql.ncb -./MySql.sln -./MySql.suo -./README.build-files -./cmakecache.txt -./config.h -./copy_mysql_files.bat -./fix-project-files -./mysql*.ds? -./mysql.ncb -./mysql.sln -./mysql.suo -./prepare -.DS_Store -.defs.mk -.depend -.depend.mk -.deps -.gdb_history -.gdbinit -.libs -.o -.out -.snprj/* -.vimrc -50 -=6 -BUILD/compile-pentium-maintainer -BitKeeper/etc/RESYNC_TREE -BitKeeper/etc/config -BitKeeper/etc/csets -BitKeeper/etc/csets-in -BitKeeper/etc/csets-out -BitKeeper/etc/gone -BitKeeper/etc/level -BitKeeper/etc/pushed -BitKeeper/post-commit -BitKeeper/post-commit-manual -BitKeeper/tmp/* -BitKeeper/tmp/bkr3sAHD -BitKeeper/tmp/gone -CMakeFiles -CMakeFiles/* -CTestTestfile.cmake -COPYING -COPYING.LIB -Docs/#manual.texi# -Docs/INSTALL-BINARY -Docs/Images/myaccess-odbc.txt -Docs/Images/myaccess.txt -Docs/Images/myarchitecture.txt -Docs/Images/mydll-properties.txt -Docs/Images/mydsn-example.txt -Docs/Images/mydsn-icon.txt -Docs/Images/mydsn-options.txt -Docs/Images/mydsn-setup.txt -Docs/Images/mydsn-test-fail.txt -Docs/Images/mydsn-test-success.txt -Docs/Images/mydsn-trace.txt -Docs/Images/mydsn.txt -Docs/Images/myflowchart.txt -Docs/include.texi -Docs/internals.html -Docs/internals.info -Docs/internals.pdf -Docs/internals.txt -Docs/internals_toc.html -Docs/manual.aux -Docs/manual.cp -Docs/manual.cps -Docs/manual.de.log -Docs/manual.dvi -Docs/manual.fn -Docs/manual.fns -Docs/manual.html -Docs/manual.ky -Docs/manual.log -Docs/manual.pdf -Docs/manual.pg -Docs/manual.texi.orig -Docs/manual.texi.rej -Docs/manual.toc -Docs/manual.tp -Docs/manual.txt -Docs/manual.vr -Docs/manual_a4.ps -Docs/manual_letter.ps -Docs/manual_toc.html -Docs/my_sys.doc -Docs/mysql.info -Docs/mysql.xml -Docs/safe-mysql.xml -Docs/tex.fmt -Docs/texi2dvi.out -EXCEPTIONS-CLIENT -INSTALL-SOURCE -INSTALL-WIN-SOURCE -Logs/* -MIRRORS -Makefile -Makefile.in -Makefile.in' -PENDING/* -scripts/scripts -TAGS -VC++Files/client/mysql_amd64.dsp -ac_available_languages_fragment -acinclude.m4 -aclocal.m4 -analyse.test -autom4te-2.53.cache/* -autom4te-2.53.cache/output.0 -autom4te-2.53.cache/requests -autom4te-2.53.cache/traces.0 -autom4te.cache/* -autom4te.cache/output.0 -autom4te.cache/requests -autom4te.cache/traces.0 -bdb/*.ds? -bdb/*.vcproj -bdb/README -bdb/btree/btree_auto.c -bdb/build_unix/* -bdb/build_vxworks/db.h -bdb/build_vxworks/db_int.h -bdb/build_win32/db.h -bdb/build_win32/db_archive.dsp -bdb/build_win32/db_checkpoint.dsp -bdb/build_win32/db_config.h -bdb/build_win32/db_cxx.h -bdb/build_win32/db_deadlock.dsp -bdb/build_win32/db_dll.dsp -bdb/build_win32/db_dump.dsp -bdb/build_win32/db_int.h -bdb/build_win32/db_java.dsp -bdb/build_win32/db_load.dsp -bdb/build_win32/db_perf.dsp -bdb/build_win32/db_printlog.dsp -bdb/build_win32/db_recover.dsp -bdb/build_win32/db_stat.dsp -bdb/build_win32/db_static.dsp -bdb/build_win32/db_tcl.dsp -bdb/build_win32/db_test.dsp -bdb/build_win32/db_upgrade.dsp -bdb/build_win32/db_verify.dsp -bdb/build_win32/ex_access.dsp -bdb/build_win32/ex_btrec.dsp -bdb/build_win32/ex_env.dsp -bdb/build_win32/ex_lock.dsp -bdb/build_win32/ex_mpool.dsp -bdb/build_win32/ex_tpcb.dsp -bdb/build_win32/excxx_access.dsp -bdb/build_win32/excxx_btrec.dsp -bdb/build_win32/excxx_env.dsp -bdb/build_win32/excxx_lock.dsp -bdb/build_win32/excxx_mpool.dsp -bdb/build_win32/excxx_tpcb.dsp -bdb/build_win32/include.tcl -bdb/build_win32/libdb.def -bdb/build_win32/libdb.rc -bdb/db/crdel_auto.c -bdb/db/db_auto.c -bdb/dbinc_auto/*.* -bdb/dbreg/dbreg_auto.c -bdb/dist/autom4te-2.53.cache/* -bdb/dist/autom4te-2.53.cache/output.0 -bdb/dist/autom4te-2.53.cache/requests -bdb/dist/autom4te-2.53.cache/traces.0 -bdb/dist/autom4te.cache/* -bdb/dist/autom4te.cache/output.0 -bdb/dist/autom4te.cache/requests -bdb/dist/autom4te.cache/traces.0 -bdb/dist/config.hin -bdb/dist/configure -bdb/dist/db.h -bdb/dist/db_config.h -bdb/dist/db_cxx.h -bdb/dist/db_int.h -bdb/dist/include.tcl -bdb/dist/tags -bdb/dist/template/db_server_proc -bdb/dist/template/gen_client_ret -bdb/dist/template/rec_btree -bdb/dist/template/rec_crdel -bdb/dist/template/rec_db -bdb/dist/template/rec_dbreg -bdb/dist/template/rec_fileops -bdb/dist/template/rec_hash -bdb/dist/template/rec_log -bdb/dist/template/rec_qam -bdb/dist/template/rec_txn -bdb/examples_c/ex_apprec/ex_apprec_auto.c -bdb/examples_c/ex_apprec/ex_apprec_auto.h -bdb/examples_c/ex_apprec/ex_apprec_template -bdb/examples_java -bdb/fileops/fileops_auto.c -bdb/hash/hash_auto.c -bdb/include/btree_auto.h -bdb/include/btree_ext.h -bdb/include/clib_ext.h -bdb/include/common_ext.h -bdb/include/crdel_auto.h -bdb/include/db_auto.h -bdb/include/db_ext.h -bdb/include/db_server.h -bdb/include/env_ext.h -bdb/include/gen_client_ext.h -bdb/include/gen_server_ext.h -bdb/include/hash_auto.h -bdb/include/hash_ext.h -bdb/include/lock_ext.h -bdb/include/log_auto.h -bdb/include/log_ext.h -bdb/include/mp_ext.h -bdb/include/mutex_ext.h -bdb/include/os_ext.h -bdb/include/qam_auto.h -bdb/include/qam_ext.h -bdb/include/rpc_client_ext.h -bdb/include/rpc_server_ext.h -bdb/include/tcl_ext.h -bdb/include/txn_auto.h -bdb/include/txn_ext.h -bdb/include/xa_ext.h -bdb/java/src/com/sleepycat/db/Db.java -bdb/java/src/com/sleepycat/db/DbBtreeStat.java -bdb/java/src/com/sleepycat/db/DbConstants.java -bdb/java/src/com/sleepycat/db/DbHashStat.java -bdb/java/src/com/sleepycat/db/DbLockStat.java -bdb/java/src/com/sleepycat/db/DbLogStat.java -bdb/java/src/com/sleepycat/db/DbMpoolFStat.java -bdb/java/src/com/sleepycat/db/DbQueueStat.java -bdb/java/src/com/sleepycat/db/DbRepStat.java -bdb/java/src/com/sleepycat/db/DbTxnStat.java -bdb/libdb_java/java_stat_auto.c -bdb/libdb_java/java_stat_auto.h -bdb/log/log_auto.c -bdb/qam/qam_auto.c -bdb/rpc_client/db_server_clnt.c -bdb/rpc_client/gen_client.c -bdb/rpc_server/c/db_server_proc.c -bdb/rpc_server/c/db_server_proc.sed -bdb/rpc_server/c/db_server_svc.c -bdb/rpc_server/c/db_server_xdr.c -bdb/rpc_server/c/gen_db_server.c -bdb/rpc_server/db_server.x -bdb/rpc_server/db_server_proc.sed -bdb/rpc_server/db_server_svc.c -bdb/rpc_server/db_server_xdr.c -bdb/rpc_server/gen_db_server.c -bdb/test/TESTS -bdb/test/include.tcl -bdb/test/logtrack.list -bdb/txn/txn_auto.c -binary/* -bkpull.log -bkpull.log* -bkpull.log.2 -bkpull.log.3 -bkpull.log.4 -bkpull.log.5 -bkpull.log.6 -bkpush.log -bkpush.log* -build.log -build_tags.sh -client/#mysql.cc# -client/*.ds? -client/*.vcproj -client/.deps/base64.Po -client/.deps/completion_hash.Po -client/.deps/dummy.Po -client/.deps/mf_tempdir.Po -client/.deps/my_bit.Po -client/.deps/my_bitmap.Po -client/.deps/my_getsystime.Po -client/.deps/my_new.Po -client/.deps/my_user.Po -client/.deps/my_vle.Po -client/.deps/mysql.Po -client/.deps/mysql_upgrade.Po -client/.deps/mysqladmin.Po -client/.deps/mysqlbinlog.Po -client/.deps/mysqlcheck.Po -client/.deps/mysqldump.Po -client/.deps/mysqlimport.Po -client/.deps/mysqlshow.Po -client/.deps/mysqlslap.Po -client/.deps/mysqltest.Po -client/.deps/readline.Po -client/.deps/sql_string.Po -client/.libs -prune -client/.libs/lt-mysql -client/.libs/lt-mysqladmin -client/.libs/lt-mysqlbinlog -client/.libs/lt-mysqlcheck -client/.libs/lt-mysqldump -client/.libs/lt-mysqlimport -client/.libs/lt-mysqlshow -client/.libs/lt-mysqlslap -client/.libs/lt-mysqltest -client/.libs/mysql -client/.libs/mysql_upgrade -client/.libs/mysqladmin -client/.libs/mysqlbinlog -client/.libs/mysqlcheck -client/.libs/mysqldump -client/.libs/mysqlimport -client/.libs/mysqlshow -client/.libs/mysqlslap -client/.libs/mysqltest -client/completion_hash.cpp -client/decimal.c -client/insert_test -client/link_sources -client/log_event.cc -client/log_event.h -client/log_event_old.cc -client/log_event_old.h -client/mf_iocache.c -client/mf_iocache.cc -client/my_decimal.cc -client/my_decimal.h -client/my_user.c -client/mysql -client/mysql.cpp -client/mysql_config_editor -client/mysql_upgrade -client/mysqladmin -client/mysqladmin.c -client/mysqladmin.cpp -client/mysqlbinlog -client/mysqlbinlog.cpp -client/mysqlcheck -client/mysqldump -client/mysqlimport -client/mysqlmanager-pwgen -client/mysqlmanagerc -client/mysqlshow -client/mysqlslap -client/mysqltest -client/mysqltestmanager-pwgen -client/mysqltestmanagerc -client/mysys_priv.h -client/readline.cpp -client/rpl_constants.h -client/rpl_record_old.cc -client/rpl_record_old.h -client/rpl_tblmap.h -client/rpl_tblmap.cc -client/rpl_utility.h -client/rpl_utility.cc -client/select_test -client/sql_const.h -client/sql_string.cpp -client/ssl_test -client/thimble -client/thread_test -client/tmp.diff -client_debug/* -client_release/* -client_test -cmake_install.cmake -cmd-line-utils/libedit/.deps/chared.Po -cmd-line-utils/libedit/.deps/common.Po -cmd-line-utils/libedit/.deps/el.Po -cmd-line-utils/libedit/.deps/emacs.Po -cmd-line-utils/libedit/.deps/fcns.Po -cmd-line-utils/libedit/.deps/fgetln.Po -cmd-line-utils/libedit/.deps/help.Po -cmd-line-utils/libedit/.deps/hist.Po -cmd-line-utils/libedit/.deps/history.Po -cmd-line-utils/libedit/.deps/key.Po -cmd-line-utils/libedit/.deps/map.Po -cmd-line-utils/libedit/.deps/parse.Po -cmd-line-utils/libedit/.deps/prompt.Po -cmd-line-utils/libedit/.deps/read.Po -cmd-line-utils/libedit/.deps/readline.Po -cmd-line-utils/libedit/.deps/refresh.Po -cmd-line-utils/libedit/.deps/search.Po -cmd-line-utils/libedit/.deps/sig.Po -cmd-line-utils/libedit/.deps/strlcat.Po -cmd-line-utils/libedit/.deps/strlcpy.Po -cmd-line-utils/libedit/.deps/term.Po -cmd-line-utils/libedit/.deps/tokenizer.Po -cmd-line-utils/libedit/.deps/tty.Po -cmd-line-utils/libedit/.deps/unvis.Po -cmd-line-utils/libedit/.deps/vi.Po -cmd-line-utils/libedit/.deps/vis.Po -cmd-line-utils/libedit/common.h -cmd-line-utils/libedit/makelist -cmd-line-utils/readline/.deps/bind.Po -cmd-line-utils/readline/.deps/callback.Po -cmd-line-utils/readline/.deps/compat.Po -cmd-line-utils/readline/.deps/complete.Po -cmd-line-utils/readline/.deps/display.Po -cmd-line-utils/readline/.deps/funmap.Po -cmd-line-utils/readline/.deps/histexpand.Po -cmd-line-utils/readline/.deps/histfile.Po -cmd-line-utils/readline/.deps/history.Po -cmd-line-utils/readline/.deps/histsearch.Po -cmd-line-utils/readline/.deps/input.Po -cmd-line-utils/readline/.deps/isearch.Po -cmd-line-utils/readline/.deps/keymaps.Po -cmd-line-utils/readline/.deps/kill.Po -cmd-line-utils/readline/.deps/macro.Po -cmd-line-utils/readline/.deps/mbutil.Po -cmd-line-utils/readline/.deps/misc.Po -cmd-line-utils/readline/.deps/nls.Po -cmd-line-utils/readline/.deps/parens.Po -cmd-line-utils/readline/.deps/readline.Po -cmd-line-utils/readline/.deps/rltty.Po -cmd-line-utils/readline/.deps/savestring.Po -cmd-line-utils/readline/.deps/search.Po -cmd-line-utils/readline/.deps/shell.Po -cmd-line-utils/readline/.deps/signals.Po -cmd-line-utils/readline/.deps/terminal.Po -cmd-line-utils/readline/.deps/text.Po -cmd-line-utils/readline/.deps/tilde.Po -cmd-line-utils/readline/.deps/undo.Po -cmd-line-utils/readline/.deps/util.Po -cmd-line-utils/readline/.deps/vi_mode.Po -cmd-line-utils/readline/.deps/xmalloc.Po -comon.h -comp_err/*.ds? -comp_err/*.vcproj -compile -config.cache -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -configure.lineno -contrib/*.ds? -contrib/*.vcproj -core -core.* -cscope.in.out -cscope.out -cscope.po.out -db-*.*.* -dbug/*.ds? -dbug/*.vcproj -dbug/.deps/dbug.Po -dbug/.deps/dbug_analyze.Po -dbug/.deps/factorial.Po -dbug/.deps/my_main.Po -dbug/.deps/sanity.Po -dbug/dbug_analyze -dbug/example*.r -dbug/factorial -dbug/factorial.r -dbug/main.r -dbug/output*.r -dbug/user.ps -dbug/user.t -debian/control -debian/defs.mk -depcomp -emacs.h -examples/*.ds? -examples/*.vcproj -examples/udf_example/udf_example.def -extra/.deps/comp_err.Po -extra/.deps/innochecksum.Po -extra/.deps/my_print_defaults.Po -extra/.deps/mysql_waitpid.Po -extra/.deps/perror.Po -extra/.deps/replace.Po -extra/.deps/resolve_stack_dump.Po -extra/.deps/resolveip.Po -extra/comp_err -extra/created_include_files -extra/innochecksum -extra/my_print_defaults -extra/mysql_install -extra/mysql_tzinfo_to_sql -extra/mysql_waitpid -extra/mysqld_ername.h -extra/mysqld_error.h -extra/perror -extra/replace -extra/resolve_stack_dump -extra/resolveip -extra/sql_state.h -extra/tztime.cc -extra/yassl/src/.deps/buffer.Plo -extra/yassl/src/.deps/cert_wrapper.Plo -extra/yassl/src/.deps/crypto_wrapper.Plo -extra/yassl/src/.deps/handshake.Plo -extra/yassl/src/.deps/lock.Plo -extra/yassl/src/.deps/log.Plo -extra/yassl/src/.deps/socket_wrapper.Plo -extra/yassl/src/.deps/ssl.Plo -extra/yassl/src/.deps/template_instnt.Plo -extra/yassl/src/.deps/timer.Plo -extra/yassl/src/.deps/yassl_error.Plo -extra/yassl/src/.deps/yassl_imp.Plo -extra/yassl/src/.deps/yassl_int.Plo -extra/yassl/taocrypt/benchmark/.deps/benchmark-benchmark.Po -extra/yassl/taocrypt/benchmark/benchmark -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aes.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aestables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-algebra.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-arc4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-asn.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-bftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-blowfish.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-coding.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-des.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dh.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-file.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-hash.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-integer.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md2.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md5.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-misc.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-random.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-ripemd.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-rsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-sha.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-template_instnt.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-tftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-twofish.Plo -extra/yassl/taocrypt/test/.deps/test-test.Po -extra/yassl/taocrypt/test/test -extra/yassl/testsuite/.deps/testsuite-client.Po -extra/yassl/testsuite/.deps/testsuite-echoclient.Po -extra/yassl/testsuite/.deps/testsuite-echoserver.Po -extra/yassl/testsuite/.deps/testsuite-server.Po -extra/yassl/testsuite/.deps/testsuite-test.Po -extra/yassl/testsuite/.deps/testsuite-testsuite.Po -extra/yassl/testsuite/testsuite -fcns.c -fcns.h -gdbinit -gmon.out -hardcopy.0 -heap/*.ds? -heap/*.vcproj -heap/hp_test1 -heap/hp_test2 -help -help.c -help.h -include/abi_check -include/check_abi -include/link_sources -include/my_config.h -include/my_global.h -include/mysql_h.ic -include/mysql_version.h -include/mysqld_ername.h -include/mysqld_error.h -include/mysqld_error.h.rule -include/openssl -include/probes_mysql_dtrace.h -include/readline -include/readline/*.h -include/readline/readline.h -include/sql_state.h -include/widec.h -innobase/*.ds? -innobase/*.vcproj -innobase/autom4te-2.53.cache/* -innobase/autom4te-2.53.cache/output.0 -innobase/autom4te-2.53.cache/requests -innobase/autom4te-2.53.cache/traces.0 -innobase/autom4te.cache/* -innobase/autom4te.cache/output.0 -innobase/autom4te.cache/requests -innobase/autom4te.cache/traces.0 -innobase/configure.lineno -innobase/conftest.s1 -innobase/conftest.subs -innobase/ib_config.h -innobase/ib_config.h.in -innobase/mkinstalldirs -innobase/stamp-h1 -insert_test -install -install-sh -isam/*.ds? -isam/*.vcproj -isam/isamchk -isam/isamlog -isam/pack_isam -isam/test1 -isam/test2 -isam/test3 -isamchk/*.ds? -isamchk/*.vcproj -item_xmlfunc.cc -lib_debug/* -lib_release/* -libmysql/*.c -libmysql/*.ds? -libmysql/*.vcproj -libmysql/.deps/array.Plo -libmysql/.deps/bchange.Plo -libmysql/.deps/bcmp.Plo -libmysql/.deps/bmove.Plo -libmysql/.deps/bmove_upp.Plo -libmysql/.deps/charset-def.Plo -libmysql/.deps/charset.Plo -libmysql/.deps/client.Plo -libmysql/.deps/conf_to_src.Po -libmysql/.deps/ctype-big5.Plo -libmysql/.deps/ctype-bin.Plo -libmysql/.deps/ctype-cp932.Plo -libmysql/.deps/ctype-czech.Plo -libmysql/.deps/ctype-euc_kr.Plo -libmysql/.deps/ctype-eucjpms.Plo -libmysql/.deps/ctype-extra.Plo -libmysql/.deps/ctype-gb2312.Plo -libmysql/.deps/ctype-gbk.Plo -libmysql/.deps/ctype-latin1.Plo -libmysql/.deps/ctype-mb.Plo -libmysql/.deps/ctype-simple.Plo -libmysql/.deps/ctype-sjis.Plo -libmysql/.deps/ctype-tis620.Plo -libmysql/.deps/ctype-uca.Plo -libmysql/.deps/ctype-ucs2.Plo -libmysql/.deps/ctype-ujis.Plo -libmysql/.deps/ctype-utf8.Plo -libmysql/.deps/ctype-win1250ch.Plo -libmysql/.deps/ctype.Plo -libmysql/.deps/dbug.Plo -libmysql/.deps/default.Plo -libmysql/.deps/default_modify.Plo -libmysql/.deps/errmsg.Plo -libmysql/.deps/errors.Plo -libmysql/.deps/get_password.Plo -libmysql/.deps/hash.Plo -libmysql/.deps/int2str.Plo -libmysql/.deps/is_prefix.Plo -libmysql/.deps/libmysql.Plo -libmysql/.deps/list.Plo -libmysql/.deps/llstr.Plo -libmysql/.deps/longlong2str.Plo -libmysql/.deps/manager.Plo -libmysql/.deps/md5.Plo -libmysql/.deps/mf_cache.Plo -libmysql/.deps/mf_dirname.Plo -libmysql/.deps/mf_fn_ext.Plo -libmysql/.deps/mf_format.Plo -libmysql/.deps/mf_iocache.Plo -libmysql/.deps/mf_iocache2.Plo -libmysql/.deps/mf_loadpath.Plo -libmysql/.deps/mf_pack.Plo -libmysql/.deps/mf_path.Plo -libmysql/.deps/mf_tempfile.Plo -libmysql/.deps/mf_unixpath.Plo -libmysql/.deps/mf_wcomp.Plo -libmysql/.deps/mulalloc.Plo -libmysql/.deps/my_alloc.Plo -libmysql/.deps/my_chsize.Plo -libmysql/.deps/my_compress.Plo -libmysql/.deps/my_create.Plo -libmysql/.deps/my_delete.Plo -libmysql/.deps/my_div.Plo -libmysql/.deps/my_error.Plo -libmysql/.deps/my_file.Plo -libmysql/.deps/my_fopen.Plo -libmysql/.deps/my_fstream.Plo -libmysql/.deps/my_gethostbyname.Plo -libmysql/.deps/my_getopt.Plo -libmysql/.deps/my_getwd.Plo -libmysql/.deps/my_init.Plo -libmysql/.deps/my_lib.Plo -libmysql/.deps/my_malloc.Plo -libmysql/.deps/my_messnc.Plo -libmysql/.deps/my_net.Plo -libmysql/.deps/my_once.Plo -libmysql/.deps/my_open.Plo -libmysql/.deps/my_port.Plo -libmysql/.deps/my_pread.Plo -libmysql/.deps/my_pthread.Plo -libmysql/.deps/my_read.Plo -libmysql/.deps/my_realloc.Plo -libmysql/.deps/my_rename.Plo -libmysql/.deps/my_seek.Plo -libmysql/.deps/my_sleep.Plo -libmysql/.deps/my_static.Plo -libmysql/.deps/my_strtoll10.Plo -libmysql/.deps/my_symlink.Plo -libmysql/.deps/my_thr_init.Plo -libmysql/.deps/my_time.Plo -libmysql/.deps/my_vsnprintf.Plo -libmysql/.deps/my_write.Plo -libmysql/.deps/net.Plo -libmysql/.deps/pack.Plo -libmysql/.deps/password.Plo -libmysql/.deps/safemalloc.Plo -libmysql/.deps/sha1.Plo -libmysql/.deps/str2int.Plo -libmysql/.deps/str_alloc.Plo -libmysql/.deps/strcend.Plo -libmysql/.deps/strcont.Plo -libmysql/.deps/strend.Plo -libmysql/.deps/strfill.Plo -libmysql/.deps/string.Plo -libmysql/.deps/strinstr.Plo -libmysql/.deps/strmake.Plo -libmysql/.deps/strmov.Plo -libmysql/.deps/strnlen.Plo -libmysql/.deps/strnmov.Plo -libmysql/.deps/strtod.Plo -libmysql/.deps/strtoll.Plo -libmysql/.deps/strtoull.Plo -libmysql/.deps/strxmov.Plo -libmysql/.deps/strxnmov.Plo -libmysql/.deps/thr_mutex.Plo -libmysql/.deps/typelib.Plo -libmysql/.deps/vio.Plo -libmysql/.deps/viosocket.Plo -libmysql/.deps/viossl.Plo -libmysql/.deps/viosslfactories.Plo -libmysql/.deps/xml.Plo -libmysql/.libs/libmysqlclient.lai -libmysql/.libs/libmysqlclient.so.15 -libmysql/.libs/libmysqlclient.so.15.0.0 -libmysql/conf_to_src -libmysql/debug/libmysql.exp -libmysql/libmysql.ver -libmysql/link_sources -libmysql/my_static.h -libmysql/my_time.c -libmysql/mysys_priv.h -libmysql/net.c -libmysql/release/libmysql.exp -libmysql/vio_priv.h -libmysql/viosocket.o.6WmSJk -libmysql_r/*.c -libmysql_r/.deps/array.Plo -libmysql_r/.deps/bchange.Plo -libmysql_r/.deps/bcmp.Plo -libmysql_r/.deps/bmove.Plo -libmysql_r/.deps/bmove_upp.Plo -libmysql_r/.deps/charset-def.Plo -libmysql_r/.deps/charset.Plo -libmysql_r/.deps/client.Plo -libmysql_r/.deps/conf_to_src.Po -libmysql_r/.deps/ctype-big5.Plo -libmysql_r/.deps/ctype-bin.Plo -libmysql_r/.deps/ctype-cp932.Plo -libmysql_r/.deps/ctype-czech.Plo -libmysql_r/.deps/ctype-euc_kr.Plo -libmysql_r/.deps/ctype-eucjpms.Plo -libmysql_r/.deps/ctype-extra.Plo -libmysql_r/.deps/ctype-gb2312.Plo -libmysql_r/.deps/ctype-gbk.Plo -libmysql_r/.deps/ctype-latin1.Plo -libmysql_r/.deps/ctype-mb.Plo -libmysql_r/.deps/ctype-simple.Plo -libmysql_r/.deps/ctype-sjis.Plo -libmysql_r/.deps/ctype-tis620.Plo -libmysql_r/.deps/ctype-uca.Plo -libmysql_r/.deps/ctype-ucs2.Plo -libmysql_r/.deps/ctype-ujis.Plo -libmysql_r/.deps/ctype-utf8.Plo -libmysql_r/.deps/ctype-win1250ch.Plo -libmysql_r/.deps/ctype.Plo -libmysql_r/.deps/dbug.Plo -libmysql_r/.deps/default.Plo -libmysql_r/.deps/default_modify.Plo -libmysql_r/.deps/errmsg.Plo -libmysql_r/.deps/errors.Plo -libmysql_r/.deps/get_password.Plo -libmysql_r/.deps/hash.Plo -libmysql_r/.deps/int2str.Plo -libmysql_r/.deps/is_prefix.Plo -libmysql_r/.deps/libmysql.Plo -libmysql_r/.deps/list.Plo -libmysql_r/.deps/llstr.Plo -libmysql_r/.deps/longlong2str.Plo -libmysql_r/.deps/manager.Plo -libmysql_r/.deps/md5.Plo -libmysql_r/.deps/mf_cache.Plo -libmysql_r/.deps/mf_dirname.Plo -libmysql_r/.deps/mf_fn_ext.Plo -libmysql_r/.deps/mf_format.Plo -libmysql_r/.deps/mf_iocache.Plo -libmysql_r/.deps/mf_iocache2.Plo -libmysql_r/.deps/mf_loadpath.Plo -libmysql_r/.deps/mf_pack.Plo -libmysql_r/.deps/mf_path.Plo -libmysql_r/.deps/mf_tempfile.Plo -libmysql_r/.deps/mf_unixpath.Plo -libmysql_r/.deps/mf_wcomp.Plo -libmysql_r/.deps/mulalloc.Plo -libmysql_r/.deps/my_alloc.Plo -libmysql_r/.deps/my_chsize.Plo -libmysql_r/.deps/my_compress.Plo -libmysql_r/.deps/my_create.Plo -libmysql_r/.deps/my_delete.Plo -libmysql_r/.deps/my_div.Plo -libmysql_r/.deps/my_error.Plo -libmysql_r/.deps/my_file.Plo -libmysql_r/.deps/my_fopen.Plo -libmysql_r/.deps/my_fstream.Plo -libmysql_r/.deps/my_gethostbyname.Plo -libmysql_r/.deps/my_getopt.Plo -libmysql_r/.deps/my_getwd.Plo -libmysql_r/.deps/my_init.Plo -libmysql_r/.deps/my_lib.Plo -libmysql_r/.deps/my_malloc.Plo -libmysql_r/.deps/my_messnc.Plo -libmysql_r/.deps/my_net.Plo -libmysql_r/.deps/my_once.Plo -libmysql_r/.deps/my_open.Plo -libmysql_r/.deps/my_port.Plo -libmysql_r/.deps/my_pread.Plo -libmysql_r/.deps/my_pthread.Plo -libmysql_r/.deps/my_read.Plo -libmysql_r/.deps/my_realloc.Plo -libmysql_r/.deps/my_rename.Plo -libmysql_r/.deps/my_seek.Plo -libmysql_r/.deps/my_sleep.Plo -libmysql_r/.deps/my_static.Plo -libmysql_r/.deps/my_strtoll10.Plo -libmysql_r/.deps/my_symlink.Plo -libmysql_r/.deps/my_thr_init.Plo -libmysql_r/.deps/my_time.Plo -libmysql_r/.deps/my_vsnprintf.Plo -libmysql_r/.deps/my_write.Plo -libmysql_r/.deps/net.Plo -libmysql_r/.deps/pack.Plo -libmysql_r/.deps/password.Plo -libmysql_r/.deps/safemalloc.Plo -libmysql_r/.deps/sha1.Plo -libmysql_r/.deps/str2int.Plo -libmysql_r/.deps/str_alloc.Plo -libmysql_r/.deps/strcend.Plo -libmysql_r/.deps/strcont.Plo -libmysql_r/.deps/strend.Plo -libmysql_r/.deps/strfill.Plo -libmysql_r/.deps/string.Plo -libmysql_r/.deps/strinstr.Plo -libmysql_r/.deps/strmake.Plo -libmysql_r/.deps/strmov.Plo -libmysql_r/.deps/strnlen.Plo -libmysql_r/.deps/strnmov.Plo -libmysql_r/.deps/strtod.Plo -libmysql_r/.deps/strtoll.Plo -libmysql_r/.deps/strtoull.Plo -libmysql_r/.deps/strxmov.Plo -libmysql_r/.deps/strxnmov.Plo -libmysql_r/.deps/thr_mutex.Plo -libmysql_r/.deps/typelib.Plo -libmysql_r/.deps/vio.Plo -libmysql_r/.deps/viosocket.Plo -libmysql_r/.deps/viossl.Plo -libmysql_r/.deps/viosslfactories.Plo -libmysql_r/.deps/xml.Plo -libmysql_r/.libs/libmysqlclient_r.lai -libmysql_r/.libs/libmysqlclient_r.so.15 -libmysql_r/.libs/libmysqlclient_r.so.15.0.0 -libmysql_r/acconfig.h -libmysql_r/client_settings.h -libmysql_r/conf_to_src -libmysql_r/link_sources -libmysql_r/my_static.h -libmysql_r/mysys_priv.h -libmysql_r/vio_priv.h -libmysqld/*.ds? -libmysqld/*.vcproj -libmysqld/.deps/client.Po -libmysqld/.deps/derror.Po -libmysqld/.deps/discover.Po -libmysqld/.deps/emb_qcache.Po -libmysqld/.deps/errmsg.Po -libmysqld/.deps/event_data_objects.Po -libmysqld/.deps/event_db_repository.Po -libmysqld/.deps/event_queue.Po -libmysqld/.deps/event_scheduler.Po -libmysqld/.deps/events.Po -libmysqld/.deps/field.Po -libmysqld/.deps/field_conv.Po -libmysqld/.deps/filesort.Po -libmysqld/.deps/get_password.Po -libmysqld/.deps/gstream.Po -libmysqld/.deps/ha_berkeley.Po -libmysqld/.deps/ha_federated.Po -libmysqld/.deps/ha_heap.Po -libmysqld/.deps/ha_innodb.Po -libmysqld/.deps/ha_myisam.Po -libmysqld/.deps/ha_myisammrg.Po -libmysqld/.deps/ha_ndbcluster.Po -libmysqld/.deps/ha_ndbcluster_binlog.Po -libmysqld/.deps/ha_partition.Po -libmysqld/.deps/handler.Po -libmysqld/.deps/hash_filo.Po -libmysqld/.deps/hostname.Po -libmysqld/.deps/init.Po -libmysqld/.deps/item.Po -libmysqld/.deps/item_buff.Po -libmysqld/.deps/item_cmpfunc.Po -libmysqld/.deps/item_create.Po -libmysqld/.deps/item_func.Po -libmysqld/.deps/item_geofunc.Po -libmysqld/.deps/item_row.Po -libmysqld/.deps/item_strfunc.Po -libmysqld/.deps/item_subselect.Po -libmysqld/.deps/item_sum.Po -libmysqld/.deps/item_timefunc.Po -libmysqld/.deps/item_uniq.Po -libmysqld/.deps/item_xmlfunc.Po -libmysqld/.deps/key.Po -libmysqld/.deps/lib_sql.Po -libmysqld/.deps/libmysql.Po -libmysqld/.deps/libmysqld.Po -libmysqld/.deps/lock.Po -libmysqld/.deps/log.Po -libmysqld/.deps/log_event.Po -libmysqld/.deps/my_decimal.Po -libmysqld/.deps/my_time.Po -libmysqld/.deps/my_user.Po -libmysqld/.deps/net_serv.Po -libmysqld/.deps/opt_range.Po -libmysqld/.deps/opt_sum.Po -libmysqld/.deps/pack.Po -libmysqld/.deps/parse_file.Po -libmysqld/.deps/partition_info.Po -libmysqld/.deps/password.Po -libmysqld/.deps/procedure.Po -libmysqld/.deps/protocol.Po -libmysqld/.deps/records.Po -libmysqld/.deps/rpl_filter.Po -libmysqld/.deps/rpl_injector.Po -libmysqld/.deps/set_var.Po -libmysqld/.deps/sp.Po -libmysqld/.deps/sp_cache.Po -libmysqld/.deps/sp_head.Po -libmysqld/.deps/sp_pcontext.Po -libmysqld/.deps/sp_rcontext.Po -libmysqld/.deps/spatial.Po -libmysqld/.deps/sql_acl.Po -libmysqld/.deps/sql_analyse.Po -libmysqld/.deps/sql_base.Po -libmysqld/.deps/sql_builtin.Po -libmysqld/.deps/sql_cache.Po -libmysqld/.deps/sql_class.Po -libmysqld/.deps/sql_crypt.Po -libmysqld/.deps/sql_cursor.Po -libmysqld/.deps/sql_db.Po -libmysqld/.deps/sql_delete.Po -libmysqld/.deps/sql_truncate.Po -libmysqld/.deps/sql_reload.Po -libmysqld/.deps/datadict.Po -libmysqld/.deps/sql_derived.Po -libmysqld/.deps/sql_do.Po -libmysqld/.deps/sql_error.Po -libmysqld/.deps/sql_handler.Po -libmysqld/.deps/sql_help.Po -libmysqld/.deps/sql_insert.Po -libmysqld/.deps/sql_lex.Po -libmysqld/.deps/sql_list.Po -libmysqld/.deps/sql_load.Po -libmysqld/.deps/sql_manager.Po -libmysqld/.deps/sql_map.Po -libmysqld/.deps/sql_parse.Po -libmysqld/.deps/sql_partition.Po -libmysqld/.deps/sql_plugin.Po -libmysqld/.deps/sql_prepare.Po -libmysqld/.deps/sql_rename.Po -libmysqld/.deps/sql_select.Po -libmysqld/.deps/sql_show.Po -libmysqld/.deps/sql_state.Po -libmysqld/.deps/sql_string.Po -libmysqld/.deps/sql_table.Po -libmysqld/.deps/sql_tablespace.Po -libmysqld/.deps/sql_test.Po -libmysqld/.deps/sql_trigger.Po -libmysqld/.deps/sql_udf.Po -libmysqld/.deps/sql_union.Po -libmysqld/.deps/sql_update.Po -libmysqld/.deps/sql_view.Po -libmysqld/.deps/sql_yacc.Po -libmysqld/.deps/stacktrace.Po -libmysqld/.deps/strfunc.Po -libmysqld/.deps/table.Po -libmysqld/.deps/thr_malloc.Po -libmysqld/.deps/time.Po -libmysqld/.deps/tztime.Po -libmysqld/.deps/uniques.Po -libmysqld/.deps/unireg.Po -libmysqld/backup_dir -libmysqld/client.c -libmysqld/client_settings.h -libmysqld/cmake_dummy.c -libmysqld/convert.cc -libmysqld/derror.cc -libmysqld/discover.cc -libmysqld/emb_qcache.cpp -libmysqld/errmsg.c -libmysqld/event.cc -libmysqld/event_data_objects.cc -libmysqld/event_db_repository.cc -libmysqld/event_executor.cc -libmysqld/event_queue.cc -libmysqld/event_scheduler.cc -libmysqld/event_timed.cc -libmysqld/events.cc -libmysqld/examples/.deps/completion_hash.Po -libmysqld/examples/.deps/mysql.Po -libmysqld/examples/.deps/mysql_client_test.Po -libmysqld/examples/.deps/mysqltest.Po -libmysqld/examples/.deps/readline.Po -libmysqld/examples/client_test.c -libmysqld/examples/client_test.cc -libmysqld/examples/completion_hash.cc -libmysqld/examples/completion_hash.h -libmysqld/examples/link_sources -libmysqld/examples/my_readline.h -libmysqld/examples/mysql -libmysqld/examples/mysql.cc -libmysqld/examples/mysql_client_test.c -libmysqld/examples/mysql_client_test_embedded -libmysqld/examples/mysqltest -libmysqld/examples/mysqltest.c -libmysqld/examples/mysqltest_embedded -libmysqld/examples/readline.cc -libmysqld/examples/sql_string.cc -libmysqld/examples/sql_string.h -libmysqld/examples/test-gdbinit -libmysqld/field.cc -libmysqld/field_conv.cc -libmysqld/filesort.cc -libmysqld/get_password.c -libmysqld/gstream.cc -libmysqld/ha_archive.cc -libmysqld/ha_berkeley.cc -libmysqld/ha_blackhole.cc -libmysqld/ha_example.cc -libmysqld/ha_federated.cc -libmysqld/ha_heap.cc -libmysqld/ha_innobase.cc -libmysqld/ha_innodb.cc -libmysqld/ha_isam.cc -libmysqld/ha_isammrg.cc -libmysqld/ha_myisam.cc -libmysqld/ha_myisammrg.cc -libmysqld/ha_ndbcluster.cc -libmysqld/ha_ndbcluster_binlog.cc -libmysqld/ha_ndbcluster_cond.cc -libmysqld/ha_partition.cc -libmysqld/ha_tina.cc -libmysqld/handler.cc -libmysqld/handlerton.cc -libmysqld/hash_filo.cc -libmysqld/hostname.cc -libmysqld/init.cc -libmysqld/item.cc -libmysqld/item_buff.cc -libmysqld/item_cmpfunc.cc -libmysqld/item_create.cc -libmysqld/item_func.cc -libmysqld/item_geofunc.cc -libmysqld/item_row.cc -libmysqld/item_strfunc.cc -libmysqld/item_subselect.cc -libmysqld/item_sum.cc -libmysqld/item_timefunc.cc -libmysqld/item_uniq.cc -libmysqld/key.cc -libmysqld/lex_hash.h -libmysqld/lib_sql.cpp -libmysqld/libmysql.c -libmysqld/link_sources -libmysqld/lock.cc -libmysqld/log.cc -libmysqld/log_event.cc -libmysqld/log_event_old.cc -libmysqld/md5.c -libmysqld/message.h -libmysqld/message.rc -libmysqld/mf_iocache.cc -libmysqld/mini_client.cc -libmysqld/my_decimal.cc -libmysqld/my_time.c -libmysqld/my_user.c -libmysqld/net_pkg.cc -libmysqld/net_serv.cc -libmysqld/opt_ft.cc -libmysqld/opt_range.cc -libmysqld/opt_sum.cc -libmysqld/pack.c -libmysqld/parse_file.cc -libmysqld/partition_info.cc -libmysqld/password.c -libmysqld/procedure.cc -libmysqld/protocol.cc -libmysqld/protocol_cursor.cc -libmysqld/records.cc -libmysqld/repl_failsafe.cc -libmysqld/rpl_filter.cc -libmysqld/rpl_handler.cc -libmysqld/rpl_injector.cc -libmysqld/rpl_record.cc -libmysqld/rpl_record_old.cc -libmysqld/rpl_utility.cc -libmysqld/scheduler.cc -libmysqld/set_var.cc -libmysqld/sha2.cc -libmysqld/simple-test -libmysqld/slave.cc -libmysqld/sp.cc -libmysqld/sp_cache.cc -libmysqld/sp_head.cc -libmysqld/sp_pcontext.cc -libmysqld/sp_rcontext.cc -libmysqld/spatial.cc -libmysqld/sql_acl.cc -libmysqld/sql_alloc_error_handler.cc -libmysqld/sql_analyse.cc -libmysqld/sql_base.cc -libmysqld/sql_builtin.cc -libmysqld/sql_cache.cc -libmysqld/sql_class.cc -libmysqld/sql_command -libmysqld/sql_connect.cc -libmysqld/sql_crypt.cc -libmysqld/sql_cursor.cc -libmysqld/sql_cursor.h -libmysqld/sql_db.cc -libmysqld/sql_delete.cc -libmysqld/sql_truncate.cc -libmysqld/sql_reload.cc -libmysqld/datadict.cc -libmysqld/sql_derived.cc -libmysqld/sql_do.cc -libmysqld/sql_error.cc -libmysqld/sql_handler.cc -libmysqld/sql_help.cc -libmysqld/sql_insert.cc -libmysqld/sql_lex.cc -libmysqld/sql_list.cc -libmysqld/sql_load.cc -libmysqld/sql_locale.cc -libmysqld/sql_manager.cc -libmysqld/sql_map.cc -libmysqld/sql_olap.cc -libmysqld/sql_parse.cc -libmysqld/sql_partition.cc -libmysqld/sql_plugin.cc -libmysqld/sql_prepare.cc -libmysqld/sql_profile.cc -libmysqld/sql_rename.cc -libmysqld/sql_repl.cc -libmysqld/sql_select.cc -libmysqld/sql_servers.cc -libmysqld/sql_show.cc -libmysqld/sql_state.c -libmysqld/sql_string.cc -libmysqld/sql_table.cc -libmysqld/sql_tablespace.cc -libmysqld/sql_test.cc -libmysqld/sql_trigger.cc -libmysqld/sql_udf.cc -libmysqld/sql_union.cc -libmysqld/sql_unions.cc -libmysqld/sql_update.cc -libmysqld/sql_view.cc -libmysqld/sql_yacc.cc -libmysqld/sql_yacc.cpp -libmysqld/sql_yacc.h -libmysqld/stacktrace.c -libmysqld/strfunc.cc -libmysqld/table.cc -libmysqld/thr_malloc.cc -libmysqld/sql_time.cc -libmysqld/tztime.cc -libmysqld/uniques.cc -libmysqld/unireg.cc -libmysqltest/*.ds? -libmysqltest/*.vcproj -libmysqltest/mytest.c -libtool -linked_client_sources -linked_include_sources -linked_libmysql_r_sources -linked_libmysql_sources -linked_libmysqld_sources -linked_libmysqldex_sources -linked_server_sources -linked_tools_sources -locked -ltmain.sh -man/*.1 -merge/*.ds? -merge/*.vcproj -missing -mit-pthreads/config.flags -mit-pthreads/include/bits -mit-pthreads/include/pthread/machdep.h -mit-pthreads/include/pthread/posix.h -mit-pthreads/include/sys -mit-pthreads/machdep.c -mit-pthreads/pg++ -mit-pthreads/pgcc -mit-pthreads/syscall.S -mkinstalldirs -my_print_defaults/*.ds? -my_print_defaults/*.vcproj -myisam/*.ds? -myisam/*.vcproj -myisam/FT1.MYD -myisam/FT1.MYI -myisam/ft_dump -myisam/ft_eval -myisam/ft_test1 -myisam/ftbench/data -myisam/ftbench/t -myisam/ftbench/var/* -myisam/mi_test1 -myisam/mi_test2 -myisam/mi_test3 -myisam/mi_test_all -myisam/myisam.log -myisam/myisam_ftdump -myisam/myisamchk -myisam/myisamlog -myisam/myisampack -myisam/rt_test -myisam/rt_test.MYD -myisam/rt_test.MYI -myisam/sp_test -myisam/test1.MYD -myisam/test1.MYI -myisam/test2.MYD -myisam/test2.MYI -myisam_ftdump/*.ds? -myisam_ftdump/*.vcproj -myisamchk/*.ds? -myisamchk/*.vcproj -myisamlog/*.ds? -myisamlog/*.vcproj -myisammrg/*.ds? -myisammrg/*.vcproj -myisampack/*.ds? -myisampack/*.vcproj -mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz -mysql-4.0.2-alpha.tar.gz -mysql-4.1.8-win-src.zip -mysql-5.0.2-alpha.tar.gz -mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz -mysql-test/*.ds? -mysql-test/*.vcproj -mysql-test/.DS_Store -mysql-test/collections/default.release -mysql-test/collections/default.release.done -mysql-test/funcs_1.log -mysql-test/funcs_1.tar -mysql-test/gmon.out -mysql-test/install_test_db -mysql-test/lib/My/SafeProcess/my_safe_process -mysql-test/lib/init_db.sql -mysql-test/linux_sys_vars.inc -mysql-test/load_sysvars.inc -mysql-test/mtr -mysql-test/mysql-test-run -mysql-test/mysql-test-gcov.err -mysql-test/mysql-test-gcov.msg -mysql-test/mysql-test-run-shell -mysql-test/mysql-test-run.log -mysql-test/mysql_test_run_new -mysql-test/ndb/ndbcluster -mysql-test/partitions.log -mysql-test/r/*.err -mysql-test/r/*.log -mysql-test/r/*.out -mysql-test/r/*.reject -mysql-test/r/index_merge_load.result -mysql-test/r/max_allowed_packet_func.result -mysql-test/r/rpl000001.eval -mysql-test/r/rpl000002.eval -mysql-test/r/rpl000014.eval -mysql-test/r/rpl000015.eval -mysql-test/r/rpl000016.eval -mysql-test/r/rpl_log.eval -mysql-test/r/slave-running.eval -mysql-test/r/slave-stopped.eval -mysql-test/r/tmp.result -mysql-test/reg.log -mysql-test/rpl.log -mysql-test/share/mysql -mysql-test/std_data/*.pem -mysql-test/suite/funcs_1.tar.gz -mysql-test/suite/funcs_1.tar.zip -mysql-test/suite/funcs_1/r/innodb_trig_03e.warnings -mysql-test/suite/funcs_1/r/innodb_views.warnings -mysql-test/suite/funcs_1/r/memory_trig_03e.warnings -mysql-test/suite/funcs_1/r/memory_views.warnings -mysql-test/suite/funcs_1/r/myisam_trig_03e.warnings -mysql-test/suite/funcs_1/r/myisam_views.warnings -mysql-test/suite/funcs_1/r/ndb_trig_03e.warnings -mysql-test/suite/funcs_1/r/ndb_views.warnings -mysql-test/suite/partitions/r/dif -mysql-test/suite/partitions/r/diff -mysql-test/suite/partitions/r/partition.result -mysql-test/suite/partitions/r/partition_bit_ndb.warnings -mysql-test/suite/partitions/r/partition_special_innodb.warnings -mysql-test/suite/partitions/r/partition_special_myisam.warnings -mysql-test/suite/partitions/r/partition_t55.out -mysql-test/suite/partitions/r/partition_t55.refout -mysql-test/suite/partitions/t/partition.test -mysql-test/t/index_merge.load -mysql-test/t/tmp.test -mysql-test/var -mysql-test/var/* -mysql-test/windows_sys_vars.inc -mysql.kdevprj -mysql.proj -sql_priv.h -mysqlbinlog/*.ds? -mysqlbinlog/*.vcproj -mysqlcheck/*.ds? -mysqlcheck/*.vcproj -mysqld.S -mysqld.sym -mysqldemb/*.ds? -mysqldemb/*.vcproj -mysqlserver/*.ds? -mysqlserver/*.vcproj -mysys/#mf_iocache.c# -mysys/*.ds? -mysys/*.vcproj -mysys/.deps/array.Po -mysys/.deps/base64.Po -mysys/.deps/charset-def.Po -mysys/.deps/charset.Po -mysys/.deps/checksum.Po -mysys/.deps/default.Po -mysys/.deps/default_modify.Po -mysys/.deps/errors.Po -mysys/.deps/hash.Po -mysys/.deps/list.Po -mysys/.deps/md5.Po -mysys/.deps/mf_brkhant.Po -mysys/.deps/mf_cache.Po -mysys/.deps/mf_dirname.Po -mysys/.deps/mf_fn_ext.Po -mysys/.deps/mf_format.Po -mysys/.deps/mf_getdate.Po -mysys/.deps/mf_iocache.Po -mysys/.deps/mf_iocache2.Po -mysys/.deps/mf_keycache.Po -mysys/.deps/mf_keycaches.Po -mysys/.deps/mf_loadpath.Po -mysys/.deps/mf_pack.Po -mysys/.deps/mf_path.Po -mysys/.deps/mf_qsort.Po -mysys/.deps/mf_qsort2.Po -mysys/.deps/mf_radix.Po -mysys/.deps/mf_same.Po -mysys/.deps/mf_sort.Po -mysys/.deps/mf_strip.Po -mysys/.deps/mf_tempdir.Po -mysys/.deps/mf_tempfile.Po -mysys/.deps/mf_unixpath.Po -mysys/.deps/mf_wcomp.Po -mysys/.deps/mf_wfile.Po -mysys/.deps/mulalloc.Po -mysys/.deps/my_access.Po -mysys/.deps/my_aes.Po -mysys/.deps/my_alarm.Po -mysys/.deps/my_alloc.Po -mysys/.deps/my_append.Po -mysys/.deps/my_atomic.Po -mysys/.deps/my_bit.Po -mysys/.deps/my_bitmap.Po -mysys/.deps/my_chsize.Po -mysys/.deps/my_clock.Po -mysys/.deps/my_compress.Po -mysys/.deps/my_copy.Po -mysys/.deps/my_crc32.Po -mysys/.deps/my_create.Po -mysys/.deps/my_delete.Po -mysys/.deps/my_div.Po -mysys/.deps/my_dup.Po -mysys/.deps/my_error.Po -mysys/.deps/my_file.Po -mysys/.deps/my_fopen.Po -mysys/.deps/my_fstream.Po -mysys/.deps/my_gethostbyname.Po -mysys/.deps/my_gethwaddr.Po -mysys/.deps/my_getncpus.Po -mysys/.deps/my_getopt.Po -mysys/.deps/my_getsystime.Po -mysys/.deps/my_getwd.Po -mysys/.deps/my_handler.Po -mysys/.deps/my_init.Po -mysys/.deps/my_largepage.Po -mysys/.deps/my_lib.Po -mysys/.deps/my_libwrap.Po -mysys/.deps/my_lock.Po -mysys/.deps/my_lockmem.Po -mysys/.deps/my_lread.Po -mysys/.deps/my_lwrite.Po -mysys/.deps/my_malloc.Po -mysys/.deps/my_memmem.Po -mysys/.deps/my_messnc.Po -mysys/.deps/my_mkdir.Po -mysys/.deps/my_mmap.Po -mysys/.deps/my_net.Po -mysys/.deps/my_netware.Po -mysys/.deps/my_new.Po -mysys/.deps/my_once.Po -mysys/.deps/my_open.Po -mysys/.deps/my_port.Po -mysys/.deps/my_pread.Po -mysys/.deps/my_pthread.Po -mysys/.deps/my_quick.Po -mysys/.deps/my_read.Po -mysys/.deps/my_realloc.Po -mysys/.deps/my_redel.Po -mysys/.deps/my_rename.Po -mysys/.deps/my_seek.Po -mysys/.deps/my_semaphore.Po -mysys/.deps/my_sleep.Po -mysys/.deps/my_static.Po -mysys/.deps/my_symlink.Po -mysys/.deps/my_symlink2.Po -mysys/.deps/my_sync.Po -mysys/.deps/my_thr_init.Po -mysys/.deps/my_vle.Po -mysys/.deps/my_windac.Po -mysys/.deps/my_write.Po -mysys/.deps/ptr_cmp.Po -mysys/.deps/queues.Po -mysys/.deps/rijndael.Po -mysys/.deps/safemalloc.Po -mysys/.deps/sha1.Po -mysys/.deps/string.Po -mysys/.deps/thr_alarm.Po -mysys/.deps/thr_lock.Po -mysys/.deps/thr_mutex.Po -mysys/.deps/thr_rwlock.Po -mysys/.deps/tree.Po -mysys/.deps/trie.Po -mysys/.deps/typelib.Po -mysys/getopt.c -mysys/getopt1.c -mysys/main.cc -mysys/my_new.cpp -mysys/raid.cpp -mysys/ste5KbMa -mysys/test_atomic -mysys/test_bitmap -mysys/test_charset -mysys/test_dir -mysys/test_gethwaddr -mysys/test_io_cache -mysys/test_thr_alarm -mysys/test_thr_lock -mysys/test_vsnprintf -mysys/testhash -ndb/bin/DbAsyncGenerator -ndb/bin/DbCreate -ndb/bin/acid -ndb/bin/async-lmc-bench-l-p10.sh -ndb/bin/async-lmc-bench-l.sh -ndb/bin/async-lmc-bench-p10.sh -ndb/bin/async-lmc-bench.sh -ndb/bin/atrt -ndb/bin/atrt-analyze-result.sh -ndb/bin/atrt-clear-result.sh -ndb/bin/atrt-gather-result.sh -ndb/bin/atrt-setup.sh -ndb/bin/bankCreator -ndb/bin/bankMakeGL -ndb/bin/bankSumAccounts -ndb/bin/bankTimer -ndb/bin/bankTransactionMaker -ndb/bin/bankValidateAllGLs -ndb/bin/basicTransporterTest -ndb/bin/benchronja -ndb/bin/bulk_copy -ndb/bin/copy_tab -ndb/bin/create_all_tabs -ndb/bin/create_index -ndb/bin/create_tab -ndb/bin/delete_all -ndb/bin/desc -ndb/bin/drop_all_tabs -ndb/bin/drop_index -ndb/bin/drop_tab -ndb/bin/flexAsynch -ndb/bin/flexBench -ndb/bin/flexHammer -ndb/bin/flexScan -ndb/bin/flexTT -ndb/bin/hugoCalculator -ndb/bin/hugoFill -ndb/bin/hugoLoad -ndb/bin/hugoLockRecords -ndb/bin/hugoPkDelete -ndb/bin/hugoPkRead -ndb/bin/hugoPkReadRecord -ndb/bin/hugoPkUpdate -ndb/bin/hugoScanRead -ndb/bin/hugoScanUpdate -ndb/bin/index -ndb/bin/index2 -ndb/bin/initronja -ndb/bin/interpreterInTup -ndb/bin/list_tables -ndb/bin/make-config.sh -ndb/bin/mgmtclient -ndb/bin/mgmtsrvr -ndb/bin/mkconfig -ndb/bin/ndb -ndb/bin/ndb_cpcc -ndb/bin/ndb_cpcd -ndb/bin/ndb_rep -ndb/bin/ndbsql -ndb/bin/newton_basic -ndb/bin/newton_br -ndb/bin/newton_pb -ndb/bin/newton_perf -ndb/bin/perfTransporterTest -ndb/bin/printConfig -ndb/bin/printSchemafile -ndb/bin/printSysfile -ndb/bin/redoLogFileReader -ndb/bin/restart -ndb/bin/restarter -ndb/bin/restarter2 -ndb/bin/restarts -ndb/bin/restore -ndb/bin/select_all -ndb/bin/select_count -ndb/bin/telco -ndb/bin/testBackup -ndb/bin/testBank -ndb/bin/testBasic -ndb/bin/testBasicAsynch -ndb/bin/testCopy -ndb/bin/testDataBuffers -ndb/bin/testDict -ndb/bin/testGrep -ndb/bin/testGrepVerify -ndb/bin/testIndex -ndb/bin/testInterpreter -ndb/bin/testKernelDataBuffer -ndb/bin/testLongSig -ndb/bin/testMgm -ndb/bin/testMgmapi -ndb/bin/testNdbApi -ndb/bin/testNodeRestart -ndb/bin/testOIBasic -ndb/bin/testOdbcDriver -ndb/bin/testOperations -ndb/bin/testRestartGci -ndb/bin/testScan -ndb/bin/testScanInterpreter -ndb/bin/testSimplePropertiesSection -ndb/bin/testSystemRestart -ndb/bin/testTimeout -ndb/bin/testTransactions -ndb/bin/test_cpcd -ndb/bin/test_event -ndb/bin/verify_index -ndb/bin/waiter -ndb/config/autom4te.cache/* -ndb/config/config.mk -ndb/examples/ndbapi_example1/ndbapi_example1 -ndb/examples/ndbapi_example2/ndbapi_example2 -ndb/examples/ndbapi_example3/ndbapi_example3 -ndb/examples/ndbapi_example5/ndbapi_example5 -ndb/examples/select_all/select_all -ndb/include/ndb_global.h -ndb/include/ndb_types.h -ndb/include/ndb_version.h -ndb/lib/libMGM_API.so -ndb/lib/libNDB_API.so -ndb/lib/libNDB_ODBC.so -ndb/lib/libNEWTON_API.so -ndb/lib/libNEWTON_BASICTEST_COMMON.so -ndb/lib/libREP_API.so -ndb/lib/libndbclient.so -ndb/lib/libndbclient_extra.so -ndb/src/common/debugger/libtrace.dsp -ndb/src/common/debugger/signaldata/libsignaldataprint.dsp -ndb/src/common/logger/liblogger.dsp -ndb/src/common/mgmcommon/libmgmsrvcommon.dsp -ndb/src/common/mgmcommon/printConfig/*.d -ndb/src/common/portlib/libportlib.dsp -ndb/src/common/transporter/libtransporter.dsp -ndb/src/common/util/libgeneral.dsp -ndb/src/common/util/testBitmask.cpp -ndb/src/cw/cpcd/ndb_cpcd -ndb/src/dummy.cpp -ndb/src/kernel/blocks/backup/libbackup.dsp -ndb/src/kernel/blocks/backup/restore/ndb_restore -ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp -ndb/src/kernel/blocks/dbacc/libdbacc.dsp -ndb/src/kernel/blocks/dbdict/libdbdict.dsp -ndb/src/kernel/blocks/dbdih/libdbdih.dsp -ndb/src/kernel/blocks/dblqh/libdblqh.dsp -ndb/src/kernel/blocks/dbtc/libdbtc.dsp -ndb/src/kernel/blocks/dbtup/libdbtup.dsp -ndb/src/kernel/blocks/dbtux/libdbtux.dsp -ndb/src/kernel/blocks/dbutil/libdbutil.dsp -ndb/src/kernel/blocks/grep/libgrep.dsp -ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp -ndb/src/kernel/blocks/ndbfs/libndbfs.dsp -ndb/src/kernel/blocks/qmgr/libqmgr.dsp -ndb/src/kernel/blocks/suma/libsuma.dsp -ndb/src/kernel/blocks/trix/libtrix.dsp -ndb/src/kernel/error/liberror.dsp -ndb/src/kernel/ndbd -ndb/src/kernel/ndbd.dsp -ndb/src/kernel/vm/libkernel.dsp -ndb/src/libndb.ver -ndb/src/libndbclient.dsp -ndb/src/mgmapi/libmgmapi.dsp -ndb/src/mgmclient/libndbmgmclient.dsp -ndb/src/mgmclient/ndb_mgm -ndb/src/mgmclient/ndb_mgm.dsp -ndb/src/mgmclient/test_cpcd/*.d -ndb/src/mgmsrv/ndb_mgmd -ndb/src/mgmsrv/ndb_mgmd.dsp -ndb/src/ndbapi/libndbapi.dsp -ndb/test/ndbapi/bank/bankCreator -ndb/test/ndbapi/bank/bankMakeGL -ndb/test/ndbapi/bank/bankSumAccounts -ndb/test/ndbapi/bank/bankTimer -ndb/test/ndbapi/bank/bankTransactionMaker -ndb/test/ndbapi/bank/bankValidateAllGLs -ndb/test/ndbapi/bank/testBank -ndb/test/ndbapi/create_all_tabs -ndb/test/ndbapi/create_tab -ndb/test/ndbapi/drop_all_tabs -ndb/test/ndbapi/flexAsynch -ndb/test/ndbapi/flexBench -ndb/test/ndbapi/flexBench.dsp -ndb/test/ndbapi/flexHammer -ndb/test/ndbapi/flexTT -ndb/test/ndbapi/testBackup -ndb/test/ndbapi/testBasic -ndb/test/ndbapi/testBasic.dsp -ndb/test/ndbapi/testBasicAsynch -ndb/test/ndbapi/testBlobs -ndb/test/ndbapi/testBlobs.dsp -ndb/test/ndbapi/testDataBuffers -ndb/test/ndbapi/testDeadlock -ndb/test/ndbapi/testDict -ndb/test/ndbapi/testIndex -ndb/test/ndbapi/testMgm -ndb/test/ndbapi/testNdbApi -ndb/test/ndbapi/testNodeRestart -ndb/test/ndbapi/testOIBasic -ndb/test/ndbapi/testOperations -ndb/test/ndbapi/testRestartGci -ndb/test/ndbapi/testSRBank -ndb/test/ndbapi/testScan -ndb/test/ndbapi/testScan.dsp -ndb/test/ndbapi/testScanInterpreter -ndb/test/ndbapi/testScanPerf -ndb/test/ndbapi/testSystemRestart -ndb/test/ndbapi/testTimeout -ndb/test/ndbapi/testTransactions -ndb/test/ndbapi/test_event -ndb/test/run-test/atrt -ndb/test/src/libNDBT.dsp -ndb/test/tools/copy_tab -ndb/test/tools/create_index -ndb/test/tools/hugoCalculator -ndb/test/tools/hugoFill -ndb/test/tools/hugoLoad -ndb/test/tools/hugoLockRecords -ndb/test/tools/hugoPkDelete -ndb/test/tools/hugoPkRead -ndb/test/tools/hugoPkReadRecord -ndb/test/tools/hugoPkUpdate -ndb/test/tools/hugoScanRead -ndb/test/tools/hugoScanUpdate -ndb/test/tools/ndb_cpcc -ndb/test/tools/restart -ndb/test/tools/verify_index -ndb/tools/ndb_config -ndb/tools/ndb_delete_all -ndb/tools/ndb_delete_all.dsp -ndb/tools/ndb_desc -ndb/tools/ndb_desc.dsp -ndb/tools/ndb_drop_index -ndb/tools/ndb_drop_index.dsp -ndb/tools/ndb_drop_table -ndb/tools/ndb_drop_table.dsp -ndb/tools/ndb_restore -ndb/tools/ndb_select_all -ndb/tools/ndb_select_all.dsp -ndb/tools/ndb_select_count -ndb/tools/ndb_select_count.dsp -ndb/tools/ndb_show_tables -ndb/tools/ndb_show_tables.dsp -ndb/tools/ndb_test_platform -ndb/tools/ndb_waiter -ndb/tools/ndb_waiter.dsp -ndbcluster-1186 -ndbcluster-1186/SCCS -ndbcluster-1186/config.ini -ndbcluster-1186/ndb_1.pid -ndbcluster-1186/ndb_1_out.log -ndbcluster-1186/ndb_1_signal.log -ndbcluster-1186/ndb_2.pid -ndbcluster-1186/ndb_2_out.log -ndbcluster-1186/ndb_2_signal.log -ndbcluster-1186/ndb_3.pid -ndbcluster-1186/ndb_3_cluster.log -ndbcluster-1186/ndb_3_out.log -ndbcluster-1186/ndbcluster.pid -netware/.deps/libmysqlmain.Po -netware/.deps/my_manage.Po -netware/.deps/mysql_install_db.Po -netware/.deps/mysql_test_run.Po -netware/.deps/mysqld_safe.Po -netware/init_db.sql -netware/libmysql.imp -netware/test_db.sql -pack_isam/*.ds? -perror/*.ds? -perror/*.vcproj -plugin/fulltext/.deps/mypluglib_la-plugin_example.Plo -plugin/fulltext/.libs/mypluglib.lai -plugin/fulltext/.libs/mypluglib.so.0 -plugin/fulltext/.libs/mypluglib.so.0.0.0 -pstack/.deps/bucomm.Po -pstack/.deps/debug.Po -pstack/.deps/filemode.Po -pstack/.deps/ieee.Po -pstack/.deps/linuxthreads.Po -pstack/.deps/pstack.Po -pstack/.deps/rddbg.Po -pstack/.deps/stabs.Po -pull.log -regex/*.ds? -regex/*.vcproj -regex/.deps/debug.Po -regex/.deps/main.Po -regex/.deps/regcomp.Po -regex/.deps/regerror.Po -regex/.deps/regexec.Po -regex/.deps/regfree.Po -regex/.deps/reginit.Po -regex/.deps/split.Po -regex/re -repl-tests/test-repl-ts/repl-timestamp.master.reject -repl-tests/test-repl/foo-dump-slave.master. -repl-tests/test-repl/sum-wlen-slave.master. -repl-tests/test-repl/sum-wlen-slave.master.re -repl-tests/test-repl/sum-wlen-slave.master.reje -replace/*.ds? -replace/*.vcproj -scripts/comp_sql -scripts/fill_func_tables -scripts/fill_func_tables.sql -scripts/fill_help_tables -scripts/fill_help_tables.sql -scripts/make_binary_distribution -scripts/make_sharedlib_distribution -scripts/make_win_binary_distribution -scripts/make_win_src_distribution -scripts/make_win_src_distribution_old -scripts/msql2mysql -scripts/mysql_config -scripts/mysql_convert_table_format -scripts/mysql_create_system_tables -scripts/mysql_explain_log -scripts/mysql_find_rows -scripts/mysql_fix_extensions -scripts/mysql_fix_privilege_tables -scripts/mysql_fix_privilege_tables.sql -scripts/mysql_fix_privilege_tables.sql.rule -scripts/mysql_fix_privilege_tables_sql.c -scripts/mysql_fix_privilege_tables_sql.c.rule -scripts/mysql_install_db -scripts/mysql_secure_installation -scripts/mysql_setpermission -scripts/mysql_tableinfo -scripts/mysql_upgrade -scripts/mysql_upgrade_shell -scripts/mysql_zap -scripts/mysqlaccess -scripts/mysqlbug -scripts/mysqld_multi -scripts/mysqld_safe -scripts/mysqldumpslow -scripts/mysqlhotcopy -scripts/mysqlhotcopy.sh.rej -scripts/safe_mysqld -select_test -server-tools/instance-manager/.deps/buffer.Po -server-tools/instance-manager/.deps/command.Po -server-tools/instance-manager/.deps/commands.Po -server-tools/instance-manager/.deps/guardian.Po -server-tools/instance-manager/.deps/instance.Po -server-tools/instance-manager/.deps/instance_map.Po -server-tools/instance-manager/.deps/instance_options.Po -server-tools/instance-manager/.deps/liboptions_la-options.Plo -server-tools/instance-manager/.deps/liboptions_la-priv.Plo -server-tools/instance-manager/.deps/listener.Po -server-tools/instance-manager/.deps/log.Po -server-tools/instance-manager/.deps/manager.Po -server-tools/instance-manager/.deps/messages.Po -server-tools/instance-manager/.deps/mysql_connection.Po -server-tools/instance-manager/.deps/mysqlmanager.Po -server-tools/instance-manager/.deps/net_serv.Po -server-tools/instance-manager/.deps/parse.Po -server-tools/instance-manager/.deps/parse_output.Po -server-tools/instance-manager/.deps/protocol.Po -server-tools/instance-manager/.deps/thread_registry.Po -server-tools/instance-manager/.deps/user_management_commands.Po -server-tools/instance-manager/.deps/user_map.Po -server-tools/instance-manager/buffer.cpp -server-tools/instance-manager/client.c -server-tools/instance-manager/client_settings.h -server-tools/instance-manager/command.cpp -server-tools/instance-manager/commands.cpp -server-tools/instance-manager/errmsg.c -server-tools/instance-manager/guardian.cpp -server-tools/instance-manager/instance.cpp -server-tools/instance-manager/instance_map.cpp -server-tools/instance-manager/instance_options.cpp -server-tools/instance-manager/listener.cpp -server-tools/instance-manager/log.cpp -server-tools/instance-manager/manager.cpp -server-tools/instance-manager/messages.cpp -server-tools/instance-manager/mysql_connection.cpp -server-tools/instance-manager/mysqlmanager -server-tools/instance-manager/mysqlmanager.cpp -server-tools/instance-manager/net_serv.cc -server-tools/instance-manager/options.cpp -server-tools/instance-manager/parse.cpp -server-tools/instance-manager/parse_output.cpp -server-tools/instance-manager/priv.cpp -server-tools/instance-manager/protocol.cpp -server-tools/instance-manager/thr_alarm.c -server-tools/instance-manager/thread_registry.cpp -server-tools/instance-manager/user_map.cpp -sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686 -sql-bench/bench-count-distinct -sql-bench/bench-init.pl -sql-bench/compare-results -sql-bench/compare-results-all -sql-bench/copy-db -sql-bench/crash-me -sql-bench/gif/* -sql-bench/graph-compare-results -sql-bench/innotest1 -sql-bench/innotest1a -sql-bench/innotest1b -sql-bench/innotest2 -sql-bench/innotest2a -sql-bench/innotest2b -sql-bench/output/* -sql-bench/run-all-tests -sql-bench/server-cfg -sql-bench/template.html -sql-bench/test-ATIS -sql-bench/test-alter-table -sql-bench/test-big-tables -sql-bench/test-connect -sql-bench/test-create -sql-bench/test-insert -sql-bench/test-select -sql-bench/test-transactions -sql-bench/test-wisconsin -sql/*.cpp -sql/*.ds? -sql/*.def -sql/*.vcproj -sql/.deps/client.Po -sql/.deps/derror.Po -sql/.deps/des_key_file.Po -sql/.deps/discover.Po -sql/.deps/event_data_objects.Po -sql/.deps/event_db_repository.Po -sql/.deps/event_queue.Po -sql/.deps/event_scheduler.Po -sql/.deps/events.Po -sql/.deps/field.Po -sql/.deps/field_conv.Po -sql/.deps/filesort.Po -sql/.deps/gen_lex_hash.Po -sql/.deps/gstream.Po -sql/.deps/ha_berkeley.Po -sql/.deps/ha_federated.Po -sql/.deps/ha_heap.Po -sql/.deps/ha_innodb.Po -sql/.deps/ha_myisam.Po -sql/.deps/ha_myisammrg.Po -sql/.deps/ha_ndbcluster.Po -sql/.deps/ha_ndbcluster_binlog.Po -sql/.deps/ha_partition.Po -sql/.deps/handler.Po -sql/.deps/hash_filo.Po -sql/.deps/hostname.Po -sql/.deps/init.Po -sql/.deps/item.Po -sql/.deps/item_buff.Po -sql/.deps/item_cmpfunc.Po -sql/.deps/item_create.Po -sql/.deps/item_func.Po -sql/.deps/item_geofunc.Po -sql/.deps/item_row.Po -sql/.deps/item_strfunc.Po -sql/.deps/item_subselect.Po -sql/.deps/item_sum.Po -sql/.deps/item_timefunc.Po -sql/.deps/item_uniq.Po -sql/.deps/item_xmlfunc.Po -sql/.deps/key.Po -sql/.deps/lock.Po -sql/.deps/log.Po -sql/.deps/log_event.Po -sql/.deps/mf_iocache.Po -sql/.deps/mini_client_errors.Po -sql/.deps/my_decimal.Po -sql/.deps/my_lock.Po -sql/.deps/my_time.Po -sql/.deps/my_user.Po -sql/.deps/mysql_tzinfo_to_sql.Po -sql/.deps/mysqld.Po -sql/.deps/net_serv.Po -sql/.deps/opt_range.Po -sql/.deps/opt_sum.Po -sql/.deps/pack.Po -sql/.deps/parse_file.Po -sql/.deps/partition_info.Po -sql/.deps/password.Po -sql/.deps/procedure.Po -sql/.deps/protocol.Po -sql/.deps/records.Po -sql/.deps/repl_failsafe.Po -sql/.deps/rpl_filter.Po -sql/.deps/rpl_injector.Po -sql/.deps/rpl_tblmap.Po -sql/.deps/set_var.Po -sql/.deps/slave.Po -sql/.deps/sp.Po -sql/.deps/sp_cache.Po -sql/.deps/sp_head.Po -sql/.deps/sp_pcontext.Po -sql/.deps/sp_rcontext.Po -sql/.deps/spatial.Po -sql/.deps/sql_acl.Po -sql/.deps/sql_analyse.Po -sql/.deps/sql_base.Po -sql/.deps/sql_binlog.Po -sql/.deps/sql_builtin.Po -sql/.deps/sql_cache.Po -sql/.deps/sql_class.Po -sql/.deps/sql_client.Po -sql/.deps/sql_crypt.Po -sql/.deps/sql_cursor.Po -sql/.deps/sql_db.Po -sql/.deps/sql_delete.Po -sql/.deps/sql_truncate.Po -sql/.deps/sql_reload.Po -sql/.deps/datadict.Po -sql/.deps/sql_derived.Po -sql/.deps/sql_do.Po -sql/.deps/sql_error.Po -sql/.deps/sql_handler.Po -sql/.deps/sql_help.Po -sql/.deps/sql_insert.Po -sql/.deps/sql_lex.Po -sql/.deps/sql_list.Po -sql/.deps/sql_load.Po -sql/.deps/sql_manager.Po -sql/.deps/sql_map.Po -sql/.deps/sql_olap.Po -sql/.deps/sql_parse.Po -sql/.deps/sql_partition.Po -sql/.deps/sql_plugin.Po -sql/.deps/sql_prepare.Po -sql/.deps/sql_rename.Po -sql/.deps/sql_repl.Po -sql/.deps/sql_select.Po -sql/.deps/sql_show.Po -sql/.deps/sql_state.Po -sql/.deps/sql_string.Po -sql/.deps/sql_table.Po -sql/.deps/sql_tablespace.Po -sql/.deps/sql_test.Po -sql/.deps/sql_trigger.Po -sql/.deps/sql_udf.Po -sql/.deps/sql_union.Po -sql/.deps/sql_update.Po -sql/.deps/sql_view.Po -sql/.deps/sql_yacc.Po -sql/.deps/stacktrace.Po -sql/.deps/strfunc.Po -sql/.deps/table.Po -sql/.deps/thr_malloc.Po -sql/.deps/time.Po -sql/.deps/tztime.Po -sql/.deps/udf_example.Plo -sql/.deps/uniques.Po -sql/.deps/unireg.Po -sql/.gdbinit -sql/.libs/udf_example.lai -sql/.libs/udf_example.so.0 -sql/.libs/udf_example.so.0.0.0 -sql/client.c -sql/cmake_dummy.cc -sql/Doxyfile -sql/cscope.out -sql/f.c -sql/gen_lex_hash -sql/gmon.out -sql/handlerton.cc -sql/html -sql/latex -sql/lex_hash.h -sql/lex_hash.h.rule -sql/link_sources -sql/max/* -sql/message.h -sql/message.mc -sql/message.rc -sql/mini_client_errors.c -sql/my_time.c -sql/my_user.c -sql/mysql_tzinfo_to_sql -sql/mysql_tzinfo_to_sql.cc -sql/mysql_tzinfo_to_sql_tztime.cc -sql/mysqlbinlog -sql/mysqld -sql/mysqld-purecov -sql/mysqld-purify -sql/mysqld-quantify -sql/new.cc -sql/pack.c -sql/safe_to_cache_query.txt -sql/share/*.sys -sql/share/charsets/gmon.out -sql/share/fixerrmsg.pl -sql/share/gmon.out -sql/share/iso639-2.txt -sql/share/mysql -sql/share/norwegian-ny/errmsg.sys -sql/share/norwegian/errmsg.sys -sql/sql_builtin.cc -sql/sql_select.cc.orig -sql/sql_yacc.cc -sql/sql_yacc.h -sql/sql_yacc.h.rule -sql/sql_yacc.output -sql/sql_yacc.yy.orig -sql/test_time -sql/udf_example.so -sql_error.cc -sql_prepare.cc -stamp-h -stamp-h.in -stamp-h1 -stamp-h1.in -stamp-h2 -stamp-h2.in -stamp-h3 -stamp-h4 -start_mysqld.sh -storage/archive/.deps/archive_test-archive_test.Po -storage/archive/.deps/archive_test-azio.Po -storage/archive/.deps/ha_archive_la-azio.Plo -storage/archive/.deps/ha_archive_la-ha_archive.Plo -storage/archive/.deps/libarchive_a-azio.Po -storage/archive/.deps/libarchive_a-ha_archive.Po -storage/archive/archive_reader -storage/archive/archive_test -storage/bdb/*.ds? -storage/bdb/*.vcproj -storage/bdb/README -storage/bdb/btree/btree_auto.c -storage/bdb/btree/btree_autop.c -storage/bdb/build_unix/* -storage/bdb/build_vxworks/BerkeleyDB20.wpj -storage/bdb/build_vxworks/BerkeleyDB20small.wpj -storage/bdb/build_vxworks/BerkeleyDB22.wpj -storage/bdb/build_vxworks/BerkeleyDB22small.wpj -storage/bdb/build_vxworks/db.h -storage/bdb/build_vxworks/db_config.h -storage/bdb/build_vxworks/db_config_small.h -storage/bdb/build_vxworks/db_deadlock/db_deadlock20.wpj -storage/bdb/build_vxworks/db_deadlock/db_deadlock22.wpj -storage/bdb/build_vxworks/db_int.h -storage/bdb/build_vxworks/dbdemo/dbdemo.c -storage/bdb/build_vxworks/dbdemo/dbdemo20.wpj -storage/bdb/build_vxworks/dbdemo/dbdemo22.wpj -storage/bdb/build_win32/*.dsp -storage/bdb/build_win32/*.h -storage/bdb/build_win32/db.h -storage/bdb/build_win32/db_archive.dsp -storage/bdb/build_win32/db_checkpoint.dsp -storage/bdb/build_win32/db_config.h -storage/bdb/build_win32/db_cxx.h -storage/bdb/build_win32/db_deadlock.dsp -storage/bdb/build_win32/db_dll.dsp -storage/bdb/build_win32/db_dump.dsp -storage/bdb/build_win32/db_int.h -storage/bdb/build_win32/db_java.dsp -storage/bdb/build_win32/db_load.dsp -storage/bdb/build_win32/db_perf.dsp -storage/bdb/build_win32/db_printlog.dsp -storage/bdb/build_win32/db_recover.dsp -storage/bdb/build_win32/db_stat.dsp -storage/bdb/build_win32/db_static.dsp -storage/bdb/build_win32/db_tcl.dsp -storage/bdb/build_win32/db_test.dsp -storage/bdb/build_win32/db_upgrade.dsp -storage/bdb/build_win32/db_verify.dsp -storage/bdb/build_win32/ex_access.dsp -storage/bdb/build_win32/ex_btrec.dsp -storage/bdb/build_win32/ex_env.dsp -storage/bdb/build_win32/ex_lock.dsp -storage/bdb/build_win32/ex_mpool.dsp -storage/bdb/build_win32/ex_tpcb.dsp -storage/bdb/build_win32/excxx_access.dsp -storage/bdb/build_win32/excxx_btrec.dsp -storage/bdb/build_win32/excxx_env.dsp -storage/bdb/build_win32/excxx_lock.dsp -storage/bdb/build_win32/excxx_mpool.dsp -storage/bdb/build_win32/excxx_tpcb.dsp -storage/bdb/build_win32/include.tcl -storage/bdb/build_win32/libdb.def -storage/bdb/build_win32/libdb.rc -storage/bdb/build_win64/*.dsp -storage/bdb/build_win64/*.dsw -storage/bdb/build_win64/*.h -storage/bdb/db/crdel_auto.c -storage/bdb/db/crdel_autop.c -storage/bdb/db/db_auto.c -storage/bdb/db/db_autop.c -storage/bdb/dbinc_auto/*.* -storage/bdb/dbreg/dbreg_auto.c -storage/bdb/dbreg/dbreg_autop.c -storage/bdb/dist/autom4te-2.53.cache/* -storage/bdb/dist/autom4te-2.53.cache/output.0 -storage/bdb/dist/autom4te-2.53.cache/requests -storage/bdb/dist/autom4te-2.53.cache/traces.0 -storage/bdb/dist/autom4te.cache/* -storage/bdb/dist/autom4te.cache/output.0 -storage/bdb/dist/autom4te.cache/requests -storage/bdb/dist/autom4te.cache/traces.0 -storage/bdb/dist/config.hin -storage/bdb/dist/configure -storage/bdb/dist/tags -storage/bdb/dist/template/db_server_proc -storage/bdb/dist/template/gen_client_ret -storage/bdb/dist/template/rec_btree -storage/bdb/dist/template/rec_crdel -storage/bdb/dist/template/rec_db -storage/bdb/dist/template/rec_dbreg -storage/bdb/dist/template/rec_fileops -storage/bdb/dist/template/rec_hash -storage/bdb/dist/template/rec_log -storage/bdb/dist/template/rec_qam -storage/bdb/dist/template/rec_txn -storage/bdb/examples_c/ex_apprec/ex_apprec_auto.c -storage/bdb/examples_c/ex_apprec/ex_apprec_auto.h -storage/bdb/examples_c/ex_apprec/ex_apprec_template -storage/bdb/examples_java -storage/bdb/fileops/fileops_auto.c -storage/bdb/fileops/fileops_autop.c -storage/bdb/hash/hash_auto.c -storage/bdb/hash/hash_autop.c -storage/bdb/include/btree_auto.h -storage/bdb/include/btree_ext.h -storage/bdb/include/clib_ext.h -storage/bdb/include/common_ext.h -storage/bdb/include/crdel_auto.h -storage/bdb/include/db_auto.h -storage/bdb/include/db_ext.h -storage/bdb/include/db_server.h -storage/bdb/include/env_ext.h -storage/bdb/include/gen_client_ext.h -storage/bdb/include/gen_server_ext.h -storage/bdb/include/hash_auto.h -storage/bdb/include/hash_ext.h -storage/bdb/include/lock_ext.h -storage/bdb/include/log_auto.h -storage/bdb/include/log_ext.h -storage/bdb/include/mp_ext.h -storage/bdb/include/mutex_ext.h -storage/bdb/include/os_ext.h -storage/bdb/include/qam_auto.h -storage/bdb/include/qam_ext.h -storage/bdb/include/rpc_client_ext.h -storage/bdb/include/rpc_server_ext.h -storage/bdb/include/tcl_ext.h -storage/bdb/include/txn_auto.h -storage/bdb/include/txn_ext.h -storage/bdb/include/xa_ext.h -storage/bdb/java/src/com/sleepycat/db/Db.java -storage/bdb/java/src/com/sleepycat/db/DbBtreeStat.java -storage/bdb/java/src/com/sleepycat/db/DbConstants.java -storage/bdb/java/src/com/sleepycat/db/DbHashStat.java -storage/bdb/java/src/com/sleepycat/db/DbLockStat.java -storage/bdb/java/src/com/sleepycat/db/DbLogStat.java -storage/bdb/java/src/com/sleepycat/db/DbMpoolFStat.java -storage/bdb/java/src/com/sleepycat/db/DbQueueStat.java -storage/bdb/java/src/com/sleepycat/db/DbRepStat.java -storage/bdb/java/src/com/sleepycat/db/DbTxnStat.java -storage/bdb/libdb_java/java_stat_auto.c -storage/bdb/libdb_java/java_stat_auto.h -storage/bdb/libdb_java/java_util.i -storage/bdb/log/log_auto.c -storage/bdb/qam/qam_auto.c -storage/bdb/qam/qam_autop.c -storage/bdb/rep/rep_auto.c -storage/bdb/rep/rep_autop.c -storage/bdb/rpc_client/db_server_clnt.c -storage/bdb/rpc_client/gen_client.c -storage/bdb/rpc_server/c/db_server_proc.c -storage/bdb/rpc_server/c/db_server_proc.sed -storage/bdb/rpc_server/c/db_server_svc.c -storage/bdb/rpc_server/c/db_server_xdr.c -storage/bdb/rpc_server/c/gen_db_server.c -storage/bdb/rpc_server/db_server.x -storage/bdb/rpc_server/db_server_proc.sed -storage/bdb/rpc_server/db_server_svc.c -storage/bdb/rpc_server/db_server_xdr.c -storage/bdb/rpc_server/gen_db_server.c -storage/bdb/test/TESTS -storage/bdb/test/include.tcl -storage/bdb/test/logtrack.list -storage/bdb/txn/txn_auto.c -storage/bdb/txn/txn_autop.c -storage/blackhole/.deps/ha_blackhole_la-ha_blackhole.Plo -storage/blackhole/.deps/libblackhole_a-ha_blackhole.Po -storage/csv/.deps/ha_csv_la-ha_tina.Plo -storage/csv/.deps/libcsv_a-ha_tina.Po -storage/example/.deps/ha_example_la-ha_example.Plo -storage/example/.deps/libexample_a-ha_example.Po -storage/heap/.deps/_check.Po -storage/heap/.deps/_rectest.Po -storage/heap/.deps/hp_block.Po -storage/heap/.deps/hp_clear.Po -storage/heap/.deps/hp_close.Po -storage/heap/.deps/hp_create.Po -storage/heap/.deps/hp_delete.Po -storage/heap/.deps/hp_extra.Po -storage/heap/.deps/hp_hash.Po -storage/heap/.deps/hp_info.Po -storage/heap/.deps/hp_open.Po -storage/heap/.deps/hp_panic.Po -storage/heap/.deps/hp_rename.Po -storage/heap/.deps/hp_rfirst.Po -storage/heap/.deps/hp_rkey.Po -storage/heap/.deps/hp_rlast.Po -storage/heap/.deps/hp_rnext.Po -storage/heap/.deps/hp_rprev.Po -storage/heap/.deps/hp_rrnd.Po -storage/heap/.deps/hp_rsame.Po -storage/heap/.deps/hp_scan.Po -storage/heap/.deps/hp_static.Po -storage/heap/.deps/hp_test1.Po -storage/heap/.deps/hp_test2.Po -storage/heap/.deps/hp_update.Po -storage/heap/.deps/hp_write.Po -storage/heap/hp_test1 -storage/heap/hp_test2 -storage/innobase/autom4te-2.53.cache/* -storage/innobase/autom4te-2.53.cache/output.0 -storage/innobase/autom4te-2.53.cache/requests -storage/innobase/autom4te-2.53.cache/traces.0 -storage/innobase/autom4te.cache/* -storage/innobase/autom4te.cache/output.0 -storage/innobase/autom4te.cache/requests -storage/innobase/autom4te.cache/traces.0 -storage/innobase/btr/.deps/btr0btr.Po -storage/innobase/btr/.deps/btr0cur.Po -storage/innobase/btr/.deps/btr0pcur.Po -storage/innobase/btr/.deps/btr0sea.Po -storage/innobase/buf/.deps/buf0buf.Po -storage/innobase/buf/.deps/buf0flu.Po -storage/innobase/buf/.deps/buf0lru.Po -storage/innobase/buf/.deps/buf0rea.Po -storage/innobase/configure.lineno -storage/innobase/conftest.s1 -storage/innobase/conftest.subs -storage/innobase/data/.deps/data0data.Po -storage/innobase/data/.deps/data0type.Po -storage/innobase/dict/.deps/dict0boot.Po -storage/innobase/dict/.deps/dict0crea.Po -storage/innobase/dict/.deps/dict0dict.Po -storage/innobase/dict/.deps/dict0load.Po -storage/innobase/dict/.deps/dict0mem.Po -storage/innobase/dyn/.deps/dyn0dyn.Po -storage/innobase/eval/.deps/eval0eval.Po -storage/innobase/eval/.deps/eval0proc.Po -storage/innobase/fil/.deps/fil0fil.Po -storage/innobase/fsp/.deps/fsp0fsp.Po -storage/innobase/fut/.deps/fut0fut.Po -storage/innobase/fut/.deps/fut0lst.Po -storage/innobase/ha/.deps/ha0ha.Po -storage/innobase/ha/.deps/hash0hash.Po -storage/innobase/ib_config.h -storage/innobase/ib_config.h.in -storage/innobase/ibuf/.deps/ibuf0ibuf.Po -storage/innobase/lock/.deps/lock0lock.Po -storage/innobase/log/.deps/log0log.Po -storage/innobase/log/.deps/log0recv.Po -storage/innobase/mach/.deps/mach0data.Po -storage/innobase/mem/.deps/mem0mem.Po -storage/innobase/mem/.deps/mem0pool.Po -storage/innobase/mkinstalldirs -storage/innobase/mtr/.deps/mtr0log.Po -storage/innobase/mtr/.deps/mtr0mtr.Po -storage/innobase/os/.deps/os0file.Po -storage/innobase/os/.deps/os0proc.Po -storage/innobase/os/.deps/os0sync.Po -storage/innobase/os/.deps/os0thread.Po -storage/innobase/page/.deps/page0cur.Po -storage/innobase/page/.deps/page0page.Po -storage/innobase/pars/.deps/lexyy.Po -storage/innobase/pars/.deps/pars0grm.Po -storage/innobase/pars/.deps/pars0opt.Po -storage/innobase/pars/.deps/pars0pars.Po -storage/innobase/pars/.deps/pars0sym.Po -storage/innobase/que/.deps/que0que.Po -storage/innobase/read/.deps/read0read.Po -storage/innobase/rem/.deps/rem0cmp.Po -storage/innobase/rem/.deps/rem0rec.Po -storage/innobase/row/.deps/row0ins.Po -storage/innobase/row/.deps/row0mysql.Po -storage/innobase/row/.deps/row0purge.Po -storage/innobase/row/.deps/row0row.Po -storage/innobase/row/.deps/row0sel.Po -storage/innobase/row/.deps/row0uins.Po -storage/innobase/row/.deps/row0umod.Po -storage/innobase/row/.deps/row0undo.Po -storage/innobase/row/.deps/row0upd.Po -storage/innobase/row/.deps/row0vers.Po -storage/innobase/srv/.deps/srv0que.Po -storage/innobase/srv/.deps/srv0srv.Po -storage/innobase/srv/.deps/srv0start.Po -storage/innobase/stamp-h1 -storage/innobase/sync/.deps/sync0arr.Po -storage/innobase/sync/.deps/sync0rw.Po -storage/innobase/sync/.deps/sync0sync.Po -storage/innobase/thr/.deps/thr0loc.Po -storage/innobase/trx/.deps/trx0purge.Po -storage/innobase/trx/.deps/trx0rec.Po -storage/innobase/trx/.deps/trx0roll.Po -storage/innobase/trx/.deps/trx0rseg.Po -storage/innobase/trx/.deps/trx0sys.Po -storage/innobase/trx/.deps/trx0trx.Po -storage/innobase/trx/.deps/trx0undo.Po -storage/innobase/usr/.deps/usr0sess.Po -storage/innobase/ut/.deps/ut0byte.Po -storage/innobase/ut/.deps/ut0dbg.Po -storage/innobase/ut/.deps/ut0list.Po -storage/innobase/ut/.deps/ut0mem.Po -storage/innobase/ut/.deps/ut0rnd.Po -storage/innobase/ut/.deps/ut0ut.Po -storage/innobase/ut/.deps/ut0vec.Po -storage/innobase/ut/.deps/ut0wqueue.Po -storage/myisam/.deps/ft_boolean_search.Po -storage/myisam/.deps/ft_nlq_search.Po -storage/myisam/.deps/ft_parser.Po -storage/myisam/.deps/ft_static.Po -storage/myisam/.deps/ft_stopwords.Po -storage/myisam/.deps/ft_update.Po -storage/myisam/.deps/mi_cache.Po -storage/myisam/.deps/mi_changed.Po -storage/myisam/.deps/mi_check.Po -storage/myisam/.deps/mi_checksum.Po -storage/myisam/.deps/mi_close.Po -storage/myisam/.deps/mi_create.Po -storage/myisam/.deps/mi_dbug.Po -storage/myisam/.deps/mi_delete.Po -storage/myisam/.deps/mi_delete_all.Po -storage/myisam/.deps/mi_delete_table.Po -storage/myisam/.deps/mi_dynrec.Po -storage/myisam/.deps/mi_extra.Po -storage/myisam/.deps/mi_info.Po -storage/myisam/.deps/mi_key.Po -storage/myisam/.deps/mi_keycache.Po -storage/myisam/.deps/mi_locking.Po -storage/myisam/.deps/mi_log.Po -storage/myisam/.deps/mi_open.Po -storage/myisam/.deps/mi_packrec.Po -storage/myisam/.deps/mi_page.Po -storage/myisam/.deps/mi_panic.Po -storage/myisam/.deps/mi_preload.Po -storage/myisam/.deps/mi_range.Po -storage/myisam/.deps/mi_rename.Po -storage/myisam/.deps/mi_rfirst.Po -storage/myisam/.deps/mi_rkey.Po -storage/myisam/.deps/mi_rlast.Po -storage/myisam/.deps/mi_rnext.Po -storage/myisam/.deps/mi_rnext_same.Po -storage/myisam/.deps/mi_rprev.Po -storage/myisam/.deps/mi_rrnd.Po -storage/myisam/.deps/mi_rsame.Po -storage/myisam/.deps/mi_rsamepos.Po -storage/myisam/.deps/mi_scan.Po -storage/myisam/.deps/mi_search.Po -storage/myisam/.deps/mi_static.Po -storage/myisam/.deps/mi_statrec.Po -storage/myisam/.deps/mi_test1.Po -storage/myisam/.deps/mi_test2.Po -storage/myisam/.deps/mi_test3.Po -storage/myisam/.deps/mi_unique.Po -storage/myisam/.deps/mi_update.Po -storage/myisam/.deps/mi_write.Po -storage/myisam/.deps/myisam_ftdump.Po -storage/myisam/.deps/myisamchk.Po -storage/myisam/.deps/myisamlog.Po -storage/myisam/.deps/myisampack.Po -storage/myisam/.deps/rt_index.Po -storage/myisam/.deps/rt_key.Po -storage/myisam/.deps/rt_mbr.Po -storage/myisam/.deps/rt_split.Po -storage/myisam/.deps/rt_test.Po -storage/myisam/.deps/sort.Po -storage/myisam/.deps/sp_key.Po -storage/myisam/.deps/sp_test.Po -storage/myisam/FT1.MYD -storage/myisam/FT1.MYI -storage/myisam/ft_dump -storage/myisam/ft_eval -storage/myisam/ft_test1 -storage/myisam/ftbench/data -storage/myisam/ftbench/t -storage/myisam/ftbench/var/* -storage/myisam/mi_test1 -storage/myisam/mi_test2 -storage/myisam/mi_test3 -storage/myisam/mi_test_all -storage/myisam/myisam.log -storage/myisam/myisam_ftdump -storage/myisam/myisamchk -storage/myisam/myisamlog -storage/myisam/myisampack -storage/myisam/rt_test -storage/myisam/rt_test.MYD -storage/myisam/rt_test.MYI -storage/myisam/sp_test -storage/myisam/test1.MYD -storage/myisam/test1.MYI -storage/myisam/test2.MYD -storage/myisam/test2.MYI -storage/myisammrg/.deps/myrg_close.Po -storage/myisammrg/.deps/myrg_create.Po -storage/myisammrg/.deps/myrg_delete.Po -storage/myisammrg/.deps/myrg_extra.Po -storage/myisammrg/.deps/myrg_info.Po -storage/myisammrg/.deps/myrg_locking.Po -storage/myisammrg/.deps/myrg_open.Po -storage/myisammrg/.deps/myrg_panic.Po -storage/myisammrg/.deps/myrg_queue.Po -storage/myisammrg/.deps/myrg_range.Po -storage/myisammrg/.deps/myrg_rfirst.Po -storage/myisammrg/.deps/myrg_rkey.Po -storage/myisammrg/.deps/myrg_rlast.Po -storage/myisammrg/.deps/myrg_rnext.Po -storage/myisammrg/.deps/myrg_rnext_same.Po -storage/myisammrg/.deps/myrg_rprev.Po -storage/myisammrg/.deps/myrg_rrnd.Po -storage/myisammrg/.deps/myrg_rsame.Po -storage/myisammrg/.deps/myrg_static.Po -storage/myisammrg/.deps/myrg_update.Po -storage/myisammrg/.deps/myrg_write.Po -storage/ndb/bin/DbAsyncGenerator -storage/ndb/bin/DbCreate -storage/ndb/bin/acid -storage/ndb/bin/async-lmc-bench-l-p10.sh -storage/ndb/bin/async-lmc-bench-l.sh -storage/ndb/bin/async-lmc-bench-p10.sh -storage/ndb/bin/async-lmc-bench.sh -storage/ndb/bin/atrt -storage/ndb/bin/atrt-analyze-result.sh -storage/ndb/bin/atrt-clear-result.sh -storage/ndb/bin/atrt-gather-result.sh -storage/ndb/bin/atrt-setup.sh -storage/ndb/bin/bankCreator -storage/ndb/bin/bankMakeGL -storage/ndb/bin/bankSumAccounts -storage/ndb/bin/bankTimer -storage/ndb/bin/bankTransactionMaker -storage/ndb/bin/bankValidateAllGLs -storage/ndb/bin/basicTransporterTest -storage/ndb/bin/benchronja -storage/ndb/bin/bulk_copy -storage/ndb/bin/copy_tab -storage/ndb/bin/create_all_tabs -storage/ndb/bin/create_index -storage/ndb/bin/create_tab -storage/ndb/bin/delete_all -storage/ndb/bin/desc -storage/ndb/bin/drop_all_tabs -storage/ndb/bin/drop_index -storage/ndb/bin/drop_tab -storage/ndb/bin/flexAsynch -storage/ndb/bin/flexBench -storage/ndb/bin/flexHammer -storage/ndb/bin/flexScan -storage/ndb/bin/flexTT -storage/ndb/bin/hugoCalculator -storage/ndb/bin/hugoFill -storage/ndb/bin/hugoLoad -storage/ndb/bin/hugoLockRecords -storage/ndb/bin/hugoPkDelete -storage/ndb/bin/hugoPkRead -storage/ndb/bin/hugoPkReadRecord -storage/ndb/bin/hugoPkUpdate -storage/ndb/bin/hugoScanRead -storage/ndb/bin/hugoScanUpdate -storage/ndb/bin/index -storage/ndb/bin/index2 -storage/ndb/bin/initronja -storage/ndb/bin/interpreterInTup -storage/ndb/bin/list_tables -storage/ndb/bin/make-config.sh -storage/ndb/bin/mgmtclient -storage/ndb/bin/mgmtsrvr -storage/ndb/bin/mkconfig -storage/ndb/bin/ndb -storage/ndb/bin/ndb_cpcc -storage/ndb/bin/ndb_cpcd -storage/ndb/bin/ndb_rep -storage/ndb/bin/ndbsql -storage/ndb/bin/newton_basic -storage/ndb/bin/newton_br -storage/ndb/bin/newton_pb -storage/ndb/bin/newton_perf -storage/ndb/bin/perfTransporterTest -storage/ndb/bin/printConfig -storage/ndb/bin/printSchemafile -storage/ndb/bin/printSysfile -storage/ndb/bin/redoLogFileReader -storage/ndb/bin/restart -storage/ndb/bin/restarter -storage/ndb/bin/restarter2 -storage/ndb/bin/restarts -storage/ndb/bin/restore -storage/ndb/bin/select_all -storage/ndb/bin/select_count -storage/ndb/bin/telco -storage/ndb/bin/testBackup -storage/ndb/bin/testBank -storage/ndb/bin/testBasic -storage/ndb/bin/testBasicAsynch -storage/ndb/bin/testCopy -storage/ndb/bin/testDataBuffers -storage/ndb/bin/testDict -storage/ndb/bin/testGrep -storage/ndb/bin/testGrepVerify -storage/ndb/bin/testIndex -storage/ndb/bin/testInterpreter -storage/ndb/bin/testKernelDataBuffer -storage/ndb/bin/testLongSig -storage/ndb/bin/testMgm -storage/ndb/bin/testMgmapi -storage/ndb/bin/testNdbApi -storage/ndb/bin/testNodeRestart -storage/ndb/bin/testOIBasic -storage/ndb/bin/testOdbcDriver -storage/ndb/bin/testOperations -storage/ndb/bin/testRestartGci -storage/ndb/bin/testScan -storage/ndb/bin/testScanInterpreter -storage/ndb/bin/testSimplePropertiesSection -storage/ndb/bin/testSystemRestart -storage/ndb/bin/testTimeout -storage/ndb/bin/testTransactions -storage/ndb/bin/test_cpcd -storage/ndb/bin/test_event -storage/ndb/bin/verify_index -storage/ndb/bin/waiter -storage/ndb/config/autom4te.cache/* -storage/ndb/config/config.mk -storage/ndb/examples/ndbapi_example1/ndbapi_example1 -storage/ndb/examples/ndbapi_example2/ndbapi_example2 -storage/ndb/examples/ndbapi_example3/ndbapi_example3 -storage/ndb/examples/ndbapi_example5/ndbapi_example5 -storage/ndb/examples/select_all/select_all -storage/ndb/include/ndb_global.h -storage/ndb/include/ndb_types.h -storage/ndb/include/ndb_version.h -storage/ndb/lib/libMGM_API.so -storage/ndb/lib/libNDB_API.so -storage/ndb/lib/libNDB_ODBC.so -storage/ndb/lib/libNEWTON_API.so -storage/ndb/lib/libNEWTON_BASICTEST_COMMON.so -storage/ndb/lib/libREP_API.so -storage/ndb/lib/libndbclient.so -storage/ndb/lib/libndbclient_extra.so -storage/ndb/ndbapi-examples/mgmapi_logevent/mgmapi_logevent -storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2 -storage/ndb/ndbapi-examples/ndbapi_async/ndbapi_async -storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1 -storage/ndb/ndbapi-examples/ndbapi_event/ndbapi_event -storage/ndb/ndbapi-examples/ndbapi_retries/ndbapi_retries -storage/ndb/ndbapi-examples/ndbapi_scan/ndbapi_scan -storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple -storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual -storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index -storage/ndb/src/common/debugger/libtrace.dsp -storage/ndb/src/common/debugger/signaldata/libsignaldataprint.dsp -storage/ndb/src/common/logger/liblogger.dsp -storage/ndb/src/common/mgmcommon/libmgmsrvcommon.dsp -storage/ndb/src/common/mgmcommon/printConfig/*.d -storage/ndb/src/common/portlib/libportlib.dsp -storage/ndb/src/common/transporter/libtransporter.dsp -storage/ndb/src/common/util/libgeneral.dsp -storage/ndb/src/common/util/testBitmask.cpp -storage/ndb/src/cw/cpcd/ndb_cpcd -storage/ndb/src/dummy.cpp -storage/ndb/src/kernel/blocks/backup/libbackup.dsp -storage/ndb/src/kernel/blocks/backup/ndb_print_backup_file -storage/ndb/src/kernel/blocks/backup/restore/ndb_restore -storage/ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp -storage/ndb/src/kernel/blocks/dbacc/libdbacc.dsp -storage/ndb/src/kernel/blocks/dbdict/libdbdict.dsp -storage/ndb/src/kernel/blocks/dbdict/ndb_print_schema_file -storage/ndb/src/kernel/blocks/dbdih/libdbdih.dsp -storage/ndb/src/kernel/blocks/dbdih/ndb_print_sys_file -storage/ndb/src/kernel/blocks/dblqh/libdblqh.dsp -storage/ndb/src/kernel/blocks/dbtc/libdbtc.dsp -storage/ndb/src/kernel/blocks/dbtup/libdbtup.dsp -storage/ndb/src/kernel/blocks/dbtup/test_varpage -storage/ndb/src/kernel/blocks/dbtux/libdbtux.dsp -storage/ndb/src/kernel/blocks/dbutil/libdbutil.dsp -storage/ndb/src/kernel/blocks/grep/libgrep.dsp -storage/ndb/src/kernel/blocks/ndb_print_file -storage/ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp -storage/ndb/src/kernel/blocks/ndbfs/libndbfs.dsp -storage/ndb/src/kernel/blocks/qmgr/libqmgr.dsp -storage/ndb/src/kernel/blocks/suma/libsuma.dsp -storage/ndb/src/kernel/blocks/trix/libtrix.dsp -storage/ndb/src/kernel/error/liberror.dsp -storage/ndb/src/kernel/ndbd -storage/ndb/src/kernel/ndbd.dsp -storage/ndb/src/kernel/vm/libkernel.dsp -storage/ndb/src/libndb.ver -storage/ndb/src/libndbclient.dsp -storage/ndb/src/mgmapi/libmgmapi.dsp -storage/ndb/src/mgmclient/libndbmgmclient.dsp -storage/ndb/src/mgmclient/ndb_mgm -storage/ndb/src/mgmclient/ndb_mgm.dsp -storage/ndb/src/mgmclient/test_cpcd/*.d -storage/ndb/src/mgmsrv/ndb_mgmd -storage/ndb/src/mgmsrv/ndb_mgmd.dsp -storage/ndb/src/ndbapi/libndbapi.dsp -storage/ndb/src/ndbapi/ndberror_check -storage/ndb/test/ndbapi/DbAsyncGenerator -storage/ndb/test/ndbapi/DbCreate -storage/ndb/test/ndbapi/bank/bankCreator -storage/ndb/test/ndbapi/bank/bankMakeGL -storage/ndb/test/ndbapi/bank/bankSumAccounts -storage/ndb/test/ndbapi/bank/bankTimer -storage/ndb/test/ndbapi/bank/bankTransactionMaker -storage/ndb/test/ndbapi/bank/bankValidateAllGLs -storage/ndb/test/ndbapi/bank/testBank -storage/ndb/test/ndbapi/create_all_tabs -storage/ndb/test/ndbapi/create_tab -storage/ndb/test/ndbapi/drop_all_tabs -storage/ndb/test/ndbapi/flexAsynch -storage/ndb/test/ndbapi/flexBench -storage/ndb/test/ndbapi/flexBench.dsp -storage/ndb/test/ndbapi/flexHammer -storage/ndb/test/ndbapi/flexTT -storage/ndb/test/ndbapi/ndbapi_slow_select -storage/ndb/test/ndbapi/testBackup -storage/ndb/test/ndbapi/testBasic -storage/ndb/test/ndbapi/testBasic.dsp -storage/ndb/test/ndbapi/testBasicAsynch -storage/ndb/test/ndbapi/testBitfield -storage/ndb/test/ndbapi/testBlobs -storage/ndb/test/ndbapi/testBlobs.dsp -storage/ndb/test/ndbapi/testDataBuffers -storage/ndb/test/ndbapi/testDeadlock -storage/ndb/test/ndbapi/testDict -storage/ndb/test/ndbapi/testIndex -storage/ndb/test/ndbapi/testIndexStat -storage/ndb/test/ndbapi/testInterpreter -storage/ndb/test/ndbapi/testLcp -storage/ndb/test/ndbapi/testMgm -storage/ndb/test/ndbapi/testNdbApi -storage/ndb/test/ndbapi/testNodeRestart -storage/ndb/test/ndbapi/testOIBasic -storage/ndb/test/ndbapi/testOperations -storage/ndb/test/ndbapi/testPartitioning -storage/ndb/test/ndbapi/testReadPerf -storage/ndb/test/ndbapi/testRestartGci -storage/ndb/test/ndbapi/testSRBank -storage/ndb/test/ndbapi/testScan -storage/ndb/test/ndbapi/testScan.dsp -storage/ndb/test/ndbapi/testScanInterpreter -storage/ndb/test/ndbapi/testScanPerf -storage/ndb/test/ndbapi/testSystemRestart -storage/ndb/test/ndbapi/testTimeout -storage/ndb/test/ndbapi/testTransactions -storage/ndb/test/ndbapi/test_event -storage/ndb/test/ndbapi/test_event_merge -storage/ndb/test/run-test/atrt -storage/ndb/test/src/libNDBT.dsp -storage/ndb/test/tools/copy_tab -storage/ndb/test/tools/create_index -storage/ndb/test/tools/hugoCalculator -storage/ndb/test/tools/hugoFill -storage/ndb/test/tools/hugoLoad -storage/ndb/test/tools/hugoLockRecords -storage/ndb/test/tools/hugoPkDelete -storage/ndb/test/tools/hugoPkRead -storage/ndb/test/tools/hugoPkReadRecord -storage/ndb/test/tools/hugoPkUpdate -storage/ndb/test/tools/hugoScanRead -storage/ndb/test/tools/hugoScanUpdate -storage/ndb/test/tools/listen_event -storage/ndb/test/tools/ndb_cpcc -storage/ndb/test/tools/rep_latency -storage/ndb/test/tools/restart -storage/ndb/test/tools/verify_index -storage/ndb/tools/ndb_config -storage/ndb/tools/ndb_delete_all -storage/ndb/tools/ndb_delete_all.dsp -storage/ndb/tools/ndb_desc -storage/ndb/tools/ndb_desc.dsp -storage/ndb/tools/ndb_drop_index -storage/ndb/tools/ndb_drop_index.dsp -storage/ndb/tools/ndb_drop_table -storage/ndb/tools/ndb_drop_table.dsp -storage/ndb/tools/ndb_restore -storage/ndb/tools/ndb_select_all -storage/ndb/tools/ndb_select_all.dsp -storage/ndb/tools/ndb_select_count -storage/ndb/tools/ndb_select_count.dsp -storage/ndb/tools/ndb_show_tables -storage/ndb/tools/ndb_show_tables.dsp -storage/ndb/tools/ndb_test_platform -storage/ndb/tools/ndb_waiter -storage/ndb/tools/ndb_waiter.dsp -strings/*.ds? -strings/*.vcproj -strings/.deps/bchange.Po -strings/.deps/bcmp.Po -strings/.deps/bfill.Po -strings/.deps/bmove.Po -strings/.deps/bmove512.Po -strings/.deps/bmove_upp.Po -strings/.deps/conf_to_src.Po -strings/.deps/ctype-big5.Po -strings/.deps/ctype-bin.Po -strings/.deps/ctype-cp932.Po -strings/.deps/ctype-czech.Po -strings/.deps/ctype-euc_kr.Po -strings/.deps/ctype-eucjpms.Po -strings/.deps/ctype-extra.Po -strings/.deps/ctype-gb2312.Po -strings/.deps/ctype-gbk.Po -strings/.deps/ctype-latin1.Po -strings/.deps/ctype-mb.Po -strings/.deps/ctype-simple.Po -strings/.deps/ctype-sjis.Po -strings/.deps/ctype-tis620.Po -strings/.deps/ctype-uca.Po -strings/.deps/ctype-ucs2.Po -strings/.deps/ctype-ujis.Po -strings/.deps/ctype-utf8.Po -strings/.deps/ctype-win1250ch.Po -strings/.deps/ctype.Po -strings/.deps/decimal.Po -strings/.deps/int2str.Po -strings/.deps/is_prefix.Po -strings/.deps/llstr.Po -strings/.deps/longlong2str.Po -strings/.deps/longlong2str_asm.Po -strings/.deps/my_strchr.Po -strings/.deps/my_strtoll10.Po -strings/.deps/my_vsnprintf.Po -strings/.deps/r_strinstr.Po -strings/.deps/str2int.Po -strings/.deps/str_alloc.Po -strings/.deps/strappend.Po -strings/.deps/strcend.Po -strings/.deps/strcont.Po -strings/.deps/strend.Po -strings/.deps/strfill.Po -strings/.deps/strinstr.Po -strings/.deps/strmake.Po -strings/.deps/strmov.Po -strings/.deps/strnlen.Po -strings/.deps/strnmov.Po -strings/.deps/strstr.Po -strings/.deps/strtod.Po -strings/.deps/strtol.Po -strings/.deps/strtoll.Po -strings/.deps/strtoul.Po -strings/.deps/strtoull.Po -strings/.deps/strxmov.Po -strings/.deps/strxnmov.Po -strings/.deps/xml.Po -strings/conf_to_src -strings/ctype_autoconf.c -strings/ctype_extra_sources.c -strings/str_test -strings/test_decimal -support-files/*.ini -support-files/MacOSX/Description.plist -support-files/MacOSX/Info.plist -support-files/MacOSX/StartupParameters.plist -support-files/MacOSX/postflight -support-files/MacOSX/postinstall -support-files/MacOSX/preflight -support-files/MacOSX/preinstall -support-files/binary-configure -support-files/my-huge.cnf -support-files/my-innodb-heavy-4G.cnf -support-files/my-large.cnf -support-files/my-medium.cnf -support-files/my-small.cnf -support-files/mysql-3.23.25-beta.spec -support-files/mysql-3.23.26-beta.spec -support-files/mysql-3.23.27-beta.spec -support-files/mysql-3.23.28-gamma.spec -support-files/mysql-3.23.29-gamma.spec -support-files/mysql-log-rotate -support-files/mysql.server -support-files/mysql.spec -support-files/mysqld_multi.server -support-files/ndb-config-2-node.ini -tags -test/ndbapi/bank/bankCreator -test/ndbapi/bank/bankMakeGL -test/ndbapi/bank/bankSumAccounts -test/ndbapi/bank/bankTimer -test/ndbapi/bank/bankTransactionMaker -test/ndbapi/bank/bankValidateAllGLs -test/ndbapi/bank/testBank -test/ndbapi/create_all_tabs -test/ndbapi/create_tab -test/ndbapi/drop_all_tabs -test/ndbapi/flexAsynch -test/ndbapi/flexBench -test/ndbapi/flexHammer -test/ndbapi/flexTT -test/ndbapi/testBackup -test/ndbapi/testBasic -test/ndbapi/testBasicAsynch -test/ndbapi/testBlobs -test/ndbapi/testDataBuffers -test/ndbapi/testDeadlock -test/ndbapi/testDict -test/ndbapi/testIndex -test/ndbapi/testMgm -test/ndbapi/testNdbApi -test/ndbapi/testNodeRestart -test/ndbapi/testOIBasic -test/ndbapi/testOperations -test/ndbapi/testRestartGci -test/ndbapi/testScan -test/ndbapi/testScanInterpreter -test/ndbapi/testScanPerf -test/ndbapi/testSystemRestart -test/ndbapi/testTimeout -test/ndbapi/testTransactions -test/ndbapi/test_event -test/run-test/atrt -test/tools/copy_tab -test/tools/create_index -test/tools/hugoCalculator -test/tools/hugoFill -test/tools/hugoLoad -test/tools/hugoLockRecords -test/tools/hugoPkDelete -test/tools/hugoPkRead -test/tools/hugoPkReadRecord -test/tools/hugoPkUpdate -test/tools/hugoScanRead -test/tools/hugoScanUpdate -test/tools/ndb_cpcc -test/tools/restart -test/tools/verify_index -test1/* -test_xml -tests/*.ds? -tests/*.vcproj -tests/.deps/dummy.Po -tests/.deps/insert_test.Po -tests/.deps/mysql_client_test.Po -tests/.deps/select_test.Po -tests/.deps/thread_test.Po -tests/.libs -prune -tests/.libs/lt-mysql_client_test -tests/.libs/mysql_client_test -tests/bug25714 -tests/client_test -tests/connect_test -tests/mysql_client_test -thr_insert_test/* -thr_test/* -thread_test -tmp/* -tools/.libs -prune -tools/my_vsnprintf.c -tools/mysqlmanager -tools/mysqlmngd -tools/mysqltestmanager -tools/mysys_priv.h -unittest/examples/*.t -unittest/examples/.deps/no_plan-t.Po -unittest/examples/.deps/simple-t.Po -unittest/examples/.deps/skip-t.Po -unittest/examples/.deps/skip_all-t.Po -unittest/examples/.deps/todo-t.Po -unittest/gunit/merge_large_tests.cc -unittest/gunit/merge_small_tests.cc -unittest/mysys/*.t -unittest/mysys/.deps/base64-t.Po -unittest/mysys/.deps/my_atomic-t.Po -unittest/mytap/.deps/tap.Po -unittest/mytap/t/*.t -unittest/mytap/t/.deps/basic-t.Po -unittest/unit -vi.h -vio/*.ds? -vio/*.vcproj -vio/.deps/dummy.Po -vio/.deps/test-ssl.Po -vio/.deps/test-sslclient.Po -vio/.deps/test-sslserver.Po -vio/.deps/vio.Po -vio/.deps/viosocket.Po -vio/.deps/viossl.Po -vio/.deps/viosslfactories.Po -vio/test-ssl -vio/test-sslclient -vio/test-sslserver -vio/viotest-ssl -vio/viotest-sslconnect.cpp -vio/viotest.cpp -win/configure.data -win/vs71cache.txt -win/vs8cache.txt -win/nmake_cache.txt -ylwrap -zlib/*.ds? -zlib/*.vcproj -mysql-test/bug36522-64.tar -mysql-test/bug36522.tar -mysql-test/t.log -mysql-test/tps.log -libmysqld/event_parse_data.cc -autom4te.cache -sql/share/czech -sql/share/danish -sql/share/dutch -sql/share/english -sql/share/estonian -sql/share/french -sql/share/german -sql/share/greek -sql/share/hungarian -sql/share/italian -sql/share/japanese -sql/share/japanese-sjis -sql/share/korean -sql/share/norwegian -sql/share/norwegian-ny -sql/share/polish -sql/share/portuguese -sql/share/romanian -sql/share/russian -sql/share/serbian -sql/share/slovak -sql/share/spanish -sql/share/swedish -sql/share/ukrainian -*.jar -*.dylib -*.stamp -storage/ndb/**/*.dir -storage/ndb/**/CMakeFiles -storage/ndb/**/target -storage/ndb/**/*.class -storage/ndb/src/ndbjtie/**/*.sh -storage/ndb/src/ndbjtie/**/*.log -storage/ndb/src/ndbjtie/jtie/test/myapi/myapi_test -storage/ndb/clusterj/**/*MANIFEST.MF -storage/ndb/clusterj/**/*manifest.mf -storage/ndb/test/crund/*.cnf -storage/ndb/test/crund/*.ini* -storage/ndb/test/crund/*.properties -storage/ndb/test/crund/build/ -storage/ndb/test/crund/javadoc/ -storage/ndb/test/crund/lib/ -storage/ndb/test/crund/**/log* -storage/ndb/test/crund/martins_little_helpers/src/utils/Properties_test -storage/ndb/test/crund/martins_little_helpers/src/utils/hrt_stopwatch_test -storage/ndb/test/crund/martins_little_helpers/src/utils/hrt_utils_test -storage/ndb/test/crund/martins_little_helpers/src/utils/utils_HrtStopwatch.h -storage/ndb/test/crund/martins_little_helpers/src/utils/utils_JniInstrumentationTest.h -storage/ndb/test/crund/scripts/ndblog -storage/ndb/test/crund/scripts/results -storage/ndb/test/crund/src/crundndb/NdbApiDriver -storage/ndb/test/crund/src/crundndb/com_mysql_cluster_crund_NdbApiLoad.h -storage/ndb/test/crund/tws/tws_java/build/ -storage/ndb/test/crund/tws/tws_java/nbproject/configs/ -storage/ndb/test/crund/tws/tws_java/nbproject/private/ -storage/ndb/test/crund/tws/tws_java/run.properties -storage/ndb/test/crund/tws/*.properties -storage/ndb/test/crund/tws/tws_cpp/TwsDriver - -libmysqld/examples/mysqltest.cc -libmysqld/sql_signal.cc -libmysqld/debug_sync.cc -dbug/tests -libmysqld/mdl.cc -client/transaction.h -libmysqld/transaction.cc -libmysqld/sys_vars.cc -libmysqld/keycaches.cc -client/dtoa.c -libmysqld/opt_trace.cc -libmysqld/sql_audit.cc -storage/archive/archive_performance -storage/archive/concurrency_test -libmysql_r/client_settings.h -libmysqld/scheduler.cc -libmysqld/sql_connect.cc -libmysqld/sql_tablespace.cc -mysql-test/dump.txt -configure.am -run_collection*.cmake -configure.am -run_collection*.cmake -cmake_install.cmake -CMakeFiles.cmake -CPackConfig.cmake -CPackSourceConfig.cmake -CTestTestfile.cmake -make_dist.cmake -_CPack_Packages -merge_archives*.cmake -libmysqld/des_key_file.cc -CPackConfig.cmake -CPackSourceConfig.cmake -make_dist.cmake -client/echo -libmysql/libmysql_exports_file.cc -libmysql/merge_archives_mysqlclient.cmake -libmysqld/merge_archives_mysqlserver.cmake -libmysqld/mysqlserver_depends.c -libmysqld/examples/mysql_embedded -libmysqld/sql_bootstrap.cc -sql/dummy.bak -mysys/thr_lock -mysys/queues -libmysqld/binlog.cc -libmysqld/sql_alter.cc -libmysqld/sql_partition_admin.cc -generated -doxyerror.log -VERSION.dep -info_macros.cmake -Docs/INFO_BIN -Docs/INFO_SRC -Testing -FilesCopied -source_downloads -client/mysql_plugin -support-files/plugins.files -storage/perfschema/pfs_lex_token.h -storage/perfschema/gen_pfs_lex_token -sql/share/bulgarian -/GPATH -/GRTAGS -/GTAGS -sql/lex_token.h -sql/gen_lex_token -mysql-test/test_results.subunit diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/atomic_stat.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/atomic_stat.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/atomic_stat.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/atomic_stat.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,94 @@ +/* This is an atomic integer abstract data type, for high-performance + tracking of a single stat. It intentionally permits inconsistent + atomic operations and reads, for better performance. This means + that, though no data should ever be lost by this stat, reads of it + at any time may not include all changes up to any particular point. + + So, values read from these may only be approximately correct. + + If your use-case will fail under these conditions, do not use this. + + Copyright (C) 2012 - 2014 Steaphan Greene + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor + Boston, MA 02110-1301, USA. +*/ + +#ifndef _atomic_stat_h_ +#define _atomic_stat_h_ + +#include + +template < typename TYPE > +class atomic_stat { +public: + // Initialize value to the default for the type + atomic_stat() : value_(TYPE()) {}; + + // This enforces a strict order, as all absolute sets should + void clear() { + value_.store(TYPE(), std::memory_order_seq_cst); + }; + + // Reads can get any valid value, it doesn't matter which, exactly + TYPE load() const { + return value_.load(std::memory_order_relaxed); + }; + + // This only supplies relative arithmetic operations + // These are all done atomically, and so can show up in any order + void inc(const TYPE &other) { + value_.fetch_add(other, std::memory_order_relaxed); + }; + + void dec(const TYPE &other) { + value_.fetch_sub(other, std::memory_order_relaxed); + }; + + void inc() { + value_.fetch_add(1, std::memory_order_relaxed); + }; + + void dec() { + value_.fetch_sub(1, std::memory_order_relaxed); + }; + + // This will make one attempt to set the value to the max of + // the current value, and the passed-in value. It can fail + // for any reason, and we only try it once. + void set_max_maybe(const TYPE &new_val) { + TYPE old_val = value_; + if (new_val > old_val) { + value_.compare_exchange_weak(old_val, new_val, + std::memory_order_relaxed, + std::memory_order_relaxed); + } + }; + + // This will make one attempt to assign the value to the passed-in + // value. It can fail for any reason, and we only try it once. + void set_maybe(const TYPE &new_val) { + TYPE old_val = value_; + value_.compare_exchange_weak(old_val, new_val, + std::memory_order_relaxed, + std::memory_order_relaxed); + }; + +private: + std::atomic value_; +}; + +#endif // _atomic_stat_h_ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/byte_order_generic_x86_64.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/byte_order_generic_x86_64.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/byte_order_generic_x86_64.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/byte_order_generic_x86_64.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/byte_order_generic_x86.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/byte_order_generic_x86.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/byte_order_generic_x86.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/byte_order_generic_x86.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/lf.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/lf.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/lf.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/lf.h 2017-10-19 04:25:29.000000000 +0000 @@ -16,7 +16,10 @@ #ifndef _lf_h #define _lf_h -#include +#include "my_global.h" +#include "my_atomic.h" +#include "my_sys.h" +#include "hash.h" C_MODE_START @@ -111,13 +114,12 @@ typedef struct { void * volatile pin[LF_PINBOX_PINS]; LF_PINBOX *pinbox; - void **stack_ends_here; void *purgatory; uint32 purgatory_count; uint32 volatile link; /* we want sizeof(LF_PINS) to be 64 to avoid false sharing */ -#if SIZEOF_INT*2+SIZEOF_CHARP*(LF_PINBOX_PINS+3) != 64 - char pad[64-sizeof(uint32)*2-sizeof(void*)*(LF_PINBOX_PINS+3)]; +#if SIZEOF_INT*2+SIZEOF_CHARP*(LF_PINBOX_PINS+2) != 64 + char pad[64-sizeof(uint32)*2-sizeof(void*)*(LF_PINBOX_PINS+2)]; #endif } LF_PINS; @@ -211,15 +213,6 @@ (pins), &pins->pinbox->pinarray.lock) -C_MODE_END - -/* - extendible hash, lf_hash.c -*/ -#include - -C_MODE_START - #define LF_HASH_UNIQUE 1 /* lf_hash overhead per element (that is, sizeof(LF_SLIST) */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_base.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_base.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_base.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_base.h 2017-10-19 04:25:29.000000000 +0000 @@ -488,7 +488,8 @@ #define HA_ERR_TEMP_FILE_WRITE_FAILURE 189 /* Temporary file write failure */ #define HA_ERR_INNODB_FORCED_RECOVERY 190 /* Innodb is in force recovery mode */ #define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE 191 /* Too many words in a phrase */ -#define HA_ERR_LAST 191 /* Copy of last error nr */ +#define HA_ERR_DEST_SCHEMA_NOT_EXIST 192 /* Destination schema does not exist */ +#define HA_ERR_LAST 192 /* Copy of last error nr */ /* Number of different errors */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_default.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_default.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_default.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_default.h 2017-10-19 04:25:29.000000000 +0000 @@ -30,6 +30,7 @@ extern const char *my_defaults_group_suffix; extern const char *my_defaults_file; extern my_bool my_getopt_use_args_separator; +extern my_bool my_defaults_read_login_file; /* Define the type of function to be passed to process_default_option_files */ typedef int (*Process_option_func)(void *ctx, const char *group_name, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_io_perf.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_io_perf.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_io_perf.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_io_perf.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,143 @@ +/* Copyright (c) 2016, Percona and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef _io_perf_h_ +#define _io_perf_h_ + +#include "atomic_stat.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Per-table operation and IO statistics */ + +/* Struct used for IO performance counters within a single thread */ +struct my_io_perf_struct { + ulonglong bytes; + ulonglong requests; + ulonglong svc_time; /*!< time to do read or write operation */ + ulonglong svc_time_max; + ulonglong wait_time; /*!< total time in the request array */ + ulonglong wait_time_max; + ulonglong slow_ios; /*!< requests that take too long */ + + /* Initialize a my_io_perf_t struct. */ + inline void init() { + memset(this, 0, sizeof(*this)); + } + + /* Sets this to a - b in diff */ + inline void diff(const my_io_perf_struct& a, const my_io_perf_struct& b) { + if (a.bytes > b.bytes) + bytes = a.bytes - b.bytes; + else + bytes = 0; + + if (a.requests > b.requests) + requests = a.requests - b.requests; + else + requests = 0; + + if (a.svc_time > b.svc_time) + svc_time = a.svc_time - b.svc_time; + else + svc_time = 0; + + if (a.wait_time > b.wait_time) + wait_time = a.wait_time - b.wait_time; + else + wait_time = 0; + + if (a.slow_ios > b.slow_ios) + slow_ios = a.slow_ios - b.slow_ios; + else + slow_ios = 0; + + svc_time_max = std::max(a.svc_time_max, b.svc_time_max); + wait_time_max = std::max(a.wait_time_max, b.wait_time_max); + } + + /* Accumulates io perf values */ + inline void sum(const my_io_perf_struct& that) { + bytes += that.bytes; + requests += that.requests; + svc_time += that.svc_time; + svc_time_max = std::max(svc_time_max, that.svc_time_max); + wait_time += that.wait_time; + wait_time_max = std::max(wait_time_max, that.wait_time_max); + slow_ios += that.slow_ios; + } +}; +typedef struct my_io_perf_struct my_io_perf_t; + +/* Struct used for IO performance counters, shared among multiple threads */ +struct my_io_perf_atomic_struct { + atomic_stat bytes; + atomic_stat requests; + atomic_stat svc_time; /*!< time to do read or write operation */ + atomic_stat svc_time_max; + atomic_stat wait_time; /*!< total time in the request array */ + atomic_stat wait_time_max; + atomic_stat slow_ios; /*!< requests that take too long */ + + /* Initialize an my_io_perf_atomic_t struct. */ + inline void init() { + bytes.clear(); + requests.clear(); + svc_time.clear(); + svc_time_max.clear(); + wait_time.clear(); + wait_time_max.clear(); + slow_ios.clear(); + } + + /* Accumulates io perf values using atomic operations */ + inline void sum(const my_io_perf_struct& that) { + bytes.inc(that.bytes); + requests.inc(that.requests); + + svc_time.inc(that.svc_time); + wait_time.inc(that.wait_time); + + // In the unlikely case that two threads attempt to update the max + // value at the same time, only the first will succeed. It's possible + // that the second thread would have set a larger max value, but we + // would rather error on the side of simplicity and avoid looping the + // compare-and-swap. + svc_time_max.set_max_maybe(that.svc_time); + wait_time_max.set_max_maybe(that.wait_time); + + slow_ios.inc(that.slow_ios); + } + + /* These assignments allow for races. That is OK. */ + inline void set_maybe(const my_io_perf_struct& that) { + bytes.set_maybe(that.bytes); + requests.set_maybe(that.requests); + svc_time.set_maybe(that.svc_time); + svc_time_max.set_maybe(that.svc_time_max); + wait_time.set_maybe(that.wait_time); + wait_time_max.set_maybe(that.wait_time_max); + slow_ios.set_maybe(that.slow_ios); + } +}; +typedef struct my_io_perf_atomic_struct my_io_perf_atomic_t; + +#ifdef __cplusplus +} +#endif +#endif diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_pthread.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_pthread.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_pthread.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_pthread.h 2017-10-19 04:25:29.000000000 +0000 @@ -864,7 +864,6 @@ my_bool init; struct st_my_thread_var *next,**prev; void *opt_info; - void *stack_ends_here; #ifndef DBUG_OFF void *dbug; char name[THREAD_NAME_SIZE+1]; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql/plugin.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql/plugin.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql/plugin.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql/plugin.h 2017-10-19 04:25:29.000000000 +0000 @@ -695,7 +695,6 @@ int thd_command(const MYSQL_THD thd); long long thd_start_time(const MYSQL_THD thd); void thd_kill(unsigned long id); -#define EXTENDED_FOR_KILLIDLE #ifdef __cplusplus } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql_com.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql_com.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql_com.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql_com.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -26,6 +26,7 @@ #define USERNAME_CHAR_LENGTH 16 #define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) #define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) +#define CONNECT_STRING_MAXLEN 1024 #define MYSQL_AUTODETECT_CHARSET_NAME "auto" diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -175,7 +175,8 @@ MYSQL_OPT_CONNECT_ATTR_DELETE, MYSQL_SERVER_PUBLIC_KEY, MYSQL_ENABLE_CLEARTEXT_PLUGIN, - MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS + MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, + MYSQL_OPT_SSL_MODE }; /** @@ -245,6 +246,11 @@ MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; +enum mysql_ssl_mode +{ + SSL_MODE_REQUIRED= 3 +}; + typedef struct character_set { unsigned int number; /* character set number */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql.h.pp percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql.h.pp --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/mysql.h.pp 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/mysql.h.pp 2017-10-19 04:25:29.000000000 +0000 @@ -272,7 +272,8 @@ MYSQL_OPT_CONNECT_ATTR_DELETE, MYSQL_SERVER_PUBLIC_KEY, MYSQL_ENABLE_CLEARTEXT_PLUGIN, - MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS + MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, + MYSQL_OPT_SSL_MODE }; struct st_mysql_options_extention; struct st_mysql_options { @@ -319,6 +320,10 @@ MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; +enum mysql_ssl_mode +{ + SSL_MODE_REQUIRED= 3 +}; typedef struct character_set { unsigned int number; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_sys.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_sys.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/my_sys.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/my_sys.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,6 +49,7 @@ #ifdef _WIN32 #include /*for alloca*/ #endif +#include #define MY_INIT(name) { my_progname= name; my_init(); } @@ -512,6 +513,16 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); +/* + Subset of struct stat fields filled by stat/lstat/fstat that uniquely + identify a file +*/ +typedef struct st_file_id +{ + dev_t st_dev; + ino_t st_ino; +} ST_FILE_ID; + typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...) ATTRIBUTE_FORMAT_FPTR(printf, 2, 3); @@ -594,8 +605,9 @@ extern int my_close(File Filedes,myf MyFlags); extern int my_mkdir(const char *dir, int Flags, myf MyFlags); extern int my_readlink(char *to, const char *filename, myf MyFlags); -extern int my_is_symlink(const char *filename); +extern int my_is_symlink(const char *filename, ST_FILE_ID *file_id); extern int my_realpath(char *to, const char *filename, myf MyFlags); +extern int my_is_same_file(File file, const ST_FILE_ID *file_id); extern File my_create_with_symlink(const char *linkname, const char *filename, int createflags, int access_flags, myf MyFlags); @@ -716,7 +728,6 @@ extern size_t system_filename(char * to,const char *from); extern size_t unpack_filename(char * to,const char *from); extern char * intern_filename(char * to,const char *from); -extern char * directory_file_name(char * dst, const char *src); extern int pack_filename(char * to, const char *name, size_t max_length); extern char * my_path(char * to,const char *progname, const char *own_pathname_part); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/sql_common.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/sql_common.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/sql_common.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/sql_common.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef SQL_COMMON_INCLUDED #define SQL_COMMON_INCLUDED -/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -52,6 +52,7 @@ char *server_public_key_path; size_t connection_attributes_length; my_bool enable_cleartext_plugin; + unsigned int ssl_mode; }; typedef struct st_mysql_methods diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/sslopt-case.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/sslopt-case.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/sslopt-case.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/sslopt-case.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef SSLOPT_CASE_INCLUDED #define SSLOPT_CASE_INCLUDED -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ exit(1); } else - opt_ssl_required= 1; + opt_ssl_mode= SSL_MODE_REQUIRED; break; #endif /* MYSQL_CLIENT */ #endif diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/sslopt-vars.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/sslopt-vars.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/sslopt-vars.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/sslopt-vars.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef SSLOPT_VARS_INCLUDED #define SSLOPT_VARS_INCLUDED -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,10 +33,10 @@ #ifdef MYSQL_CLIENT SSL_STATIC my_bool opt_ssl_verify_server_cert= 0; -SSL_STATIC my_bool opt_ssl_required= 0; +SSL_STATIC uint opt_ssl_mode= 0; #endif /* MYSQL_CLIENT */ #else /* HAVE_OPENSSL */ -#define opt_ssl_required 0 +#define opt_ssl_mode 0 #endif /* HAVE_OPENSSL */ #endif /* SSLOPT_VARS_INCLUDED */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/include/welcome_copyright_notice.h percona-xtradb-cluster-5.6-5.6.37-26.21/include/welcome_copyright_notice.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/include/welcome_copyright_notice.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/include/welcome_copyright_notice.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2016" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2017" /* This define specifies copyright notice which is displayed by every MySQL diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/libmysql/libmysql.c percona-xtradb-cluster-5.6-5.6.37-26.21/libmysql/libmysql.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/libmysql/libmysql.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/libmysql/libmysql.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4726,10 +4726,14 @@ mysql->status= MYSQL_STATUS_READY; } int4store(buff, stmt->stmt_id); - if ((rc= stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt))) - { - set_stmt_errmsg(stmt, &mysql->net); - } + /* + If stmt_command failed, it would have already raised + error using set_mysql_error. Caller should use + mysql_error() or mysql_errno() to find out details. + Memory allocated for stmt will be released regardless + of the error. + */ + rc= stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt); } } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/comp_err.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/comp_err.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/comp_err.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/comp_err.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBcomp_err\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBCOMP_ERR\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBCOMP_ERR\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -241,7 +241,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/innochecksum.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/innochecksum.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/innochecksum.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/innochecksum.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBinnochecksum\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBINNOCHECKSUM\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBINNOCHECKSUM\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -39,15 +39,18 @@ InnoDB files\&. This tool reads an InnoDB -tablespace file, calculates the checksum for each page, compares the calculated checksum to the stored checksum, and reports mismatches, which indicate damaged pages\&. It was originally developed to speed up verifying the integrity of tablespace files after power outages but can also be used after file copies\&. Because checksum mismatches will cause +tablespace file, calculates the checksum for each page, compares the calculated checksum to the stored checksum, and reports mismatches, which indicate damaged pages\&. It was originally developed to speed up verifying the integrity of tablespace files after power outages but can also be used after file copies\&. Because checksum mismatches cause InnoDB -to deliberately shut down a running server, it can be preferable to use this tool rather than waiting for a server in production usage to encounter the damaged pages\&. As of MySQL 5\&.6\&.16, +to deliberately shut down a running server, it may be preferable to use this tool rather than waiting for an in\-production server to encounter the damaged pages\&. As of MySQL 5\&.6\&.16, \fBinnochecksum\fR supports files greater than 2GB in size\&. Previously, \fBinnochecksum\fR only supported files up to 2GB in size\&. .PP \fBinnochecksum\fR +does not support tablespaces that contain compressed pages\&. +.PP +\fBinnochecksum\fR cannot be used on tablespace files that the server already has open\&. For such files, you should use CHECK TABLE to check tables within the tablespace\&. @@ -153,7 +156,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/msql2mysql.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/msql2mysql.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/msql2mysql.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/msql2mysql.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmsql2mysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMSQL2MYSQL\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMSQL2MYSQL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -84,7 +84,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisamchk.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisamchk.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisamchk.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisamchk.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamchk\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMCHK\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMCHK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -975,7 +975,7 @@ \fB\-k \fR\fB\fIval\fR\fR .sp For -\fBmyisamchk\fR, the option value is a bit\-value that indicates which indexes to update\&. Each binary bit of the option value corresponds to a table index, where the first index is bit 0\&. An option value of 0 disables updates to all indexes, which can be used to get faster inserts\&. Deactivated indexes can be reactivated by using +\fBmyisamchk\fR, the option value is a bit value that indicates which indexes to update\&. Each binary bit of the option value corresponds to a table index, where the first index is bit 0\&. An option value of 0 disables updates to all indexes, which can be used to get faster inserts\&. Deactivated indexes can be reactivated by using \fBmyisamchk \-r\fR\&. .RE .sp @@ -1142,7 +1142,7 @@ TMPDIR environment variable\&. \fB\-\-tmpdir\fR -can be set to a list of directory paths that are used successively in round\-robin fashion for creating temporary files\&. The separator character between directory names is the colon (\(lq:\(rq) on Unix and the semicolon (\(lq;\(rq) on Windows\&. +can be set to a list of directory paths that are used successively in round\-robin fashion for creating temporary files\&. The separator character between directory names is the colon (:) on Unix and the semicolon (;) on Windows\&. .RE .sp .RS 4 @@ -1379,7 +1379,7 @@ PRIMARY KEY (id), INDEX (last_name, first_name), INDEX (birth) -) MAX_ROWS = 1000000; +) MAX_ROWS = 1000000 ENGINE=MYISAM; .fi .if n \{\ .RE @@ -2463,7 +2463,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisam_ftdump.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisam_ftdump.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisam_ftdump.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisam_ftdump.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmyisam_ftdump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAM_FTDUMP\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAM_FTDUMP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -238,7 +238,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisamlog.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisamlog.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisamlog.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisamlog.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMLOG\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMLOG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -227,7 +227,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisampack.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisampack.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/myisampack.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/myisampack.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmyisampack\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMPACK\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMPACK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -825,7 +825,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/my_print_defaults.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/my_print_defaults.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/my_print_defaults.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/my_print_defaults.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmy_print_defaults\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMY_PRINT_DEFAULTS" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMY_PRINT_DEFAULTS" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -220,7 +220,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -66,14 +66,15 @@ .RS 4 .\} .nf -shell> \fBmysql \-\-user=\fR\fB\fIuser_name\fR\fR\fB \-\-password=\fR\fB\fIyour_password\fR\fR\fB \fR\fB\fIdb_name\fR\fR +shell> \fBmysql \-\-user=\fR\fB\fIuser_name\fR\fR\fB \-\-password \fR\fB\fIdb_name\fR\fR +Enter password: \fIyour_password\fR .fi .if n \{\ .RE .\} .PP Then type an SQL statement, end it with -\(lq;\(rq, +;, \eg, or \eG and press Enter\&. @@ -216,6 +217,24 @@ .sp -1 .IP \(bu 2.3 .\} +\fB\-\-binary\-as\-hex\fR, +\fB\-b\fR +.sp +When this option is given, +\fBmysql\fR +displays binary data using hexadecimal notation (0x\fIvalue\fR)\&. This occurs whether the overall output dislay format is tabular, vertical, HTML, or XML\&. +.sp +This option was added in MySQL 5\&.6\&.37\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-binary\-mode\fR .sp This option helps when processing @@ -313,7 +332,11 @@ \fB\-\-comments\fR, \fB\-c\fR .sp -Whether to preserve comments in statements sent to the server\&. The default is \-\-skip\-comments (discard comments), enable with \-\-comments (preserve comments)\&. +Whether to preserve comments in statements sent to the server\&. The default is +\fB\-\-skip\-comments\fR +(discard comments), enable with +\fB\-\-comments\fR +(preserve comments)\&. .RE .sp .RS 4 @@ -443,7 +466,7 @@ client by default uses another\&. In this case, output may be formatted incorrectly\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&. .sp For more information, see -Section\ \&10.1.5, \(lqConnection Character Sets and Collations\(rq, and +Section\ \&10.1.4, \(lqConnection Character Sets and Collations\(rq, and Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. .RE .sp @@ -519,7 +542,7 @@ .\} \fB\-\-delimiter=\fR\fB\fIstr\fR\fR .sp -Set the statement delimiter\&. The default is the semicolon character (\(lq;\(rq)\&. +Set the statement delimiter\&. The default is the semicolon character (;)\&. .RE .sp .RS 4 @@ -534,7 +557,7 @@ .sp Disable named commands\&. Use the \e* -form only, or use named commands only at the beginning of a line ending with a semicolon (\(lq;\(rq)\&. +form only, or use named commands only at the beginning of a line ending with a semicolon (;)\&. \fBmysql\fR starts with this option \fIenabled\fR @@ -555,7 +578,7 @@ Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -689,15 +712,15 @@ Enable or disable LOCAL capability for -LOAD DATA INFILE\&. With no value, the option enables +LOAD DATA INFILE\&. For +\fBmysql\fR, this capability is disabled by default\&. With no value, the option enables LOCAL\&. The option may be given as \fB\-\-local\-infile=0\fR or \fB\-\-local\-infile=1\fR to explicitly disable or enable -LOCAL\&. Enabling -LOCAL -has no effect if the server does not also support it\&. +LOCAL\&. Enabling local data loading has no effect if the server does not also support it; see +Section\ \&6.1.6, \(lqSecurity Issues with LOAD DATA LOCAL\(rq .RE .sp .RS 4 @@ -1205,12 +1228,9 @@ For additional discussion regarding use of the sha256_password plugin, including how to get the RSA public key, see -Section\ \&6.5.1.4, \(lqThe SHA-256 Authentication Plugin\(rq\&. +Section\ \&6.5.1.4, \(lqSHA-256 Pluggable Authentication\(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 -and renamed in 5\&.6\&.7 to -\fB\-\-server\-public\-key\-path\fR\&. +This option is available only if MySQL was built using OpenSSL\&. .RE .sp .RS 4 @@ -1748,11 +1768,11 @@ .sp Change the string that \fBmysql\fR -interprets as the separator between SQL statements\&. The default is the semicolon character (\(lq;\(rq)\&. +interprets as the separator between SQL statements\&. The default is the semicolon character (;)\&. .sp The delimiter string can be specified as an unquoted or quoted argument on the delimiter -command line\&. Quoting can be done with either single quote (\*(Aq), double quote ("), or backtick (`) characters\&. To include a quote within a quoted string, either quote the string with a different quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delimiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&. +command line\&. Quoting can be done with either single quote (\*(Aq), double quote ("), or backtick (`) characters\&. To include a quote within a quoted string, either quote the string with a different quote character or escape the quote with a backslash (\e) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delimiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&. .sp \fBmysql\fR interprets instances of the delimiter string as a statement delimiter anywhere it occurs, except within quoted strings\&. Be careful about defining a delimiter that might occur within other words\&. For example, if you define the delimiter as @@ -1768,8 +1788,8 @@ When the delimiter recognized by \fBmysql\fR is set to something other than the default of -\(lq;\(rq, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets -\(lq;\(rq +;, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets +; as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see Section\ \&23.8.17, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see Section\ \&20.1, \(lqDefining Stored Programs\(rq)\&. @@ -2449,7 +2469,7 @@ T{ \e\e T}:T{ -A literal \(lq\e\(rq backslash character +A literal \e backslash character T} T{ \e\fIx\fR @@ -2921,9 +2941,9 @@ .\} .PP The search string can contain the wildcard characters -\(lq%\(rq +% and -\(lq_\(rq\&. These have the same meaning as for pattern\-matching operations performed with the +_\&. These have the same meaning as for pattern\-matching operations performed with the LIKE operator\&. For example, HELP rep% @@ -3390,7 +3410,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlaccess.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlaccess.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlaccess.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlaccess.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlaccess\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLACCESS\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLACCESS\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -51,7 +51,7 @@ .RE .PP \fBmysqlaccess\fR -is a diagnostic tool that Yves Carlier has provided for the MySQL distribution\&. It checks the access privileges for a host name, user name, and database combination\&. Note that +is a diagnostic tool that Yves Carlier has provided for the MySQL distribution\&. It checks the access privileges for a host name, user name, and database combination\&. \fBmysqlaccess\fR checks access using only the user @@ -77,8 +77,45 @@ .RE .\} .PP +When \fBmysqlaccess\fR -supports the following options\&. +runs, it loads and executes the contents of its configuration file, +mysqlaccess\&.conf\&. +\fBmysqlaccess\fR +looks for the configuration file in these locations, in order: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The directory named by the +\fBSYSCONFDIR\fR +option to +\fBCMake\fR +when MySQL was built\&. By default, this is the +etc +directory located under the compiled\-in installation directory\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The +/etc +directory\&. +.RE +.PP +\fBmysqlaccess\fR +supports the options shown in the following table\&. .sp .RS 4 .ie n \{\ @@ -407,7 +444,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqladmin.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqladmin.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqladmin.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqladmin.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqladmin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLADMIN\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLADMIN\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -785,7 +785,7 @@ Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -1230,7 +1230,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlbinlog.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlbinlog.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlbinlog.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlbinlog.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbinlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBINLOG\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1138,7 +1138,7 @@ .sp This option is supported only by the versions of \fBmysqlbinlog\fR -supplied with the MySQL Cluster distribution, or built from the MySQL Cluster sources\&. +supplied with the NDB Cluster distribution, or built from the NDB Cluster sources\&. .RE .sp .RS 4 @@ -1240,6 +1240,22 @@ .sp -1 .IP \(bu 2.3 .\} +\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.4.5, \(lqCommand Options for Secure Connections\(rq\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \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 @@ -2886,7 +2902,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlbug.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlbug.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlbug.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlbug.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbug\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBUG\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBUG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlcheck.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlcheck.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlcheck.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlcheck.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlcheck\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLCHECK\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLCHECK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -105,7 +105,7 @@ If \fBmysqlcheck\fR is unable to repair a table, see -Section\ \&2.11.4, \(lqRebuilding or Repairing Tables or Indexes\(rq +Section\ \&2.11.3, \(lqRebuilding or Repairing Tables or Indexes\(rq for manual table repair strategies\&. This will be the case, for example, for InnoDB tables, which can be checked with @@ -554,7 +554,7 @@ Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) .sp This option was added in MySQL 5\&.6\&.28\&. .RE @@ -1062,7 +1062,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_client_test.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_client_test.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_client_test.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_client_test.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_client_test\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/16/2016 +.\" Date: 06/01/2017 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL_CLIENT_TEST" "1" "09/16/2016" "MySQL" "MySQL Database System" +.TH "\FBMYSQL_CLIENT_TEST" "1" "06/01/2017" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -43,8 +43,11 @@ program is used for testing aspects of the MySQL client API that cannot be tested using \fBmysqltest\fR and its test language\&. +\fBmysql_client_test\fR +is run as part of the test suite\&. +.PP \fBmysql_client_test_embedded\fR -is similar but used for testing the embedded server\&. Both programs are run as part of the test suite\&. +is similar but is used for testing the embedded server\&. This program is available only prior to MySQL 8\&.0\&. .PP The source code for the programs can be found in in tests/mysql_client_test\&.c @@ -208,7 +211,7 @@ \fB\-\-server\-arg=\fR\fB\fIarg\fR\fR, \fB\-A \fR\fB\fIarg\fR\fR .sp -Argument to send to the embedded server\&. +Argument to send to the embedded server\&. This option was removed in MySQL 8\&.0\&. .RE .sp .RS 4 @@ -303,7 +306,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_config.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_config.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_config.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_config.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -93,9 +93,11 @@ .IP \(bu 2.3 .\} \fB\-\-libmysqld\-libs\fR, +\fB\-\-embedded\-libs\fR, \fB\-\-embedded\fR .sp -Libraries and options required to link with the MySQL embedded server\&. +Libraries and options required to link with +libmysqld, the MySQL embedded server\&. .RE .sp .RS 4 @@ -251,7 +253,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_config_editor.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_config_editor.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_config_editor.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_config_editor.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config_editor\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG_EDIT" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG_EDIT" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1064,7 +1064,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_convert_table_format.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_convert_table_format.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_convert_table_format.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_convert_table_format.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_convert_table_format\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONVERT_TAB" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONVERT_TAB" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -59,7 +59,7 @@ and DBD::mysql Perl modules be installed (see -Section\ \&2.13, \(lqPerl Installation Notes\(rq)\&. +Section\ \&2.12, \(lqPerl Installation Notes\(rq)\&. .PP Invoke \fBmysql_convert_table_format\fR @@ -131,7 +131,7 @@ .\} \fB\-\-password=\fR\fB\fIpassword\fR\fR .sp -The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&. +The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MySQL programs\&. .sp Specifying a password on the command line should be considered insecure\&. See Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. @@ -220,7 +220,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqld.8 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqld.8 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqld.8 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqld.8 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD\FR" "8" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -60,7 +60,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqld_multi.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqld_multi.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqld_multi.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqld_multi.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_multi\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_MULTI\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_MULTI\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -435,16 +435,6 @@ \fInot\fR give you extra performance in a threaded system\&. See Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .if n \{\ .sp .\} @@ -658,7 +648,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqld_safe.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqld_safe.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqld_safe.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqld_safe.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_safe\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_SAFE\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_SAFE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -169,7 +169,12 @@ .\} \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\&. +Read this option file in addition to the usual option files\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. This must be the first option on the command line if it is used\&. +.sp +For additional information about this option, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -182,7 +187,12 @@ .\} \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\&. +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. This must be the first option on the command line if it is used\&. +.sp +For additional information about this option, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -198,6 +208,8 @@ If \fBmysqld_safe\fR cannot find the server, use this option to indicate the path name to the directory where the server is located\&. +.sp +As of MySQL 5\&.6\&.35, this option is accepted only on the command line, not in option files\&. .RE .sp .RS 4 @@ -386,7 +398,7 @@ \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\&. +As of MySQL 5\&.6\&.33, this option is accepted only on the command line, not in option files\&. .RE .sp .RS 4 @@ -419,7 +431,7 @@ 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\&. +As of MySQL 5\&.6\&.33, this option is accepted only on the command line, not in option files\&. .RE .sp .RS 4 @@ -447,7 +459,12 @@ .\} \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\&. +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. This must be the first option on the command line if it is used\&. +.sp +For additional information about this option, see +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -495,7 +512,9 @@ .\} \fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR .sp -The path name of the process ID file\&. +The path name that +\fBmysqld\fR +should use for its process ID file\&. .RE .sp .RS 4 @@ -828,7 +847,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqldump.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqldump.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqldump.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqldump.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqldump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLDUMP\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLDUMP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -277,7 +277,7 @@ .\} .PP However, UTF\-16 is not permitted as a connection character set (see -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 +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 \fB\-\-result\-file\fR option, which creates the output in ASCII format: .sp @@ -462,7 +462,7 @@ Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) .sp This option was added in MySQL 5\&.6\&.28\&. .RE @@ -899,7 +899,7 @@ Adds to a table dump all SQL statements needed to create any tablespaces used by an NDB table\&. This information is not otherwise included in the output from -\fBmysqldump\fR\&. This option is currently relevant only to MySQL Cluster tables\&. +\fBmysqldump\fR\&. This option is currently relevant only to NDB Cluster tables\&. .RE .sp .RS 4 @@ -1677,11 +1677,11 @@ \fB\-Q\fR .sp Quote identifiers (such as database, table, and column names) within -\(lq`\(rq +` characters\&. If the ANSI_QUOTES SQL mode is enabled, identifiers are quoted within -\(lq"\(rq +" characters\&. This option is enabled by default\&. It can be disabled with \fB\-\-skip\-quote\-names\fR, but this option should be given after any option such as \fB\-\-compatible\fR @@ -1703,9 +1703,9 @@ Direct output to the named file\&. The result file is created and its previous contents overwritten, even if an error occurs while generating the dump\&. .sp This option should be used on Windows to prevent newline -\(lq\en\(rq +\en characters from being converted to -\(lq\er\en\(rq +\er\en carriage return/newline sequences\&. .RE .sp @@ -1745,9 +1745,9 @@ \fBmysqldump\fR is run on the same machine as the \fBmysqld\fR -server\&. Because the server creates files +server\&. Because the server creates *\&.txt -file in the directory that you specify, the directory must be writable by the server and the MySQL account that you use must have the +files in the directory that you specify, the directory must be writable by the server and the MySQL account that you use must have the FILE privilege\&. Because \fBmysqldump\fR @@ -2293,7 +2293,7 @@ and UNLOCK TABLES statements\&. This results in faster inserts when the dump file is reloaded\&. See -Section\ \&8.2.2.1, \(lqSpeed of INSERT Statements\(rq\&. +Section\ \&8.2.4.1, \(lqOptimizing INSERT Statements\(rq\&. .RE .sp .RS 4 @@ -2315,7 +2315,8 @@ \fIfor each database dumped\fR\&. The exception is when using \fB\-\-lock\-all\-tables\fR, \fB\-\-master\-data\fR, or -\fB\-\-single\-transaction\fR: In this case, the logs are flushed only once, corresponding to the moment that all tables are locked\&. If you want your dump and the log flush to happen at exactly the same moment, you should use +\fB\-\-single\-transaction\fR: In this case, the logs are flushed only once, corresponding to the moment that all tables are locked by +FLUSH TABLES WITH READ LOCK\&. If you want your dump and the log flush to happen at exactly the same moment, you should use \fB\-\-flush\-logs\fR together with \fB\-\-lock\-all\-tables\fR, @@ -2731,7 +2732,7 @@ option\&. .PP \fBmysqldump\fR -does not dump the MySQL Cluster +does not dump the NDB Cluster ndbinfo information database\&. .PP @@ -2751,7 +2752,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_find_rows.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_find_rows.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_find_rows.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_find_rows.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_find_rows\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIND_ROWS\F" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIND_ROWS\F" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -165,7 +165,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_fix_extensions.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_fix_extensions.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_fix_extensions.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_fix_extensions.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_fix_extensions\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIX_EXTENSI" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIX_EXTENSI" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -85,7 +85,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlhotcopy.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlhotcopy.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlhotcopy.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlhotcopy.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlhotcopy\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLHOTCOPY\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLHOTCOPY\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -107,7 +107,7 @@ .RE .\} .PP -The regular expression for the table name can be negated by prefixing it with a tilde (\(lq~\(rq): +The regular expression for the table name can be negated by prefixing it with a tilde (~): .sp .if n \{\ .RS 4 @@ -505,7 +505,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlimport.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlimport.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlimport.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlimport.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlimport\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLIMPORT\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLIMPORT\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -312,7 +312,7 @@ Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) .sp This option was added in MySQL 5\&.6\&.28\&. .RE @@ -425,7 +425,10 @@ \fB\-\-local\fR, \fB\-L\fR .sp -Read input files locally from the client host\&. +By default, files are read by the server on the server host\&. With this option, +\fBmysqlimport\fR +reads input files locally on the client host\&. Enabling local data loading has no effect if the server does not also support it; see +Section\ \&6.1.6, \(lqSecurity Issues with LOAD DATA LOCAL\(rq .RE .sp .RS 4 @@ -831,7 +834,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_install_db.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_install_db.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_install_db.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_install_db.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_install_db\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_INSTALL_DB\" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_INSTALL_DB\" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -549,7 +549,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_plugin.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_plugin.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_plugin.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_plugin.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_plugin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_PLUGIN\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_PLUGIN\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -347,7 +347,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_secure_installation.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_secure_installation.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_secure_installation.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_secure_installation.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_secure_installation\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SECURE_INST" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SECURE_INST" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -109,7 +109,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql.server.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql.server.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql.server.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql.server.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql.server\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\&.SERVER\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\&.SERVER\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,13 +34,21 @@ \fBmysql {start|stop}\fR .SH "DESCRIPTION" .PP -MySQL distributions on Unix include a script named -\fBmysql\&.server\fR, which starts the server using -\fBmysqld_safe\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the OS X Startup Item for MySQL\&. +MySQL distributions on Unix and Unix\-like system include a script named +\fBmysql\&.server\fR, which starts the MySQL server using +\fBmysqld_safe\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the macOS Startup Item for MySQL\&. +.PP +\fBmysql\&.server\fR +is the script name as used within the MySQL source tree\&. The installed name might be different; for example, +\fBmysqld\fR +or +\fBmysql\fR\&. In the following discussion, adjust the name +\fBmysql\&.server\fR +as appropriate for your system\&. .PP To start or stop the server manually using the \fBmysql\&.server\fR -script, invoke it with +script, invoke it from the command line with start or stop @@ -57,21 +65,20 @@ .RE .\} .PP -Before \fBmysql\&.server\fR -starts the server, it changes location to the MySQL installation directory, and then invokes +changes location to the MySQL installation directory, then invokes \fBmysqld_safe\fR\&. To run the server as some specific user, add an appropriate user option to the [mysqld] -group of the +group of the global /etc/my\&.cnf option file, as shown later in this section\&. (It is possible that you must edit \fBmysql\&.server\fR if you\*(Aqve installed a binary distribution of MySQL in a nonstandard location\&. Modify it to change location into the proper directory before it runs \fBmysqld_safe\fR\&. If you do this, your modified version of \fBmysql\&.server\fR -may be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&.) +may be overwritten if you upgrade MySQL in the future; make a copy of your edited version that you can reinstall\&.) .PP \fBmysql\&.server stop\fR stops the server by sending a signal to it\&. You can also stop the server manually by executing @@ -79,27 +86,44 @@ .PP To start and stop MySQL automatically on your server, you must add start and stop commands to the appropriate places in your /etc/rc* -files\&. -.PP +files: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} If you use the Linux server RPM package (MySQL\-server\-\fIVERSION\fR\&.rpm), or a native Linux package installation, the \fBmysql\&.server\fR script may be installed in the /etc/init\&.d directory with the name +mysqld +or mysql\&. See Section\ \&2.5.5, \(lqInstalling MySQL on Linux Using RPM Packages from Oracle\(rq, for more information on the Linux RPM packages\&. -.PP -Some vendors provide RPM packages that install a startup script under a different name such as -\fBmysqld\fR\&. -.PP +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} If you install MySQL from a source distribution or using a binary distribution format that does not install \fBmysql\&.server\fR -automatically, you can install it manually\&. The script can be found in the +automatically, you can install the script manually\&. It can be found in the support\-files -directory under the MySQL installation directory or in a MySQL source tree\&. Copy it to the +directory under the MySQL installation directory or in a MySQL source tree\&. Copy the script to the /etc/init\&.d directory with the name -\fBmysql\fR, and then make it executable: +\fBmysql\fR +and make it executable: .sp .if n \{\ .RS 4 @@ -112,40 +136,6 @@ .RE .\} .sp -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -Older Red Hat systems use the -/etc/rc\&.d/init\&.d -directory rather than -/etc/init\&.d\&. Adjust the preceding commands accordingly\&. Alternatively, first create -/etc/init\&.d -as a symbolic link that points to -/etc/rc\&.d/init\&.d: -.sp .5v -.RE -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBcd /etc\fR -shell> \fBln \-s rc\&.d/init\&.d \&.\fR -.fi -.if n \{\ -.RE -.\} -.PP After installing the script, the commands needed to activate it to run at system startup depend on your operating system\&. On Linux, you can use \fBchkconfig\fR: .sp @@ -158,7 +148,7 @@ .if n \{\ .RE .\} -.PP +.sp On some Linux systems, the following command also seems to be necessary to fully enable the \fBmysql\fR script: @@ -172,18 +162,36 @@ .if n \{\ .RE .\} -.PP +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} On FreeBSD, startup scripts generally should go in -/usr/local/etc/rc\&.d/\&. The -rc(8) -manual page states that scripts in this directory are executed only if their base name matches the -*\&.sh -shell file name pattern\&. Any other files or directories present within the directory are silently ignored\&. In other words, on FreeBSD, you should install the +/usr/local/etc/rc\&.d/\&. Install the mysql\&.server script as /usr/local/etc/rc\&.d/mysql\&.server\&.sh -to enable automatic startup\&. -.PP +to enable automatic startup\&. The +rc(8) +manual page states that scripts in this directory are executed only if their base name matches the +*\&.sh +shell file name pattern\&. Any other files or directories present within the directory are silently ignored\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} As an alternative to the preceding setup, some operating systems also use /etc/rc\&.local or @@ -199,8 +207,18 @@ .if n \{\ .RE .\} -.PP +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} For other systems, consult your operating system documentation to see how to install startup scripts\&. +.RE .PP \fBmysql\&.server\fR reads options from the @@ -217,7 +235,7 @@ in a global /etc/my\&.cnf file\&. A typical -/etc/my\&.cnf +my\&.cnf file might look like this: .sp .if n \{\ @@ -238,7 +256,7 @@ .PP The \fBmysql\&.server\fR -script supports the following options\&. If specified, they +script supports the options shown in the following table\&. If specified, they \fImust\fR be placed in an option file, not on the command line\&. \fBmysql\&.server\fR @@ -248,6 +266,57 @@ stop as command\-line arguments\&. .sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&4.3.\ \&mysql\&.server Option\-File Options +.TS +allbox tab(:); +lB lB lB. +T{ +Option Name +T}:T{ +Description +T}:T{ +Type +T} +.T& +l l l +l l l +l l l +l l l. +T{ +basedir +T}:T{ +Path to MySQL installation directory +T}:T{ +directory name +T} +T{ +datadir +T}:T{ +Path to MySQL data directory +T}:T{ +directory name +T} +T{ +pid\-file +T}:T{ +File in which server should write its process ID +T}:T{ +file name +T} +T{ +service\-startup\-timeout +T}:T{ +How long to wait for server startup +T}:T{ +integer +T} +.TE +.sp 1 +.sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c @@ -256,7 +325,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR +\fBbasedir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL installation directory\&. .RE @@ -269,7 +338,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR +\fBdatadir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL data directory\&. .RE @@ -282,7 +351,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR +\fBpid\-file=\fR\fB\fIfile_name\fR\fR .sp The path name of the file in which the server should write its process ID\&. .sp @@ -301,7 +370,7 @@ [mysqld_safe] group, you can ensure that \fBmysqld_safe\fR -gets the same value when invoke using +gets the same value when invoked from \fBmysql\&.server\fR as when invoked manually by putting the same pid\-file @@ -320,7 +389,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-service\-startup\-timeout=\fR\fB\fIseconds\fR\fR +\fBservice\-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, \fBmysql\&.server\fR @@ -329,7 +398,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_setpermission.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_setpermission.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_setpermission.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_setpermission.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_setpermission\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SETPERMISSI" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SETPERMISSI" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -58,7 +58,7 @@ and DBD::mysql Perl modules be installed (see -Section\ \&2.13, \(lqPerl Installation Notes\(rq)\&. +Section\ \&2.12, \(lqPerl Installation Notes\(rq)\&. .PP Invoke \fBmysql_setpermission\fR @@ -127,7 +127,7 @@ .\} \fB\-\-password=\fR\fB\fIpassword\fR\fR .sp -The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&. +The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MySQL programs\&. .sp Specifying a password on the command line should be considered insecure\&. See Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. @@ -175,7 +175,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlshow.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlshow.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlshow.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlshow.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlshow\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSHOW\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSHOW\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -95,23 +95,23 @@ .PP The output displays only the names of those databases, tables, or columns for which you have some privileges\&. .PP -If the last argument contains shell or SQL wildcard characters (\(lq*\(rq, -\(lq?\(rq, -\(lq%\(rq, or -\(lq_\(rq), only those names that are matched by the wildcard are shown\&. If a database name contains any underscores, those should be escaped with a backslash (some Unix shells require two) to get a list of the proper tables or columns\&. -\(lq*\(rq +If the last argument contains shell or SQL wildcard characters (*, +?, +%, or +_), only those names that are matched by the wildcard are shown\&. If a database name contains any underscores, those should be escaped with a backslash (some Unix shells require two) to get a list of the proper tables or columns\&. +* and -\(lq?\(rq +? characters are converted into SQL -\(lq%\(rq +% and -\(lq_\(rq +_ wildcard characters\&. This might cause some confusion when you try to display the columns for a table with a -\(lq_\(rq +_ in the name, because in this case, \fBmysqlshow\fR shows you only the table names that match the pattern\&. This is easily fixed by adding an extra -\(lq%\(rq +% last on the command line as a separate argument\&. .PP \fBmysqlshow\fR @@ -344,7 +344,7 @@ Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) .sp This option was added in MySQL 5\&.6\&.28\&. .RE @@ -695,7 +695,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlslap.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlslap.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqlslap.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqlslap.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlslap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSLAP\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSLAP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -577,7 +577,7 @@ Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -1083,7 +1083,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql-stress-test.pl.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql-stress-test.pl.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql-stress-test.pl.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql-stress-test.pl.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql-stress-test.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/16/2016 +.\" Date: 06/01/2017 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL\-STRESS\-TE" "1" "09/16/2016" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-STRESS\-TE" "1" "06/01/2017" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -445,7 +445,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqltest.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqltest.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysqltest.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysqltest.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysqltest\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/16/2016 +.\" Date: 06/01/2017 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQLTEST\FR" "1" "09/16/2016" "MySQL" "MySQL Database System" +.TH "\FBMYSQLTEST\FR" "1" "06/01/2017" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,7 +49,7 @@ \fBmysqltest_embedded\fR is similar but is built with support for the libmysqld -embedded server\&. +embedded server\&. This program is available only prior to MySQL 8\&.0\&. .PP Features of \fBmysqltest\fR: @@ -613,7 +613,7 @@ Pass the argument as an argument to the embedded server\&. For example, \fB\-\-server\-arg=\-\-tmpdir=/tmp\fR or -\fB\-\-server\-arg=\-\-core\fR\&. Up to 64 arguments can be given\&. +\fB\-\-server\-arg=\-\-core\fR\&. Up to 64 arguments can be given\&. This option was removed in MySQL 8\&.0\&. .RE .sp .RS 4 @@ -627,7 +627,7 @@ \fB\-\-server\-file=\fR\fB\fIfile_name\fR\fR, \fB\-F \fR\fB\fIfile_name\fR\fR .sp -Read arguments for the embedded server from the given file\&. The file should contain one argument per line\&. +Read arguments for the embedded server from the given file\&. The file should contain one argument per line\&. This option was removed in MySQL 8\&.0\&. .RE .sp .RS 4 @@ -649,7 +649,7 @@ For additional discussion regarding use of the sha256_password plugin, including how to get the RSA public key, see -\m[blue]\fBThe SHA\-256 Authentication Plugin\fR\m[]\&\s-2\u[1]\d\s+2\&. +\m[blue]\fBSHA\-256 Pluggable Authentication\fR\m[]\&\s-2\u[1]\d\s+2\&. .sp This option is available only if MySQL was built using OpenSSL\&. It was added in MySQL 5\&.6\&.6 under the name \fB\-\-server\-public\-key\fR @@ -826,7 +826,7 @@ to immediately display the output from executed programs to stdout\&. .sp -This option was added in MySQL 5\&.8\&.0\&. +This option was added in MySQL 8\&.0\&.0\&. .RE .sp .RS 4 @@ -888,7 +888,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -898,9 +898,9 @@ .sp .SH "NOTES" .IP " 1." 4 -The SHA-256 Authentication Plugin +SHA-256 Pluggable Authentication .RS 4 -\%http://dev.mysql.com/doc/refman/5.7/en/sha256-authentication-plugin.html +\%http://dev.mysql.com/doc/refman/8.0/en/sha256-pluggable-authentication.html .RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql-test-run.pl.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql-test-run.pl.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql-test-run.pl.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql-test-run.pl.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql-test-run.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/16/2016 +.\" Date: 06/01/2017 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL\-TEST\-RUN\" "1" "09/16/2016" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-TEST\-RUN\" "1" "06/01/2017" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -33,6 +33,24 @@ .HP \w'\fBmysql\-test\-run\&.pl\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBmysql\-test\-run\&.pl [\fR\fB\fIoptions\fR\fR\fB]\fR .SH "DESCRIPTION" +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +\fIThis content is no longer updated\&.\fR +Any further updates to test framework documention take place in the MySQL Source Code documentation and can be accessed at +\m[blue]\fBThe MySQL Test Framework, Version 2\&.0\fR\m[]\&\s-2\u[1]\d\s+2\&. +.sp .5v +.RE .PP The \fBmysql\-test\-run\&.pl\fR @@ -262,6 +280,7 @@ l l l l l l +l l l l. T{ MTR_BUILD_THREAD @@ -293,7 +312,7 @@ CTEST (all in seconds)\&. MTR_CTEST_TIMEOUT is for \fBctest\fR unit tests; it was added in - MySQL 5\&.8\&.0\&. + MySQL 8\&.0\&.0\&. T} T{ MTR_PARALLEL @@ -365,6 +384,12 @@ Path name to the var directory that is used for logs, temporary files, and so forth T} +T{ +TSAN_OPTIONS +T}:T{ +Path name to a file containing ThreadSanitizer suppressions\&. Supported + as of MySQL 8\&.0\&.1\&. +T} .TE .sp 1 .PP @@ -428,6 +453,14 @@ is set to 1\&. .sp This is typically done for tests that take very long to run, or that use very much resources, so that they are not suitable for running as part of a normal test suite run\&. +.sp +If both +\fB\-\-big\-test\fR +and +\fB\-\-only\-big\-tests\fR +are given, +\fB\-\-only\-big\-tests\fR +is ignored\&. .RE .sp .RS 4 @@ -536,6 +569,24 @@ .sp -1 .IP \(bu 2.3 .\} +\fB\-\-charset\-for\-testdb=\fR\fB\fIcharset_name\fR\fR +.sp +Specify the default character set for the +test +database\&. The default value is +latin1\&. +.sp +This option was added in MySQL 8\&.0\&.1\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-check\-testcases\fR .sp Check test cases for side effects\&. This is done by checking the system state before and after each test case; if there is any difference, a warning to that effect is written, but the test case is not marked as failed because of it\&. This check is enabled by default\&. To disable it, use the @@ -851,7 +902,7 @@ does not fail if Debug Sync is not compiled in\&. .sp For information about using the Debug Sync facility for testing, see -Section\ \&4.14, \(lqThread Synchronization in Test Cases\(rq\&. +Section\ \&4.15, \(lqThread Synchronization in Test Cases\(rq\&. .RE .sp .RS 4 @@ -1012,7 +1063,7 @@ .sp Use a version of \fBmysqltest\fR -built with the embedded server\&. +built with the embedded server\&. This option was removed in MySQL 8\&.0\&. .RE .sp .RS 4 @@ -1065,7 +1116,13 @@ .sp Run EXPLAIN EXTENDED -on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&. +on all +SELECT, +INSERT, +REPLACE, +UPDATE, and +DELETE +statements\&. .RE .sp .RS 4 @@ -1126,7 +1183,7 @@ .\} \fB\-\-fail\-check\-testcases\fR .sp -Enabling this option when a test is run, causes it to fail if MTR\*(Aqs internal check of the test case fails\&. If this option is disabled, only a warning is generated while the test passes\&. For additional information, see the description of the +Enabling this option when a test is run, causes it to fail if MTR\*(Aqs internal check of the test case fails\&. If this option is disabled, only a warning is generated while the test passes\&. This option is enabled by default\&. For additional information, see the description of the \fB\-\-check\-testcases\fR option\&. .sp @@ -1471,7 +1528,7 @@ Extra options to pass to \fBmysqltest\fR\&. .sp -This option was added in MySQL 5\&.8\&.0\&. +This option was added in MySQL 8\&.0\&.0\&. .RE .sp .RS 4 @@ -1620,6 +1677,28 @@ .sp -1 .IP \(bu 2.3 .\} +\fB\-\-only\-big\-tests\fR +.sp +This option causes only big tests to run\&. Normal (non\-big) tests are skipped\&. If both +\fB\-\-big\-test\fR +and +\fB\-\-only\-big\-tests\fR +are given, +\fB\-\-only\-big\-tests\fR +is ignored\&. +.sp +\fB\-\-only\-big\-tests\fR +was added in MySQL 8\&.0\&.1\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-parallel={\fR\fB\fIN\fR\fR\fB|auto}\fR .sp Run tests using @@ -1831,6 +1910,26 @@ .sp -1 .IP \(bu 2.3 .\} +\fB\-\-sanitize\fR +.sp +Scan the server log files for warnings from various sanitizers\&. Use of this option assumes that MySQL was configured with +\fB\-DWITH_ASAN\fR +or +\fB\-DWITH_UBSAN\fR\&. +.sp +This option was added in MySQL 8\&.0\&.0\&. As of MySQL 8\&.0\&.1, the +TSAN_OPTIONS +environment variable can be set to specify the path name of a file containing ThreadSanitizer suppressions\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-shutdown\-timeout=\fR\fB\fIseconds\fR\fR .sp Max number of seconds to wait for servers to do controlled shutdown before killing them\&. Default is 10\&. @@ -2197,6 +2296,32 @@ .sp -1 .IP \(bu 2.3 .\} +\fB\-\-summary\-report=\fR\fB\fIfile_name\fR\fR +.sp +Generate a plain text version of the test summary only and write it to the file named as the option argument\&. The file is suitable for sending by email\&. This option was added in MySQL 8\&.0\&.1\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-test\-progress\fR +.sp +Display the percentage of tests remaining\&. This option was added in MySQL 5\&.7\&.19\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-testcase\-timeout=\fR\fB\fIminutes\fR\fR .sp Specify the maximum test case runtime in minutes\&. @@ -2576,7 +2701,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -2584,6 +2709,12 @@ .PP You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. .sp +.SH "NOTES" +.IP " 1." 4 +The MySQL Test Framework, Version 2.0 +.RS 4 +\%http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_MYSQL_TEST_RUN.html +.RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_tzinfo_to_sql.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_tzinfo_to_sql.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_tzinfo_to_sql.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_tzinfo_to_sql.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_tzinfo_to_sql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_TZINFO_TO_S" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_TZINFO_TO_S" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -120,7 +120,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_upgrade.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_upgrade.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_upgrade.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_upgrade.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_upgrade\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_UPGRADE\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_UPGRADE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,7 +42,7 @@ If \fBmysql_upgrade\fR finds that a table has a possible incompatibility, it performs a table check and, if problems are found, attempts a table repair\&. If the table cannot be repaired, see -Section\ \&2.11.4, \(lqRebuilding or Repairing Tables or Indexes\(rq +Section\ \&2.11.3, \(lqRebuilding or Repairing Tables or Indexes\(rq for manual table repair strategies\&. .PP You should execute @@ -819,7 +819,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_waitpid.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_waitpid.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_waitpid.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_waitpid.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_waitpid\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_WAITPID\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_WAITPID\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -124,7 +124,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_zap.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_zap.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/mysql_zap.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/mysql_zap.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_zap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_ZAP\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_ZAP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -126,7 +126,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_blob_tool.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_blob_tool.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_blob_tool.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_blob_tool.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_blob_tool\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_BLOB_TOOL\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_BLOB_TOOL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_blob_tool \- check and repair BLOB and TEXT columns of MySQL Cluster tables +ndb_blob_tool \- check and repair BLOB and TEXT columns of NDB Cluster tables .SH "SYNOPSIS" .HP \w'\fBndb_blob_tool\ \fR\fB\fIoptions\fR\fR\fB\ \fR\fB\fItable\fR\fR\fB\ [\fR\fB\fIcolumn\fR\fR\fB,\ \&.\&.\&.]\fR\ 'u \fBndb_blob_tool \fR\fB\fIoptions\fR\fR\fB \fR\fB\fItable\fR\fR\fB [\fR\fB\fIcolumn\fR\fR\fB, \&.\&.\&.]\fR @@ -85,15 +85,15 @@ option provides additional information in the output about the tool\*(Aqs progress\&. .PP The following table includes options that are specific to -\fBndb_blob_tool\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +\fBndb_blob_tool\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_blob_tool\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.86.\ \& This table describes command\-line options for the ndb_blob_tool program +.B Table\ \&18.87.\ \& This table describes command\-line options for the ndb_blob_tool program .TS allbox tab(:); . @@ -133,7 +133,7 @@ T} .TE .sp 1 -Check for orphaned BLOB parts in MySQL Cluster tables\&. +Check for orphaned BLOB parts in NDB Cluster tables\&. .RE .sp .RS 4 @@ -206,7 +206,7 @@ T} .TE .sp 1 -Remove orphaned BLOB parts from MySQL Cluster tables\&. +Remove orphaned BLOB parts from NDB Cluster tables\&. .RE .sp .RS 4 @@ -377,7 +377,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb-common-options.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb-common-options.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb-common-options.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb-common-options.1 2017-10-19 04:25:29.000000000 +0000 @@ -1,13 +1,13 @@ '\" t -.\" Title: Options Common to MySQL Cluster Programs +.\" Title: Options Common to NDB Cluster Programs .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "OPTIONS COMMON TO MY" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "OPTIONS COMMON TO ND" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,10 +28,10 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb-common-options \- MySQL Cluster Common Program Options +ndb-common-options \- NDB Cluster Common Program Options .SH "DESCRIPTION" .PP -All MySQL Cluster programs accept the options described in this section, with the following exceptions: +All NDB Cluster programs accept the options described in this section, with the following exceptions: .sp .RS 4 .ie n \{\ @@ -89,66 +89,36 @@ .ps -1 .br .PP -Users of earlier MySQL Cluster versions should note that some of these options have been changed to make them consistent with one another, and also with +Users of earlier NDB Cluster versions should note that some of these options have been changed to make them consistent with one another, and also with \fBmysqld\fR\&. You can use the \fB\-\-help\fR -option with any MySQL Cluster program\(emwith the exception of +option with any NDB Cluster program\(emwith the exception of \fBndb_print_backup_file\fR, \fBndb_print_schema_file\fR, and \fBndb_print_sys_file\fR\(emto view a list of the options which the program supports\&. .sp .5v .RE .PP -The options in the following table are common to all MySQL Cluster executables (except those noted previously in this section)\&. +The options in the following table are common to all NDB Cluster executables (except those noted previously in this section)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.102.\ \& This table describes command\-line options common to all MySQL Cluster programs +.B Table\ \&18.104.\ \& This table describes command\-line options common to all MySQL NDB Cluster programs .TS allbox tab(:); . .TE .sp 1 .PP -For options specific to individual MySQL Cluster programs, see -Section\ \&18.4, \(lqMySQL Cluster Programs\(rq\&. +For options specific to individual NDB Cluster programs, see +Section\ \&18.4, \(lqNDB Cluster Programs\(rq\&. .PP See -Section\ \&18.3.3.8.1, \(lqMySQL Server Options for MySQL Cluster\(rq, for +Section\ \&18.3.3.8.1, \(lqMySQL Server Options for NDB Cluster\(rq, for \fBmysqld\fR -options relating to MySQL Cluster\&. -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-help\fR, -\fB\-\-usage\fR, -\fB\-?\fR -.TS -allbox tab(:); -l l s s -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-help -T} -T{ -\ \& -T}:T{ -\-\-usage -T} -.TE -.sp 1 -Prints a short list with descriptions of the available command options\&. -.RE +options relating to NDB Cluster\&. .sp .RS 4 .ie n \{\ @@ -193,63 +163,6 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-ndb\-connectstring=\fR\fB\fIconnection_string\fR\fR, -\fB\-\-connect\-string=\fR\fB\fIconnection_string\fR\fR, -\fB\-c \fR\fB\fIconnection_string\fR\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ndb\-connectstring=connectstring -T} -T{ -\ \& -T}:T{ -\-\-connect\-string=connectstring -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -localhost:1186 -T} -.TE -.sp 1 -This option takes a MySQL Cluster connection string that specifies the management server for the application to connect to, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndbd \-\-ndb\-connectstring="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186"\fR -.fi -.if n \{\ -.RE -.\} -.sp -For more information, see -Section\ \&18.3.3.3, \(lqMySQL Cluster Connection Strings\(rq\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} \fB\-\-connect\-retries=\fR\fB\fI#\fR\fR .TS allbox tab(:); @@ -312,7 +225,7 @@ \fBndb_mgm\fR(1), for more information\&. .sp .5v .RE -This option was added in MySQL Cluster NDB 7\&.4\&.9\&. +This option was added in NDB 7\&.4\&.9\&. .RE .sp .RS 4 @@ -369,7 +282,7 @@ This option specifies the length of time to wait per attempt a connection before giving up\&. The number of times to try connecting is set by \fB\-\-connect\-retries\fR\&. .sp -This option was added in MySQL Cluster NDB 7\&.4\&.9\&. +This option was added in NDB 7\&.4\&.9\&. .RE .sp .RS 4 @@ -405,12 +318,12 @@ T} .TE .sp 1 -Write a core file if the program dies\&. The name and location of the core file are system\-dependent\&. (For MySQL Cluster programs nodes running on Linux, the default location is the program\*(Aqs working directory\(emfor a data node, this is the node\*(Aqs +Write a core file if the program dies\&. The name and location of the core file are system\-dependent\&. (For NDB Cluster programs nodes running on Linux, the default location is the program\*(Aqs working directory\(emfor a data node, this is the node\*(Aqs DataDir\&.) For some systems, there may be restrictions or limitations; for example, it might be necessary to execute \fBulimit \-c unlimited\fR before starting the server\&. Consult your system documentation for detailed information\&. .sp -If MySQL Cluster was built using the +If NDB Cluster was built using the \fB\-\-debug\fR option for \fBconfigure\fR, then @@ -466,6 +379,237 @@ .sp -1 .IP \(bu 2.3 .\} +\fB\-\-defaults\-extra\-file\fR=\fIfilename\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-defaults\-extra\-file=filename +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +[none] +T} +.TE +.sp 1 +Read this file after global option files are read\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-defaults\-file\fR=\fIfilename\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-defaults\-file=filename +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +[none] +T} +.TE +.sp 1 +Read default options from this file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-defaults\-group\-suffix\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-defaults\-group\-suffix +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +[none] +T} +.TE +.sp 1 +Also read groups with names ending in this suffix\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-help\fR, +\fB\-\-usage\fR, +\fB\-?\fR +.TS +allbox tab(:); +l l s s +l l s s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-help +T} +T{ +\ \& +T}:T{ +\-\-usage +T} +.TE +.sp 1 +Prints a short list with descriptions of the available command options\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-login\-path\fR=\fIpath\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-login\-path=path +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +[none] +T} +.TE +.sp 1 +Read this path from the login file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-ndb\-connectstring=\fR\fB\fIconnection_string\fR\fR, +\fB\-\-connect\-string=\fR\fB\fIconnection_string\fR\fR, +\fB\-c \fR\fB\fIconnection_string\fR\fR +.TS +allbox tab(:); +l l s s +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-ndb\-connectstring=connectstring +T} +T{ +\ \& +T}:T{ +\-\-connect\-string=connectstring +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +localhost:1186 +T} +.TE +.sp 1 +This option takes an NDB Cluster connection string that specifies the management server for the application to connect to, as shown here: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBndbd \-\-ndb\-connectstring="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186"\fR +.fi +.if n \{\ +.RE +.\} +.sp +For more information, see +Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-ndb\-mgmd\-host=\fR\fB\fIhost\fR\fR\fB[:\fR\fB\fIport\fR\fR\fB]\fR .TS allbox tab(:); @@ -529,9 +673,45 @@ T} .TE .sp 1 -Sets this node\*(Aqs MySQL Cluster node ID\&. -\fIThe range of permitted values depends on the node\*(Aqs type (data, management, or API) and the MySQL Cluster software version\fR\&. See -Section\ \&18.1.6.2, \(lqLimits and Differences of MySQL Cluster from Standard MySQL Limits\(rq, for more information\&. +Sets this node\*(Aqs NDB Cluster node ID\&. +\fIThe range of permitted values depends on the node\*(Aqs type (data, management, or API) and the NDB Cluster software version\fR\&. See +Section\ \&18.1.6.2, \(lqLimits and Differences of NDB Cluster from Standard MySQL Limits\(rq, for more information\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-no\-defaults\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-no\-defaults +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +TRUE +T} +.TE +.sp 1 +Do not read default options from any option file other than login file\&. .RE .sp .RS 4 @@ -578,6 +758,42 @@ .sp -1 .IP \(bu 2.3 .\} +\fB\-\-print\-defaults\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-print\-defaults +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +TRUE +T} +.TE +.sp 1 +Print the program argument list and exit\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} \fB\-\-version\fR, \fB\-V\fR .TS @@ -590,15 +806,15 @@ T} .TE .sp 1 -Prints the MySQL Cluster version number of the executable\&. The version number is relevant because not all versions can be used together, and the MySQL Cluster startup process verifies that the versions of the binaries being used can co\-exist in the same cluster\&. This is also important when performing an online (rolling) software upgrade or downgrade of MySQL Cluster\&. +Prints the NDB Cluster version number of the executable\&. The version number is relevant because not all versions can be used together, and the NDB Cluster startup process verifies that the versions of the binaries being used can co\-exist in the same cluster\&. This is also important when performing an online (rolling) software upgrade or downgrade of NDB Cluster\&. .sp See -Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq), for more information\&. +Section\ \&18.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq), for more information\&. .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_config.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_config.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_config.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_config.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_CONFIG\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_CONFIG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,13 +28,13 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_config \- extract MySQL Cluster configuration information +ndb_config \- extract NDB Cluster configuration information .SH "SYNOPSIS" .HP \w'\fBndb_config\ \fR\fB\fIoptions\fR\fR\ 'u \fBndb_config \fR\fB\fIoptions\fR\fR .SH "DESCRIPTION" .PP -This tool extracts current configuration information for data nodes, SQL nodes, and API nodes from one of a number of sources: a MySQL Cluster management node, or its +This tool extracts current configuration information for data nodes, SQL nodes, and API nodes from one of a number of sources: an NDB Cluster management node, or its config\&.ini or my\&.cnf @@ -60,15 +60,15 @@ \fB\-\-connections\fR\&. .PP The following table includes options that are specific to -\fBndb_config\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +\fBndb_config\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_config\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.87.\ \& This table describes command\-line options for the ndb_config program +.B Table\ \&18.88.\ \& This table describes command\-line options for the ndb_config program .TS allbox tab(:); . @@ -83,28 +83,143 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-usage\fR, -\fB\-\-help\fR, or -\fB\-?\fR +\fB\-\-configinfo\fR +.sp +The +\fB\-\-configinfo\fR +option causes +\fBndb_config\fR +to dump a list of each NDB Cluster configuration parameter supported by the NDB Cluster distribution of which +\fBndb_config\fR +is a part, including the following information: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +A brief description of each parameter\*(Aqs purpose, effects, and usage +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The section of the +config\&.ini +file where the parameter may be used +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The parameter\*(Aqs data type or unit of measurement +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Where applicable, the parameter\*(Aqs default, minimum, and maximum values +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +NDB Cluster release version and build information +.RE +.sp +By default, this output is in text format\&. Part of this output is shown here: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBndb_config \-\-configinfo\fR +****** SYSTEM ****** +Name (String) +Name of system (NDB Cluster) +MANDATORY +PrimaryMGMNode (Non\-negative Integer) +Node id of Primary ndb_mgmd(MGM) node +Default: 0 (Min: 0, Max: 4294967039) +ConfigGenerationNumber (Non\-negative Integer) +Configuration generation number +Default: 0 (Min: 0, Max: 4294967039) +****** DB ****** +MaxNoOfSubscriptions (Non\-negative Integer) +Max no of subscriptions (default 0 == MaxNoOfTables) +Default: 0 (Min: 0, Max: 4294967039) +MaxNoOfSubscribers (Non\-negative Integer) +Max no of subscribers (default 0 == 2 * MaxNoOfTables) +Default: 0 (Min: 0, Max: 4294967039) +\&... +.fi +.if n \{\ +.RE +.\} +.sp +Use this option together with the +\fB\-\-xml\fR +option to obtain output in XML format\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-config\-file=\fR\fB\fIpath\-to\-file\fR\fR .TS allbox tab(:); l l s s -l l s s. +l l l s +^ l l s. T{ \fBCommand\-Line Format\fR T}:T{ -\-\-help +\-\-config\-file=file_name T} T{ -\ \& +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +file name +T} +:T{ +\fBDefault\fR T}:T{ -\-\-usage T} .TE .sp 1 -Causes +Gives the path to the management server\*(Aqs configuration file (config\&.ini)\&. This may be a relative or absolute path\&. If the management node resides on a different host from the one on which \fBndb_config\fR -to print a list of available options, and then exit\&. +is invoked, then an absolute path must be used\&. .RE .sp .RS 4 @@ -126,7 +241,7 @@ T{ \fBCommand\-Line Format\fR T}:T{ -\-\-config_from_node=# +\-\-config\-from\-node=# T} T{ \fBPermitted Values\fR @@ -167,21 +282,51 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-version\fR, -\fB\-V\fR +\fB\-\-connections\fR .TS allbox tab(:); -l l s s. +l l s s +l l l s +^ l l s. T{ \fBCommand\-Line Format\fR T}:T{ -\-\-version +\-\-connections +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE T} .TE .sp 1 -Causes +Tells \fBndb_config\fR -to print a version information string, and then exit\&. +to print +CONNECTIONS +information only\(emthat is, information about parameters found in the +[tcp], +[tcp default], +[sci], +[sci default], +[shm], or +[shm default] +sections of the cluster configuration file (see +Section\ \&18.3.3.9, \(lqNDB Cluster TCP/IP Connections\(rq, +Section\ \&18.3.3.12, \(lqSCI Transport Connections in NDB Cluster\(rq, and +Section\ \&18.3.3.11, \(lqNDB Cluster Shared-Memory Connections\(rq, for more information)\&. +.sp +This option is mutually exclusive with +\fB\-\-nodes\fR +and +\fB\-\-system\fR; only one of these 3 options can be used\&. .RE .sp .RS 4 @@ -192,8 +337,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-ndb\-connectstring=\fR\fB\fIconnection_string\fR\fR, -\fB\-c \fR\fB\fIconnection_string\fR\fR +\fB\-\-diff\-default\fR .TS allbox tab(:); l l s s @@ -201,14 +345,52 @@ l l l s ^ l l s. T{ +\fBIntroduced\fR +T}:T{ +5\&.6\&.36\-ndb\-7\&.4\&.16 +T} +T{ \fBCommand\-Line Format\fR T}:T{ -\-\-ndb\-connectstring=connectstring +\-\-diff\-default T} T{ -\ \& +\fBPermitted Values\fR (>= 5\&.6\&.36\-ndb\-7\&.4\&.16) T}:T{ -\-\-connect\-string=connectstring +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Print only configuration parameters that have non\-default values\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-fields=\fR\fB\fIdelimiter\fR\fR, +\fB\-f\fR +\fIdelimiter\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-fields=string T} T{ \fBPermitted Values\fR @@ -220,13 +402,33 @@ :T{ \fBDefault\fR T}:T{ -localhost:1186 T} .TE .sp 1 -Specifies the connection string to use in connecting to the management server\&. The format for the connection string is the same as described in -Section\ \&18.3.3.3, \(lqMySQL Cluster Connection Strings\(rq, and defaults to -localhost:1186\&. +Specifies a +\fIdelimiter\fR +string used to separate the fields in the result\&. The default is +, +(the comma character)\&. +.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 +If the +\fIdelimiter\fR +contains spaces or escapes (such as +\en +for the linefeed character), then it must be quoted\&. +.sp .5v +.RE .RE .sp .RS 4 @@ -237,7 +439,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-config\-file=\fR\fB\fIpath\-to\-file\fR\fR +\fB\-\-host=\fR\fB\fIhostname\fR\fR .TS allbox tab(:); l l s s @@ -246,14 +448,14 @@ T{ \fBCommand\-Line Format\fR T}:T{ -\-\-config\-file=file_name +\-\-host=name T} T{ \fBPermitted Values\fR T}:T{ \fBType\fR T}:T{ -file name +string T} :T{ \fBDefault\fR @@ -261,9 +463,37 @@ T} .TE .sp 1 -Gives the path to the management server\*(Aqs configuration file (config\&.ini)\&. This may be a relative or absolute path\&. If the management node resides on a different host from the one on which +Specifies the host name of the node for which configuration information is to be obtained\&. +.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 +While the hostname +localhost +usually resolves to the IP address +127\&.0\&.0\&.1, this may not necessarily be true for all operating platforms and configurations\&. This means that it is possible, when +localhost +is used in +config\&.ini, for +\fBndb_config \fR\fB\fB\-\-host=localhost\fR\fR +to fail if \fBndb_config\fR -is invoked, then an absolute path must be used\&. +is run on a different host where +localhost +resolves to a different address (for example, on some versions of SUSE Linux, this is +127\&.0\&.0\&.2)\&. In general, for best results, you should use numeric IP addresses for all NDB Cluster configuration values relating to hosts, or verify that all NDB Cluster hosts handle +localhost +in the same fashion\&. +.sp .5v +.RE .RE .sp .RS 4 @@ -312,9 +542,8 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-query=\fR\fB\fIquery\-options\fR\fR, -\fB\-q\fR -\fIquery\-options\fR +\fB\-\-nodeid=\fR\fB\fInode_id\fR\fR, +\fB\-\-id=\fR\fB\fInode_id\fR\fR .TS allbox tab(:); l l s s @@ -323,50 +552,25 @@ T{ \fBCommand\-Line Format\fR T}:T{ -\-\-query=string +\-\-ndb\-nodeid=# T} T{ \fBPermitted Values\fR T}:T{ \fBType\fR T}:T{ -string +numeric T} :T{ \fBDefault\fR T}:T{ +0 T} .TE .sp 1 -This is a comma\-delimited list of -\fIquery options\fR\(emthat is, a list of one or more node attributes to be returned\&. These include -id -(node ID), type (node type\(emthat is, -ndbd, -mysqld, or -ndb_mgmd), and any configuration parameters whose values are to be obtained\&. -.sp -For example, -\fB\-\-query=id,type,indexmemory,datamemory\fR -returns the node ID, node type, -DataMemory, and -IndexMemory -for each node\&. -.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 -If a given parameter is not applicable to a certain type of node, than an empty string is returned for the corresponding value\&. See the examples later in this section for more information\&. -.sp .5v -.RE +Specify the node ID of the node for which configuration information is to be obtained\&. +\fB\-\-nodeid\fR +is the preferred form\&. .RE .sp .RS 4 @@ -377,7 +581,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-host=\fR\fB\fIhostname\fR\fR +\fB\-\-nodes\fR .TS allbox tab(:); l l s s @@ -386,52 +590,35 @@ T{ \fBCommand\-Line Format\fR T}:T{ -\-\-host=name +\-\-nodes T} T{ \fBPermitted Values\fR T}:T{ \fBType\fR T}:T{ -string +boolean T} :T{ \fBDefault\fR T}:T{ +FALSE T} .TE .sp 1 -Specifies the host name of the node for which configuration information is to be obtained\&. -.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 -While the hostname -localhost -usually resolves to the IP address -127\&.0\&.0\&.1, this may not necessarily be true for all operating platforms and configurations\&. This means that it is possible, when -localhost -is used in -config\&.ini, for -\fBndb_config \fR\fB\fB\-\-host=localhost\fR\fR -to fail if +Tells \fBndb_config\fR -is run on a different host where -localhost -resolves to a different address (for example, on some versions of SUSE Linux, this is -127\&.0\&.0\&.2)\&. In general, for best results, you should use numeric IP addresses for all MySQL Cluster configuration values relating to hosts, or verify that all MySQL Cluster hosts handle -localhost -in the same fashion\&. -.sp .5v -.RE +to print information relating only to parameters defined in an +[ndbd] +or +[ndbd default] +section of the cluster configuration file (see +Section\ \&18.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq)\&. +.sp +This option is mutually exclusive with +\fB\-\-connections\fR +and +\fB\-\-system\fR; only one of these 3 options can be used\&. .RE .sp .RS 4 @@ -442,36 +629,41 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-id=\fR\fB\fInode_id\fR\fR -.sp -\fB\-\-nodeid=\fR\fB\fInode_id\fR\fR +\fB\-\-ndb\-connectstring=\fR\fB\fIconnection_string\fR\fR, +\fB\-c \fR\fB\fIconnection_string\fR\fR .TS allbox tab(:); l l s s +l l s s l l l s ^ l l s. T{ \fBCommand\-Line Format\fR T}:T{ -\-\-ndb\-nodeid=# +\-\-ndb\-connectstring=connectstring +T} +T{ +\ \& +T}:T{ +\-\-connect\-string=connectstring T} T{ \fBPermitted Values\fR T}:T{ \fBType\fR T}:T{ -numeric +string T} :T{ \fBDefault\fR T}:T{ -0 +localhost:1186 T} .TE .sp 1 -Either of these options can be used to specify the node ID of the node for which configuration information is to be obtained\&. -\fB\-\-nodeid\fR -is the preferred form\&. +Specifies the connection string to use in connecting to the management server\&. The format for the connection string is the same as described in +Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, and defaults to +localhost:1186\&. .RE .sp .RS 4 @@ -482,7 +674,9 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-nodes\fR +\fB\-\-query=\fR\fB\fIquery\-options\fR\fR, +\fB\-q\fR +\fIquery\-options\fR .TS allbox tab(:); l l s s @@ -491,35 +685,75 @@ T{ \fBCommand\-Line Format\fR T}:T{ -\-\-nodes +\-\-query=string T} T{ \fBPermitted Values\fR T}:T{ \fBType\fR T}:T{ -boolean +string T} :T{ \fBDefault\fR T}:T{ -FALSE T} .TE .sp 1 -Tells -\fBndb_config\fR -to print information relating only to parameters defined in an -[ndbd] -or -[ndbd default] -section of the cluster configuration file (see -Section\ \&18.3.3.6, \(lqDefining MySQL Cluster Data Nodes\(rq)\&. +This is a comma\-delimited list of +\fIquery options\fR\(emthat is, a list of one or more node attributes to be returned\&. These include +id +(node ID), type (node type\(emthat is, +ndbd, +mysqld, or +ndb_mgmd), and any configuration parameters whose values are to be obtained\&. +.sp +For example, +\fB\-\-query=id,type,indexmemory,datamemory\fR +returns the node ID, node type, +DataMemory, and +IndexMemory +for each node\&. +.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 +If a given parameter is not applicable to a certain type of node, than an empty string is returned for the corresponding value\&. See the examples later in this section for more information\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-query\-all\fR, +\fB\-a\fR +.TS +allbox tab(:); +l l s s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-query\-all +T} +.TE +.sp 1 +Returns a comma\-delimited list of all query options (node attributes; note that this list is a single string\&. .sp -This option is mutually exclusive with -\fB\-\-connections\fR -and -\fB\-\-system\fR; only one of these 3 options can be used\&. +This option was introduced in NDB 7\&.4\&.16 (Bug #60095, Bug #11766869)\&. .RE .sp .RS 4 @@ -530,7 +764,9 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-connections\fR +\fB\-\-rows=\fR\fB\fIseparator\fR\fR, +\fB\-r\fR +\fIseparator\fR .TS allbox tab(:); l l s s @@ -539,42 +775,43 @@ T{ \fBCommand\-Line Format\fR T}:T{ -\-\-connections +\-\-rows=string T} T{ \fBPermitted Values\fR T}:T{ \fBType\fR T}:T{ -boolean +string T} :T{ \fBDefault\fR T}:T{ -FALSE T} .TE .sp 1 -Tells -\fBndb_config\fR -to print -CONNECTIONS -information only\(emthat is, information about parameters found in the -[tcp], -[tcp default], -[sci], -[sci default], -[shm], or -[shm default] -sections of the cluster configuration file (see -Section\ \&18.3.3.9, \(lqMySQL Cluster TCP/IP Connections\(rq, -Section\ \&18.3.3.12, \(lqSCI Transport Connections in MySQL Cluster\(rq, and -Section\ \&18.3.3.11, \(lqMySQL Cluster Shared-Memory Connections\(rq, for more information)\&. +Specifies a +\fIseparator\fR +string used to separate the rows in the result\&. The default is a space character\&. +.if n \{\ .sp -This option is mutually exclusive with -\fB\-\-nodes\fR -and -\fB\-\-system\fR; only one of these 3 options can be used\&. +.\} +.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 +If the +\fIseparator\fR +contains spaces or escapes (such as +\en +for the linefeed character), then it must be quoted\&. +.sp .5v +.RE .RE .sp .RS 4 @@ -687,56 +924,28 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-fields=\fR\fB\fIdelimiter\fR\fR, -\fB\-f\fR -\fIdelimiter\fR +\fB\-\-usage\fR, +\fB\-\-help\fR, or +\fB\-?\fR .TS allbox tab(:); l l s s -l l l s -^ l l s. +l l s s. T{ \fBCommand\-Line Format\fR T}:T{ -\-\-fields=string +\-\-help T} T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR +\ \& T}:T{ +\-\-usage T} .TE .sp 1 -Specifies a -\fIdelimiter\fR -string used to separate the fields in the result\&. The default is -\(lq,\(rq -(the comma character)\&. -.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 -If the -\fIdelimiter\fR -contains spaces or escapes (such as -\en -for the linefeed character), then it must be quoted\&. -.sp .5v -.RE +Causes +\fBndb_config\fR +to print a list of available options, and then exit\&. .RE .sp .RS 4 @@ -747,118 +956,21 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-rows=\fR\fB\fIseparator\fR\fR, -\fB\-r\fR -\fIseparator\fR +\fB\-\-version\fR, +\fB\-V\fR .TS allbox tab(:); -l l s s -l l l s -^ l l s. +l l s s. T{ \fBCommand\-Line Format\fR T}:T{ -\-\-rows=string -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ +\-\-version T} .TE .sp 1 -Specifies a -\fIseparator\fR -string used to separate the rows in the result\&. The default is a space character\&. -.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 -If the -\fIseparator\fR -contains spaces or escapes (such as -\en -for the linefeed character), then it must be quoted\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-configinfo\fR -.sp -The -\fB\-\-configinfo\fR -option causes -\fBndb_config\fR -to dump a list of each MySQL Cluster configuration parameter supported by the MySQL Cluster distribution of which +Causes \fBndb_config\fR -is a part, including the following information: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -A brief description of each parameter\*(Aqs purpose, effects, and usage -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -The section of the -config\&.ini -file where the parameter may be used -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -The parameter\*(Aqs data type or unit of measurement -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Where applicable, the parameter\*(Aqs default, minimum, and maximum values +to print a version information string, and then exit\&. .RE .sp .RS 4 @@ -869,39 +981,6 @@ .sp -1 .IP \(bu 2.3 .\} -MySQL Cluster release version and build information -.RE -.sp -By default, this output is in text format\&. Part of this output is shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_config \-\-configinfo\fR -****** SYSTEM ****** -Name (String) -Name of system (NDB Cluster) -MANDATORY -PrimaryMGMNode (Non\-negative Integer) -Node id of Primary ndb_mgmd(MGM) node -Default: 0 (Min: 0, Max: 4294967039) -ConfigGenerationNumber (Non\-negative Integer) -Configuration generation number -Default: 0 (Min: 0, Max: 4294967039) -****** DB ****** -MaxNoOfSubscriptions (Non\-negative Integer) -Max no of subscriptions (default 0 == MaxNoOfTables) -Default: 0 (Min: 0, Max: 4294967039) -MaxNoOfSubscribers (Non\-negative Integer) -Max no of subscribers (default 0 == 2 * MaxNoOfTables) -Default: 0 (Min: 0, Max: 4294967039) -\&... -.fi -.if n \{\ -.RE -.\} -.sp \fB\-\-configinfo\fR \fB\-\-xml\fR .TS @@ -928,19 +1007,17 @@ T} .TE .sp 1 -You can obtain the output of +Cause \fBndb_config\fR \fB\-\-configinfo\fR -as XML by adding the -\fB\-\-xml\fR -option\&. A portion of the resulting output is shown in this example: +to provide output as XML by adding this option\&. A portion of such output is shown in this example: .sp .if n \{\ .RS 4 .\} .nf shell> \fBndb_config \-\-configinfo \-\-xml\fR -
@@ -1035,7 +1112,7 @@ system (meaning that all cluster nodes must be shut down at the same time, then restarted)\&. .sp -Beginning with MySQL Cluster NDB 7\&.4\&.7, deprecated parameters are indicated in the XML output with the addition of a +Beginning with NDB 7\&.4\&.7, deprecated parameters are indicated in the XML output with the addition of a deprecated attribute, as shown here: .sp @@ -1084,14 +1161,15 @@ \fB\-\-configinfo\fR and \fB\-\-xml\fR -use information obtained from the MySQL Cluster sources when +use information obtained from the NDB Cluster sources when \fBndb_config\fR -was compiled\&. For this reason, no connection to a running MySQL Cluster or access to a +was compiled\&. For this reason, no connection to a running NDB Cluster or access to a config\&.ini or my\&.cnf file is required for these two options\&. -.sp +.RE +.PP Combining other \fBndb_config\fR options (such as @@ -1099,9 +1177,9 @@ or \fB\-\-type\fR) with \fB\-\-configinfo\fR -or +(with or without the \fB\-\-xml\fR -is not supported\&. Currently, if you attempt to do so, the usual result is that all other options besides +option) is not supported\&. Currently, if you attempt to do so, the usual result is that all other options besides \fB\-\-configinfo\fR or \fB\-\-xml\fR @@ -1109,14 +1187,13 @@ \fIHowever, this behavior is not guaranteed and is subject to change at any time\fR\&. In addition, since \fBndb_config\fR, when used with the \fB\-\-configinfo\fR -option, does not access the MySQL Cluster or read any files, trying to specify additional options such as +option, does not access the NDB Cluster or read any files, trying to specify additional options such as \fB\-\-ndb\-connectstring\fR or \fB\-\-config\-file\fR with \fB\-\-configinfo\fR serves no purpose\&. -.RE Examples .sp .RS 4 @@ -1246,15 +1323,13 @@ to determine the attributes to be queried\&. .sp Similarly, you can limit results to a node with a specific ID using the -\fB\-\-id\fR -or \fB\-\-nodeid\fR option\&. .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_cpcd.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_cpcd.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_cpcd.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_cpcd.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_cpcd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_CPCD\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_CPCD\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,11 +34,11 @@ \fBndb_cpcd \fR\fB\fIoptions\fR\fR .SH "DESCRIPTION" .PP -A utility having this name was formerly part of an internal automated test framework used in testing and debugging MySQL Cluster\&. It is no longer included in MySQL Cluster distributions provided by Oracle\&. +A utility having this name was formerly part of an internal automated test framework used in testing and debugging NDB Cluster\&. It is no longer included in NDB Cluster distributions provided by Oracle\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbd.8 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbd.8 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbd.8 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbd.8 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndbd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBD\FR" "8" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndbd \- the MySQL Cluster data node daemon +ndbd \- the NDB Cluster data node daemon .SH "SYNOPSIS" .HP \w'\fBndbd\ \fR\fB\fIoptions\fR\fR\ 'u \fBndbd \fR\fB\fIoptions\fR\fR @@ -37,20 +37,20 @@ \fBndbd\fR is the process that is used to handle all the data in tables using the NDB Cluster storage engine\&. This is the process that empowers a data node to accomplish distributed transaction handling, node recovery, checkpointing to disk, online backup, and related tasks\&. .PP -In a MySQL Cluster, a set of +In an NDB Cluster, a set of \fBndbd\fR processes cooperate in handling data\&. These processes can execute on the same computer (host) or on different computers\&. The correspondences between data nodes and Cluster hosts is completely configurable\&. .PP -The following table includes command options specific to the MySQL Cluster data node program -\fBndbd\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes command options specific to the NDB Cluster data node program +\fBndbd\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndbd\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.82.\ \& This table describes command\-line options for the ndbd program +.B Table\ \&18.83.\ \& This table describes command\-line options for the ndbd program .TS allbox tab(:); . @@ -303,7 +303,7 @@ \fIonly\fR when starting the \fBndbd\fR -process under very special circumstances; this is because this option causes all files to be removed from the MySQL Cluster file system and all redo log files to be re\-created\&. These circumstances are listed here: +process under very special circumstances; this is because this option causes all files to be removed from the NDB Cluster file system and all redo log files to be re\-created\&. These circumstances are listed here: .sp .RS 4 .ie n \{\ @@ -339,6 +339,34 @@ As a measure of last resort when for some reason the node restart or system restart repeatedly fails\&. In this case, be aware that this node can no longer be used to restore data due to the destruction of the data files\&. .RE .sp +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBWarning\fR +.ps -1 +.br +To avoid the possibility of eventual data loss, it is recommended that you +\fInot\fR +use the +\fB\-\-initial\fR +option together with +StopOnError = 0\&. Instead, set +StopOnError +to 0 in +config\&.ini +only after the cluster has been started, then restart the data nodes normally\(emthat is, without the +\fB\-\-initial\fR +option\&. See the description of the +StopOnError +parameter for a detailed explanation of this issue\&. (Bug #24945638) +.sp .5v +.RE Use of this option prevents the StartPartialTimeout and @@ -379,11 +407,11 @@ .sp -1 .IP \(bu 2.3 .\} -MySQL Cluster Disk Data files (see -Section\ \&18.5.12, \(lqMySQL Cluster Disk Data Tables\(rq)\&. +NDB Cluster Disk Data files (see +Section\ \&18.5.12, \(lqNDB Cluster Disk Data Tables\(rq)\&. .RE .sp -This option also has no effect on recovery of data by a data node that is just starting (or restarting) from data nodes that are already running\&. This recovery of data occurs automatically, and requires no user intervention in a MySQL Cluster that is running normally\&. +This option also has no effect on recovery of data by a data node that is just starting (or restarting) from data nodes that are already running\&. This recovery of data occurs automatically, and requires no user intervention in an NDB Cluster that is running normally\&. .sp .5v .RE It is permissible to use this option when starting the cluster for the very first time (that is, before any data node files have been created); however, it is @@ -554,7 +582,7 @@ connects to the management server, obtains configuration data from it, and initializes communication objects\&. However, it does not actually start the execution engine until specifically requested to do so by the management server\&. This can be accomplished by issuing the proper START command in the management client (see -Section\ \&18.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq)\&. +Section\ \&18.5.2, \(lqCommands in the NDB Cluster Management Client\(rq)\&. .RE .sp .RS 4 @@ -780,7 +808,7 @@ \fB\-\-connect\-retries\fR option)\&. The default is 5 seconds\&. .sp -This option is deprecated in MySQL Cluster NDB 7\&.4\&.9, and is subject to removal in a future release of MySQL Cluster\&. Use +This option is deprecated in NDB 7\&.4\&.9, and is subject to removal in a future release of NDB Cluster\&. Use \fB\-\-connect\-retry\-delay\fR instead\&. .RE @@ -840,9 +868,9 @@ \fB\-\-connect\-retries\fR option)\&. The default is 5 seconds\&. .sp -This option was added in MySQL Cluster NDB 7\&.4\&.9, and is intended to take the place of the +This option was added in NDB 7\&.4\&.9, and is intended to take the place of the \fB\-\-connect\-delay\fR -option, which is now deprecated and subject to removal in a future release of MySQL Cluster\&. +option, which is now deprecated and subject to removal in a future release of NDB Cluster\&. .RE .PP \fBndbd\fR @@ -894,7 +922,7 @@ Listings of possible \fBndbd\fR exit codes and messages generated when a data node process shuts down prematurely can be found in -\m[blue]\fBndbd Error Messages\fR\m[]\&\s-2\u[1]\d\s+2\&. +\m[blue]\fBData Node Error Messages\fR\m[]\&\s-2\u[1]\d\s+2\&. .if n \{\ .sp .\} @@ -926,7 +954,7 @@ .IP \(bu 2.3 .\} ndb_\fInode_id\fR_trace\&.log\&.\fItrace_id\fR -is a trace file describing exactly what happened just before the error occurred\&. This information is useful for analysis by the MySQL Cluster development team\&. +is a trace file describing exactly what happened just before the error occurred\&. This information is useful for analysis by the NDB Cluster development team\&. .sp It is possible to configure the number of these trace files that will be created before old files are overwritten\&. \fItrace_id\fR @@ -1008,10 +1036,10 @@ .\} .PP See -Section\ \&18.3.3.3, \(lqMySQL Cluster Connection Strings\(rq, for additional information about this issue\&. -Options Common to MySQL Cluster Programs(1), describes other command\-line options which can be used with +Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for additional information about this issue\&. +Options Common to NDB Cluster Programs(1), describes other command\-line options which can be used with \fBndbd\fR\&. For information about data node configuration parameters, see -Section\ \&18.3.3.6, \(lqDefining MySQL Cluster Data Nodes\(rq\&. +Section\ \&18.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq\&. .PP When \fBndbd\fR @@ -1035,11 +1063,11 @@ For a machine with many CPUs it is possible to use several \fBndbd\fR processes which belong to different node groups; however, such a configuration is still considered experimental and is not supported for MySQL 5\&.6 in a production setting\&. See -Section\ \&18.1.6, \(lqKnown Limitations of MySQL Cluster\(rq\&. +Section\ \&18.1.6, \(lqKnown Limitations of NDB Cluster\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -1049,9 +1077,9 @@ .sp .SH "NOTES" .IP " 1." 4 -ndbd Error Messages +Data Node Error Messages .RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html +\%http://dev.mysql.com/doc/ndb-internals/en/ndb-node-error-messages.html .RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_delete_all.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_delete_all.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_delete_all.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_delete_all.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_delete_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DELETE_ALL\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DELETE_ALL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -61,15 +61,15 @@ in MySQL\&. .PP The following table includes options that are specific to -\fBndb_delete_all\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +\fBndb_delete_all\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_delete_all\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.88.\ \& This table describes command\-line options for the ndb_delete_all program +.B Table\ \&18.89.\ \& This table describes command\-line options for the ndb_delete_all program .TS allbox tab(:); . @@ -107,7 +107,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_desc.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_desc.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_desc.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_desc.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_desc\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DESC\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DESC\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -229,7 +229,7 @@ .\} .PP (For more information on the statements just shown and the objects created by them, see -Section\ \&18.5.12.1, \(lqMySQL Cluster Disk Data Objects\(rq, as well as +Section\ \&18.5.12.1, \(lqNDB Cluster Disk Data Objects\(rq, as well as Section\ \&13.1.14, \(lqCREATE LOGFILE GROUP Syntax\(rq, and Section\ \&13.1.18, \(lqCREATE TABLESPACE Syntax\(rq\&.) .PP @@ -316,15 +316,15 @@ table\&. .PP The following table includes options that are specific to -\fBndb_desc\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +\fBndb_desc\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_desc\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.89.\ \& This table describes command\-line options for the ndb_desc program +.B Table\ \&18.90.\ \& This table describes command\-line options for the ndb_desc program .TS allbox tab(:); . @@ -378,7 +378,7 @@ \fB\-\-extra\-node\-info\fR, \fB\-n\fR .sp -Include information about the mappings between table partitions and the data nodes upon which they reside\&. This information can be useful for verifying distribution awareness mechanisms and supporting more efficient application access to the data stored in MySQL Cluster\&. +Include information about the mappings between table partitions and the data nodes upon which they reside\&. This information can be useful for verifying distribution awareness mechanisms and supporting more efficient application access to the data stored in NDB Cluster\&. .sp Use of this option also requires the use of the \fB\-\-extra\-partition\-info\fR @@ -443,7 +443,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -455,7 +455,7 @@ .IP " 1." 4 NDB Schema Object Versions .RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-schema-object-versions.html +\%http://dev.mysql.com/doc/ndb-internals/en/ndb-internals-schema-object-versions.html .RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbd_redo_log_reader.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbd_redo_log_reader.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbd_redo_log_reader.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbd_redo_log_reader.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,214 +0,0 @@ -'\" t -.\" Title: \fBndbd_redo_log_reader\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDBD_REDO_LOG_REA" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -ndbd_redo_log_reader \- check and print content of cluster redo log -.SH "SYNOPSIS" -.HP \w'\fBndbd_redo_log_reader\ \fR\fB\fIfile_name\fR\fR\fB\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u -\fBndbd_redo_log_reader \fR\fB\fIfile_name\fR\fR\fB [\fR\fB\fIoptions\fR\fR\fB]\fR -.SH "DESCRIPTION" -.PP -Reads a redo log file, checking it for errors, printing its contents in a human\-readable format, or both\&. -\fBndbd_redo_log_reader\fR -is intended for use primarily by MySQL Cluster developers and Support personnel in debugging and diagnosing problems\&. -.PP -This utility remains under development, and its syntax and behavior are subject to change in future MySQL Cluster releases\&. -.PP -The C++ source files for -\fBndbd_redo_log_reader\fR -can be found in the directory -/storage/ndb/src/kernel/blocks/dblqh/redoLogReader\&. -.PP -The following table includes options that are specific to the MySQL Cluster program -\fBndbd_redo_log_reader\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndbd_redo_log_reader\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.94.\ \& This table describes command\-line options for the ndbd_redo_log_reader program -.TS -allbox tab(:); -. -.TE -.sp 1 -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndbd_redo_log_reader \fIfile_name\fR [\fIoptions\fR] -.fi -.if n \{\ -.RE -.\} -.PP -\fIfile_name\fR -is the name of a cluster redo log file\&. redo log files are located in the numbered directories under the data node\*(Aqs data directory (DataDir); the path under this directory to the redo log files matches the pattern -ndb_\fI#\fR_fs/D\fI#\fR/LCP/\fI#\fR/T\fI#\fRF\fI#\fR\&.Data\&. In each case, the -\fI#\fR -represents a number (not necessarily the same number)\&. For more information, see -\m[blue]\fBMySQL Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. -.PP -The name of the file to be read may be followed by one or more of the options listed here: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-noprint -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -\fB\-noprint\fR: Do not print the contents of the log file\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-nocheck -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -\fB\-nocheck\fR: Do not check the log file for errors\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.TS -allbox tab(:); -l l s s -l l s s. -T{ -\fBIntroduced\fR -T}:T{ -5\&.6\&.15\-ndb\-7\&.3\&.4 -T} -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-help -T} -.TE -.sp 1 -\fB\-\-help\fR: Print usage information\&. -.sp -Added in MySQL Cluster NDB 7\&.3\&.4\&. (Bug #11749591, Bug #36805) -.RE -.PP -Like -\fBndb_print_backup_file\fR -and -\fBndb_print_schema_file\fR -(and unlike most of the -NDB -utilities that are intended to be run on a management server host or to connect to a management server) -\fBndbd_redo_log_reader\fR -must be run on a cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "NOTES" -.IP " 1." 4 -MySQL Cluster Data Node File System Directory Files -.RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html -.RE -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_drop_index.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_drop_index.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_drop_index.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_drop_index.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_drop_index\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DROP_INDEX\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DROP_INDEX\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -59,15 +59,15 @@ \fIdatabase\fR\&. .PP The following table includes options that are specific to -\fBndb_drop_index\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +\fBndb_drop_index\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_drop_index\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.90.\ \& This table describes command\-line options for the ndb_drop_index program +.B Table\ \&18.91.\ \& This table describes command\-line options for the ndb_drop_index program .TS allbox tab(:); . @@ -102,7 +102,7 @@ Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with \-A Welcome to the MySQL monitor\&. Commands end with ; or \eg\&. -Your MySQL connection id is 7 to server version: 5\&.6\&.33\-ndb\-7\&.3\&.15 +Your MySQL connection id is 7 to server version: 5\&.6\&.36\-ndb\-7\&.3\&.18 Type \*(Aqhelp;\*(Aq or \*(Aq\eh\*(Aq for help\&. Type \*(Aq\ec\*(Aq to clear the buffer\&. mysql> \fBSHOW TABLES;\fR +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ @@ -133,7 +133,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_drop_table.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_drop_table.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_drop_table.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_drop_table.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_drop_table\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DROP_TABLE\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DROP_TABLE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -57,15 +57,15 @@ .\} .PP The following table includes options that are specific to -\fBndb_drop_table\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +\fBndb_drop_table\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_drop_table\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.91.\ \& This table describes command\-line options for the ndb_drop_table program +.B Table\ \&18.92.\ \& This table describes command\-line options for the ndb_drop_table program .TS allbox tab(:); . @@ -74,7 +74,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_error_reporter.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_error_reporter.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_error_reporter.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_error_reporter.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_error_reporter\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_ERROR_REPORTE" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_ERROR_REPORTE" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,17 +36,17 @@ .PP \fBndb_error_reporter\fR creates an archive from data node and management node log files that can be used to help diagnose bugs or other problems with a cluster\&. -\fIIt is highly recommended that you make use of this utility when filing reports of bugs in MySQL Cluster\fR\&. +\fIIt is highly recommended that you make use of this utility when filing reports of bugs in NDB Cluster\fR\&. .PP -The following table includes command options specific to the MySQL Cluster program -\fBndb_error_reporter\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes command options specific to the NDB Cluster program +\fBndb_error_reporter\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_error_reporter\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .PP \fBndb_error_reporter\fR did not support the \fB\-\-help\fR -option prior to MySQL Cluster NDB 7\&.3\&.3 (Bug #11756666, Bug #48606)\&. The +option prior to NDB 7\&.3\&.3 (Bug #11756666, Bug #48606)\&. The \fB\-\-connection\-timeout\fR \fB\-\-dry\-scp\fR, and \fB\-\-skip\-nodegroup\fR @@ -56,7 +56,7 @@ .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.92.\ \& This table describes command\-line options for the ndb_error_reporter program +.B Table\ \&18.93.\ \& This table describes command\-line options for the ndb_error_reporter program .TS allbox tab(:); . @@ -255,7 +255,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_index_stat.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_index_stat.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_index_stat.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_index_stat.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_index_stat\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_INDEX_STAT\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_INDEX_STAT\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -156,17 +156,17 @@ .\} .sp Options.PP -The following table includes options that are specific to the MySQL Cluster +The following table includes options that are specific to the NDB Cluster \fBndb_index_stat\fR -utility\&. Additional descriptions are listed following the table\&. For options common to most MySQL Cluster programs (including +utility\&. Additional descriptions are listed following the table\&. For options common to most NDB Cluster programs (including \fBndb_index_stat\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.93.\ \& This table describes command\-line options for the ndb_index_stat program +.B Table\ \&18.94.\ \& This table describes command\-line options for the ndb_index_stat program .TS allbox tab(:); . @@ -835,7 +835,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbinfo_select_all.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbinfo_select_all.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbinfo_select_all.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbinfo_select_all.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndbinfo_select_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBINFO_SELECT_AL" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBINFO_SELECT_AL" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,7 +37,7 @@ \fBndbinfo_select_all\fR is a client program that selects all rows and columns from one or more tables in the ndbinfo -database\&. It is included with the MySQL Cluster distribution beginning with MySQL Cluster NDB 7\&.2\&.2\&. +database\&. It is included with the NDB Cluster distribution beginning with NDB 7\&.2\&.2\&. .PP Not all ndbinfo @@ -106,15 +106,15 @@ .\} .PP The following table includes options that are specific to -\fBndbinfo_select_all\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +\fBndbinfo_select_all\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndbinfo_select_all\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.83.\ \& This table describes command\-line options for the ndbinfo_select_all program +.B Table\ \&18.84.\ \& This table describes command\-line options for the ndbinfo_select_all program .TS allbox tab(:); . @@ -224,7 +224,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_mgm.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_mgm.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_mgm.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_mgm.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_mgm\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_MGM\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_MGM\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_mgm \- the MySQL Cluster management client +ndb_mgm \- the NDB Cluster management client .SH "SYNOPSIS" .HP \w'\fBndb_mgm\ \fR\fB\fIoptions\fR\fR\ 'u \fBndb_mgm \fR\fB\fIoptions\fR\fR @@ -67,16 +67,16 @@ localhost and 1186, respectively\&. .PP -The following table includes options that are specific to the MySQL Cluster management client program -\fBndb_mgm\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster management client program +\fBndb_mgm\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_mgm\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.85.\ \& This table describes command\-line options for the ndb_mgm program +.B Table\ \&18.86.\ \& This table describes command\-line options for the ndb_mgm program .TS allbox tab(:); . @@ -137,14 +137,14 @@ This option specifies the number of times following the first attempt to retry a connection before giving up (the client always tries the connection at least once)\&. The length of time to wait per attempt is set using \fB\-\-connect\-retry\-delay\fR\&. .sp -This option was added in MySQL Cluster NDB 7\&.4\&.9, and is synonymous with the +This option was added in NDB 7\&.4\&.9, and is synonymous with the \fB\-\-try\-reconnect\fR option, which is now deprecated\&. .sp The default for this option this option differs from its default when used with other NDB programs\&. See -Options Common to MySQL Cluster Programs(1), for more information\&. +Options Common to NDB Cluster Programs(1), for more information\&. .RE .sp .RS 4 @@ -167,7 +167,7 @@ T} .TE .sp 1 -This option can be used to send a command to the MySQL Cluster management client from the system shell\&. For example, either of the following is equivalent to executing +This option can be used to send a command to the NDB Cluster management client from the system shell\&. For example, either of the following is equivalent to executing SHOW in the management client: .sp @@ -264,18 +264,18 @@ \fInumber\fR before giving up and reporting an error instead\&. .sp -This option is deprecated in MySQL Cluster NDB 7\&.4\&.9 and later, and is superseded by +This option is deprecated in NDB 7\&.4\&.9 and later, and is superseded by \fB\-\-connect\-retries\fR\&. .RE .PP Additional information about using \fBndb_mgm\fR can be found in -Section\ \&18.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq\&. +Section\ \&18.5.2, \(lqCommands in the NDB Cluster Management Client\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_mgmd.8 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_mgmd.8 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_mgmd.8 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_mgmd.8 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_mgmd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_MGMD\FR" "8" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_MGMD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_mgmd \- the MySQL Cluster management server daemon +ndb_mgmd \- the NDB Cluster management server daemon .SH "SYNOPSIS" .HP \w'\fBndb_mgmd\ \fR\fB\fIoptions\fR\fR\ 'u \fBndb_mgmd \fR\fB\fIoptions\fR\fR @@ -36,16 +36,16 @@ .PP The management server is the process that reads the cluster configuration file and distributes this information to all nodes in the cluster that request it\&. It also maintains a log of cluster activities\&. Management clients can connect to the management server and check the cluster\*(Aqs status\&. .PP -The following table includes options that are specific to the MySQL Cluster management server program -\fBndb_mgmd\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster management server program +\fBndb_mgmd\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_mgmd\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.84.\ \& This table describes command\-line options for the ndb_mgmd program +.B Table\ \&18.85.\ \& This table describes command\-line options for the ndb_mgmd program .TS allbox tab(:); . @@ -60,7 +60,7 @@ .sp -1 .IP \(bu 2.3 .\} -\fB\-\-bind\-address=\fR\fB\fIhost\fR\fR\fB[:\fR\fB\fIport\fR\fR\fB]\fR +\fB\-\-bind\-address=\fR\fB\fIhost\fR\fR .TS allbox tab(:); l l s s @@ -69,7 +69,7 @@ T{ \fBCommand\-Line Format\fR T}:T{ -\-\-bind\-address=ip_address +\-\-bind\-address=host T} T{ \fBPermitted Values\fR @@ -85,12 +85,7 @@ T} .TE .sp 1 -When specified, this option limits management server connections by management clients to clients at the specified host name or IP address (and possibly port, if this is also specified)\&. In such cases, a management client attempting to connect to the management server from any other address fails with the error -Unable to setup port: \fIhost\fR:\fIport\fR! -.sp -If the -\fIport\fR -is not specified, the management client attempts to use port 1186\&. +Causes the management server to bind to a specific network interface (host name or IP address)\&. This option has no default value\&. .RE .sp .RS 4 @@ -213,7 +208,7 @@ ON), can be used to disable the management server\*(Aqs configuration cache, so that it reads its configuration from config\&.ini every time it starts (see -Section\ \&18.3.3, \(lqMySQL Cluster Configuration Files\(rq)\&. You can do this by starting the +Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. You can do this by starting the \fBndb_mgmd\fR process with any one of the following options: .sp @@ -372,11 +367,11 @@ \fBndb_mgmd\fR was started with \fB\-\-config\-cache=OFF\fR\&. See -Section\ \&18.3.3, \(lqMySQL Cluster Configuration Files\(rq, for more information\&. +Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq, for more information\&. .sp Formerly, using this option together with \fB\-\-initial\fR -caused removal of the configuration cache even if the file was not found\&. This issue was resolved in MySQL Cluster NDB 7\&.3\&.2\&. (Bug #1299289) +caused removal of the configuration cache even if the file was not found\&. This issue was resolved in NDB 7\&.3\&.2\&. (Bug #1299289) .RE .sp .RS 4 @@ -497,7 +492,7 @@ \fBndb_mgmd\fR in interactive mode; that is, an \fBndb_mgm\fR -client session is started as soon as the management server is running\&. This option does not start any other MySQL Cluster nodes\&. +client session is started as soon as the management server is running\&. This option does not start any other NDB Cluster nodes\&. .RE .sp .RS 4 @@ -534,7 +529,7 @@ .TE .sp 1 Configuration data is cached internally, rather than being read from the cluster global configuration file each time the management server is started (see -Section\ \&18.3.3, \(lqMySQL Cluster Configuration Files\(rq)\&. Using the +Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using the \fB\-\-initial\fR option overrides this behavior, by forcing the management server to delete any existing cache files, and then to re\-read the configuration data from the cluster configuration file and to build a new cache\&. .sp @@ -552,16 +547,16 @@ \fB\-\-initial\fR but cannot find a global configuration file, the management server cannot start\&. .sp -When a management server starts, it checks for another management server in the same MySQL Cluster and tries to use the other management server\*(Aqs configuration data; +When a management server starts, it checks for another management server in the same NDB Cluster and tries to use the other management server\*(Aqs configuration data; \fBndb_mgmd\fR ignores \fB\-\-initial\fR -unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of a MySQL Cluster with multiple management nodes\&. See -Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for more information\&. +unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of an NDB Cluster with multiple management nodes\&. See +Section\ \&18.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&. .sp Formerly, using this option together with the \fB\-\-config\-file\fR -option caused removal of the configuration cache even if the file was not found\&. Starting with MySQL Cluster NDB 7\&.3\&.2, the cache is cleared in such cases only if the configuration file is actually found\&. (Bug #1299289) +option caused removal of the configuration cache even if the file was not found\&. Starting with NDB 7\&.3\&.2, the cache is cleared in such cases only if the configuration file is actually found\&. (Bug #1299289) .RE .sp .RS 4 @@ -716,8 +711,8 @@ T} .TE .sp 1 -In MySQL Cluster NDB 7\&.3, configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see -Section\ \&18.3.3, \(lqMySQL Cluster Configuration Files\(rq)\&. Using this option forces the management server to check its internal data store against the cluster configuration file and to reload the configuration if it finds that the configuration file does not match the cache\&. Existing configuration cache files are preserved, but not used\&. +In NDB Cluster 7\&.3, configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see +Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using this option forces the management server to check its internal data store against the cluster configuration file and to reload the configuration if it finds that the configuration file does not match the cache\&. Existing configuration cache files are preserved, but not used\&. .sp This differs in two ways from the \fB\-\-initial\fR @@ -731,12 +726,12 @@ \fB\-\-reload\fR option is ignored\&. .sp -When a management server starts, it checks for another management server in the same MySQL Cluster and tries to use the other management server\*(Aqs configuration data; +When a management server starts, it checks for another management server in the same NDB Cluster and tries to use the other management server\*(Aqs configuration data; \fBndb_mgmd\fR ignores \fB\-\-reload\fR -unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of a MySQL Cluster with multiple management nodes\&. See -Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for more information\&. +unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of an NDB Cluster with multiple management nodes\&. See +Section\ \&18.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&. .RE .sp .RS 4 @@ -783,7 +778,7 @@ T} .TE .sp 1 -When starting a MySQL Cluster is configured with two management nodes, each management server normally checks to see whether the other +When starting an NDB Cluster is configured with two management nodes, each management server normally checks to see whether the other \fBndb_mgmd\fR is also operational and whether the other management server\*(Aqs configuration is identical to its own\&. However, it is sometimes desirable to start the cluster with only one management node (and perhaps to allow the other \fBndb_mgmd\fR @@ -861,8 +856,8 @@ .sp The same is true with regard to the connection string used with any \fBmysqld\fR -processes that you wish to start as MySQL Cluster SQL nodes connected to this cluster\&. See -Section\ \&18.3.3.3, \(lqMySQL Cluster Connection Strings\(rq, for more information\&. +processes that you wish to start as NDB Cluster SQL nodes connected to this cluster\&. See +Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for more information\&. .sp When used with \fBndb_mgmd\fR, this option affects the behavior of the management node with regard to other management nodes only\&. Do not confuse it with the @@ -873,7 +868,7 @@ \fBndbmtd\fR to permit a cluster to start with fewer than its full complement of data nodes; when used with data nodes, this option affects their behavior only with regard to other data nodes\&. .sp -Multiple management node IDs may be passed to this option as a comma\-separated list\&. Each node ID must be no less than 1 and no greater than 255\&. In practice, it is quite rare to use more than two management servers for the same MySQL Cluster (or to have any need for doing so); in most cases you need to pass to this option only the single node ID for the one management server that you do not wish to use when starting the cluster\&. +Multiple management node IDs may be passed to this option as a comma\-separated list\&. Each node ID must be no less than 1 and no greater than 255\&. In practice, it is quite rare to use more than two management servers for the same NDB Cluster (or to have any need for doing so); in most cases you need to pass to this option only the single node ID for the one management server that you do not wish to use when starting the cluster\&. .if n \{\ .sp .\} @@ -896,7 +891,7 @@ It is not strictly necessary to specify a connection string when starting the management server\&. However, if you are using more than one management server, a connection string should be provided and each node in the cluster should specify its node ID explicitly\&. .PP See -Section\ \&18.3.3.3, \(lqMySQL Cluster Connection Strings\(rq, for information about using connection strings\&. +Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for information about using connection strings\&. \fBndb_mgmd\fR(8), describes other options for \fBndb_mgmd\fR\&. .PP @@ -920,7 +915,7 @@ .\} config\&.ini is the configuration file for the cluster as a whole\&. This file is created by the user and read by the management server\&. -Section\ \&18.3, \(lqConfiguration of MySQL Cluster\(rq, discusses how to set up this file\&. +Section\ \&18.3, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up this file\&. .RE .sp .RS 4 @@ -933,7 +928,7 @@ .\} ndb_\fInode_id\fR_cluster\&.log is the cluster events log file\&. Examples of such events include checkpoint startup and completion, node startup events, node failures, and levels of memory usage\&. A complete listing of cluster events with descriptions may be found in -Section\ \&18.5, \(lqManagement of MySQL Cluster\(rq\&. +Section\ \&18.5, \(lqManagement of NDB Cluster\(rq\&. .sp By default, when the size of the cluster log reaches one million bytes, the file is renamed to ndb_\fInode_id\fR_cluster\&.log\&.\fIseq_id\fR, where @@ -1087,7 +1082,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_move_data.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_move_data.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_move_data.1 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_move_data.1 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,446 @@ +'\" t +.\" Title: \fBndb_move_data\fR +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 06/02/2017 +.\" Manual: MySQL Database System +.\" Source: MySQL 5.6 +.\" Language: English +.\" +.TH "\FBNDB_MOVE_DATA\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +ndb_move_data \- NDB data copy utility +.SH "SYNOPSIS" +.HP \w'\fBndb_move_data\ \fR\fB\fIoptions\fR\fR\ 'u +\fBndb_move_data \fR\fB\fIoptions\fR\fR +.SH "DESCRIPTION" +.PP +\fBndb_move_data\fR +copies data from one NDB table to another\&. +Usage.PP +The program is invoked with the names of the source and target tables; either or both of these may be qualified optionally with the database name\&. Both tables must use the NDB storage engine\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +ndb_move_data \fIoptions\fR \fIsource\fR \fItarget\fR +.fi +.if n \{\ +.RE +.\} +.PP +The following table includes options that are specific to +\fBndb_move_data\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including +\fBndb_move_data\fR), see +Options Common to NDB Cluster Programs(1)\&. +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&18.95.\ \& This table describes command\-line options for the ndb_move_data program +.TS +allbox tab(:); +. +.TE +.sp 1 +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-abort\-on\-error\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-abort\-on\-error +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Dump core on permanent error (debug option)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-character\-sets\-dir\fR=\fIname\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-character\-sets\-dir=name +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +[none] +T} +.TE +.sp 1 +Directory where character sets are\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-database\fR=\fIdbname\fR, +\fB\-d\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-database=dbname +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +TEST_DB +T} +.TE +.sp 1 +Name of the database in which the table is found\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-drop\-source\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-drop\-source +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Drop source table after all rows have been moved\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-error\-insert\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-error\-insert +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Insert random temporary errors (testing option)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-exclude\-missing\-columns\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-exclude\-missing\-columns +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Ignore extra columns in source or target table\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-lossy\-conversions\fR, +\fB\-l\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-lossy\-conversions +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Allow attribute data to be truncated when converted to a smaller type\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-promote\-attributes\fR, +\fB\-A\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-promote\-attributes +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Allow attribute data to be converted to a larger type\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-staging\-tries\fR=\fIx[,y[,z]]\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-staging\-tries=x[,y[,z]] +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +string +T} +:T{ +\fBDefault\fR +T}:T{ +0,1000,60000 +T} +.TE +.sp 1 +Specify tries on temporary errors\&. Format is x[,y[,z]] where x=max tries (0=no limit), y=min delay (ms), z=max delay (ms)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-verbose\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-verbose +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Enable verbose messages\&. +.RE +.SH "COPYRIGHT" +.br +.PP +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. +.PP +This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. +.PP +This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +.PP +You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. +.sp +.SH "SEE ALSO" +For more information, please refer to the MySQL Reference Manual, +which may already be installed locally and which is also available +online at http://dev.mysql.com/doc/. +.SH AUTHOR +Oracle Corporation (http://dev.mysql.com/). diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbmtd.8 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbmtd.8 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndbmtd.8 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndbmtd.8 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndbmtd\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBMTD\FR" "8" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBMTD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndbmtd \- the MySQL Cluster data node daemon (multi\-threaded version) +ndbmtd \- the NDB Cluster data node daemon (multi\-threaded version) .SH "SYNOPSIS" .HP \w'\fBndbmtd\ \fR\fB\fIoptions\fR\fR\ 'u \fBndbmtd \fR\fB\fIoptions\fR\fR @@ -47,14 +47,14 @@ \fBndbmtd\fR differs from \fBndbd\fR, and you should consult -\fBndbd\fR(8), for additional information about running MySQL Cluster data nodes that apply to both the single\-threaded and multi\-threaded versions of the data node process\&. +\fBndbd\fR(8), for additional information about running NDB Cluster data nodes that apply to both the single\-threaded and multi\-threaded versions of the data node process\&. .PP Command\-line options and configuration parameters used with \fBndbd\fR also apply to \fBndbmtd\fR\&. For more information about these options and parameters, see \fBndbd\fR(8), and -Section\ \&18.3.3.6, \(lqDefining MySQL Cluster Data Nodes\(rq, respectively\&. +Section\ \&18.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq, respectively\&. .PP \fBndbmtd\fR is also file system\-compatible with @@ -133,7 +133,7 @@ In the event of a critical error, \fBndbmtd\fR generates trace files describing what happened just prior to the error\*(Aq occurrence\&. These files, which can be found in the data node\*(Aqs -DataDir, are useful for analysis of problems by the MySQL Cluster Development and Support teams\&. One trace file is generated for each +DataDir, are useful for analysis of problems by the NDB Cluster Development and Support teams\&. One trace file is generated for each \fBndbmtd\fR thread\&. The names of these files have the following pattern: .sp @@ -155,7 +155,7 @@ \fIthread_id\fR is the thread ID\&. For example, in the event of the failure of an \fBndbmtd\fR -process running as a MySQL Cluster data node having the node ID 3 and with +process running as an NDB Cluster data node having the node ID 3 and with MaxNoOfExecutionThreads equal to 4, four trace files are generated in the data node\*(Aqs data directory\&. If the is the first time this node has failed, then these files are named ndb_3_trace\&.log\&.1_t1, @@ -169,7 +169,7 @@ \fBndbd\fR exit codes and messages that are generated when a data node process shuts down prematurely are also used by \fBndbmtd\fR\&. See -\m[blue]\fBndbd Error Messages\fR\m[]\&\s-2\u[1]\d\s+2, for a listing of these\&. +\m[blue]\fBData Node Error Messages\fR\m[]\&\s-2\u[1]\d\s+2, for a listing of these\&. .if n \{\ .sp .\} @@ -187,13 +187,13 @@ \fBndbd\fR and \fBndbmtd\fR -concurrently on different data nodes in the same MySQL Cluster\&. However, such configurations have not been tested extensively; thus, we cannot recommend doing so in a production setting at this time\&. +concurrently on different data nodes in the same NDB Cluster\&. However, such configurations have not been tested extensively; thus, we cannot recommend doing so in a production setting at this time\&. .sp .5v .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -203,9 +203,9 @@ .sp .SH "NOTES" .IP " 1." 4 -ndbd Error Messages +Data Node Error Messages .RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html +\%http://dev.mysql.com/doc/ndb-internals/en/ndb-node-error-messages.html .RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_backup_file.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_backup_file.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_backup_file.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_backup_file.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_backup_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_BACKUP_" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_BACKUP_" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -56,7 +56,7 @@ BACKUP\-\fI#\fR, where \fI#\fR is the sequence number for the backup\&. For more information about cluster backup files and their contents, see -Section\ \&18.5.3.1, \(lqMySQL Cluster Backup Concepts\(rq\&. +Section\ \&18.5.3.1, \(lqNDB Cluster Backup Concepts\(rq\&. .PP Like \fBndb_print_schema_file\fR @@ -72,7 +72,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_file.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_file.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_file.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_file.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_FILE\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_FILE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,7 +35,7 @@ .SH "DESCRIPTION" .PP \fBndb_print_file\fR -obtains information from a MySQL Cluster Disk Data file\&. +obtains information from an NDB Cluster Disk Data file\&. Usage .sp .if n \{\ @@ -49,7 +49,7 @@ .\} .PP \fIfile_name\fR -is the name of a MySQL Cluster Disk Data file\&. Multiple filenames are accepted, separated by spaces\&. +is the name of an NDB Cluster Disk Data file\&. Multiple filenames are accepted, separated by spaces\&. .PP Like \fBndb_print_schema_file\fR @@ -59,7 +59,7 @@ NDB utilities that are intended to be run on a management server host or to connect to a management server) \fBndb_print_file\fR -must be run on a MySQL Cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. +must be run on an NDB Cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. Additional Options.PP \fBndb_print_file\fR supports the following options: @@ -98,15 +98,15 @@ \fB\-h\fR, \fB\-?\fR: Print help message\&. .sp -This option did not work correctly prior to MySQL Cluster NDB 7\&.3\&.7\&. (Bug #17069285) +This option did not work correctly prior to NDB 7\&.3\&.7\&. (Bug #17069285) .RE .PP For more information, see -Section\ \&18.5.12, \(lqMySQL Cluster Disk Data Tables\(rq\&. +Section\ \&18.5.12, \(lqNDB Cluster Disk Data Tables\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_frag_file.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_frag_file.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_frag_file.1 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_frag_file.1 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,140 @@ +'\" t +.\" Title: \fBndb_print_frag_file\fR +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 06/02/2017 +.\" Manual: MySQL Database System +.\" Source: MySQL 5.6 +.\" Language: English +.\" +.TH "\FBNDB_PRINT_FRAG_FI" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +ndb_print_frag_file \- print NDB Fragment List File contents +.SH "SYNOPSIS" +.HP \w'\fBndb_print_frag_file\ \fR\fB\fIfile_name\fR\fR\ 'u +\fBndb_print_frag_file \fR\fB\fIfile_name\fR\fR +.SH "DESCRIPTION" +.PP +\fBndb_print_frag_file\fR +obtains information from a cluster fragment list file\&. It is intended for use in helping to diagnose issues with data node restarts\&. +Usage +.sp +.if n \{\ +.RS 4 +.\} +.nf +ndb_print_frag_file \fIfile_name\fR +.fi +.if n \{\ +.RE +.\} +.PP +\fIfile_name\fR +is the name of a cluster fragment list file, which matches the pattern +S\fIX\fR\&.FragList, where +\fIX\fR +is a digit in the range 2\-9 inclusive, and are found in the data node file system of the data node having the node ID +\fInodeid\fR, in directories named +ndb_\fInodeid\fR_fs/D\fIN\fR/DBDIH/, where +\fIN\fR +is +1 +or +2\&. Each fragment file contains records of the fragments belonging to each +NDB +table\&. For more information about cluster fragment files, see +\m[blue]\fBNDB Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. +.PP +Like +\fBndb_print_backup_file\fR, +\fBndb_print_sys_file\fR, and +\fBndb_print_schema_file\fR +(and unlike most of the other +NDB +utilities that are intended to be run on a management server host or to connect to a management server), +\fBndb_print_frag_file\fR +must be run on a cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. +Additional Options.PP +None\&. +Sample Output +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBndb_print_frag_file /usr/local/mysqld/data/ndb_3_fs/D1/DBDIH/S2\&.FragList\fR +Filename: /usr/local/mysqld/data/ndb_3_fs/D1/DBDIH/S2\&.FragList with size 8192 +noOfPages = 1 noOfWords = 182 +Table Data +\-\-\-\-\-\-\-\-\-\- +Num Frags: 2 NoOfReplicas: 2 hashpointer: 4294967040 +kvalue: 6 mask: 0x00000000 method: HashMap +Storage is on Logged and checkpointed, survives SR +\-\-\-\-\-\- Fragment with FragId: 0 \-\-\-\-\-\-\-\- +Preferred Primary: 2 numStoredReplicas: 2 numOldStoredReplicas: 0 distKey: 0 LogPartId: 0 +\-\-\-\-\-\-\-Stored Replica\-\-\-\-\-\-\-\-\-\- +Replica node is: 2 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1 +LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid +LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid +\-\-\-\-\-\-\-Stored Replica\-\-\-\-\-\-\-\-\-\- +Replica node is: 3 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1 +LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid +LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid +\-\-\-\-\-\- Fragment with FragId: 1 \-\-\-\-\-\-\-\- +Preferred Primary: 3 numStoredReplicas: 2 numOldStoredReplicas: 0 distKey: 0 LogPartId: 1 +\-\-\-\-\-\-\-Stored Replica\-\-\-\-\-\-\-\-\-\- +Replica node is: 3 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1 +LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid +LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid +\-\-\-\-\-\-\-Stored Replica\-\-\-\-\-\-\-\-\-\- +Replica node is: 2 initialGci: 2 numCrashedReplicas = 0 nextLcpNo = 1 +LcpNo[0]: maxGciCompleted: 1 maxGciStarted: 2 lcpId: 1 lcpStatus: valid +LcpNo[1]: maxGciCompleted: 0 maxGciStarted: 0 lcpId: 0 lcpStatus: invalid +.fi +.if n \{\ +.RE +.\} +.PP +This program was added in MySQL NDB Cluster 7\&.4\&.3\&. (Bug #74594, Bug #19898269) +.SH "COPYRIGHT" +.br +.PP +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. +.PP +This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. +.PP +This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +.PP +You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. +.sp +.SH "NOTES" +.IP " 1." 4 +NDB Cluster Data Node File System Directory Files +.RS 4 +\%http://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html +.RE +.SH "SEE ALSO" +For more information, please refer to the MySQL Reference Manual, +which may already be installed locally and which is also available +online at http://dev.mysql.com/doc/. +.SH AUTHOR +Oracle Corporation (http://dev.mysql.com/). diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_schema_file.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_schema_file.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_schema_file.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_schema_file.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_schema_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_SCHEMA_" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_SCHEMA_" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -50,7 +50,7 @@ .PP \fIfile_name\fR is the name of a cluster schema file\&. For more information about cluster schema files, see -\m[blue]\fBMySQL Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. +\m[blue]\fBNDB Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP Like \fBndb_print_backup_file\fR @@ -66,7 +66,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -76,9 +76,9 @@ .sp .SH "NOTES" .IP " 1." 4 -MySQL Cluster Data Node File System Directory Files +NDB Cluster Data Node File System Directory Files .RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html +\%http://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html .RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_sys_file.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_sys_file.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_print_sys_file.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_print_sys_file.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_print_sys_file\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_SYS_FIL" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_SYS_FIL" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,7 +35,7 @@ .SH "DESCRIPTION" .PP \fBndb_print_sys_file\fR -obtains diagnostic information from a MySQL Cluster system file\&. +obtains diagnostic information from an NDB Cluster system file\&. Usage .sp .if n \{\ @@ -53,7 +53,7 @@ ndb_\fI#\fR_fs/D\fI#\fR/DBDIH/P\fI#\fR\&.sysfile\&. In each case, the \fI#\fR represents a number (not necessarily the same number)\&. For more information, see -\m[blue]\fBMySQL Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. +\m[blue]\fBNDB Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP Like \fBndb_print_backup_file\fR @@ -69,7 +69,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP @@ -79,9 +79,9 @@ .sp .SH "NOTES" .IP " 1." 4 -MySQL Cluster Data Node File System Directory Files +NDB Cluster Data Node File System Directory Files .RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html +\%http://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html .RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_redo_log_reader.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_redo_log_reader.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_redo_log_reader.1 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_redo_log_reader.1 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,602 @@ +'\" t +.\" Title: \fBndb_redo_log_reader\fR +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 06/02/2017 +.\" Manual: MySQL Database System +.\" Source: MySQL 5.6 +.\" Language: English +.\" +.TH "\FBNDB_REDO_LOG_READ" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +ndb_redo_log_reader \- check and print content of cluster redo log +.SH "SYNOPSIS" +.HP \w'\fBndb_redo_log_reader\ \fR\fB\fIfile_name\fR\fR\fB\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u +\fBndb_redo_log_reader \fR\fB\fIfile_name\fR\fR\fB [\fR\fB\fIoptions\fR\fR\fB]\fR +.SH "DESCRIPTION" +.PP +Reads a redo log file, checking it for errors, printing its contents in a human\-readable format, or both\&. +\fBndb_redo_log_reader\fR +is intended for use primarily by NDB Cluster developers and Support personnel in debugging and diagnosing problems\&. +.PP +This utility remains under development, and its syntax and behavior are subject to change in future NDB Cluster releases\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +Prior to NDB 7\&.2, this utility was named +\fBndbd_redo_log_reader\fR\&. +.sp .5v +.RE +.PP +The C++ source files for +\fBndb_redo_log_reader\fR +can be found in the directory +/storage/ndb/src/kernel/blocks/dblqh/redoLogReader\&. +.PP +The following table includes options that are specific to the NDB Cluster program +\fBndb_redo_log_reader\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including +\fBndb_redo_log_reader\fR), see +Options Common to NDB Cluster Programs(1)\&. +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&18.96.\ \& This table describes command\-line options for the ndb_redo_log_reader program +.TS +allbox tab(:); +. +.TE +.sp 1 +Usage +.sp +.if n \{\ +.RS 4 +.\} +.nf +ndb_redo_log_reader \fIfile_name\fR [\fIoptions\fR] +.fi +.if n \{\ +.RE +.\} +.PP +\fIfile_name\fR +is the name of a cluster redo log file\&. redo log files are located in the numbered directories under the data node\*(Aqs data directory (DataDir); the path under this directory to the redo log files matches the pattern +ndb_\fInodeid\fR_fs/D\fI#\fR/DBLQH/S\fI#\fR\&.FragLog\&. +\fInodeid\fR +is the data node\*(Aqs node ID\&. The two instances of +\fI#\fR +each represent a number (not necessarily the same number); the number following +D +is in the range 8\-39 inclusive; the range of the number following +S +varies according to the value of the +NoOfFragmentLogFiles +configuration parameter, whose default value is 16; thus, the default range of the number in the file name is 0\-15 inclusive\&. For more information, see +\m[blue]\fBNDB Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. +.PP +The name of the file to be read may be followed by one or more of the options listed here: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-dump\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-dump +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Print dump info\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-filedescriptors +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +\fB\-filedescriptors\fR: Print file descriptors only\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l s s. +T{ +\fBIntroduced\fR +T}:T{ +5\&.6\&.15\-ndb\-7\&.3\&.4 +T} +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-\-help +T} +.TE +.sp 1 +\fB\-\-help\fR: Print usage information\&. +.sp +Added in NDB 7\&.3\&.4\&. (Bug #11749591, Bug #36805) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-lap\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-lap +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Provide lap info, with max GCI started and completed\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s +^ l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-mbyte # +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +numeric +T} +:T{ +\fBDefault\fR +T}:T{ +0 +T} +:T{ +\fBMin Value\fR +T}:T{ +0 +T} +:T{ +\fBMax Value\fR +T}:T{ +15 +T} +.TE +.sp 1 +\fB\-mbyte \fR\fB\fI#\fR\fR: Starting megabyte\&. +.sp +\fI#\fR +is an integer in the range 0 to 15, inclusive\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-mbyteheaders +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +\fB\-mbyteheaders\fR: Show only the first page header of every megabyte in the file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-noprint +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +\fB\-noprint\fR: Do not print the contents of the log file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-nocheck +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +\fB\-nocheck\fR: Do not check the log file for errors\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s +^ l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-page # +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +integer +T} +:T{ +\fBDefault\fR +T}:T{ +0 +T} +:T{ +\fBMin Value\fR +T}:T{ +0 +T} +:T{ +\fBMax Value\fR +T}:T{ +31 +T} +.TE +.sp 1 +\fB\-page \fR\fB\fI#\fR\fR: Start at this page\&. +.sp +\fI#\fR +is an integer in the range 0 to 31, inclusive\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-pageheaders +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +\fB\-pageheaders\fR: Show page headers only\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.TS +allbox tab(:); +l l s s +l l l s +^ l l s +^ l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-pageindex # +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +integer +T} +:T{ +\fBDefault\fR +T}:T{ +12 +T} +:T{ +\fBMin Value\fR +T}:T{ +12 +T} +:T{ +\fBMax Value\fR +T}:T{ +8191 +T} +.TE +.sp 1 +\fB\-pageindex \fR\fB\fI#\fR\fR: Start at this page index\&. +.sp +\fI#\fR +is an integer between 12 and 8191, inclusive\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-twiddle\fR +.TS +allbox tab(:); +l l s s +l l l s +^ l l s. +T{ +\fBCommand\-Line Format\fR +T}:T{ +\-twiddle +T} +T{ +\fBPermitted Values\fR +T}:T{ +\fBType\fR +T}:T{ +boolean +T} +:T{ +\fBDefault\fR +T}:T{ +FALSE +T} +.TE +.sp 1 +Bit\-shifted dump\&. +.RE +.PP +Like +\fBndb_print_backup_file\fR +and +\fBndb_print_schema_file\fR +(and unlike most of the +NDB +utilities that are intended to be run on a management server host or to connect to a management server) +\fBndb_redo_log_reader\fR +must be run on a cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. +.SH "COPYRIGHT" +.br +.PP +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. +.PP +This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. +.PP +This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +.PP +You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. +.sp +.SH "NOTES" +.IP " 1." 4 +NDB Cluster Data Node File System Directory Files +.RS 4 +\%http://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html +.RE +.SH "SEE ALSO" +For more information, please refer to the MySQL Reference Manual, +which may already be installed locally and which is also available +online at http://dev.mysql.com/doc/. +.SH AUTHOR +Oracle Corporation (http://dev.mysql.com/). diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_restore.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_restore.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_restore.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_restore.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_restore\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_RESTORE\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_RESTORE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_restore \- restore a MySQL Cluster backup +ndb_restore \- restore an NDB Cluster backup .SH "SYNOPSIS" .HP \w'\fBndb_restore\ \fR\fB\fIoptions\fR\fR\ 'u \fBndb_restore \fR\fB\fIoptions\fR\fR @@ -43,7 +43,7 @@ must be executed once for each of the backup files that were created by the START BACKUP command used to create the backup (see -Section\ \&18.5.3.2, \(lqUsing The MySQL Cluster Management Client to Create a Backup\(rq)\&. This is equal to the number of data nodes in the cluster at the time that the backup was created\&. +Section\ \&18.5.3.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq)\&. This is equal to the number of data nodes in the cluster at the time that the backup was created\&. .if n \{\ .sp .\} @@ -59,27 +59,27 @@ .PP Before using \fBndb_restore\fR, it is recommended that the cluster be running in single user mode, unless you are restoring multiple data nodes in parallel\&. See -Section\ \&18.5.8, \(lqMySQL Cluster Single User Mode\(rq, for more information\&. +Section\ \&18.5.8, \(lqNDB Cluster Single User Mode\(rq, for more information\&. .sp .5v .RE .PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_restore\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster native backup restoration program +\fBndb_restore\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_restore\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.95.\ \& This table describes command\-line options for the ndb_restore program +.B Table\ \&18.97.\ \& This table describes command\-line options for the ndb_restore program .TS allbox tab(:); . .TE .sp 1 .PP -Normally, when restoring from a MySQL Cluster backup, +Normally, when restoring from an NDB Cluster backup, \fBndb_restore\fR requires at a minimum the \fB\-\-nodeid\fR @@ -117,7 +117,7 @@ .ps -1 .br .PP -In MySQL Cluster NDB 7\&.3\&.11 and MySQL Cluster NDB 7\&.4\&.8 +In NDB 7\&.3\&.11 and NDB 7\&.4\&.8 \fIonly\fR, when \fBndb_restore\fR is used to restore any tables containing unique indexes, you must include @@ -132,7 +132,7 @@ option is used to specify a connection string which tells ndb_restore where to locate the cluster management server\&. (See -Section\ \&18.3.3.3, \(lqMySQL Cluster Connection Strings\(rq, for information on connection strings\&.) If this option is not used, then +Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for information on connection strings\&.) If this option is not used, then \fBndb_restore\fR attempts to connect to a management server on localhost:1186\&. This utility acts as a cluster API node, and so requires a free connection @@ -150,7 +150,7 @@ section in config\&.ini that is not being used for a MySQL server or other application for this reason (see -Section\ \&18.3.3.7, \(lqDefining SQL and Other API Nodes in a MySQL Cluster\(rq)\&. +Section\ \&18.3.3.7, \(lqDefining SQL and Other API Nodes in an NDB Cluster\(rq)\&. .PP You can verify that \fBndb_restore\fR @@ -174,17 +174,348 @@ \fB\-\-nodeid\fR or \fB\-n\fR -is used to specify the node ID of the data node on which the backup should be restored\&. +is used to specify the node ID of the data node on which the backup was taken\&. .PP -The first time you run the -\fBndb_restore\fR -restoration program, you also need to restore the metadata\&. In other words, you must re\-create the database tables\(emthis can be done by running it with the -\fB\-\-restore_meta\fR -(\fB\-m\fR) option\&. Restoring the metdata need be done only on a single data node; this is sufficient to restore it to the entire cluster\&. Note that the cluster should have an empty database when starting to restore a backup\&. (In other words, you should start -\fBndbd\fR -with +When restoring to a cluster with different number of data nodes from that where the backup was taken, this information helps identify the correct set or sets of files to be restored to a given node\&. (In such cases, multiple files usually need to be restored to a single data node\&.) The next few paragraphs provide an example\&. +.PP +\fBRestore to a different number of data nodes\fR. You can restore to a cluster having fewer data nodes than the original provided that the larger number of nodes is an even multiple of the smaller number\&. In the following example, we use a backup taken on a cluster having four data nodes to a cluster having two data nodes\&. +.sp +.RS 4 +.ie n \{\ +\h'-04' 1.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 1." 4.2 +.\} +The management server for the original cluster is on host +host10\&. The original cluster has four data nodes, with the node IDs and host names shown in the following extract from the management server\*(Aqs +config\&.ini +file: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[ndbd] +NodeId=2 +HostName=host2 +[ndbd] +NodeId=4 +HostName=host4 +[ndbd] +NodeId=6 +HostName=host6 +[ndbd] +NodeId=8 +HostName=host8 +.fi +.if n \{\ +.RE +.\} +.sp +We assume that each data node was originally started with +\fBndbmtd\fR +\fB\-\-ndb\-connectstring=host10\fR +or the equivalent\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 2.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 2." 4.2 +.\} +Perform a backup in the normal manner\&. See +Section\ \&18.5.3.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq, for information about how to do this\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 3.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 3." 4.2 +.\} +The files created by the backup on each data node are listed here, where +\fIN\fR +is the node ID and +\fIB\fR +is the backup ID\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-\fIB\fR\-0\&.\fIN\fR\&.Data +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-\fIB\fR\&.\fIN\fR\&.ctl +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-\fIB\fR\&.\fIN\fR\&.log +.RE +.sp +These files are found under +BackupDataDir/BACKUP/BACKUP\-\fIB\fR, on each data node\&. For the rest of this example, we assume that the backup ID is 1\&. +.sp +Have all of these files available for later copying to the new data nodes (where they can be accessed on the data node\*(Aqs local file system by +\fBndb_restore\fR)\&. It is simplest to copy them all to a single location; we assume that this is what you have done\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 4.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 4." 4.2 +.\} +The management server for the target cluster is on host +host20, and the target has two data nodes, with the node IDs and host names shown, from the management server +config\&.ini +file on +host20: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[ndbd] +NodeId=3 +hostname=host3 +[ndbd] +NodeId=5 +hostname=host5 +.fi +.if n \{\ +.RE +.\} +.sp +Each of the data node processes on +host3 +and +host5 +should be started with +\fBndbmtd\fR +\fB\-c host20\fR \fB\-\-initial\fR -prior to performing the restore\&.) +or the equivalent, so that the new (target) cluster starts with clean data node file systems\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 5.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 5." 4.2 +.\} +Copy two different sets of two backup files to each of the target data nodes\&. For this example, copy the backup files from nodes 2 and 6 from the original cluster to node 3 in the target cluster\&. These files are listed here: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\-0\&.2\&.Data +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.2\&.ctl +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.2\&.log +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\-0\&.6\&.Data +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.6\&.ctl +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.6\&.log +.RE +.sp +Then copy the backup files from nodes 4 and 8 to node 5; these files are shown in the following list: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\-0\&.4\&.Data +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.4\&.ctl +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.4\&.log +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\-0\&.8\&.Data +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.8\&.ctl +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BACKUP\-1\&.8\&.log +.RE +.sp +For the remainder of this example, we assume that the respective backup files have been saved to the directory +/BACKUP\-1 +on each of nodes 3 and 5\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 6.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 6." 4.2 +.\} +On each of the two target data nodes, you must restore from both sets of backups\&. First, restore the backups from nodes 2 and 6 to node 3 by invoking +\fBndb_restore\fR +on +host3 +as shown here: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBndb_restore \-c host20 \fR\fB\fB\-\-nodeid=2\fR\fR\fB \fR\fB\fB\-\-backupid=1\fR\fR\fB \fR\fB\fB\-\-restore_data\fR\fR\fB \fR\fB\fB\-\-backup_path=/BACKUP\-1\fR\fR +shell> \fBndb_restore \-c host20 \-\-nodeid=4 \-\-backupid=1 \-\-restore_data \-\-backup_path=/BACKUP\-1\fR +.fi +.if n \{\ +.RE +.\} +.sp +Then restore the backups from nodes 4 and 8 to node 5 by invoking +\fBndb_restore\fR +on +host5, like this: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBndb_restore \-c host20 \-\-nodeid=6 \-\-backupid=1 \-\-restore_data \-\-backup_path=/BACKUP\-1\fR +shell> \fBndb_restore \-c host20 \-\-nodeid=8 \-\-backupid=1 \-\-restore_data \-\-backup_path=/BACKUP\-1\fR +.fi +.if n \{\ +.RE +.\} +.RE .PP It is possible to restore data without restoring table metadata\&. The default behavior when doing this is for \fBndb_restore\fR @@ -308,13 +639,13 @@ \fB\-A\fR) when restoring the table data\&. Attribute promotion does not occur if this option is not used; instead, the restore operation fails with an error\&. .RE .PP -Prior to MySQL Cluster NDB 7\&.3\&.3, conversions between character data types and +Prior to NDB 7\&.3\&.3, conversions between character data types and TEXT or BLOB were not handled correctly (Bug #17325051)\&. .PP -Prior to MySQL Cluster NDB 7\&.3\&.7, demotion of +Prior to NDB 7\&.3\&.7, demotion of TEXT to TINYTEXT @@ -340,7 +671,7 @@ .PP Converting between TEXT -columns using different character sets is not supported\&. Beginning with MySQL Cluster NDB 7\&.3\&.7, it is expressly disallowed (Bug #18875137)\&. +columns using different character sets is not supported\&. Beginning with NDB 7\&.3\&.7, it is expressly disallowed (Bug #18875137)\&. .PP When performing conversions of character or binary types to TEXT @@ -436,7 +767,7 @@ option is used to specify the ID or sequence number of the backup, and is the same number shown by the management client in the Backup \fIbackup_id\fR completed message displayed upon completion of a backup\&. (See -Section\ \&18.5.3.2, \(lqUsing The MySQL Cluster Management Client to Create a Backup\(rq\&.) +Section\ \&18.5.3.2, \(lqUsing The NDB Cluster Management Client to Create a Backup\(rq\&.) .if n \{\ .sp .\} @@ -456,14 +787,14 @@ .PP \fB\-\-restore_epoch\fR (short form: -\fB\-e\fR) adds (or restores) epoch information to the cluster replication status table\&. This is useful for starting replication on a MySQL Cluster replication slave\&. When this option is used, the row in the +\fB\-e\fR) adds (or restores) epoch information to the cluster replication status table\&. This is useful for starting replication on an NDB Cluster replication slave\&. When this option is used, the row in the mysql\&.ndb_apply_status having 0 in the id column is updated if it already exists; such a row is inserted if it does not already exist\&. (See -Section\ \&18.6.9, \(lqMySQL Cluster Backups With MySQL Cluster Replication\(rq\&.) +Section\ \&18.6.9, \(lqNDB Cluster Backups With NDB Cluster Replication\(rq\&.) .PP \fB\-\-restore_data\fR .PP @@ -479,7 +810,33 @@ \fBndb_restore\fR to print NDB -table metadata\&. Generally, you need only use this option when restoring the first data node of a cluster; additional data nodes can obtain the metadata from the first one\&. +table metadata\&. +.PP +The first time you run the +\fBndb_restore\fR +restoration program, you also need to restore the metadata\&. In other words, you must re\-create the database tables\(emthis can be done by running it with the +\fB\-\-restore_meta\fR +(\fB\-m\fR) option\&. Restoring the metadata need be done only on a single data node; this is sufficient to restore it to the entire cluster\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +The cluster should have an empty database when starting to restore a backup\&. (In other words, you should start +\fBndbd\fR +with +\fB\-\-initial\fR +prior to performing the restore\&.) +.sp .5v +.RE .PP \fB\-\-restore\-privilege\-tables\fR .PP @@ -491,7 +848,7 @@ This works only if the privilege tables were converted to NDB before the backup was taken\&. For more information, see -Section\ \&18.5.14, \(lqDistributed MySQL Privileges for MySQL Cluster\(rq\&. +Section\ \&18.5.14, \(lqDistributed MySQL Privileges for NDB Cluster\(rq\&. .PP \fB\-\-backup_path\fR .PP @@ -518,7 +875,7 @@ must be run twice\(emonce for each database node in the cluster where the backup was taken\&. However, \fBndb_restore\fR cannot always restore backups made from a cluster running one version of MySQL to a cluster running a different MySQL version\&. See -Section\ \&18.2.8, \(lqUpgrading and Downgrading MySQL Cluster\(rq, for more information\&. +Section\ \&18.2.8, \(lqUpgrading and Downgrading NDB Cluster\(rq, for more information\&. .if n \{\ .sp .\} @@ -532,14 +889,14 @@ .ps -1 .br .PP -It is not possible to restore a backup made from a newer version of MySQL Cluster using an older version of +It is not possible to restore a backup made from a newer version of NDB Cluster using an older version of \fBndb_restore\fR\&. You can restore a backup made from a newer version of MySQL to an older cluster, but you must use a copy of \fBndb_restore\fR -from the newer MySQL Cluster version to do so\&. +from the newer NDB Cluster version to do so\&. .PP -For example, to restore a cluster backup taken from a cluster running MySQL Cluster NDB 7\&.4\&.5 to a cluster running MySQL Cluster NDB 7\&.3\&.8, you must use the +For example, to restore a cluster backup taken from a cluster running NDB 7\&.4\&.5 to a cluster running NDB 7\&.3\&.8, you must use the \fBndb_restore\fR -that comes with the MySQL Cluster NDB 7\&.4\&.5 distribution\&. +that comes with the NDB 7\&.4\&.5 distribution\&. .sp .5v .RE .PP @@ -577,7 +934,7 @@ TEXT and BLOB -column values are always truncated\&. In MySQL Cluster NDB 7\&.3\&.7 and earlier, such values are truncated to the first 240 bytes in the output; in MySQL Cluster NDB 7\&.3\&.8 and later, they are truncated to 256 bytes\&. (Bug #14571512, Bug #65467) This cannot currently be overridden when using +column values are always truncated\&. In NDB 7\&.3\&.7 and earlier, such values are truncated to the first 240 bytes in the output; in NDB 7\&.3\&.8 and later, they are truncated to 256 bytes\&. (Bug #14571512, Bug #65467) This cannot currently be overridden when using \fB\-\-print_data\fR\&. .PP Several additional options are available for use with the @@ -881,7 +1238,7 @@ options is in effect performing a dry run\&. Including one or more of these options causes any output to be redirected to stdout; in such cases, \fBndb_restore\fR -makes no attempt to restore data or metadata to a MySQL Cluster\&. +makes no attempt to restore data or metadata to an NDB Cluster\&. .sp .5v .RE .PP @@ -913,8 +1270,8 @@ .PP This option stops \fBndb_restore\fR -from restoring any MySQL Cluster Disk Data objects, such as tablespaces and log file groups; see -Section\ \&18.5.12, \(lqMySQL Cluster Disk Data Tables\(rq, for more information about these\&. +from restoring any NDB Cluster Disk Data objects, such as tablespaces and log file groups; see +Section\ \&18.5.12, \(lqNDB Cluster Disk Data Tables\(rq, for more information about these\&. .PP \fB\-\-parallelism=#\fR, \fB\-p\fR @@ -1047,7 +1404,7 @@ \fBndb_restore\fR using \fB\-\-include\-*\fR -options (other options possibly required have been omitted for clarity), and the effects these have on restoring from a MySQL Cluster backup: +options (other options possibly required have been omitted for clarity), and the effects these have on restoring from an NDB Cluster backup: .TS allbox tab(:); lB lB. @@ -1193,7 +1550,7 @@ \fBndb_restore\fR usng \fB\-\-exclude\-*\fR -options (other options possibly required have been omitted for clarity), and the effects these options have on restoring from a MySQL Cluster backup: +options (other options possibly required have been omitted for clarity), and the effects these options have on restoring from an NDB Cluster backup: .TS allbox tab(:); lB lB. @@ -1393,7 +1750,7 @@ .TE .sp 1 .PP -Beginning with MySQL Cluster NDB 7\&.3\&.7, it is also possible to restore only selected tables columns using this option, which causes +Beginning with NDB 7\&.3\&.7, it is also possible to restore only selected tables columns using this option, which causes \fBndb_restore\fR to ignore any tables from the backup that are not found in the target database\&. .PP @@ -1492,7 +1849,7 @@ \fBndb_restore\fR to ignore any schema objects it does not recognize while reading a native NDB -backup\&. This can be used for restoring a backup made from a cluster running MySQL Cluster NDB 7\&.3 to a cluster running MySQL Cluster NDB 7\&.2\&. +backup\&. This can be used for restoring a backup made from a cluster running NDB Cluster 7\&.3 to a cluster running NDB Cluster 7\&.2\&. .PP \fB\-\-rewrite\-database=\fR\fB\fIold_dbname\fR\fR\fB,\fR\fB\fInew_dbname\fR\fR .TS @@ -1633,7 +1990,7 @@ .PP The \fB\-\-exclude\-intermediate\-sql\-tables\fR -option was introduced in MySQL Cluster NDB 7\&.3\&.6\&. (Bug #17882305) +option was introduced in NDB 7\&.3\&.6\&. (Bug #17882305) .PP \fBError reporting\fR. \fBndb_restore\fR reports both temporary and permanent errors\&. In the case of temporary errors, it may able to recover from them, and reports @@ -1654,16 +2011,16 @@ .PP After using \fBndb_restore\fR -to initialize a MySQL Cluster for use in circular replication, binary logs on the SQL node acting as the replication slave are not automatically created, and you must cause them to be created manually\&. To cause the binary logs to be created, issue a +to initialize an NDB Cluster for use in circular replication, binary logs on the SQL node acting as the replication slave are not automatically created, and you must cause them to be created manually\&. To cause the binary logs to be created, issue a SHOW TABLES statement on that SQL node before running -START SLAVE\&. This is a known issue in MySQL Cluster\&. +START SLAVE\&. This is a known issue in NDB Cluster\&. .sp .5v .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_select_all.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_select_all.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_select_all.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_select_all.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_select_all\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SELECT_ALL\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SELECT_ALL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -51,16 +51,16 @@ .RE .\} .PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_select_all\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster native backup restoration program +\fBndb_select_all\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_select_all\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.96.\ \& This table describes command\-line options for the ndb_select_all program +.B Table\ \&18.98.\ \& This table describes command\-line options for the ndb_select_all program .TS allbox tab(:); . @@ -281,8 +281,8 @@ Adds a GCI column to the output showing the global checkpoint at which each row was last updated\&. See -Section\ \&18.1, \(lqMySQL Cluster Overview\(rq, and -Section\ \&18.5.6.2, \(lqMySQL Cluster Log Events\(rq, for more information about checkpoints\&. +Section\ \&18.1, \(lqNDB Cluster Overview\(rq, and +Section\ \&18.5.6.2, \(lqNDB Cluster Log Events\(rq, for more information about checkpoints\&. .RE .sp .RS 4 @@ -374,7 +374,7 @@ .RE .\} .PP -All string values are enclosed by square brackets (\(lq[\&.\&.\&.]\(rq) in the output of +All string values are enclosed by square brackets ([\&.\&.\&.]) in the output of \fBndb_select_all\fR\&. For another example, consider the table created and populated as shown here: .sp .if n \{\ @@ -423,7 +423,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_select_count.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_select_count.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_select_count.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_select_count.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_select_count\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SELECT_COUNT\" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SELECT_COUNT\" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -51,16 +51,16 @@ .RE .\} .PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_select_count\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster native backup restoration program +\fBndb_select_count\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_select_count\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.97.\ \& This table describes command\-line options for the ndb_select_count program +.B Table\ \&18.99.\ \& This table describes command\-line options for the ndb_select_count program .TS allbox tab(:); . @@ -86,7 +86,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_setup.py.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_setup.py.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_setup.py.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_setup.py.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_setup.py\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SETUP\&.PY\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SETUP\&.PY\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,19 +28,37 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_setup.py \- Start browser\-based Auti\-Installer for MySQL Cluster +ndb_setup.py \- Start browser\-based Auti\-Installer for NDB Cluster .SH "SYNOPSIS" .HP \w'\fBndb_setup\&.py\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBndb_setup\&.py [\fR\fB\fIoptions\fR\fR\fB]\fR .SH "DESCRIPTION" .PP \fBndb_setup\&.py\fR -starts the MySQL Cluster Auto\-Installer and opens the installer\*(Aqs Start page in the default Web browser\&. +starts the NDB Cluster Auto\-Installer and opens the installer\*(Aqs Start page in the default Web browser\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBImportant\fR +.ps -1 +.br +.PP +This program is intended to be invoked as a normal user, and not with the +mysql, system +root, or other administrative account\&. +.sp .5v +.RE .PP This section describes usage of and program options for the command\-line tool only\&. For information about using the Auto\-Installer GUI that is spawned when \fBndb_setup\&.py\fR is invoked, see -Section\ \&18.2.1, \(lqThe MySQL Cluster Auto-Installer\(rq\&. +Section\ \&18.2.1, \(lqThe NDB Cluster Auto-Installer\(rq\&. Usage.PP All platforms: .sp @@ -66,14 +84,14 @@ .RE .\} .PP -The following table includes all options that are supported by the MySQL Cluster installation and configuration program +The following table includes all options that are supported by the NDB Cluster installation and configuration program \fBndb_setup\&.py\fR\&. Additional descriptions follow the table\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.98.\ \& This table describes command\-line options for the ndb_setup\&.py program +.B Table\ \&18.100.\ \& This table describes command\-line options for the ndb_setup\&.py program .TS allbox tab(:); . @@ -511,7 +529,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_show_tables.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_show_tables.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_show_tables.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_show_tables.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_show_tables\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SHOW_TABLES\F" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SHOW_TABLES\F" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -40,18 +40,18 @@ database objects in the cluster\&. By default, this includes not only both user\-created tables and NDB system tables, but -NDB\-specific indexes, internal triggers, and MySQL Cluster Disk Data objects as well\&. +NDB\-specific indexes, internal triggers, and NDB Cluster Disk Data objects as well\&. .PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_show_tables\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster native backup restoration program +\fBndb_show_tables\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_show_tables\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.99.\ \& This table describes command\-line options for the ndb_show_tables program +.B Table\ \&18.101.\ \& This table describes command\-line options for the ndb_show_tables program .TS allbox tab(:); . @@ -80,7 +80,7 @@ \fB\-\-database\fR, \fB\-d\fR .sp -Specifies the name of the database in which the tables are found\&. In MySQL Cluster NDB 7\&.4\&.8 and later, if this option has not been specified, and no tables are found in the +Specifies the name of the database in which the tables are found\&. In NDB 7\&.4\&.8 and later, if this option has not been specified, and no tables are found in the TEST_DB database, \fBndb_show_tables\fR @@ -206,7 +206,7 @@ .ps -1 .br .PP -Only user\-created MySQL Cluster tables may be accessed from MySQL; system tables such as +Only user\-created NDB Cluster tables may be accessed from MySQL; system tables such as SYSTAB_0 are not visible to \fBmysqld\fR\&. However, you can examine the contents of system tables using @@ -220,7 +220,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_size.pl.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_size.pl.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_size.pl.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_size.pl.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_size.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SIZE\&.PL\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SIZE\&.PL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,7 +36,7 @@ .PP This is a Perl script that can be used to estimate the amount of space that would be required by a MySQL database if it were converted to use the NDBCLUSTER -storage engine\&. Unlike the other utilities discussed in this section, it does not require access to a MySQL Cluster (in fact, there is no reason for it to do so)\&. However, it does need to access the MySQL server on which the database to be tested resides\&. +storage engine\&. Unlike the other utilities discussed in this section, it does not require access to an NDB Cluster (in fact, there is no reason for it to do so)\&. However, it does need to access the MySQL server on which the database to be tested resides\&. Requirements .sp .RS 4 @@ -47,7 +47,7 @@ .sp -1 .IP \(bu 2.3 .\} -A running MySQL server\&. The server instance does not have to provide support for MySQL Cluster\&. +A running MySQL server\&. The server instance does not have to provide support for NDB Cluster\&. .RE .sp .RS 4 @@ -92,16 +92,16 @@ can also be found in the MySQL sources in storage/ndb/tools\&. .PP -The following table includes options that are specific to the MySQL Cluster program -\fBndb_size\&.pl\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster program +\fBndb_size\&.pl\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_size\&.pl\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.100.\ \& This table describes command\-line options for the ndb_size\&.pl program +.B Table\ \&18.102.\ \& This table describes command\-line options for the ndb_size\&.pl program .TS allbox tab(:); . @@ -276,7 +276,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_waiter.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_waiter.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/ndb_waiter.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/ndb_waiter.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBndb_waiter\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_WAITER\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_WAITER\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,7 +28,7 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -ndb_waiter \- wait for MySQL Cluster to reach a given status +ndb_waiter \- wait for NDB Cluster to reach a given status .SH "SYNOPSIS" .HP \w'\fBndb_waiter\ \fR\fB\fIoptions\fR\fR\ 'u \fBndb_waiter \fR\fB\fIoptions\fR\fR @@ -132,16 +132,16 @@ SINGLE USER MODE: This is shown for all cluster data nodes when the cluster is in single user mode\&. .RE .PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_waiter\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including +The following table includes options that are specific to the NDB Cluster native backup restoration program +\fBndb_waiter\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including \fBndb_waiter\fR), see -Options Common to MySQL Cluster Programs(1)\&. +Options Common to NDB Cluster Programs(1)\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.101.\ \& This table describes command\-line options for the ndb_waiter program +.B Table\ \&18.103.\ \& This table describes command\-line options for the ndb_waiter program .TS allbox tab(:); . @@ -316,7 +316,7 @@ \fBSample Output\fR. Shown here is the output from \fBndb_waiter\fR when run against a 4\-node cluster in which two nodes have been shut down and then started again manually\&. Duplicate reports (indicated by -\(lq\&.\&.\&.\(rq) are omitted\&. +\&.\&.\&.) are omitted\&. .sp .if n \{\ .RS 4 @@ -393,7 +393,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/perror.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/perror.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/perror.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/perror.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBperror\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBPERROR\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBPERROR\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -82,7 +82,7 @@ .RE .\} .PP -To obtain the error message for a MySQL Cluster error code, invoke +To obtain the error message for an NDB Cluster error code, invoke \fBperror\fR with the \fB\-\-ndb\fR @@ -129,7 +129,7 @@ .\} \fB\-\-ndb\fR .sp -Print the error message for a MySQL Cluster error code\&. +Print the error message for an NDB Cluster error code\&. .RE .sp .RS 4 @@ -176,7 +176,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/replace.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/replace.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/replace.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/replace.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBreplace\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBREPLACE\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBREPLACE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -167,7 +167,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/resolveip.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/resolveip.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/resolveip.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/resolveip.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBresolveip\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVEIP\FR" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVEIP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -101,7 +101,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/man/resolve_stack_dump.1 percona-xtradb-cluster-5.6-5.6.37-26.21/man/resolve_stack_dump.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/man/resolve_stack_dump.1 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/man/resolve_stack_dump.1 2017-10-19 04:25:29.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: \fBresolve_stack_dump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 09/29/2016 +.\" Date: 06/02/2017 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVE_STACK_DUM" "1" "09/29/2016" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVE_STACK_DUM" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -120,7 +120,7 @@ .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/collections/default.weekly.basic percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/collections/default.weekly.basic --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/collections/default.weekly.basic 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/collections/default.weekly.basic 2017-10-19 04:25:29.000000000 +0000 @@ -1,22 +1,13 @@ # Smaller batch of weekly run for tier2 platforms # Same as default.weekly, but all tests are run without big-test option. # big-test runs were leading to sporadic failures in tier2 platforms -# Comprises of the following -# 1. Repeat of daily runs -# 2. All suites in normal mode -# 3. nist suite -# 4. engine independant suite -# 5. Covers debug and non-debug runs -# 6. Covers all suites with Multi-Threaded-Slave and MIXED binlog-format -# 7. Covers all suites with innodb-page-size=4k and 8k - -# Repeat daily run -# big-test option for normal runs -# Default suites (in modes binlog format stmt/mixed/row, parts), embedded and ps-protocol + +# Default suites (in modes binlog format stmt/mixed/row, parts) perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug --vardir=var-normal-debug --report-features --skip-test-list=collections/disabled-daily.list --mysqld=--innodb_autoextend_increment=64 --unit-tests-report # Run all default suites with embedded server -# --debug-server is not used for embedded runs since debug build of embedded server is not available +# --debug-server is not used for embedded runs +# since debug build of embedded server is not available perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server # Run default suites with ps protocol @@ -47,23 +38,3 @@ #Memcached tests perl mysql-test-run.pl --timer --force --debug-server --comment=memcached-debug --vardir=var-debug-memcached --experimental=collections/default.experimental --parallel=1 --retry=0 --suite=memcached --skip-test-list=collections/disabled-weekly.list -# Non debug runs of default suites in normal modes -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal-non-debug --vardir=var-normal-non-debug --report-features --skip-test-list=collections/disabled-daily.list - - - -# Multi-Thread Slave -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=MTS-debug --vardir=var-MTS-debug --suite=rpl --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --skip-test-list=collection/disabled-weekly.list - -# Run all default suites with 4K page size -perl mysql-test-run.pl --debug-server --timer --force --parallel=auto --comment=all_4k_size --vardir=var_all_4k_size --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --mysqld=--innodb-page-size=4k - -# Run all default suites with 8K page size -perl mysql-test-run.pl --debug-server --timer --force --parallel=auto --comment=all_8k_size --vardir=var-all_8k_size --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --mysqld=--innodb-page-size=8k - - - -# Additional run to test rpl HASH_SCAN & INDEX_SCAN -perl mysql-test-run.pl --force --debug-server --timer --parallel=auto --experimental=collections/default.experimental --comment=binlog_rpl_row_hash_scan --vardir=var-binlog_rpl_row_hash_scan --mysqld=--binlog-format=row --suite=binlog,rpl --mysqld=--slave-rows-search-algorithms=HASH_SCAN,INDEX_SCAN --skip-test-list=collection/disabled-weekly.list -perl mysql-test-run.pl --debug-server --timer --force --parallel=auto --comment=rpl_binlog_row_hash_MTS --vardir=var-mts-rpl-binlog-hash-n_mix --mysqld=--binlog-format=row --experimental=collections/default.experimental --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl,binlog -mysqld=--slave-rows-search-algorithms=HASH_SCAN,INDEX_SCAN --skip-test-list=collection/disabled-weekly.list - diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/binlog_tests/drop_temp_table.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/binlog_tests/drop_temp_table.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/binlog_tests/drop_temp_table.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/binlog_tests/drop_temp_table.test 2017-10-19 04:25:29.000000000 +0000 @@ -17,10 +17,9 @@ # BUG#46572 DROP TEMPORARY table IF EXISTS does not have a consistent behavior # in ROW mode # -# In RBR, 'DROP TEMPORARY TABLE ...' statement should never be binlogged no -# matter if the tables exist or not. In contrast, both in SBR and MBR, the -# statement should be always binlogged no matter if the tables exist or not. -# In MBR though, it will always be binlogged with IF EXISTS. +# In RBR/MIXED, 'DROP TEMPORARY TABLE ...' statement should never be binlogged +# no matter if the tables exist or not. In contrast, in SBR, the statement +# should be always binlogged no matter if the tables exist or not. ############################################################################## CREATE TEMPORARY TABLE tmp(c1 int); CREATE TEMPORARY TABLE tmp1(c1 int); @@ -35,15 +34,15 @@ # binlogged when the table did not exist in RBR. DROP TEMPORARY TABLE IF EXISTS tmp; -# In RBR, 'DROP TEMPORARY TABLE ...' statement is never binlogged no matter if +# In RBR/MIXED, 'DROP TEMPORARY TABLE ...' statement is never binlogged no matter if # the tables exist or not. DROP TEMPORARY TABLE IF EXISTS tmp, tmp1; DROP TEMPORARY TABLE tmp3; -#In RBR, tmp2 will NOT be binlogged, because it is a temporary table. +#In RBR/MIXED, tmp2 will NOT be binlogged, because it is a temporary table. DROP TABLE IF EXISTS tmp2, t; -#In RBR, tmp2 will be binlogged, because it does not exist and master do not know +#In RBR/MIXED, tmp2 will be binlogged, because it does not exist and master do not know # whether it is a temporary table or not. DROP TABLE IF EXISTS tmp2, t; --enable_warnings @@ -69,6 +68,7 @@ let $VERSION=`SELECT VERSION()`; source include/show_binlog_events.inc; DROP DATABASE `drop-temp+table-test`; +RESET MASTER; # @@ -81,23 +81,55 @@ # for temporary tables on session closing must be logged. # -RESET MASTER; +if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) +{ + CREATE TABLE t1 ( i text ); + + --connect(con1,localhost,root,,) + CREATE TEMPORARY TABLE ttmp1 ( i text ); + SET @@session.binlog_format=ROW; + INSERT INTO t1 VALUES ('1'); + SELECT @@session.binlog_format; + --disconnect con1 + + -- connection default + --let $wait_binlog_event= DROP + --source include/wait_for_binlog_event.inc + -- source include/show_binlog_events.inc + DROP TABLE t1; -CREATE TABLE t1 ( i text ); + RESET MASTER; +} ---connect(con1,localhost,root,,) -CREATE TEMPORARY TABLE ttmp1 ( i text ); -SET @@session.binlog_format=ROW; -INSERT INTO t1 VALUES ('1'); -SELECT @@session.binlog_format; ---disconnect con1 +# End of 4.1 tests --- connection default ---let $wait_binlog_event= DROP ---source include/wait_for_binlog_event.inc --- source include/show_binlog_events.inc -RESET MASTER; +--echo # +--echo # Bug 83003: Using temporary tables on slaves increases GTID sequence number +--echo # + +--source include/count_sessions.inc + +--connect (con1,localhost,root,,) + +SET @saved_binlog_format= @@SESSION.binlog_format; +SET SESSION binlog_format= STATEMENT; +CREATE TEMPORARY TABLE temp_needs_logging(a INT) ENGINE=InnoDB; +SET SESSION binlog_format= @saved_binlog_format; + +# Check with both transactional and non-transactional tables as those are logged +# separately in close_temporary_tables. +CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trx(a INT) ENGINE=MyISAM; + +CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 0; +CREATE TEMPORARY TABLE temp_binlog_disabled(a INT) ENGINE=InnoDB; +SET SESSION sql_log_bin= 1; + +--disconnect con1 +--connection default +--source include/wait_until_count_sessions.inc -DROP TABLE t1; +--source include/show_binlog_events.inc -# End of 4.1 tests +# End of 5.6 tests diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/binlog_tests/tmp_table.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/binlog_tests/tmp_table.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/binlog_tests/tmp_table.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/binlog_tests/tmp_table.test 2017-10-19 04:25:29.000000000 +0000 @@ -27,6 +27,8 @@ # source include/have_log_bin.inc; +--source include/count_sessions.inc + RESET MASTER; --disable_query_log @@ -89,9 +91,14 @@ # Reset GTIDs RESET MASTER; exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved35583 | $MYSQL; +remove_file $MYSQLD_DATADIR/master-bin.saved35583; select * from foo; # clean up +disconnect master; +disconnect master1; + +connection default; drop table foo; ################################################################# @@ -137,8 +144,11 @@ -- disconnect con1 -- connection default --- let $wait_binlog_event= DROP --- source include/wait_for_binlog_event.inc +if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) +{ + -- let $wait_binlog_event= DROP + -- source include/wait_for_binlog_event.inc +} # action: insert in the t1. This would cause the the test to fail, # because when replaying the binlog the previous implicit drop @@ -149,8 +159,11 @@ -- disconnect con2 -- connection default --- let $wait_binlog_event= DROP --- source include/wait_for_binlog_event.inc +if (`SELECT @@GLOBAL.binlog_format = 'STATEMENT'`) +{ + -- let $wait_binlog_event= DROP + -- source include/wait_for_binlog_event.inc +} -- eval DROP DATABASE $dbname FLUSH LOGS; @@ -161,3 +174,6 @@ # assertion: assert that when replaying the binary log will succeed, # instead of failing with "Table 'XXX.YYY' doesn't exist" -- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved51226 | $MYSQL +remove_file $MYSQLD_DATADIR/master-bin.saved51226; + +--source include/wait_until_count_sessions.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_auto_increment.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_auto_increment.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_auto_increment.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_auto_increment.test 2017-10-19 04:25:29.000000000 +0000 @@ -216,7 +216,7 @@ connection master; let $MYSQLD_DATADIR= `SELECT @@DATADIR`; # Keep original binlog file ---copy_file $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.saved +--copy_file $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin-rpl-auto-increment.saved # Stop slave connection slave; source include/stop_slave.inc; @@ -229,7 +229,8 @@ connection slave; source include/start_slave.inc; connection master; ---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved | $MYSQL test +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin-rpl-auto-increment.saved | $MYSQL test +--remove_file $MYSQLD_DATADIR/master-bin-rpl-auto-increment.saved --source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_drop_temp.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_drop_temp.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_drop_temp.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_drop_temp.test 2017-10-19 04:25:29.000000000 +0000 @@ -21,9 +21,12 @@ --source include/wait_until_disconnected.inc connection master; --- let $wait_binlog_event= DROP --- source include/wait_for_binlog_event.inc -sync_slave_with_master; +if (`SELECT @@SESSION.binlog_format = 'STATEMENT'`) +{ + -- let $wait_binlog_event= DROP + -- source include/wait_for_binlog_event.inc + sync_slave_with_master; +} connection slave; show status like 'Slave_open_temp_tables'; @@ -33,10 +36,9 @@ sync_slave_with_master; # -# Bug#49137 # This test verifies if DROP MULTI TEMPORARY TABLE -# will cause different errors on master and slave, -# when one or more of these tables do not exist. +# will be binlogged correctly when one or more of +# these tables do not exist. # connection master; @@ -58,7 +60,6 @@ DROP TEMPORARY TABLE tmp3; connection slave; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; connection master; @@ -82,8 +83,11 @@ --disconnect con1 -- connection master ---let $wait_binlog_event= DROP ---source include/wait_for_binlog_event.inc +if (`SELECT @@SESSION.binlog_format = 'STATEMENT'`) +{ + --let $wait_binlog_event= DROP + --source include/wait_for_binlog_event.inc +} --sync_slave_with_master SHOW STATUS LIKE 'Slave_open_temp_tables'; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test 2017-10-19 04:25:29.000000000 +0000 @@ -429,8 +429,16 @@ # they are declared without DEFAULT clause. sync_slave_with_master; + --replace_column 4 CURRENT_TIMESTAMP select * from t9; + # Bug #22916743 RBR DOES NOT USE DEFAULT CURRENT_TIMESTAMP FOR EXTRA COLUMN + # ON SLAVE + --let $assert_text= The values of column 'd' should have non-zero timetsamp. + --let $assert_cond= [SELECT COUNT(*) AS Val FROM t9 WHERE d = "0000-00-00 00:00:00", Val, 1] = 0 + --source include/assert.inc + # End of test for Bug #22916743 + # todo: fix Bug #43992 slave sql thread can't tune own sql_mode ... # and add/restore waiting for stop test diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test 2017-10-19 04:25:29.000000000 +0000 @@ -44,9 +44,11 @@ eval SET @@global.debug= "+d,$dbug_sync_point"; ---source include/start_slave.inc +START SLAVE; --echo slave is going to hang in get_master_version_and_clock +SET DEBUG_SYNC= "NOW WAIT_FOR in_get_master_version_and_clock"; + --let $rpl_server_number= 1 --source include/rpl_stop_server.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test 2017-10-19 04:25:29.000000000 +0000 @@ -502,50 +502,39 @@ let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx; let $in_temporary= yes; # - # In SBR and MIXED modes, the DDL statement is written to the binary log - # but does not commit the current transaction: - # - # In SBR, we have what follows: + # In SBR mode, the DDL statement is written to the binary log but does + # not commit the current transaction: # # 1: BEGIN # 2: INSERT # 3: DROP TEMPORARY # 4: COMMIT # - # In RBR the transaction is not committed either and the statement is not - # written to the binary log: + # In RBR and MIXED modes, the transaction is not committed either and + # the statement is not written to the binary log: # + # RBR: # 1: BEGIN # 2: TABLE MAP EVENT # 3: ROW EVENT # 4: COMMIT # + # MIXED: + # 1: BEGIN + # 2: ROW EVENT + # 3: COMMIT + # if (`select @@binlog_format = 'STATEMENT'`) { let $commit_event_row_number= 4; } - # In ROW mode, the changes are logged as rows and we have what follows: - # - # 1: BEGIN - # 2: TABLE MAP EVENT - # 3: ROW EVENT - # 4: DROP TEMPORARY table IF EXISTS - # 5: COMMIT - # if (`select @@binlog_format = 'ROW'`) { - let $commit_event_row_number= 5; + let $commit_event_row_number= 4; } - # In MIXED mode, the changes are logged as rows and we have what follows: - # - # 1: BEGIN - # 2: ROW EVENT - # 3: DROP TEMPORARY table IF EXISTS - # 4: COMMIT - # if (`select @@binlog_format = 'MIXED'`) { - let $commit_event_row_number= 4; + let $commit_event_row_number= 3; } # diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_innodb.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_innodb.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_innodb.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_innodb.test 2017-10-19 04:25:29.000000000 +0000 @@ -70,8 +70,8 @@ connection slave; # We want to verify that the following transactions are written to the -# binlog, despite the transaction is rolled back. (They should be -# written to the binlog since they contain non-transactional DROP +# binlog in SBR, despite the transaction is rolled back. (They should be +# written to the binlog since they contain non-transactional CREATE # TEMPORARY TABLE). To see that, we use the auxiliary table t1, which # is transactional (InnoDB) on master and MyISAM on slave. t1 should # be transactional on master so that the insert into t1 does not cause @@ -107,12 +107,8 @@ SHOW CREATE TABLE mysqltest1.tmp; --error ER_NO_SUCH_TABLE SHOW CREATE TABLE mysqltest1.tmp2; -# Aa a result of the bugfix for 1313901, t1 has one row here since the -# CREATE TEMPORARY TABLE tmp2 above is not binlogged and thus changes the -# transactional/non-transactional logic, causing the INSERT f1=2 to not be bilogged -# on ROLLBACK --echo ######### for SBR, t1 has two rows here: the transaction not rolled back since t1 uses MyISAM ######### ---echo ######### for MBR, t1 has one row here: the transaction not rolled back since t1 uses MyISAM ######### +--echo ######### for MBR, t1 has zero rows here, as CREATE/DROP TEMPORARY TABLE were not binlogged ######### SELECT COUNT(*) FROM mysqltest1.t1; FLUSH LOGS; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_mts_pending_events.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_mts_pending_events.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_mts_pending_events.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_mts_pending_events.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,123 @@ +############################################################################### +# This .inc is used to check coordinator behaviour of scheduling an event +# when the new event cannot be placed into worker's queue due to size limit +# (SLAVE_PENDING_JOBS_SIZE_MAX) +# +# Usage: +# --let $table_to_lock=db1.t +# --let $query_that_waits_on_table_lock=INSERT INTO db1.t VALUES ('small event') +# --let $query_that_needs_to_be_processed_by_coordinator=INSERT INTO db2.t VALUES (REPEAT('big event', $mts_pending_max)) +# --let $tables_involved_in_test=db1.t, db2.t +# --source ../mysql-test/extra/rpl_tests/rpl_mts_pending_events.inc +# +# Parameters: +# +# $table_to_lock: +# Provide full table name that needs to be locked using LOCK TABLE. +# Eg: --let $table_to_lock=db1.t +# +# $query_that_waits_on_table_lock: +# A query that cannot be executed due the lock acquired by LOCK TABLE. +# Eg: --let $table_to_lock=db1.t +# --let $query_that_waits_on_table_lock=INSERT INTO db1.t VALUES ('small event') +# +# $query_that_needs_to_be_processed_by_coordinator: +# A query that will be processed by coordinator only after +# $query_that_waits_on_table_lock is completely executed due to size limit +# (SLAVE_PENDING_JOBS_SIZE_MAX) +# --let $query_that_needs_to_be_processed_by_coordinator=INSERT INTO db2.t VALUES (REPEAT('big event', $mts_pending_max)) +# +# $tables_involved_in_test: +# Tables that are involved in the test. This list will be used to do diff +# between master and slave's tables to test that replication worked fine. +# Eg: --let $tables_involved_in_test=db1.t, db2.t +# +############################################################################### + +if (!$table_to_lock) +{ + --die ERROR IN TEST: you must set $table_to_lock before sourcing rpl_mts_pending_events.inc. +} +if (!$query_that_waits_on_table_lock) +{ + --die ERROR IN TEST: you must set $query_that_waits_on_table_lock before sourcing rpl_mts_pending_events.inc. +} +if (!$query_that_needs_to_be_processed_by_coordinator) +{ + --die ERROR IN TEST: you must set $query_that_needs_to_be_processed_by_coordinator before sourcing rpl_mts_pending_events.inc. +} +if (!$tables_involved_in_test) +{ + --die ERROR IN TEST: you must set $tables_involved_in_test before sourcing rpl_mts_pending_events.inc. +} + +--echo # +--echo # 1) On Slave, lock one table so that any operation on that +--echo # will be waiting for the lock to be released. +--echo # +--source include/rpl_connection_slave1.inc +--eval LOCK TABLE $table_to_lock WRITE + +--echo # +--echo # 2) Execute query that is going to wait for the table lock. +--echo # +--source include/rpl_connection_master.inc +--eval $query_that_waits_on_table_lock + +--echo # +--echo # 3) Wait on Slave till a worker picks this event and wait for the +--echo # lock (which is acquired in step 1) +--echo # +--source include/rpl_connection_slave.inc +--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for table metadata lock" +--source include/wait_condition.inc + +--echo # +--echo # 4) Now on Master, insert another query that reaches slave. +--echo # +--source include/rpl_connection_master.inc +--eval $query_that_needs_to_be_processed_by_coordinator + +--echo # +--echo # 5) Check that Coordinator waits for the query (at step 2) to be +--echo # executed before dedicating this new query (at step 4) to +--echo # one of the workers because of the event size limits. +--echo # +--source include/rpl_connection_slave.inc +--let $assert_text= Check that one of the applier worker thread is waiting for the table metadata lock. +--let $assert_cond= [SELECT count(*) FROM information_schema.processlist WHERE state = "Waiting for table metadata lock"] = 1 +--source include/assert.inc + +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for Slave Workers to free pending events" +--source include/wait_condition.inc + +--echo # +--echo # 6) Release the lock acquired in step 1, so that first query will +--echo # continue it's work and once it is done, second big event +--echo # will also continue it's work. +--echo # +--source include/rpl_connection_slave1.inc +UNLOCK TABLES; + +--echo # +--echo # 7) check that slave is able to catch up with master after releasing the +--echo # lock in step 6. +--echo # +--echo # 7.1) Sync SQL thread with Master. +--echo # +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc + +--echo # +--echo # 7.2) Diff all the tables involved in the test to prove +--echo # that replication worked fine. +--echo # +--let $number_of_tables_involved_in_test=`SELECT LENGTH('$tables_involved_in_test') - LENGTH(REPLACE('$tables_involved_in_test',',','')) + 1` +--let $t=1 +while ($t <= $number_of_tables_involved_in_test) +{ + --let $table= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX('$tables_involved_in_test', ',', $t), ',', -1 )` + --let $diff_tables= master:$table,slave:$table + --source include/diff_tables.inc + --inc $t +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_rewrt_db.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_rewrt_db.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/extra/rpl_tests/rpl_rewrt_db.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/extra/rpl_tests/rpl_rewrt_db.test 2017-10-19 04:25:29.000000000 +0000 @@ -86,6 +86,10 @@ # End of 4.1 tests +# Test only STATEMENT as for MIX/ROW no DROPS will be logged +if (`SELECT @@SESSION.binlog_format = 'STATEMENT'`) +{ + --echo --echo **** --echo **** Bug #46861 Auto-closing of temporary tables broken by replicate-rewrite-db @@ -249,6 +253,8 @@ DROP DATABASE database_slave_temp_03; SET sql_log_bin= 1; +} # if (`SELECT @@SESSION.binlog_format = 'STATEMENT') + connection master; --source include/sync_slave_sql_with_master.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/assert.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/assert.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/assert.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/assert.inc 2017-10-19 04:25:29.000000000 +0000 @@ -9,6 +9,7 @@ # --let $assert_text= Relay_Log_Pos must be between min_pos and max_pos # --let $assert_cond= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] >= $min_pos AND <1> <= $max_pos # [--let $rpl_debug= 1] +# [--let $assert_debug= SHOW SLAVE STATUS] # --source include/assert.inc # # Parameters: @@ -28,6 +29,9 @@ # # $rpl_debug # Print extra debug info. +# +# $assert_debug +# If set, and the assert fails, an extra SQL statement to execute --let $include_filename= assert.inc [$assert_text] @@ -63,6 +67,11 @@ --echo Assertion condition: '$assert_cond' --echo Assertion condition, interpolated: '$_eval_expr_interp' --echo Assertion result: '$eval_result' + if ($assert_debug) + { + --echo Assertion debug statement: + --eval $assert_debug + } --die Test assertion failed in assert.inc } @@ -71,6 +80,7 @@ --let $assert_text= --let $assert_cond= +--let $assert_debug= --let $eval_expr= $_assert_old_eval_expr --let $eval_result= $_assert_old_eval_result --let $eval_no_result= $_assert_old_eval_no_result diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/audit_log_events.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/audit_log_events.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/audit_log_events.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/audit_log_events.inc 2017-10-19 04:25:29.000000000 +0000 @@ -55,5 +55,7 @@ create user 'jeffrey'@'localhost' IDENTIFIED BY 'mypass'; drop user 'jeffrey'@'localhost'; select '&;&&&""""<><<>>>>'; +let $str=`SELECT x'2009080c0a0d2f225c5c'`; +eval select '$str'; disconnect con1; --source include/wait_until_count_sessions.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/check_openssl.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/check_openssl.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/check_openssl.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/check_openssl.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,5 @@ +# Only run this test if the server was built with OpenSSL +--let $rsa_var = query_get_value("SHOW STATUS LIKE 'Rsa_public_key'", Variable_name, 1) +if ($rsa_var != 'Rsa_public_key'){ + --skip Need OpenSSL support +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/expect_crash.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/expect_crash.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/expect_crash.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/expect_crash.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,5 @@ +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect + +# There should be a debug crash after using this .inc file +--exec echo "wait" > $_expect_file_name diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/filter_file.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/filter_file.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/filter_file.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/filter_file.inc 2017-10-19 04:25:29.000000000 +0000 @@ -15,6 +15,7 @@ # [--let $select_columns= ] # [--let $pre_script= ] # [--let $rpl_debug= 1] +# [--let $skip_column_names= 0] # --source include/filter_file.inc # # Parameters: @@ -45,6 +46,9 @@ # numbers, it will print only the numbered columns, in the given # order. # +# $skip_column_names +# If true then skip reading columns line. false by default. +# # $pre_script # This script will be evaluated before starting to iterate over # the lines of $input_file. It can be useful if you need some @@ -70,6 +74,10 @@ --let _FF_INPUT_FILE= $input_file --let _FF_OUTPUT_FILE= $output_file --let _FF_SELECT_COLUMNS= $select_columns +if (!$skip_column_names) { + --let $skip_column_names= 0; +} +--let _FF_SKIP_COLUMN_NAMES= $skip_column_names --let _FF_DEBUG= $rpl_debug if (!$output_file) { @@ -83,6 +91,7 @@ my $input_file = $ENV{'_FF_INPUT_FILE'}; my $output_file = $ENV{'_FF_OUTPUT_FILE'}; my $select_columns = $ENV{'_FF_SELECT_COLUMNS'}; + my $skip_column_names = $ENV{'_FF_SKIP_COLUMN_NAMES'}; my $debug = $ENV{'_FF_DEBUG'}; if ($select_columns) { @@ -114,7 +123,7 @@ { chomp; s/\015?\012?$//; - if (!%column_names) + if (!%column_names && $skip_column_names == 0) { my $n = 1; %column_names = map { $_ => $n++ } split(/\t/, $_); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/galera_cluster.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/galera_cluster.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/galera_cluster.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/galera_cluster.inc 2017-10-19 04:25:29.000000000 +0000 @@ -8,3 +8,5 @@ --let $galera_cluster_size = 2 --source include/galera_init.inc + +--source include/have_innodb.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_all.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_all.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_all.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_all.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,26 @@ +--source include/gap_lock_error_init.inc + +let $select_lock=for update; +let $autocommit = 0; +--source include/gap_lock_error_select.inc +let $autocommit = 1; +--source include/gap_lock_error_select.inc + +let $select_lock=lock in share mode; +let $autocommit = 0; +--source include/gap_lock_error_select.inc +let $autocommit = 1; +--source include/gap_lock_error_select.inc + +let $select_lock=; +let $autocommit = 0; +--source include/gap_lock_error_select.inc +let $autocommit = 1; +--source include/gap_lock_error_select.inc + +let $autocommit = 0; +--source include/gap_lock_error_update.inc +let $autocommit = 1; +--source include/gap_lock_error_update.inc + +--source include/gap_lock_error_cleanup.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_cleanup.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_cleanup.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_cleanup.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_cleanup.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +drop table gap1, gap2, gap3, gap4; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_init.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_init.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_init.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_init.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,24 @@ +eval CREATE TABLE gap1 (id1 INT, id2 INT, id3 INT, c1 INT, value INT, + PRIMARY KEY (id1, id2, id3), + INDEX i (c1)) ENGINE=$engine; +CREATE TABLE gap2 like gap1; +eval CREATE TABLE gap3 (id INT, value INT, + PRIMARY KEY (id), + UNIQUE KEY ui(value)) ENGINE=$engine; +eval CREATE TABLE gap4 (id INT, value INT, + PRIMARY KEY (id)) ENGINE=$engine + PARTITION BY HASH(id) PARTITIONS 2; +--disable_query_log +let $max = 1000; +let $i = 1; +while ($i <= $max) { + eval INSERT INTO gap1 (id1, id2, id3, c1, value) + VALUES ($i div 2, $i div 10, $i, $i, $i); + eval INSERT INTO gap2 (id1, id2, id3, c1, value) + VALUES ($i div 2, $i div 10, $i, $i, $i); + inc $i; +} +--enable_query_log + +insert into gap3 values (1,1), (2,2),(3,3),(4,4),(5,5); +insert into gap4 values (1,1), (2,2),(3,3),(4,4),(5,5); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_select.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_select.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_select.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_select.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,89 @@ +eval set session autocommit=$autocommit; +let $is_gaplock_target = `SELECT @@autocommit = 0 && '$select_lock' != '' && '$expect_gap_lock_errors' = 1`; + +if ($is_gaplock_target) +{ +# rnd_init +--error ER_UNKNOWN_ERROR +eval select * from gap1 limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where value != 100 limit 1 $select_lock; +# index_read_map +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 $select_lock; +# read_range_first +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 and id3 != 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 and id3 + between 1 and 3 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 order by id3 asc + limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 order by id3 desc + limit 1 $select_lock; +# index_first +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 asc limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 asc, id2 asc, id3 asc limit 1 $select_lock; +# index_last +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 desc limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 desc, id2 desc, id3 desc + limit 1 $select_lock; +# secondary index lookup +--error ER_UNKNOWN_ERROR +eval select * from gap1 force index(i) where c1=1 $select_lock; +# unique index lookup, ensure no gap lock errors as this is effectively a +# single point select that does not lock ranges or gaps of keys +eval select * from gap3 force index(ui) where value=1 $select_lock; +# primary key lookup, ensure no gap lock errors as these are effectively +# single point selects that do not lock ranges or gaps of keys +eval select * from gap1 where id1=1 and id2=1 and id3=1 $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3 in (1, 2, 3) $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3=1 and value=1 + order by c1 $select_lock; +eval select * from gap3 where id=1 $select_lock; +eval select * from gap4 where id=1 $select_lock; +eval select * from gap4 where id in (1, 2, 3) $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap4 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap4 where id between 3 and 7 $select_lock; +} + +if (!$is_gaplock_target) +{ +eval select * from gap1 limit 1 $select_lock; +eval select * from gap1 where value != 100 limit 1 $select_lock; +eval select * from gap1 where id1=1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 and id3 != 1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 and id3 + between 1 and 3 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 order by id3 asc + limit 1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 order by id3 desc + limit 1 $select_lock; +eval select * from gap1 order by id1 asc limit 1 $select_lock; +eval select * from gap1 order by id1 asc, id2 asc, id3 asc limit 1 $select_lock; +eval select * from gap1 order by id1 desc limit 1 $select_lock; +eval select * from gap1 order by id1 desc, id2 desc, id3 desc + limit 1 $select_lock; +eval select * from gap1 force index(i) where c1=1 $select_lock; +eval select * from gap3 force index(ui) where value=1 $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3=1 $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3 in (1, 2, 3) $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3=1 and value=1 + order by c1 $select_lock; +eval select * from gap3 where id=1 $select_lock; +eval select * from gap4 where id=1 $select_lock; +eval select * from gap4 where id in (1, 2, 3) $select_lock; +eval select * from gap4 $select_lock; +eval select * from gap4 where id between 3 and 7 $select_lock; +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_update.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_update.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/gap_lock_error_update.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/gap_lock_error_update.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,91 @@ +eval set session autocommit=$autocommit; +let $is_gaplock_target = `SELECT @@autocommit = 0 && '$expect_gap_lock_errors' = 1`; + +if ($is_gaplock_target) +{ +## single-table insert,update,delete +insert into gap1 (id1, id2, id3) values (-1,-1,-1); +insert into gap1 (id1, id2, id3) values (-1,-1,-1) + on duplicate key update value=100; +--error ER_UNKNOWN_ERROR +update gap1 set value=100 where id1=1; +update gap1 set value=100 where id1=1 and id2=1 and id3=1; +--error ER_UNKNOWN_ERROR +delete from gap1 where id1=2; +delete from gap1 where id1=-1 and id2=-1 and id3=-1; +commit; + +## multi-table statements (preventing all gap locks with autocommit) +# insert into select +--error ER_UNKNOWN_ERROR +insert into gap2 select * from gap1; +--error ER_UNKNOWN_ERROR +insert into gap2 select * from gap1 where id1=1; +insert into gap2 select * from gap1 where id1=1 and id2=1 and id3=1; + +# create table select +eval create table t4 engine=$engine select * from gap1 where id1=1 and id2=1 and id3=1; +drop table t4; +--error ER_UNKNOWN_ERROR +eval create table t4 engine=$engine select * from gap1; +--error ER_UNKNOWN_ERROR +eval create table t4 engine=$engine select * from gap1 where id1=1; + +# update join +update gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 set gap1.value=100 where gap2.id1=3 + and gap2.id2=3 and gap2.id3=3; +--error ER_UNKNOWN_ERROR +update gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 set gap1.value=100 where gap2.id1=3; +--error ER_UNKNOWN_ERROR +update gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 join gap3 on gap1.id1=gap3.id + set gap1.value=100 where gap2.id1=3; +--error ER_UNKNOWN_ERROR +update gap1 set gap1.value= (select count(*) from gap2); + +# delete join +delete gap1 from gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 where gap2.id1=3 + and gap2.id2=3 and gap2.id3=3; +--error ER_UNKNOWN_ERROR +delete gap1 from gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 where gap2.id1=3; + +# select join / self join +--error ER_UNKNOWN_ERROR +select * from gap1, gap2 limit 1 for update; +--error ER_UNKNOWN_ERROR +select * from gap1 a, gap1 b limit 1 for update; + +# unique secondary key +eval create table u1( + c1 int, + c2 int, + c3 int, + c4 int, + primary key (c1, c2, c3), + unique key (c3, c1) +) engine=$engine; +begin; +insert into u1 values (1,1,1,1); +commit; +begin; +insert into u1 values (1,2,1,1) on duplicate key update c4=10; +commit; +begin; +select * from u1 where c3=1 and c1 = 1 for update; +--error ER_UNKNOWN_ERROR +select * from u1 where c3=1 for update; +commit; +drop table u1; +} + +if (!$is_gaplock_target) +{ +# autocommit doesn't prevent single table operations +insert into gap1 (id1, id2, id3) values (-1,-1,-1); +insert into gap1 (id1, id2, id3) values (-1,-1,-1) + on duplicate key update value=100; +update gap1 set value=100 where id1=1; +update gap1 set value=100 where id1=1 and id2=1 and id3=1; +delete from gap1 where id1=2; +delete from gap1 where id1=-1 and id2=-1 and id3=-1; +commit; +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/have_tokudb_backup.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/have_tokudb_backup.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/have_tokudb_backup.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/have_tokudb_backup.inc 2017-10-19 04:25:29.000000000 +0000 @@ -3,10 +3,3 @@ if (!$TOKUDB_BACKUP) { --skip TokuDB Backup requires the environment variable \$TOKUDB_BACKUP to be set (normally done by mtr) } - -# -# Check if --plugin-dir was setup for TokuDB Backup -# -if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$TOKUDB_BACKUP_OPT/'`) { - --skip TokuDB Backup requires that --plugin-dir is set to the TokuDB Backup plugin dir (either the .opt file does not contain \$TOKUDB_BACKUP_OPT or another plugin is in use) -} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/have_tokudb.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/have_tokudb.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/have_tokudb.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/have_tokudb.inc 2017-10-19 04:25:29.000000000 +0000 @@ -8,10 +8,3 @@ if (!$TOKUDB) { --skip TokuDB requires the environment variable \$TOKUDB to be set (normally done by mtr) } - -# -# Check if --plugin-dir was setup for TokuDB -# -if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$TOKUDB_OPT/'`) { - --skip TokuDB requires that --plugin-dir is set to the TokuDB plugin dir (either the .opt file does not contain \$TOKUDB_OPT or another plugin is in use) -} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/index_merge1.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/index_merge1.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/index_merge1.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/index_merge1.inc 2017-10-19 04:25:29.000000000 +0000 @@ -453,6 +453,10 @@ alter table t3 add keyC int not null, add index iC(keyC); update t3 set key9=key1,keyA=key1,keyB=key1,keyC=key1; +# Force complete purge +SET @@GLOBAL.innodb_fast_shutdown = 0; +--source include/restart_mysqld.inc + -- disable_query_log -- disable_result_log analyze table t3; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/index_merge2.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/index_merge2.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/index_merge2.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/index_merge2.inc 2017-10-19 04:25:29.000000000 +0000 @@ -371,6 +371,10 @@ alter table t1 add index i3(key3); update t1 set key2=key1,key3=key1; +# Force complete purge +SET @@GLOBAL.innodb_fast_shutdown = 0; +--source include/restart_mysqld.inc + -- disable_query_log -- disable_result_log analyze table t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/index_merge_ror.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/index_merge_ror.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/index_merge_ror.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/index_merge_ror.inc 2017-10-19 04:25:29.000000000 +0000 @@ -178,11 +178,16 @@ # ROR-union(ROR-intersection) with one of ROR-intersection giving empty # results +--replace_result key3 key34 key4 key34 explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; delete from t1 where key3=100 and key4=100; +# Force complete purge +SET @@GLOBAL.innodb_fast_shutdown = 0; +--source include/restart_mysqld.inc + -- disable_query_log -- disable_result_log analyze table t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/join_cache.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/join_cache.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/join_cache.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/join_cache.inc 2017-10-19 04:25:29.000000000 +0000 @@ -1807,6 +1807,7 @@ GROUP BY field2 ORDER BY field1; +--replace_column 9 ROWS eval explain $query; eval $query; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/kill_mysqld.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/kill_mysqld.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/kill_mysqld.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/kill_mysqld.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,7 @@ +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect + +--echo # Kill the server +--exec echo "wait" > $_expect_file_name +--shutdown_server 0 +--source include/wait_until_disconnected.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/mix1.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/mix1.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/mix1.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/mix1.inc 2017-10-19 04:25:29.000000000 +0000 @@ -459,9 +459,6 @@ EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5'; SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5'; DELETE FROM t1; ---echo # Masking (#) number in "rows" column of the following EXPLAIN output, as it may vary (bug#47746). ---replace_column 9 # -EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5'; SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5'; DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/mtr_warnings.sql percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/mtr_warnings.sql --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/mtr_warnings.sql 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/mtr_warnings.sql 2017-10-19 04:25:29.000000000 +0000 @@ -251,6 +251,9 @@ */ ("Insecure configuration for --secure-file-priv:*"), + /* ASan memory allocation warnings */ + ("==[0-9]*== WARNING: AddressSanitizer failed to allocate 0x[0-9a-f]+ bytes"), + /* Galera suppressions */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_kill_idle_trx.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_kill_idle_trx.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_kill_idle_trx.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_kill_idle_trx.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,63 @@ +--source include/count_sessions.inc +--let $default_se= `SELECT @@default_storage_engine` + +--echo # +--echo # Test kill_idle_transaction_timeout feature with $default_se +--echo # + +CREATE TABLE t1 (a INT); + +let $saved_kill_idle_transaction= `SELECT @@kill_idle_transaction`; +SET GLOBAL kill_idle_transaction= 1; + +BEGIN; +INSERT INTO t1 VALUES (1),(2); +COMMIT; +SELECT * FROM t1; + +BEGIN; +INSERT INTO t1 VALUES (3); +sleep 2; + +--echo # Current connection idle transaction killed, reconnecting +--source include/wait_until_disconnected.inc +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect +SELECT * FROM t1; + +--echo # +--echo # Test that row locks are released on idle transaction kill +--echo # + +SET GLOBAL kill_idle_transaction= 2; + +--connect (conn1,localhost,root,,) +--connection conn1 + +--echo # Take row locks in connection conn1 +BEGIN; +SELECT * FROM t1 FOR UPDATE; + +--connection default + +sleep 3; +--echo # Take row locks in connection default +UPDATE t1 SET a=4; +SELECT * FROM t1; + +--connection conn1 + +--echo # Show that connection conn1 has been killed +--error 2006 +SELECT * FROM t1; + +--disconnect conn1 +--connection default +--echo # connection default + +--echo # Cleanup +DROP TABLE t1; +--replace_result $saved_kill_idle_transaction saved_kill_idle_transaction +eval SET GLOBAL kill_idle_transaction= $saved_kill_idle_transaction; +--source include/wait_until_count_sessions.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_kill_idle_trx_non_trx_se.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_kill_idle_trx_non_trx_se.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_kill_idle_trx_non_trx_se.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_kill_idle_trx_non_trx_se.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,46 @@ +--echo # +--echo # Tests for kill_idle_transaction feature that do not depend on transactional SEs +--echo # + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; + +let $saved_kill_idle_transaction= `SELECT @@kill_idle_transaction`; +SET GLOBAL kill_idle_transaction= 1; + +--echo # Autocommitting non-trx SE queries should not result in kills +INSERT INTO t1 VALUES (1); +SELECT * FROM t1; + +sleep 2; + +--echo # Should not have been disconnected +INSERT INTO t1 VALUES (2); + +SELECT * FROM t1; + +--echo # An idle transaction should be killed even if it does not use any transactional SE +BEGIN; +sleep 2; + +--echo # Current connection idle transaction killed, reconnecting +--source include/wait_until_disconnected.inc +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect + +--echo # With a low wait_timeout and high kill_idle_transaction the lower value takes precedence +SET GLOBAL kill_idle_transaction= 100000; +SET SESSION wait_timeout= 5; + +BEGIN; +sleep 6; +--echo # Current connection idle transaction killed, reconnecting +--source include/wait_until_disconnected.inc +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect + +--echo # Cleanup +DROP TABLE t1; +--replace_result $saved_kill_idle_transaction saved_kill_idle_transaction +eval SET GLOBAL kill_idle_transaction= $saved_kill_idle_transaction; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_show_slave_status_nolock.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_show_slave_status_nolock.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_show_slave_status_nolock.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_show_slave_status_nolock.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ ---echo ---disable_result_log -connection slave_lock; ---echo [slave_lock] -send SHOW SLAVE STATUS; - -connection slave; ---let $condition= 'SHOW SLAVE STATUS' ---source include/wait_show_condition.inc - ---disable_warnings -SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1'; ---enable_warnings - ---let current=`SELECT SUBSTR(Variable_value FROM 22) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name = 'DEBUG_SYNC'` ---echo SIGNAL after SHOW SLAVE STATUS is $current - -connection slave; ---echo [slave] -SET DEBUG_SYNC='now SIGNAL signal.empty'; - -connection slave_nolock; ---echo [slave_nolock] -send SHOW SLAVE STATUS NONBLOCKING; - -connection slave; ---let $condition= 'SHOW SLAVE STATUS NONBLOCKING' ---source include/wait_show_condition.inc - ---disable_warnings -SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1'; ---enable_warnings - ---echo # should be 'signal.after_show_slave_status' ---let current=`SELECT SUBSTR(Variable_value FROM 22) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name = 'DEBUG_SYNC'` ---echo SIGNAL after SHOW SLAVE STATUS NONBLOCKING is $current - -connection slave; ---echo [slave] -SET DEBUG_SYNC='now SIGNAL signal.continue'; - -connection slave_lock; ---disable_result_log -reap; ---enable_result_log - -connection slave_nolock; ---disable_result_log -reap; ---enable_result_log - -connection slave; ---echo [slave] -SET DEBUG_SYNC='now SIGNAL signal.empty'; ---enable_result_log ---echo diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_signal_handling.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_signal_handling.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_signal_handling.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_signal_handling.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,52 @@ +# +# Test the effect of various signals on the server +# +--let $test_error_log= $MYSQLTEST_VARDIR/tmp/test_threadpool_sig_handler.err +--let $restart_parameters=restart:--log-error=$test_error_log +--source include/restart_mysqld.inc + +SELECT @@GLOBAL.thread_handling; + +--let $mysqld_pid_file=`SELECT @@GLOBAL.pid_file` + +--echo # Test SIGPIPE, SIGTSTP, SIGINT, which should be ignored +exec kill -PIPE `cat $mysqld_pid_file`; +exec kill -TSTP `cat $mysqld_pid_file`; +exec kill -INT `cat $mysqld_pid_file`; + +--echo # Test SIGHUP, which should result in status dump in the error log +exec kill -HUP `cat $mysqld_pid_file`; + +SELECT 1; + +--echo # +--echo # Bug 805805: attaching to percona-server with gdb disconnects clients +--echo # Bug 1060136: safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT +--echo # + +exec kill -STOP `cat $mysqld_pid_file`; +exec kill -CONT `cat $mysqld_pid_file`; + +SELECT 1; + +--echo # +--echo # Bug 1537554: SIGTERM kills server instead of shutdown w/ threadpool +--echo # + +--source include/expect_crash.inc +exec kill -TERM `cat $mysqld_pid_file`; +--source include/wait_until_disconnected.inc + +--let $restart_parameters= +--source include/start_mysqld.inc + +# Test for SIGHUP output +--let SEARCH_FILE=$test_error_log +--let SEARCH_PATTERN=Status information: +--source include/search_pattern_in_file.inc + +# Test for SIGTERM output +--let SEARCH_PATTERN=mysqld.*: Shutdown complete +--source include/search_pattern_in_file.inc + +--remove_file $test_error_log diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_slow_log_verbosity_grep.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_slow_log_verbosity_grep.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/percona_slow_log_verbosity_grep.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/percona_slow_log_verbosity_grep.inc 2017-10-19 04:25:29.000000000 +0000 @@ -1,11 +1,13 @@ # Common extensions to the slow query log --let grep_pattern = ^# Schema: .+ Last_errno: \d+ Killed: \d+\$ +--let log_expected_matches = $log_slow_verbosity_expected_matches --source include/log_grep.inc --let grep_pattern = ^#.*Rows_affected: \d+\$ --source include/log_grep.inc --let grep_pattern = ^# Bytes_sent: \d+.*\$ --source include/log_grep.inc # InnoDB +--let log_expected_matches = $log_slow_verbosity_innodb_expected_matches --let grep_pattern = ^# InnoDB_trx_id: \w+\$ --source include/log_grep.inc # Query plan diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/plugin.defs percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/plugin.defs --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/plugin.defs 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/plugin.defs 2017-10-19 04:25:29.000000000 +0000 @@ -10,6 +10,10 @@ # PLUGVAR_OPT: mysqld option --plugin_dir=.... # PLUGVAR_LOAD: option --plugin_load=.... if the 4th element is present # PLUGVAR_LOAD_ADD: option --plugin_load_add=.... if the 4th element is present +# PLUGVAR_LOAD_PATH: option --plugin_load=.... with library full path +# if the 4th element is present +# PLUGVAR_LOAD_ADD_PATH: option --plugin_load_add=.... with library full path +# if the 4th element is present # # If a listed plugin is not found, the corresponding variables will be # set to empty, they will not be unset. @@ -53,6 +57,7 @@ handlersocket plugin/HandlerSocket-Plugin-for-MySQL HANDLER_SOCKET mysql_no_login plugin/mysql_no_login MYSQL_NO_LOGIN mysql_no_login test_udf_services plugin/udf_services TESTUDFSERVICES -ha_tokudb storage/tokudb TOKUDB tokudb,tokudb_trx,tokudb_locks,tokudb_lock_waits,tokudb_fractal_tree_info,tokudb_background_job_status -tokudb_backup plugin/tokudb_backup TOKUDB_BACKUP tokudb_backup -ha_rocksdb storage/rocksdb ROCKSDB rocksdb,rocksdb_cfstats,rocksdb_dbstats,rocksdb_perf_context_global,rocksdb_cf_options,rocksdb_global_info,rocksdb_ddl,rocksdb_index_file_map +connection_control plugin/connection_control CONNECTION_CONTROL_PLUGIN connection_control +ha_tokudb storage/tokudb TOKUDB tokudb,tokudb_trx,tokudb_locks,tokudb_lock_waits,tokudb_fractal_tree_info,tokudb_background_job_status,tokudb_file_map +tokudb_backup plugin/tokudb-backup-plugin TOKUDB_BACKUP tokudb_backup +ha_rocksdb storage/rocksdb ROCKSDB rocksdb,rocksdb_cfstats,rocksdb_dbstats,rocksdb_perf_context,rocksdb_perf_context_global,rocksdb_cf_options,rocksdb_compaction_stats,rocksdb_global_info,rocksdb_ddl,rocksdb_index_file_map,rocksdb_locks,rocksdb_trx diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/range.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/range.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/range.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/range.inc 2017-10-19 04:25:29.000000000 +0000 @@ -1813,6 +1813,8 @@ INSERT INTO t1 SELECT c1, 2, c3 FROM t1; INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; +ANALYZE TABLE t1; + SELECT COUNT(*) FROM t1; EXPLAIN SELECT c1, c2, c3 @@ -1836,4 +1838,67 @@ SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; -DROP TABLE t1; \ No newline at end of file +DROP TABLE t1; + +--echo # +--echo # Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY +--echo # INDEX, EVEN THOUGH COST IS HIGHER +--echo # + +CREATE TABLE `giant_table` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `one_id` int(11) NOT NULL, + `other_id` bigint(20) NOT NULL DEFAULT '0', + `some_other_id` int(11) DEFAULT 0 NOT NULL, + `something` double NOT NULL DEFAULT '0', + `comment` text COLLATE utf8_unicode_ci, + `flags` int(11) NOT NULL DEFAULT '0', + `time_created` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `time_created` (`time_created`), + KEY `some_other_id` (`some_other_id`), + KEY `one_other_idx` (`one_id`,`other_id`), + KEY `other_id` (`other_id`,`time_created`) +) ENGINE=InnoDB AUTO_INCREMENT=101651329 +DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; + +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520), + (82543190), (67538270), (77282760), (77908170), + (70923370), (68066360); +DELIMITER $; +CREATE PROCEDURE p() +BEGIN +SET @x = 1; +REPEAT + +INSERT INTO giant_table(id,one_id) + SELECT c1 + @x, 0 + FROM t1 + WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270, + 77282760, 77908170, 70923370, 68066360); +SET @x = @x + 1; + +UNTIL @x > 30 END REPEAT; +END $ +DELIMITER ;$ + +CALL p(); +SELECT count(*) FROM giant_table; + +INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1), + (89628210,1), (77869520,2); +INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1), + (61069031, 1, 1); + +EXPLAIN SELECT id, something, comment, time_created, one_id, other_id, + some_other_id, flags +FROM giant_table +WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272, + 84673401, 61069031, 68214385, 77282865, 76991297, 64569216, + 89481638, 74534074, 70396537, 80076375, 63308530, 77908270, + 70923271, 68066180) + AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0; + +DROP PROCEDURE p; +DROP TABLE giant_table, t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/restart_mysqld.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/restart_mysqld.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/restart_mysqld.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/restart_mysqld.inc 2017-10-19 04:25:29.000000000 +0000 @@ -32,6 +32,9 @@ # Call script that will poll the server waiting for it to be back online again --source include/wait_until_connected_again.inc +# Wait for wsrep +--source include/wait_wsrep_ready.inc + # Turn off reconnect again --disable_reconnect diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/restart_readonly_mysqld.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/restart_readonly_mysqld.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/restart_readonly_mysqld.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/restart_readonly_mysqld.inc 2017-10-19 04:25:29.000000000 +0000 @@ -5,24 +5,9 @@ SET GLOBAL innodb_fast_shutdown=0; --enable_query_log -# Write file to make mysql-test-run.pl expect the "crash", but don't start -# it until it's told to ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect ---exec echo "wait" > $_expect_file_name +--let $_restart_readonly_mysqld_saved_restart_parameters= $restart_parameters -# Send shutdown to the connected server and give -# it 10 seconds to die before zapping it -shutdown_server 10; +--let $restart_parameters=restart: --innodb-read-only +--source include/restart_mysqld.inc -# Write file to make mysql-test-run.pl start up the server again ---exec echo "restart: --innodb-read-only " > $_expect_file_name - -# Turn on reconnect ---enable_reconnect - -# Call script that will poll the server waiting for it to be back online again ---source include/wait_until_connected_again.inc - -# Turn off reconnect again ---disable_reconnect +--let $restart_parameters= $_restart_readonly_mysqld_saved_restart_parameters diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/rpl_diff.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/rpl_diff.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/rpl_diff.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/rpl_diff.inc 2017-10-19 04:25:29.000000000 +0000 @@ -112,7 +112,7 @@ --let $_rpl_diff_first= 0 } --remove_file $_rpl_diff_prev_file - +--remove_file $_rpl_diff_statement_file --let $include_filename= rpl_diff.inc --source include/end_include_file.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/start_mysqld.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/start_mysqld.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/start_mysqld.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/start_mysqld.inc 2017-10-19 04:25:29.000000000 +0000 @@ -34,5 +34,8 @@ # Call script that will poll the server waiting for it to be back online again --source include/wait_until_connected_again.inc +# Wait for wsrep +--source include/wait_wsrep_ready.inc + # Turn off reconnect again --disable_reconnect diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/subquery_sj.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/subquery_sj.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/subquery_sj.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/subquery_sj.inc 2017-10-19 04:25:29.000000000 +0000 @@ -4421,6 +4421,7 @@ AND grandparent1.col_varchar_key IS NOT NULL ); +--replace_column 9 ROWS eval EXPLAIN $query; eval $query; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_condition_with_debug.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_condition_with_debug.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_condition_with_debug.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_condition_with_debug.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,61 @@ +# include/wait_condition_with_debug.inc +# +# SUMMARY +# +# Waits until the passed statement returns true, or the operation +# times out. If the operation times out, the additional error +# statement will be executed. +# +# USAGE +# +# let $wait_condition= +# SELECT c = 3 FROM t; +# let $wait_condition_on_error_output= select count(*) from t; +# --source include/wait_condition_with_debug.inc +# +# OR +# +# let $wait_timeout= 60; # Override default 30 seconds with 60. +# let $wait_condition= +# SELECT c = 3 FROM t; +# let $wait_condition_on_error_output= select count(*) from t; +# --source include/wait_condition_with_debug.inc +# --echo Executed the test condition $wait_condition_reps times +# +# +# EXAMPLE +# events_bugs.test, events_time_zone.test +# + +let $wait_counter= 300; +if ($wait_timeout) +{ + let $wait_counter= `SELECT $wait_timeout * 10`; +} +# Reset $wait_timeout so that its value won't be used on subsequent +# calls, and default will be used instead. +let $wait_timeout= 0; + +# Keep track of how many times the wait condition is tested +# This is used by some tests (e.g., main.status) +let $wait_condition_reps= 0; +while ($wait_counter) +{ + --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) + { + let $wait_counter= 0; + } + if (!$success) + { + real_sleep 0.1; + dec $wait_counter; + } +} +if (!$success) +{ + echo Timeout in wait_condition.inc for $wait_condition; + --eval $wait_condition_on_error_output +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_for_mts_checkpoint.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_for_mts_checkpoint.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_for_mts_checkpoint.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_for_mts_checkpoint.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,11 @@ +# ==== Purpose ==== +# +# Waits until mts_checkpoint_routine has been fully +# executed - from the beginning till the end +# +SET @@global.debug= "+d,mts_checkpoint"; +#If end was hit before start - clear it +SET DEBUG_SYNC="RESET"; +SET DEBUG_SYNC="now WAIT_FOR mts_checkpoint_start"; +SET DEBUG_SYNC="now WAIT_FOR mts_checkpoint_end"; +SET @@global.debug= "-d,mts_checkpoint"; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_until_disconnected.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_until_disconnected.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_until_disconnected.inc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_until_disconnected.inc 2017-10-19 04:25:29.000000000 +0000 @@ -7,7 +7,7 @@ let $mysql_errno= 0; while (!$mysql_errno) { - --error 0,1040,1047,1053,2002,2003,2006,2013 + --error 0,1040,1047,1053,1317,2002,2003,2006,2013 show status; dec $counter; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_wsrep_ready.inc percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_wsrep_ready.inc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/include/wait_wsrep_ready.inc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/include/wait_wsrep_ready.inc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,15 @@ +# +# If the wsrep plugin is loaded, wait until the wsrep provider becomes +# ready for use. +# + +--disable_query_log +--disable_result_log + +if (`SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`) +{ + --source include/galera_wait_ready.inc +} + +--enable_query_log +--enable_result_log diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/lib/generate_percona_ssl_certs.sh percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/lib/generate_percona_ssl_certs.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/lib/generate_percona_ssl_certs.sh 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/lib/generate_percona_ssl_certs.sh 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,30 @@ +#!/bin/sh + +set -xe + +# boilerplace for "openssl ca" and /etc/ssl/openssl.cnf +rm -rf demoCA +mkdir demoCA demoCA/newcerts +touch demoCA/index.txt +echo 01 > demoCA/serial + +# Generate a new self-signed CA certificate +openssl req -x509 -newkey rsa:2048 -keyout percona-cakey.pem -out percona-cacert.pem -days 7300 -nodes -subj '/CN=percona-cacert/C=US/ST=NC/L=Raleigh/O=Percona' -text +# The following operation althought looking redundant will remove 'passphrase' from the RSA key (which is currently unsupported in YaSSL) +openssl rsa -in percona-cakey.pem -out percona-cakey.pem + +# Generating a new certificate signing request for the server +openssl req -newkey rsa:2048 -keyout percona-serversan-key.pem -out demoCA/percona-serversan.csr -days 7300 -nodes -subj '/CN=percona-server/C=US/ST=NC/L=Raleigh/O=Percona' +# The following operation althought looking redundant will remove 'passphrase' from the RSA key (which is currently unsupported in YaSSL) +openssl rsa -in percona-serversan-key.pem -out percona-serversan-key.pem +# Generate a new server certificate signed with new CA +# with SubjectAltName, only for OpenSSL 1.0.2+ +cat > demoCA/sanext.conf <{'comment'}"); return; } my $timeout= $tinfo->{'timeout'}; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/lib/My/ConfigFactory.pm percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/lib/My/ConfigFactory.pm --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/lib/My/ConfigFactory.pm 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/lib/My/ConfigFactory.pm 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2007, 2011, Oracle and/or its affiliates +# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -362,6 +362,7 @@ my @mysqlbinlog_rules= ( { 'character-sets-dir' => \&fix_charset_dir }, + { 'local-load' => sub { return shift->{ARGS}->{tmpdir}; } }, ); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/lib/My/CoreDump.pm percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/lib/My/CoreDump.pm --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/lib/My/CoreDump.pm 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/lib/My/CoreDump.pm 2017-10-19 04:25:29.000000000 +0000 @@ -62,8 +62,6 @@ /Core was generated by `([^\s\'\`]+)/; my $binary= $1 or return; - $binary= _verify_binpath ($binary, $core_name) or return; - # Create tempfile containing gdb commands my ($tmp, $tmp_name) = tempfile(); print $tmp diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/mysql-test-run.pl percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/mysql-test-run.pl --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/mysql-test-run.pl 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/mysql-test-run.pl 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -101,6 +101,8 @@ use IO::Select; use Subunit; +push @INC, "."; + require "lib/mtr_process.pl"; require "lib/mtr_io.pl"; require "lib/mtr_gcov.pl"; @@ -165,8 +167,9 @@ # If you add a new suite, please check TEST_DIRS in Makefile.am. # my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,innodb_fts," - ."innodb_zip,perfschema,funcs_1,funcs_2,opt_trace,parts,auth_sec,jp,stress," - ."engines/iuds,engines/funcs,query_response_time,innodb_stress,galera"; + ."innodb_zip,perfschema,funcs_1,funcs_2,opt_trace,parts,auth_sec," + ."connection_control,jp,stress,engines/iuds,engines/funcs," + ."query_response_time,innodb_stress,galera"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose @@ -348,6 +351,12 @@ main(); +sub is_core_dump { + my $core_name= shift; + # Name beginning with core, not ending in .gz, or ending with .dmp on Windows + return (($core_name =~ /^core/ and $core_name !~ /\.gz$/) + or (IS_WINDOWS and $core_name =~ /\.dmp$/)); +} sub main { # Default, verbosity on @@ -558,6 +567,19 @@ mtr_print_line(); } + if ($opt_ctest) { + find({ wanted => sub { + my $core_file= $File::Find::name; + my $core_name= basename($core_file); + + if (is_core_dump($core_name)) { + mtr_report(" - found '$core_file'"); + + My::CoreDump->show($core_file, "", 1); + } + }}, $bindir); + } + print_total_times($opt_parallel) if $opt_report_times; mtr_report_stats("Completed", $completed); @@ -652,10 +674,7 @@ my $core_file= $File::Find::name; my $core_name= basename($core_file); - # Name beginning with core, not ending in .gz - if (($core_name =~ /^core/ and $core_name !~ /\.gz$/) - or (IS_WINDOWS and $core_name =~ /\.dmp$/)){ - # Ending with .dmp + if (is_core_dump($core_name)) { mtr_report(" - found '$core_name'", "($num_saved_cores/$opt_max_save_core)"); @@ -2556,6 +2575,16 @@ $ENV{'INNOCHECKSUM'}= native_path($exe_innochecksum); # ---------------------------------------------------- + # sst_dump + # ---------------------------------------------------- + my $exe_sst_dump= + mtr_exe_maybe_exists( + vs_config_dirs('storage/rocksdb', 'sst_dump'), + "$path_client_bindir/sst_dump", + "$basedir/storage/rocksdb/sst_dump"); + $ENV{'MYSQL_SST_DUMP'}= native_path($exe_sst_dump); + + # ---------------------------------------------------- # Setup env so childs can execute myisampack and myisamchk # ---------------------------------------------------- $ENV{'MYISAMCHK'}= native_path(mtr_exe_exists( @@ -2572,6 +2601,17 @@ "$basedir/myisam/myisampack")); # ---------------------------------------------------- + # mysqlaccess + # ---------------------------------------------------- + my $mysqlaccess= + mtr_pl_maybe_exists("$bindir/scripts/mysqlaccess") || + mtr_pl_maybe_exists("$path_client_bindir/mysqlaccess"); + if ($mysqlaccess) + { + $ENV{'MYSQLACCESS'}= $mysqlaccess; + } + + # ---------------------------------------------------- # mysqlhotcopy # ---------------------------------------------------- my $mysqlhotcopy= @@ -4208,6 +4248,14 @@ resfile_test_info("start_time", isotime time); } +sub error_logs_to_comment { + my $tinfo= shift; + foreach my $mysqld (mysqlds()) + { + $tinfo->{comment}.= "\nServer " . $mysqld->{proc} . " log: ". + get_log_from_proc($mysqld->{proc}, $tinfo->{name}); + } +} # # Run a single test case @@ -4492,13 +4540,6 @@ goto SRVDIED; } - #foreach my $mysqld (mysqlds()) - #{ - # $tinfo->{comment}.= - # "\nServer " . $mysqld->{proc} . " log: ". - # get_log_from_proc($mysqld->{proc}, $tinfo->{name}); - #} - # Test case failure reported by mysqltest report_failure_and_restart($tinfo); } @@ -5285,13 +5326,26 @@ my $found_skip_core= 0; my $found_no_console= 0; my $found_log_error= 0; + + # On windows, do not add console if log-error found in .cnf file + open (CONFIG_FILE, " < $path_config_file") or + die("Could not open output file $path_config_file"); + + while () + { + if (m/^log[-_]error/) + { + $found_log_error= 1; + } + } + close (CONFIG_FILE); + foreach my $arg ( @$extra_opts ) { # Skip --defaults-file option since it's handled above. next if $arg =~ /^--defaults-file/; - - if ($arg eq "--log-error") + if ($arg =~ /^--log[-_]error/) { $found_log_error= 1; } @@ -5796,16 +5850,14 @@ my $mysqld_basedir= $mysqld->value('basedir'); if ( $basedir eq $mysqld_basedir ) { - if (! $opt_start_dirty) # If dirty, keep possibly grown system db + if (!$opt_start_dirty) # If dirty, keep possibly grown system db { - # Copy datadir from installed system db - for my $path ( "$opt_vardir", "$opt_vardir/..") { - my $install_db= "$path/install.db"; - copytree($install_db, $datadir) - if -d $install_db; - } - mtr_error("Failed to copy system db to '$datadir'") - unless -d $datadir; + # Copy datadir from installed system db + my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/.."; + my $install_db= "$path/install.db"; + copytree($install_db, $datadir) if -d $install_db; + mtr_error("Failed to copy system db to '$datadir'") + unless -d $datadir; } } else diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/alter_table.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/alter_table.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/alter_table.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/alter_table.result 2017-10-19 04:25:29.000000000 +0000 @@ -2578,3 +2578,56 @@ PRIMARY KEY (`fld1`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 DROP TABLE t1; +# +# Bug#19635706 +# Verify that it is possible to add a unique key to a not-NULL POINT +# column and that this key is promoted to primary key +# +CREATE TABLE t1(a INT NOT NULL, b POINT NOT NULL) ENGINE=INNODB; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` point NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t1 ADD UNIQUE INDEX (b); +# Note that SHOW CREATE TABLE does not list b as a primary key, +# even though it was promoted. This appears to be the case also +# for other column types. +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` point NOT NULL, + UNIQUE KEY `b` (`b`(25)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t1 ADD UNIQUE INDEX (a); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` point NOT NULL, + UNIQUE KEY `b` (`b`(25)), + UNIQUE KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Verify that the expected indices have been created by Innodb +SELECT T.NAME AS TABLE_NAME, I.NAME AS INDEX_NAME, +CASE I.TYPE +WHEN 0 THEN 'Secondary' +WHEN 1 THEN 'Clustered' +WHEN 2 THEN 'Unique' +WHEN 3 THEN 'Primary' +WHEN 32 THEN 'Full text' +WHEN 64 THEN 'Spatial' +ELSE 'Unknown' +END AS INDEX_TYPE, +F.NAME AS FIELD_NAME, F.POS AS FIELD_POS FROM +INFORMATION_SCHEMA.INNODB_SYS_TABLES AS T JOIN +INFORMATION_SCHEMA.INNODB_SYS_INDEXES AS I JOIN +INFORMATION_SCHEMA.INNODB_SYS_FIELDS AS F +ON I.INDEX_ID = F.INDEX_ID AND I.TABLE_ID = T.TABLE_ID +WHERE T.NAME = 'test/t1'; +TABLE_NAME INDEX_NAME INDEX_TYPE FIELD_NAME FIELD_POS +test/t1 b Primary b 0 +test/t1 a Unique a 0 +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_csv.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_csv.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_csv.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_csv.result 2017-10-19 04:25:29.000000000 +0000 @@ -91,4 +91,9 @@ select '&;&&&""""<><<>>>>'; &;&&&""""<><<>>>> &;&&&""""<><<>>>> +select '  + /"\\'; +/"\ +  + /"\ set global audit_log_flush= ON; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_filter_users.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_filter_users.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_filter_users.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_filter_users.result 2017-10-19 04:25:29.000000000 +0000 @@ -56,9 +56,6 @@ SET GLOBAL audit_log_flush=ON; SET GLOBAL audit_log_flush=ON; SET GLOBAL audit_log_include_accounts= ''; -SELECT 'skip this'; -skip this -skip this SELECT 'user1'; user1 user1 @@ -77,13 +74,7 @@ SELECT 'us,er1'; us,er1 us,er1 -SELECT 'skip this'; -skip this -skip this SET GLOBAL audit_log_include_accounts= 'user1@localhost,, user22@127.0.0.1,admin@%,veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryloooooooooooooongusername@veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryloooooooooooooonghostname'; -SELECT 'skip this'; -skip this -skip this SELECT 'user1'; user1 user1 @@ -102,13 +93,7 @@ SELECT 'us,er1'; us,er1 us,er1 -SELECT 'skip this'; -skip this -skip this SET GLOBAL audit_log_include_accounts= NULL; -SELECT 'skip this'; -skip this -skip this SELECT 'user1'; user1 user1 @@ -127,13 +112,7 @@ SELECT 'us,er1'; us,er1 us,er1 -SELECT 'skip this'; -skip this -skip this SET GLOBAL audit_log_exclude_accounts= 'user1@localhost,, user22@127.0.0.1,admin@%'; -SELECT 'skip this'; -skip this -skip this SELECT 'user1'; user1 user1 @@ -152,9 +131,6 @@ SELECT 'us,er1'; us,er1 us,er1 -SELECT 'skip this'; -skip this -skip this SET GLOBAL audit_log_exclude_accounts= NULL; set global audit_log_flush= ON; =================================================================== diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_json.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_json.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_json.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_json.result 2017-10-19 04:25:29.000000000 +0000 @@ -91,4 +91,9 @@ select '&;&&&""""<><<>>>>'; &;&&&""""<><<>>>> &;&&&""""<><<>>>> +select '  + /"\\'; +/"\ +  + /"\ set global audit_log_flush= ON; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_many_connections.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_many_connections.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_many_connections.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_many_connections.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,7 @@ +SET @saved_max_connections = @@global.max_connections; +SET GLOBAL max_connections = 2; +connect(localhost,root,,test,MYSQL_PORT,MYSQL_SOCK); +ERROR HY000: Too many connections +connect(localhost,root,,test,MYSQL_PORT,MYSQL_SOCK); +ERROR HY000: Too many connections +SET GLOBAL max_connections= @saved_max_connections; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_new.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_new.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_new.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_new.result 2017-10-19 04:25:29.000000000 +0000 @@ -91,4 +91,9 @@ select '&;&&&""""<><<>>>>'; &;&&&""""<><<>>>> &;&&&""""<><<>>>> +select '  + /"\\'; +/"\ +  + /"\ set global audit_log_flush= ON; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_old.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_old.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_old.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_old.result 2017-10-19 04:25:29.000000000 +0000 @@ -91,4 +91,9 @@ select '&;&&&""""<><<>>>>'; &;&&&""""<><<>>>> &;&&&""""<><<>>>> +select '  + /"\\'; +/"\ +  + /"\ set global audit_log_flush= ON; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_startup.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_startup.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_startup.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_startup.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,12 @@ +call mtr.add_suppression("Plugin 'audit_log' init function returned error."); +call mtr.add_suppression("Plugin 'audit_log' registration as a AUDIT failed."); +SET GLOBAL audit_log_exclude_accounts='info@localhost'; +SET GLOBAL audit_log_include_accounts='info@localhost'; +SET GLOBAL audit_log_exclude_commands='insert'; +SET GLOBAL audit_log_include_commands='insert'; +SHOW VARIABLES LIKE 'audit_log%'; +Variable_name Value +SHOW VARIABLES LIKE 'audit_log%'; +Variable_name Value +SHOW VARIABLES LIKE 'audit_log%'; +Variable_name Value diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_syslog.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_syslog.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_syslog.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_syslog.result 2017-10-19 04:25:29.000000000 +0000 @@ -89,3 +89,8 @@ select '&;&&&""""<><<>>>>'; &;&&&""""<><<>>>> &;&&&""""<><<>>>> +select '  + /"\\'; +/"\ +  + /"\ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_threadpool.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_threadpool.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/audit_log_threadpool.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/audit_log_threadpool.result 2017-10-19 04:25:29.000000000 +0000 @@ -7,4 +7,4 @@ 1more 1more set global audit_log_flush= ON; -1 connects, 1 disconnects +2 connects, 1 disconnects diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/backup_locks_mysqldump.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/backup_locks_mysqldump.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/backup_locks_mysqldump.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/backup_locks_mysqldump.result 2017-10-19 04:25:29.000000000 +0000 @@ -18,6 +18,7 @@ /*!40103 SET TIME_ZONE='+00:00' */ FLUSH TABLES FLUSH TABLES WITH READ LOCK +SELECT COUNT(*) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'rocksdb\_skip\_fill\_cache' SHOW VARIABLES LIKE 'gtid\_mode' SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL AND LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test'))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE ORDER BY LOGFILE_GROUP_NAME SELECT DISTINCT TABLESPACE_NAME, FILE_NAME, LOGFILE_GROUP_NAME, EXTENT_SIZE, INITIAL_SIZE, ENGINE FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('test')) ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME @@ -59,6 +60,7 @@ /*!40103 SET TIME_ZONE='+00:00' */ SHOW VARIABLES LIKE 'have_backup_locks' LOCK TABLES FOR BACKUP +SELECT COUNT(*) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'rocksdb\_skip\_fill\_cache' SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT */ SHOW VARIABLES LIKE 'gtid\_mode' @@ -106,6 +108,7 @@ SHOW VARIABLES LIKE 'have_backup_locks' SHOW STATUS LIKE 'binlog_snapshot_%' LOCK TABLES FOR BACKUP +SELECT COUNT(*) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'rocksdb\_skip\_fill\_cache' SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT */ SHOW VARIABLES LIKE 'gtid\_mode' diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/binary_to_hex.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/binary_to_hex.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/binary_to_hex.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/binary_to_hex.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,117 @@ +USE test; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (c1 TINYBLOB, +c2 BLOB, +c3 MEDIUMBLOB, +c4 LONGBLOB, +c5 TEXT, +c6 BIT(1), +c7 CHAR, +c8 VARCHAR(10), +c9 GEOMETRY) CHARACTER SET = binary; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` tinyblob, + `c2` blob, + `c3` mediumblob, + `c4` longblob, + `c5` blob, + `c6` bit(1) DEFAULT NULL, + `c7` binary(1) DEFAULT NULL, + `c8` varbinary(10) DEFAULT NULL, + `c9` geometry DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=binary +INSERT INTO t1 VALUES ('tinyblob-text readable', 'blob-text readable', +'mediumblob-text readable', 'longblob-text readable', +'text readable', b'1', 'c', 'variable', +POINT(1, 1)); +CREATE TABLE t2(id int, `col1` binary(10),`col2` blob); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) DEFAULT NULL, + `col1` binary(10) DEFAULT NULL, + `col2` blob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t2 VALUES (1, X'AB1234', X'123ABC'), (2, X'DE1234', X'123DEF'); +#Print the table contents when binary-as-hex option is off. +SELECT * FROM t1; +c1 c2 c3 c4 c5 c6 c7 c8 c9 +tinyblob-text readable blob-text readable mediumblob-text readable longblob-text readable text readable # c variable # +SELECT * FROM t2; +id col1 col2 +1 # # +2 # # +#Print the table contents after turning on the binary-as-hex option + +#Print the table contents in tab format + +c1 c2 c3 c4 c5 c6 c7 c8 c9 +0x74696E79626C6F622D74657874207265616461626C65 0x626C6F622D74657874207265616461626C65 0x6D656469756D626C6F622D74657874207265616461626C65 0x6C6F6E67626C6F622D74657874207265616461626C65 0x74657874207265616461626C65 0x01 0x63 0x7661726961626C65 0x000000000101000000000000000000F03F000000000000F03F +id col1 col2 +1 0xAB123400000000000000 0x123ABC +2 0xDE123400000000000000 0x123DEF + +#Print the table contents in table format + ++------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+ +| c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | c9 | ++------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+ +| 0x74696E79626C6F622D74657874207265616461626C65 | 0x626C6F622D74657874207265616461626C65 | 0x6D656469756D626C6F622D74657874207265616461626C65 | 0x6C6F6E67626C6F622D74657874207265616461626C65 | 0x74657874207265616461626C65 | 0x01 | 0x63 | 0x7661726961626C65 | 0x000000000101000000000000000000F03F000000000000F03F | ++------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+ ++------+------------------------+------------+ +| id | col1 | col2 | ++------+------------------------+------------+ +| 1 | 0xAB123400000000000000 | 0x123ABC | ++------+------------------------+------------+ + +#Print the table contents vertically + +*************************** 1. row *************************** +c1: 0x74696E79626C6F622D74657874207265616461626C65 +c2: 0x626C6F622D74657874207265616461626C65 +c3: 0x6D656469756D626C6F622D74657874207265616461626C65 +c4: 0x6C6F6E67626C6F622D74657874207265616461626C65 +c5: 0x74657874207265616461626C65 +c6: 0x01 +c7: 0x63 +c8: 0x7661726961626C65 +c9: 0x000000000101000000000000000000F03F000000000000F03F + +#Print the table contents in xml format + + + + + + 0x74696E79626C6F622D74657874207265616461626C65 + 0x626C6F622D74657874207265616461626C65 + 0x6D656469756D626C6F622D74657874207265616461626C65 + 0x6C6F6E67626C6F622D74657874207265616461626C65 + 0x74657874207265616461626C65 + 0x01 + 0x63 + 0x7661726961626C65 + 0x000000000101000000000000000000F03F000000000000F03F + + + + + + + 1 + 0xAB123400000000000000 + 0x123ABC + + + + 2 + 0xDE123400000000000000 + 0x123DEF + + + +#Print the table contents in html format + +
c1c2c3c4c5c6c7c8c9
0x74696E79626C6F622D74657874207265616461626C650x626C6F622D74657874207265616461626C650x6D656469756D626C6F622D74657874207265616461626C650x6C6F6E67626C6F622D74657874207265616461626C650x74657874207265616461626C650x010x630x7661726961626C650x000000000101000000000000000000F03F000000000000F03F
idcol1col2
10xAB1234000000000000000x123ABC
20xDE1234000000000000000x123DEF
DROP TABLE t1, t2; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug1432494.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug1432494.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug1432494.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug1432494.result 2017-10-19 04:25:29.000000000 +0000 @@ -3,3 +3,4 @@ SET @@GLOBAL.master_info_repository="TABLE"; CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1; SET @@GLOBAL.master_info_repository=@old_master_info_repository; +RESET SLAVE; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug74615.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug74615.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug74615.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug74615.result 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,5 @@ call mtr.add_suppression("Did not write failed"); +call mtr.add_suppression("Column count of mysql\\.user is wrong\\. Expected [0-9]+, found [0-9]+\\. The table is probably corrupted"); ALTER TABLE mysql.user RENAME mysql.user_bak; CREATE TABLE mysql.user(Host char binary DEFAULT'',User char binary DEFAULT'', Password char collate latin1_bin DEFAULT'',Select_priv enum('','')COLLATE utf8_general_ci DEFAULT'', @@ -64,6 +65,6 @@ Note 1291 Column 'Trigger_priv' has duplicated value '' in ENUM Note 1291 Column 'ssl_type' has duplicated value '' in ENUM grant select on test.* to''@'santa.claus.ipv4.example.com'; -ERROR 42S22: Unknown column 'plugin' in 'mysql.user' +ERROR HY000: Column count of mysql.user is wrong. Expected 43, found 39. The table is probably corrupted DROP TABLE mysql.user; ALTER TABLE mysql.user_bak RENAME mysql.user; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug75943.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug75943.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug75943.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug75943.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,4 @@ +SET NAMES utf8, collation_connection = 'utf16_bin'; +SELECT '2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second; +'2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second +2010-10-10 10:10:10 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug76039.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug76039.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug76039.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug76039.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,7 @@ +SET @x = '1.1'; +SET collation_connection = utf32_bin; +PREPARE stmt FROM 'SELECT ? = ?'; +EXECUTE stmt USING @x, @y; +? = ? +NULL +DEALLOCATE PREPARE stmt; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug78064.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug78064.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug78064.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug78064.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,2 @@ +SET @@global.ft_boolean_syntax = '# -><()~*:11&1'; +ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '# -><()~*:11&1' diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug78230.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug78230.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug78230.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug78230.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,31 @@ +CALL mtr.add_suppression("mysql.user table is damaged or in unsupported 3\\.20 format\\."); +CALL mtr.add_suppression("Did not write failed"); +CALL mtr.add_suppression("Column count of mysql\\.user is wrong\\. Expected [0-9]+, found [0-9]+\\. The table is probably corrupted"); +ALTER TABLE mysql.user RENAME mysql.user_bak; +CREATE TABLE mysql.user( +Host CHAR BINARY DEFAULT '', +User CHAR BINARY DEFAULT '', +PasswONs INT UNSIGNED, +PRIMARY KEY Host (Host, User) +) ENGINE=MyISAM; +FLUSH PRIVILEGES; +ERROR HY000: Unknown error +CREATE TABLE t1( +a INT UNSIGNED, +b INT UNSIGNED, +c CHAR(50), +d BINARY(23), +e CHAR(48), +f VARCHAR(37), +g BLOB, +h BLOB, +id INT, +KEY(b), +KEY(e) +) ENGINE=MyISAM; +GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; +ERROR HY000: Column count of mysql.user is wrong. Expected 43, found 3. The table is probably corrupted +DROP TABLE t1; +DROP TABLE mysql.user; +ALTER TABLE mysql.user_bak RENAME mysql.user; +FLUSH PRIVILEGES; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug80134.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug80134.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug80134.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug80134.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,6 @@ +call mtr.add_suppression("option 'sort_buffer_size': unsigned value [0-9]+ adjusted to [0-9]+"); +call mtr.add_suppression("Out of memory \\(Needed [0-9]+ bytes\\)"); +CREATE TABLE t1(a CHAR (1) KEY) ENGINE=Memory DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +INSERT INTO t1 VALUES(1); +DELETE t1 FROM t1, t1 AS t4; +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug80438.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug80438.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug80438.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug80438.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,4 @@ +CREATE TABLE t1(a CHAR); +INSERT INTO t1 VALUES(); +UPDATE t1 SET a = 1 ORDER BY CAST(ST_Distance(1, 1) AS DECIMAL); +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81409.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81409.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81409.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81409.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,3 @@ +SELECT Area(AsBinary(MultiPoint(Point(0,9), Point(0,1), Point(2,2)))); +Area(AsBinary(MultiPoint(Point(0,9), Point(0,1), Point(2,2)))) +NULL diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81447.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81447.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81447.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81447.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,3 @@ +CREATE SERVER '' FOREIGN DATA WRAPPER w2 OPTIONS (HOST ''); +ERROR HY000: Incorrect server name value: '' +FLUSH PRIVILEGES; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81449.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81449.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81449.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81449.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,4 @@ +CALL mtr.add_suppression("Column count of mysql\\.user is wrong\\. Expected [0-9]+, found [0-9]+\\. The table is probably corrupted"); +CREATE TEMPORARY TABLE mysql.user(id INT) ENGINE=MyISAM; +DROP USER 'user\\_0'@0; +ERROR HY000: Operation DROP USER failed for 'user\\_0'@'0' diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81457.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81457.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug81457.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug81457.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,5 @@ +SET collation_connection = utf32_general_ci; +CREATE TEMPORARY TABLE t1 AS SELECT 'This is temp. t' A; +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('b', 0); +COUNT(*) +0 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug82967.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug82967.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug82967.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug82967.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,18 @@ +CREATE TABLE t1( +a CHAR (255), +b VARCHAR(255) CHARACTER SET utf8, +c VARCHAR(255) CHARACTER SET utf8, +d VARCHAR(255) CHARACTER SET utf8, +e VARCHAR(255) CHARACTER SET utf8, +f VARCHAR(4) CHARACTER SET utf8, +KEY (a), +KEY (b, c, d, e, f) +) ENGINE=InnoDB; +SET big_tables = TRUE; +INSERT INTO t1(a, b) VALUES +('1001 MySQL Tricks','1. Never run mysqld as root. 2. q ...'), +('MySQL vs. YourSQL use','In the following database comparison ...'), +('MySQL Security','When run configured properly,MySQL ...'); +SELECT * FROM t1 WHERE (a, b) = ANY (SELECT a, MAX(b) FROM t1 GROUP BY a); +ERROR HY000: Internal error: Failed to create MyISAM temporary table for query processing, key too large +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug84640.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug84640.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug84640.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug84640.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,42 @@ +# +# Tests for MyISAM handling of symlinks +# +# +# Bug 1654256: symlinks in CREATE TABLE ... DATA DIRECTORY, last path component +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM DATA DIRECTORY='custom_data_directory'; +INSERT INTO t1 VALUES (1), (2); +FLUSH TABLES; +SET DEBUG_SYNC="before_opening_datafile SIGNAL open_ready WAIT_FOR finish_open"; +SELECT * FROM t1; +SET DEBUG_SYNC="now WAIT_FOR open_ready"; +SET DEBUG_SYNC="now SIGNAL finish_open"; +ERROR HY000: File 'custom_data_directory/t1.MYD' not found (Errcode: 40 - Too many levels of symbolic links) +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; +# +# Bug 1654256: symlinks in CREATE TABLE ... INDEX DIRECTORY +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM INDEX DIRECTORY='custom_index_directory'; +INSERT INTO t1 VALUES (1), (2); +FLUSH TABLES; +SET DEBUG_SYNC="before_opening_indexfile SIGNAL open_ready WAIT_FOR finish_open"; +SELECT * FROM t1 ORDER BY a; +SET DEBUG_SYNC="now WAIT_FOR open_ready"; +SET DEBUG_SYNC="now SIGNAL finish_open"; +ERROR HY000: Got error 40 from storage engine +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; +# +# Bug 1654256: symlinks in CREATE TABLE ... DATA DIRECTORY, middle path component +# +CREATE TABLE user(a INT) ENGINE=MyISAM DATA DIRECTORY='custom_data_directory'; +INSERT INTO user VALUES (1), (2); +FLUSH TABLES; +SET DEBUG_SYNC="before_opening_datafile SIGNAL open_ready WAIT_FOR finish_open"; +SELECT * FROM user; +SET DEBUG_SYNC="now WAIT_FOR open_ready"; +SET DEBUG_SYNC="now SIGNAL finish_open"; +ERROR HY000: Table storage engine for 'user' doesn't have this option +SET DEBUG_SYNC= 'RESET'; +DROP TABLE user; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug84656.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug84656.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug84656.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug84656.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,3 @@ +SET @saved_ft_boolean_syntax = @@global.ft_boolean_syntax; +SET GLOBAL ft_boolean_syntax = ' ~/!@#$%^&*()-'; +SET GLOBAL ft_boolean_syntax = @saved_ft_boolean_syntax; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug84824.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug84824.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug84824.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug84824.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,8 @@ +SET big_tables = 1; +CREATE TABLE t1(a BINARY (1)) ROW_FORMAT=DYNAMIC ENGINE=InnoDB; +Warnings: +Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. +Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. +SELECT NOT EXISTS(SELECT 1) FROM t1 JOIN t1 a USING(a) GROUP BY 1 DESC WITH ROLLUP; +NOT EXISTS(SELECT 1) +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug86209.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug86209.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug86209.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug86209.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,7 @@ +INSTALL PLUGIN null_audit SONAME 'adt_null.so'; +SET collation_connection='ucs2_general_ci'; +PREPARE foo FROM @bar; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +UNINSTALL PLUGIN null_audit; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug86260.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug86260.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/bug86260.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/bug86260.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,18 @@ +# +# Bug 86260: Assert on KILL'ing a stored routine invocation +# +CREATE TABLE t1 (a INT); +CREATE FUNCTION f1() RETURNS INT +BEGIN +INSERT INTO t1 VALUES (1); +RETURN 1; +END| +SET DEBUG_SYNC= "sp_before_exec_core SIGNAL sp_ready WAIT_FOR sp_finish"; +SELECT f1(); +SET DEBUG_SYNC= "now WAIT_FOR sp_ready"; +KILL QUERY sp_con_id; +SET DEBUG_SYNC= "now SIGNAL sp_finish"; +ERROR 70100: Query execution was interrupted +SET DEBUG_SYNC= 'RESET'; +DROP FUNCTION f1; +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/derived.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/derived.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/derived.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/derived.result 2017-10-19 04:25:29.000000000 +0000 @@ -1995,6 +1995,10 @@ a INTEGER NOT NULL )ENGINE=InnoDB; INSERT INTO t2 VALUES (1), (2); +ANALYZE TABLE t1,t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK SET @save_optimizer_switch= @@optimizer_switch; SET @@SESSION.optimizer_switch="index_condition_pushdown=on"; EXPLAIN SELECT a1.a, a1.b, a1.c FROM (SELECT a, b, c FROM t1 ) a1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/distinct.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/distinct.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/distinct.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/distinct.result 2017-10-19 04:25:29.000000000 +0000 @@ -982,3 +982,16 @@ t3_date NULL DROP TABLE t1,t2,t3; +# +# Bug#22686994 REGRESSION FOR A GROUPING QUERY WITH DISTINCT +# +CREATE TABLE t1 (a INTEGER, b INTEGER); +INSERT INTO t1 VALUES (1,3), (2,4), (1,5), +(1,3), (2,1), (1,5), (1,7), (3,1), +(3,2), (3,1), (2,4); +SELECT DISTINCT (COUNT(DISTINCT b) + 1) AS c FROM t1 GROUP BY a; +c +4 +3 +DROP TABLE t1; +# End of test for Bug#22686994 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/events_2.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/events_2.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/events_2.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/events_2.result 2017-10-19 04:25:29.000000000 +0000 @@ -1,10 +1,10 @@ drop database if exists events_test; create database events_test; use events_test; -create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5; +create event e_26 on schedule at '2037-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion -events_test e_26 set @a = 5 root@localhost 2017-01-01 00:00:00 DROP +events_test e_26 set @a = 5 root@localhost 2037-01-01 00:00:00 DROP drop event e_26; create event e_26 on schedule at NULL disable do set @a = 5; ERROR HY000: Incorrect AT value: 'NULL' diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/fulltext.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/fulltext.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/fulltext.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/fulltext.result 2017-10-19 04:25:29.000000000 +0000 @@ -689,3 +689,10 @@ DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 5.1 tests +# Bug#21140111: Explain ... match against: Assertion failed: ret ... +CREATE TABLE z(a INTEGER) engine=innodb; +CREATE TABLE q(b TEXT CHARSET latin1, fulltext(b)) engine=innodb; +explain format=json SELECT 1 FROM q +WHERE (SELECT MATCH(b) AGAINST ('*') FROM z); +ERROR HY000: Incorrect arguments to MATCH +DROP TABLE z, q; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/gap_lock_error_memory.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/gap_lock_error_memory.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/gap_lock_error_memory.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/gap_lock_error_memory.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,20 @@ +CREATE TABLE gap1 (id1 INT, id2 INT, id3 INT, c1 INT, value INT, +PRIMARY KEY (id1, id2, id3), +INDEX i (c1)) ENGINE=memory; +CREATE TABLE gap2 like gap1; +CREATE TABLE gap3 (id INT, value INT, +PRIMARY KEY (id), +UNIQUE KEY ui(value)) ENGINE=memory; +CREATE TABLE gap4 (id INT, value INT, +PRIMARY KEY (id)) ENGINE=memory +PARTITION BY HASH(id) PARTITIONS 2; +insert into gap3 values (1,1), (2,2),(3,3),(4,4),(5,5); +insert into gap4 values (1,1), (2,2),(3,3),(4,4),(5,5); +select sum(value) from gap1; +sum(value) +500500 +update gap1 set gap1.value= (select count(*) from gap2); +select sum(value) from gap1; +sum(value) +1000000 +drop table gap1, gap2, gap3, gap4; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/gap_lock_error_myisam.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/gap_lock_error_myisam.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/gap_lock_error_myisam.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/gap_lock_error_myisam.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,20 @@ +CREATE TABLE gap1 (id1 INT, id2 INT, id3 INT, c1 INT, value INT, +PRIMARY KEY (id1, id2, id3), +INDEX i (c1)) ENGINE=myisam; +CREATE TABLE gap2 like gap1; +CREATE TABLE gap3 (id INT, value INT, +PRIMARY KEY (id), +UNIQUE KEY ui(value)) ENGINE=myisam; +CREATE TABLE gap4 (id INT, value INT, +PRIMARY KEY (id)) ENGINE=myisam +PARTITION BY HASH(id) PARTITIONS 2; +insert into gap3 values (1,1), (2,2),(3,3),(4,4),(5,5); +insert into gap4 values (1,1), (2,2),(3,3),(4,4),(5,5); +select sum(value) from gap1; +sum(value) +500500 +update gap1 set gap1.value= (select count(*) from gap2); +select sum(value) from gap1; +sum(value) +1000000 +drop table gap1, gap2, gap3, gap4; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/group_min_max_innodb.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/group_min_max_innodb.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/group_min_max_innodb.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/group_min_max_innodb.result 2017-10-19 04:25:29.000000000 +0000 @@ -321,3 +321,241 @@ SET optimizer_trace=DEFAULT; SET end_markers_in_json=DEFAULT; DROP TABLE t0,t1,t2; +# +# Bug #21749123: SELECT DISTINCT, WRONG RESULTS COMBINED WITH +# USE_INDEX_EXTENSIONS=OFF +# +CREATE TABLE t1 ( +pk_col INT AUTO_INCREMENT PRIMARY KEY, +a1 CHAR(64), +KEY a1_idx (a1) +) ENGINE=INNODB; +INSERT INTO t1 (a1) VALUES ('a'),('a'),('a'),('a'),('a'),('a'),('a'),('a'); +CREATE TABLE t2 ( +pk_col1 INT NOT NULL, +pk_col2 INT NOT NULL, +a1 CHAR(64), +a2 CHAR(64), +PRIMARY KEY(pk_col1, pk_col2), +KEY a1_idx (a1), +KEY a1_a2_idx (a1, a2) +) ENGINE=INNODB; +INSERT INTO t2 (pk_col1, pk_col2, a1, a2) VALUES (1,1,'a','b'),(1,2,'a','b'), +(1,3,'a','c'),(1,4,'a','c'), +(2,1,'a','d'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref PRIMARY,a1_idx a1_idx 65 const 4 Using where; Using index +SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +a1 +a +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a1_idx a1_idx 69 NULL 9 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +COUNT(DISTINCT a1) +1 +1 +1 +1 +1 +1 +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a1_idx,a1_a2_idx a1_idx 69 NULL 6 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +COUNT(DISTINCT a1) +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a1_a2_idx a1_a2_idx 130 NULL 6 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +COUNT(DISTINCT a1) +1 +1 +1 +SET @optimizer_switch_save=@@optimizer_switch; +SET @@optimizer_switch= "use_index_extensions=off"; +EXPLAIN SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref PRIMARY,a1_idx a1_idx 65 const 8 Using where; Using index +SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +a1 +a +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index a1_idx a1_idx 65 NULL 8 Using index +SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +COUNT(DISTINCT a1) +1 +1 +1 +1 +1 +1 +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index a1_idx,a1_a2_idx a1_idx 65 NULL 5 Using index +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +COUNT(DISTINCT a1) +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a1_a2_idx a1_a2_idx 130 NULL 6 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +COUNT(DISTINCT a1) +1 +1 +1 +SET @@optimizer_switch= @optimizer_switch_save; +DROP TABLE t1, t2; +# +# Bug #24671968: WHEN THE OPTIMISER IS USING INDEX FOR GROUP-BY IT OFTEN +# OFTEN GIVES WRONG RESULTS +# +CREATE TABLE t1 ( +id int NOT NULL, +c1 int NOT NULL, +c2 int, +PRIMARY KEY(id), +INDEX c1_c2_idx(c1, c2)); +INSERT INTO t1 (id, c1, c2) VALUES (1,1,1), (2,2,2), (10,10,1), (11,10,8), +(12,10,1), (13,10,2), (3,1,1), (4,10,1), +(5,10,1), (6,10,8), (7,1,1), (8,10,1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT DISTINCT c1 +FROM t1 +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index c1_c2_idx c1_c2_idx 9 NULL # Using where; Using index +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +EXPLAIN SELECT DISTINCT c1 +FROM t1 +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index c1_c2_idx c1_c2_idx 9 NULL # Using where; Using index +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +EXPLAIN SELECT DISTINCT c1 +FROM t1 +WHERE c2 = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c1_c2_idx c1_c2_idx 9 NULL # Using where; Using index for group-by +EXPLAIN SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL c1_c2_idx NULL NULL NULL # Using where; Using temporary +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +EXPLAIN SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL c1_c2_idx NULL NULL NULL # Using where; Using temporary +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +SET optimizer_trace="enabled=on"; +SELECT DISTINCT c1 +FROM t1 +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +c1 +2 +10 +SELECT TRACE INTO @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "keypart_reference_from_where_clause"; +@trace RLIKE "keypart_reference_from_where_clause" +1 +SET optimizer_trace="enabled=off"; +SELECT DISTINCT c1 +FROM t1 +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +c1 +2 +10 +SELECT DISTINCT c1 +FROM t1 +WHERE c2 = 2; +c1 +2 +10 +SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +c1 +2 +10 +SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +c1 +2 +10 +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/index_merge_innodb.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/index_merge_innodb.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/index_merge_innodb.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/index_merge_innodb.result 2017-10-19 04:25:29.000000000 +0000 @@ -294,6 +294,7 @@ alter table t3 add keyB int not null, add index iB(keyB); alter table t3 add keyC int not null, add index iC(keyC); update t3 set key9=key1,keyA=key1,keyB=key1,keyC=key1; +SET @@GLOBAL.innodb_fast_shutdown = 0; explain select * from t3 where key1=1 or key2=2 or key3=3 or key4=4 or key5=5 or key6=6 or key7=7 or key8=8 or @@ -695,13 +696,14 @@ delete from t1 where key1=200 and key2=200; select key1,key2,filler1 from t1 where key2=100 and key2=200; key1 key2 filler1 -explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; +explain select key1,key2,key34,key34,filler1 from t1 where key1=100 and key2=100 or key34=100 and key34=100; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 4 Using union(intersect(key1,key2),intersect(key3,key4)); Using where +1 SIMPLE t1 index_merge key1,key2,key34,key34 key1,key2,key34,key34 5,5,5,5 NULL 4 Using union(intersect(key1,key2),intersect(key34,key34)); Using where select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; key1 key2 key3 key4 filler1 -1 -1 100 100 key4-key3 delete from t1 where key3=100 and key4=100; +SET @@GLOBAL.innodb_fast_shutdown = 0; explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 4 Using union(intersect(key1,key2),intersect(key3,key4)); Using where @@ -1132,6 +1134,7 @@ alter table t1 add index i2(key2); alter table t1 add index i3(key3); update t1 set key2=key1,key3=key1; +SET @@GLOBAL.innodb_fast_shutdown = 0; explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL # Using sort_union(i3,i2); Using where diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/index_merge_myisam.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/index_merge_myisam.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/index_merge_myisam.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/index_merge_myisam.result 2017-10-19 04:25:29.000000000 +0000 @@ -300,6 +300,7 @@ alter table t3 add keyB int not null, add index iB(keyB); alter table t3 add keyC int not null, add index iC(keyC); update t3 set key9=key1,keyA=key1,keyB=key1,keyC=key1; +SET @@GLOBAL.innodb_fast_shutdown = 0; explain select * from t3 where key1=1 or key2=2 or key3=3 or key4=4 or key5=5 or key6=6 or key7=7 or key8=8 or @@ -725,13 +726,14 @@ delete from t1 where key1=200 and key2=200; select key1,key2,filler1 from t1 where key2=100 and key2=200; key1 key2 filler1 -explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; +explain select key1,key2,key34,key34,filler1 from t1 where key1=100 and key2=100 or key34=100 and key34=100; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 152 Using union(intersect(key1,key2),intersect(key3,key4)); Using where +1 SIMPLE t1 index_merge key1,key2,key34,key34 key1,key2,key34,key34 5,5,5,5 NULL 152 Using union(intersect(key1,key2),intersect(key34,key34)); Using where select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; key1 key2 key3 key4 filler1 -1 -1 100 100 key4-key3 delete from t1 where key3=100 and key4=100; +SET @@GLOBAL.innodb_fast_shutdown = 0; explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 152 Using union(intersect(key1,key2),intersect(key3,key4)); Using where @@ -1171,6 +1173,7 @@ alter table t1 add index i2(key2); alter table t1 add index i3(key3); update t1 set key2=key1,key3=key1; +SET @@GLOBAL.innodb_fast_shutdown = 0; explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL 11 Using sort_union(i3,i2); Using where diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bka_nixbnl.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bka_nixbnl.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bka_nixbnl.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bka_nixbnl.result 2017-10-19 04:25:29.000000000 +0000 @@ -2461,8 +2461,8 @@ GROUP BY field2 ORDER BY field1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index col_int_key,col_varchar_key col_varchar_key 7 NULL 3 Using index; Using temporary; Using filesort -1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key 1 Using join buffer (Batched Key Access) +1 SIMPLE t1 index col_int_key,col_varchar_key col_varchar_key 7 NULL ROWS Using index; Using temporary; Using filesort +1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key ROWS Using join buffer (Batched Key Access) SELECT MIN(t2.col_datetime_key) AS field1, t1.col_int_key AS field2 FROM t1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bka.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bka.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bka.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bka.result 2017-10-19 04:25:29.000000000 +0000 @@ -2461,8 +2461,8 @@ GROUP BY field2 ORDER BY field1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index col_int_key,col_varchar_key col_varchar_key 7 NULL 3 Using index; Using temporary; Using filesort -1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key 1 Using join buffer (Batched Key Access) +1 SIMPLE t1 index col_int_key,col_varchar_key col_varchar_key 7 NULL ROWS Using index; Using temporary; Using filesort +1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key ROWS Using join buffer (Batched Key Access) SELECT MIN(t2.col_datetime_key) AS field1, t1.col_int_key AS field2 FROM t1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bkaunique.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bkaunique.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bkaunique.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bkaunique.result 2017-10-19 04:25:29.000000000 +0000 @@ -2462,8 +2462,8 @@ GROUP BY field2 ORDER BY field1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index col_int_key,col_varchar_key col_varchar_key 7 NULL 3 Using index; Using temporary; Using filesort -1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key 1 Using join buffer (Batched Key Access (unique)) +1 SIMPLE t1 index col_int_key,col_varchar_key col_varchar_key 7 NULL ROWS Using index; Using temporary; Using filesort +1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key ROWS Using join buffer (Batched Key Access (unique)) SELECT MIN(t2.col_datetime_key) AS field1, t1.col_int_key AS field2 FROM t1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bnl.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bnl.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_bnl.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_bnl.result 2017-10-19 04:25:29.000000000 +0000 @@ -2462,8 +2462,8 @@ GROUP BY field2 ORDER BY field1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index col_int_key,col_varchar_key col_int_key 4 NULL 3 Using temporary; Using filesort -1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key 1 NULL +1 SIMPLE t1 index col_int_key,col_varchar_key col_int_key 4 NULL ROWS Using temporary; Using filesort +1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key ROWS NULL SELECT MIN(t2.col_datetime_key) AS field1, t1.col_int_key AS field2 FROM t1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_nojb.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_nojb.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/join_cache_nojb.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/join_cache_nojb.result 2017-10-19 04:25:29.000000000 +0000 @@ -2462,8 +2462,8 @@ GROUP BY field2 ORDER BY field1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index col_int_key,col_varchar_key col_int_key 4 NULL 3 Using temporary; Using filesort -1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key 1 NULL +1 SIMPLE t1 index col_int_key,col_varchar_key col_int_key 4 NULL ROWS Using temporary; Using filesort +1 SIMPLE t2 ref col_varchar_key col_varchar_key 3 test.t1.col_varchar_key ROWS NULL SELECT MIN(t2.col_datetime_key) AS field1, t1.col_int_key AS field2 FROM t1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/loaddata.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/loaddata.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/loaddata.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/loaddata.result 2017-10-19 04:25:29.000000000 +0000 @@ -316,7 +316,7 @@ TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' (c0, c2); -ERROR HY000: Invalid column reference (v2.c0) in LOAD DATA +ERROR HY000: Column 'c0' is not updatable LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v3 FIELDS ESCAPED BY '\\' @@ -507,7 +507,7 @@ # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U # CREATE TABLE t1(f1 INT); -SELECT 0xE1C330 INTO OUTFILE 't1.dat'; +SELECT 0xE1BB30 INTO OUTFILE 't1.dat'; LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8; DROP TABLE t1; # @@ -532,27 +532,3 @@ 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; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/log_tables-big.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/log_tables-big.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/log_tables-big.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/log_tables-big.result 2017-10-19 04:25:29.000000000 +0000 @@ -1,29 +1,34 @@ +set @saved_log_output = @@global.log_output; +set @@global.log_output = 'TABLE'; +truncate table mysql.slow_log; set session long_query_time=10; select get_lock('bug27638', 1); get_lock('bug27638', 1) 1 set session long_query_time=1; -truncate table mysql.slow_log; select get_lock('bug27638', 2); get_lock('bug27638', 2) 0 -select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log +where sql_text = 'select get_lock(\'bug27638\', 2)'; qt sql_text OK select get_lock('bug27638', 2) -truncate table mysql.slow_log; select get_lock('bug27638', 60); get_lock('bug27638', 60) 0 -select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log +where sql_text = 'select get_lock(\'bug27638\', 60)'; qt sql_text OK select get_lock('bug27638', 60) -truncate table mysql.slow_log; select get_lock('bug27638', 101); get_lock('bug27638', 101) 0 -select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log +where sql_text = 'select get_lock(\'bug27638\', 101)'; qt sql_text OK select get_lock('bug27638', 101) select release_lock('bug27638'); release_lock('bug27638') 1 +set @@global.log_output = @saved_log_output; +truncate table mysql.slow_log; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/log_tables.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/log_tables.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/log_tables.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/log_tables.result 2017-10-19 04:25:29.000000000 +0000 @@ -147,7 +147,7 @@ select sleep(2); sleep(2) 0 -select * from mysql.slow_log; +select * from mysql.slow_log where sql_text="select sleep(2)"; start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 mysql 0 0 1 QUERY THREAD_ID set @@session.long_query_time = @saved_long_query_time; @@ -229,7 +229,7 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query truncate table mysql.slow_log TIMESTAMP USER_HOST THREAD_ID 1 Query set session long_query_time=1 TIMESTAMP USER_HOST THREAD_ID 1 Query select sleep(2) -TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.slow_log +TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.slow_log where sql_text="select sleep(2)" TIMESTAMP USER_HOST THREAD_ID 1 Query set @@session.long_query_time = @saved_long_query_time TIMESTAMP USER_HOST THREAD_ID 1 Query alter table mysql.general_log engine=myisam TIMESTAMP USER_HOST THREAD_ID 1 Query alter table mysql.slow_log engine=myisam diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/myisam.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/myisam.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/myisam.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/myisam.result 2017-10-19 04:25:29.000000000 +0000 @@ -1077,8 +1077,8 @@ 0 SELECT DISTINCT length(c1), c1 FROM t1 ORDER BY c1; length(c1) c1 -0 2 A +0 2 B DROP TABLE t1; End of 4.1 tests diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysql_config_editor.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysql_config_editor.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysql_config_editor.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysql_config_editor.result 2017-10-19 04:25:29.000000000 +0000 @@ -100,8 +100,8 @@ ############################################## # Tests for mysql_config_editor's help command ############################################## -Copyright (c) 2009-2016 Percona LLC and/or its affiliates -Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2009-2017 Percona LLC and/or its affiliates +Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective @@ -268,3 +268,9 @@ # normally. mysqld is alive #### End of test #### +# +# Bug #24557925: MYSQL_CONFIG_EDITOR CAN MAKE SERVER UNBOOTABLE +# +# Restarting the server. Should work +# Cleanup +# End of 5.6 tests diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysqld--help-notwin.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysqld--help-notwin.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysqld--help-notwin.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysqld--help-notwin.result 2017-10-19 04:25:29.000000000 +0000 @@ -325,6 +325,9 @@ The default size of key cache blocks --key-cache-division-limit=# The minimum percentage of warm blocks in key cache + --kill-idle-transaction=# + If non-zero, number of seconds to wait before killing + idle connections that have open transactions -L, --language=name Client error messages in given language. May be given as a full path. Deprecated. Use --lc-messages-dir instead. --large-pages Enable support for large pages @@ -1340,6 +1343,7 @@ key-cache-age-threshold 300 key-cache-block-size 1024 key-cache-division-limit 100 +kill-idle-transaction 0 language MYSQL_SHAREDIR/ large-pages FALSE lc-messages en_US diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysqldump-max.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysqldump-max.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysqldump-max.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysqldump-max.result 2017-10-19 04:25:29.000000000 +0000 @@ -88,6 +88,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -164,6 +172,10 @@ /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -185,6 +197,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -261,6 +281,10 @@ /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysqldump.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysqldump.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysqldump.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysqldump.result 2017-10-19 04:25:29.000000000 +0000 @@ -97,6 +97,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -111,6 +119,10 @@ INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -127,6 +139,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( @@ -136,6 +156,10 @@ /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456); +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -208,6 +232,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -222,6 +254,10 @@ INSERT INTO `t1` VALUES (NULL); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -244,6 +280,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL @@ -254,6 +298,10 @@ INSERT INTO `t1` VALUES (1),(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -267,6 +315,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL @@ -277,6 +333,10 @@ INSERT INTO `t1` VALUES (1),(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -311,6 +371,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -323,6 +391,10 @@ /*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -339,6 +411,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS "t1"; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -351,6 +431,10 @@ /*!40000 ALTER TABLE "t1" DISABLE KEYS */; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -370,6 +454,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -382,6 +474,10 @@ /*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -398,6 +494,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS "t1"; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -410,6 +514,10 @@ /*!40000 ALTER TABLE "t1" DISABLE KEYS */; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -433,6 +541,14 @@ /*!40103 SET TIME_ZONE='+00:00' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -441,6 +557,10 @@ ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -467,10 +587,22 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `test`; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -493,10 +625,22 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; USE `mysqldump_test_db`; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -527,6 +671,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -540,6 +692,10 @@ INSERT INTO `t1` VALUES ('ÄÖÜß'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -563,6 +719,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL @@ -573,6 +737,10 @@ INSERT INTO `t1` VALUES ('Ž™šá'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -586,6 +754,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL @@ -596,6 +772,10 @@ INSERT INTO `t1` VALUES ('Ž™šá'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -609,6 +789,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) DEFAULT NULL @@ -619,6 +807,10 @@ INSERT INTO `t1` VALUES ('ÄÖÜß'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -645,6 +837,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t2`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -658,6 +858,10 @@ INSERT INTO `t2` VALUES (4),(5),(6); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -686,6 +890,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -699,6 +911,10 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -727,6 +943,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -740,6 +964,10 @@ INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -761,6 +989,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -772,6 +1008,10 @@ /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1130,6 +1370,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1472,6 +1720,10 @@ INSERT INTO `t1` (`F_c4ca4238a0b923820dcc509a6f75849b`, `F_c81e728d9d4c2f636f067f89cc14862c`, `F_eccbc87e4b5ce2fe28308fd9f2a7baf3`, `F_a87ff679a2f3e71d9181a67b7542122c`, `F_e4da3b7fbbce2345d7772b0674a318d5`, `F_1679091c5a880faf6fb5e6087eb1b2dc`, `F_8f14e45fceea167a5a36dedd4bea2543`, `F_c9f0f895fb98ab9159f51fd0297e236d`, `F_45c48cce2e2d7fbdea1afc51c7c6ad26`, `F_d3d9446802a44259755d38e6d163e820`, `F_6512bd43d9caa6e02c990b0a82652dca`, `F_c20ad4d76fe97759aa27a0c99bff6710`, `F_c51ce410c124a10e0db5e4b97fc2af39`, `F_aab3238922bcc25a6f606eb525ffdc56`, `F_9bf31c7ff062936a96d3c8bd1f8f2ff3`, `F_c74d97b01eae257e44aa9d5bade97baf`, `F_70efdf2ec9b086079795c442636b55fb`, `F_6f4922f45568161a8cdf4ad2299f6d23`, `F_1f0e3dad99908345f7439f8ffabdffc4`, `F_98f13708210194c475687be6106a3b84`, `F_3c59dc048e8850243be8079a5c74d079`, `F_b6d767d2f8ed5d21a44b0e5886680cb9`, `F_37693cfc748049e45d87b8c7d8b9aacd`, `F_1ff1de774005f8da13f42943881c655f`, `F_8e296a067a37563370ded05f5a3bf3ec`, `F_4e732ced3463d06de0ca9a15b6153677`, `F_02e74f10e0327ad868d138f2b4fdd6f0`, `F_33e75ff09dd601bbe69f351039152189`, `F_6ea9ab1baa0efb9e19094440c317e21b`, `F_34173cb38f07f89ddbebc2ac9128303f`, `F_c16a5320fa475530d9583c34fd356ef5`, `F_6364d3f0f495b6ab9dcf8d3b5c6e0b01`, `F_182be0c5cdcd5072bb1864cdee4d3d6e`, `F_e369853df766fa44e1ed0ff613f563bd`, `F_1c383cd30b7c298ab50293adfecb7b18`, `F_19ca14e7ea6328a42e0eb13d585e4c22`, `F_a5bfc9e07964f8dddeb95fc584cd965d`, `F_a5771bce93e200c36f7cd9dfd0e5deaa`, `F_d67d8ab4f4c10bf22aa353e27879133c`, `F_d645920e395fedad7bbbed0eca3fe2e0`, `F_3416a75f4cea9109507cacd8e2f2aefc`, `F_a1d0c6e83f027327d8461063f4ac58a6`, `F_17e62166fc8586dfa4d1bc0e1742c08b`, `F_f7177163c833dff4b38fc8d2872f1ec6`, `F_6c8349cc7260ae62e3b1396831a8398f`, `F_d9d4f495e875a2e075a1a4a6e1b9770f`, `F_67c6a1e7ce56d3d6fa748ab6d9af3fd7`, `F_642e92efb79421734881b53e1e1b18b6`, `F_f457c545a9ded88f18ecee47145a72c0`, `F_c0c7c76d30bd3dcaefc96f40275bdc0a`, `F_2838023a778dfaecdc212708f721b788`, `F_9a1158154dfa42caddbd0694a4e9bdc8`, `F_d82c8d1619ad8176d665453cfb2e55f0`, `F_a684eceee76fc522773286a895bc8436`, `F_b53b3a3d6ab90ce0268229151c9bde11`, `F_9f61408e3afb633e50cdf1b20de6f466`, `F_72b32a1f754ba1c09b3695e0cb6cde7f`, `F_66f041e16a60928b05a7e228a89c3799`, `F_093f65e080a295f8076b1c5722a46aa2`, `F_072b030ba126b2f4b2374f342be9ed44`, `F_7f39f8317fbdb1988ef4c628eba02591`, `F_44f683a84163b3523afe57c2e008bc8c`, `F_03afdbd66e7929b125f8597834fa83a4`, `F_ea5d2f1c4608232e07d3aa3d998e5135`, `F_fc490ca45c00b1249bbe3554a4fdf6fb`, `F_3295c76acbf4caaed33c36b1b5fc2cb1`, `F_735b90b4568125ed6c3f678819b6e058`, `F_a3f390d88e4c41f2747bfa2f1b5f87db`, `F_14bfa6bb14875e45bba028a21ed38046`, `F_7cbbc409ec990f19c78c75bd1e06f215`, `F_e2c420d928d4bf8ce0ff2ec19b371514`, `F_32bb90e8976aab5298d5da10fe66f21d`, `F_d2ddea18f00665ce8623e36bd4e3c7c5`, `F_ad61ab143223efbc24c7d2583be69251`, `F_d09bf41544a3365a46c9077ebb5e35c3`, `F_fbd7939d674997cdb4692d34de8633c4`, `F_28dd2c7955ce926456240b2ff0100bde`, `F_35f4a8d465e6e1edc05f3d8ab658c551`, `F_d1fe173d08e959397adf34b1d77e88d7`, `F_f033ab37c30201f73f142449d037028d`, `F_43ec517d68b6edd3015b3edc9a11367b`, `F_9778d5d219c5080b9a6a17bef029331c`, `F_fe9fc289c3ff0af142b6d3bead98a923`, `F_68d30a9594728bc39aa24be94b319d21`, `F_3ef815416f775098fe977004015c6193`, `F_93db85ed909c13838ff95ccfa94cebd9`, `F_c7e1249ffc03eb9ded908c236bd1996d`, `F_2a38a4a9316c49e5a833517c45d31070`, `F_7647966b7343c29048673252e490f736`, `F_8613985ec49eb8f757ae6439e879bb2a`, `F_54229abfcfa5649e7003b83dd4755294`, `F_92cc227532d17e56e07902b254dfad10`, `F_98dce83da57b0395e163467c9dae521b`, `F_f4b9ec30ad9f68f89b29639786cb62ef`, `F_812b4ba287f5ee0bc9d43bbf5bbe87fb`, `F_26657d5ff9020d2abefe558796b99584`, `F_e2ef524fbf3d9fe611d5a8e90fefdc9c`, `F_ed3d2c21991e3bef5e069713af9fa6ca`, `F_ac627ab1ccbdb62ec96e702f07f6425b`, `F_f899139df5e1059396431415e770c6dd`, `F_38b3eff8baf56627478ec76a704e9b52`, `F_ec8956637a99787bd197eacd77acce5e`, `F_6974ce5ac660610b44d9b9fed0ff9548`, `F_c9e1074f5b3f9fc8ea15d152add07294`, `F_65b9eea6e1cc6bb9f0cd2a47751a186f`, `F_f0935e4cd5920aa6c7c996a5ee53a70f`, `F_a97da629b098b75c294dffdc3e463904`, `F_a3c65c2974270fd093ee8a9bf8ae7d0b`, `F_2723d092b63885e0d7c260cc007e8b9d`, `F_5f93f983524def3dca464469d2cf9f3e`, `F_698d51a19d8a121ce581499d7b701668`, `F_7f6ffaa6bb0b408017b62254211691b5`, `F_73278a4a86960eeb576a8fd4c9ec6997`, `F_5fd0b37cd7dbbb00f97ba6ce92bf5add`, `F_2b44928ae11fb9384c4cf38708677c48`, `F_c45147dee729311ef5b5c3003946c48f`, `F_eb160de1de89d9058fcb0b968dbbbd68`, `F_5ef059938ba799aaa845e1c2e8a762bd`, `F_07e1cd7dca89a1678042477183b7ac3f`, `F_da4fb5c6e93e74d3df8527599fa62642`, `F_4c56ff4ce4aaf9573aa5dff913df997a`, `F_a0a080f42e6f13b3a2df133f073095dd`, `F_202cb962ac59075b964b07152d234b70`, `F_c8ffe9a587b126f152ed3d89a146b445`, `F_3def184ad8f4755ff269862ea77393dd`, `F_069059b7ef840f0c74a814ec9237b6ec`, `F_ec5decca5ed3d6b8079e2e7e7bacc9f2`, `F_76dc611d6ebaafc66cc0879c71b5db5c`, `F_d1f491a404d6854880943e5c3cd9ca25`, `F_9b8619251a19057cff70779273e95aa6`, `F_1afa34a7f984eeabdbb0a7d494132ee5`, `F_65ded5353c5ee48d0b7d48c591b8f430`, `F_9fc3d7152ba9336a670e36d0ed79bc43`, `F_02522a2b2726fb0a03bb19f2d8d9524d`, `F_7f1de29e6da19d22b51c68001e7e0e54`, `F_42a0e188f5033bc65bf8d78622277c4e`, `F_3988c7f88ebcb58c6ce932b957b6f332`, `F_013d407166ec4fa56eb1e1f8cbe183b9`, `F_e00da03b685a0dd18fb6a08af0923de0`, `F_1385974ed5904a438616ff7bdb3f7439`, `F_0f28b5d49b3020afeecd95b4009adf4c`, `F_a8baa56554f96369ab93e4f3bb068c22`, `F_903ce9225fca3e988c2af215d4e544d3`, `F_0a09c8844ba8f0936c20bd791130d6b6`, `F_2b24d495052a8ce66358eb576b8912c8`, `F_a5e00132373a7031000fd987a3c9f87b`, `F_8d5e957f297893487bd98fa830fa6413`, `F_47d1e990583c9c67424d369f3414728e`, `F_f2217062e9a397a1dca429e7d70bc6ca`, `F_7ef605fc8dba5425d6965fbd4c8fbe1f`, `F_a8f15eda80c50adb0e71943adc8015cf`, `F_37a749d808e46495a8da1e5352d03cae`, `F_b3e3e393c77e35a4a3f3cbd1e429b5dc`, `F_1d7f7abc18fcb43975065399b0d1e48e`, `F_2a79ea27c279e471f4d180b08d62b00a`, `F_1c9ac0159c94d8d0cbedc973445af2da`, `F_6c4b761a28b734fe93831e3fb400ce87`, `F_06409663226af2f3114485aa4e0a23b4`, `F_140f6969d5213fd0ece03148e62e461e`, `F_b73ce398c39f506af761d2277d853a92`, `F_bd4c9ab730f5513206b999ec0d90d1fb`, `F_82aa4b0af34c2313a562076992e50aa3`, `F_0777d5c17d4066b82ab86dff8a46af6f`, `F_fa7cdfad1a5aaf8370ebeda47a1ff1c3`, `F_9766527f2b5d3e95d4a733fcfb77bd7e`, `F_7e7757b1e12abcb736ab9a754ffb617a`, `F_5878a7ab84fb43402106c575658472fa`, `F_006f52e9102a8d3be2fe5614f42ba989`, `F_3636638817772e42b59d74cff571fbb3`, `F_149e9677a5989fd342ae44213df68868`, `F_a4a042cf4fd6bfb47701cbc8a1653ada`, `F_1ff8a7b5dc7a7d1f0ed65aaa29c04b1e`, `F_f7e6c85504ce6e82442c770f7c8606f0`, `F_bf8229696f7a3bb4700cfddef19fa23f`, `F_82161242827b703e6acf9c726942a1e4`, `F_38af86134b65d0f10fe33d30dd76442e`, `F_96da2f590cd7246bbde0051047b0d6f7`, `F_8f85517967795eeef66c225f7883bdcb`, `F_8f53295a73878494e9bc8dd6c3c7104f`, `F_045117b0e0a11a242b9765e79cbf113f`, `F_fc221309746013ac554571fbd180e1c8`, `F_4c5bde74a8f110656874902f07378009`, `F_cedebb6e872f539bef8c3f919874e9d7`, `F_6cdd60ea0045eb7a6ec44c54d29ed402`, `F_eecca5b6365d9607ee5a9d336962c534`, `F_9872ed9fc22fc182d371c3e9ed316094`, `F_31fefc0e570cb3860f2a6d4b38c6490d`, `F_9dcb88e0137649590b755372b040afad`, `F_a2557a7b2e94197ff767970b67041697`, `F_cfecdb276f634854f3ef915e2e980c31`, `F_0aa1883c6411f7873cb83dacb17b0afc`, `F_58a2fc6ed39fd083f55d4182bf88826d`, `F_bd686fd640be98efaae0091fa301e613`, `F_a597e50502f5ff68e3e25b9114205d4a`, `F_0336dcbab05b9d5ad24f4333c7658a0e`, `F_084b6fbb10729ed4da8c3d3f5a3ae7c9`, `F_85d8ce590ad8981ca2c8286f79f59954`, `F_0e65972dce68dad4d52d063967f0a705`, `F_84d9ee44e457ddef7f2c4f25dc8fa865`, `F_3644a684f98ea8fe223c713b77189a77`, `F_757b505cfd34c64c85ca5b5690ee5293`, `F_854d6fae5ee42911677c739ee1734486`, `F_e2c0be24560d78c5e599c2a9c9d0bbd2`, `F_274ad4786c3abca69fa097b85867d9a4`, `F_eae27d77ca20db309e056e3d2dcd7d69`, `F_7eabe3a1649ffa2b3ff8c02ebfd5659f`, `F_69adc1e107f7f7d035d7baf04342e1ca`, `F_091d584fced301b442654dd8c23b3fc9`, `F_b1d10e7bafa4421218a51b1e1f1b0ba2`, `F_6f3ef77ac0e3619e98159e9b6febf557`, `F_eb163727917cbba1eea208541a643e74`, `F_1534b76d325a8f591b52d302e7181331`, `F_979d472a84804b9f647bc185a877a8b5`, `F_ca46c1b9512a7a8315fa3c5a946e8265`, `F_3b8a614226a953a8cd9526fca6fe9ba5`, `F_45fbc6d3e05ebd93369ce542e8f2322d`, `F_63dc7ed1010d3c3b8269faf0ba7491d4`, `F_e96ed478dab8595a7dbda4cbcbee168f`, `F_c0e190d8267e36708f955d7ab048990d`, `F_ec8ce6abb3e952a85b8551ba726a1227`, `F_060ad92489947d410d897474079c1477`, `F_bcbe3365e6ac95ea2c0343a2395834dd`, `F_115f89503138416a242f40fb7d7f338e`, `F_13fe9d84310e77f13a6d184dbf1232f3`, `F_d1c38a09acc34845c6be3a127a5aacaf`, `F_9cfdf10e8fc047a44b08ed031e1f0ed1`, `F_705f2172834666788607efbfca35afb3`, `F_74db120f0a8e5646ef5a30154e9f6deb`, `F_57aeee35c98205091e18d1140e9f38cf`, `F_6da9003b743b65f4c0ccd295cc484e57`, `F_9b04d152845ec0a378394003c96da594`, `F_be83ab3ecd0db773eb2dc1b0a17836a1`, `F_e165421110ba03099a1c0393373c5b43`, `F_289dff07669d7a23de0ef88d2f7129e7`, `F_577ef1154f3240ad5b9b413aa7346a1e`, `F_01161aaa0b6d1345dd8fe4e481144d84`, `F_539fd53b59e3bb12d203f45a912eeaf2`, `F_ac1dd209cbcc5e5d1c6e28598e8cbbe8`, `F_555d6702c950ecb729a966504af0a635`, `F_335f5352088d7d9bf74191e006d8e24c`, `F_f340f1b1f65b6df5b5e3f94d95b11daf`, `F_e4a6222cdb5b34375400904f03d8e6a5`, `F_cb70ab375662576bd1ac5aaf16b3fca4`, `F_9188905e74c28e489b44e954ec0b9bca`, `F_0266e33d3f546cb5436a10798e657d97`, `F_38db3aed920cf82ab059bfccbd02be6a`, `F_3cec07e9ba5f5bb252d13f5f431e4bbb`, `F_621bf66ddb7c962aa0d22ac97d69b793`, `F_077e29b11be80ab57e1a2ecabb7da330`, `F_6c9882bbac1c7093bd25041881277658`, `F_19f3cd308f1455b3fa09a282e0d496f4`, `F_03c6b06952c750899bb03d998e631860`, `F_c24cd76e1ce41366a4bbe8a49b02a028`, `F_c52f1bd66cc19d05628bd8bf27af3ad6`, `F_fe131d7f5a6b38b23cc967316c13dae2`, `F_f718499c1c8cef6730f9fd03c8125cab`, `F_d96409bf894217686ba124d7356686c9`, `F_502e4a16930e414107ee22b6198c578f`, `F_cfa0860e83a4c3a763a7e62d825349f7`, `F_a4f23670e1833f3fdb077ca70bbd5d66`, `F_b1a59b315fc9a3002ce38bbe070ec3f5`, `F_36660e59856b4de58a219bcf4e27eba3`, `F_8c19f571e251e61cb8dd3612f26d5ecf`, `F_d6baf65e0b240ce177cf70da146c8dc8`, `F_e56954b4f6347e897f954495eab16a88`, `F_f7664060cc52bc6f3d620bcedc94a4b6`, `F_eda80a3d5b344bc40f3bc04f65b7a357`, `F_8f121ce07d74717e0b1f21d122e04521`, `F_06138bc5af6023646ede0e1f7c1eac75`, `F_39059724f73a9969845dfe4146c5660e`, `F_7f100b7b36092fb9b06dfb4fac360931`, `F_7a614fd06c325499f1680b9896beedeb`, `F_4734ba6f3de83d861c3176a6273cac6d`, `F_d947bf06a885db0d477d707121934ff8`, `F_63923f49e5241343aa7acb6a06a751e7`, `F_db8e1af0cb3aca1ae2d0018624204529`, `F_20f07591c6fcb220ffe637cda29bb3f6`, `F_07cdfd23373b17c6b337251c22b7ea57`, `F_d395771085aab05244a4fb8fd91bf4ee`, `F_92c8c96e4c37100777c7190b76d28233`, `F_e3796ae838835da0b6f6ea37bcf8bcb7`, `F_6a9aeddfc689c1d0e3b9ccc3ab651bc5`, `F_0f49c89d1e7298bb9930789c8ed59d48`, `F_46ba9f2a6976570b0353203ec4474217`, `F_0e01938fc48a2cfb5f2217fbfb00722d`, `F_16a5cdae362b8d27a1d8f8c7b78b4330`, `F_918317b57931b6b7a7d29490fe5ec9f9`, `F_48aedb8880cab8c45637abc7493ecddd`, `F_839ab46820b524afda05122893c2fe8e`, `F_f90f2aca5c640289d0a29417bcb63a37`, `F_9c838d2e45b2ad1094d42f4ef36764f6`, `F_1700002963a49da13542e0726b7bb758`, `F_53c3bce66e43be4f209556518c2fcb54`, `F_6883966fd8f918a4aa29be29d2c386fb`, `F_49182f81e6a13cf5eaa496d51fea6406`, `F_d296c101daa88a51f6ca8cfc1ac79b50`, `F_9fd81843ad7f202f26c1a174c7357585`, `F_26e359e83860db1d11b6acca57d8ea88`, `F_ef0d3930a7b6c95bd2b32ed45989c61f`, `F_94f6d7e04a4d452035300f18b984988c`, `F_34ed066df378efacc9b924ec161e7639`, `F_577bcc914f9e55d5e4e4f82f9f00e7d4`, `F_11b9842e0a271ff252c1903e7132cd68`, `F_37bc2f75bf1bcfe8450a1a41c200364c`, `F_496e05e1aea0a9c4655800e8a7b9ea28`, `F_b2eb7349035754953b57a32e2841bda5`, `F_8e98d81f8217304975ccb23337bb5761`, `F_a8c88a0055f636e4a163a5e3d16adab7`, `F_eddea82ad2755b24c4e168c5fc2ebd40`, `F_06eb61b839a0cefee4967c67ccb099dc`, `F_9dfcd5e558dfa04aaf37f137a1d9d3e5`, `F_950a4152c2b4aa3ad78bdd6b366cc179`, `F_158f3069a435b314a80bdcb024f8e422`, `F_758874998f5bd0c393da094e1967a72b`, `F_ad13a2a07ca4b7642959dc0c4c740ab6`, `F_3fe94a002317b5f9259f82690aeea4cd`, `F_5b8add2a5d98b1a652ea7fd72d942dac`, `F_432aca3a1e345e339f35a30c8f65edce`, `F_8d3bba7425e7c98c50f52ca1b52d3735`, `F_320722549d1751cf3f247855f937b982`, `F_caf1a3dfb505ffed0d024130f58c5cfa`, `F_5737c6ec2e0716f3d8a7a5c4e0de0d9a`, `F_bc6dc48b743dc5d013b1abaebd2faed2`, `F_f2fc990265c712c49d51a18a32b39f0c`, `F_89f0fd5c927d466d6ec9a21b9ac34ffa`, `F_a666587afda6e89aec274a3657558a27`, `F_b83aac23b9528732c23cc7352950e880`, `F_cd00692c3bfe59267d5ecfac5310286c`, `F_6faa8040da20ef399b63a72d0e4ab575`, `F_fe73f687e5bc5280214e0486b273a5f9`) VALUES (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1499,6 +1751,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40000 DROP DATABASE IF EXISTS `test`*/; @@ -1518,6 +1778,10 @@ INSERT INTO `t1` VALUES (1),(2),(3); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1549,6 +1813,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1563,6 +1835,10 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1584,6 +1860,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1598,6 +1882,10 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1796,6 +2084,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t3`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1817,6 +2113,10 @@ `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1845,6 +2145,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1853,6 +2161,10 @@ ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1881,6 +2193,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS "t1"; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1897,6 +2217,10 @@ INSERT INTO "t1" VALUES (815,4711,2006); /*!40000 ALTER TABLE "t1" ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1915,6 +2239,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1931,6 +2263,10 @@ INSERT INTO `t1` VALUES (815,4711,2006); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -1969,6 +2305,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t2`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -2004,6 +2348,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2063,6 +2411,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -2095,6 +2451,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2133,6 +2493,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t2`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -2168,6 +2536,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2198,6 +2570,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -2211,6 +2591,10 @@ INSERT INTO `t1` VALUES ('\''); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2244,6 +2628,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -2323,6 +2715,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2393,6 +2789,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -2501,6 +2905,10 @@ /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2522,6 +2930,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -2552,6 +2968,10 @@ /*!40000 ALTER TABLE `t2` DISABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2667,6 +3087,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -2774,6 +3202,10 @@ /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2818,6 +3250,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -2836,6 +3276,10 @@ INSERT INTO `t1` VALUES ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2855,6 +3299,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -2873,6 +3325,10 @@ INSERT INTO `t1` VALUES ('2003-10-26 02:00:00'),('2003-10-26 02:00:00'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -2912,6 +3368,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS "t1 test"; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -2954,6 +3418,10 @@ INSERT INTO "t2 test" VALUES (1),(2),(3); /*!40000 ALTER TABLE "t2 test" ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -2991,6 +3459,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -3078,6 +3554,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3116,6 +3596,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -3151,6 +3639,10 @@ /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3179,6 +3671,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -3193,6 +3693,10 @@ INSERT INTO `t1` VALUES (0x00,''); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3214,6 +3718,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -3228,6 +3740,10 @@ INSERT INTO `t1` VALUES (0x00,''); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3387,6 +3903,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40000 DROP DATABASE IF EXISTS `mysqldump_test_db`*/; @@ -3428,6 +3952,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3656,6 +4184,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -3687,6 +4223,10 @@ /*!40000 ALTER TABLE `t3` DISABLE KEYS */; /*!40000 ALTER TABLE `t3` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3844,6 +4384,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -3876,6 +4424,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3899,6 +4451,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `straße`; CREATE TABLE `straße` ( `f1` int(11) DEFAULT NULL @@ -3908,6 +4468,10 @@ /*!40000 ALTER TABLE `straße` DISABLE KEYS */; /*!40000 ALTER TABLE `straße` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3921,6 +4485,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `straße`; CREATE TABLE `straße` ( `f1` int(11) DEFAULT NULL @@ -3930,6 +4502,10 @@ /*!40000 ALTER TABLE `straße` DISABLE KEYS */; /*!40000 ALTER TABLE `straße` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3945,6 +4521,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `כדשגכחךלדגכחשךדגחכךלדגכ`; CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( `f1` int(11) DEFAULT NULL @@ -3954,6 +4538,10 @@ /*!40000 ALTER TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` DISABLE KEYS */; /*!40000 ALTER TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -3967,6 +4555,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`; SET NAMES latin1; # @@ -3988,6 +4584,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -4002,6 +4606,10 @@ REPLACE INTO `t1` VALUES (1,1),(2,3),(3,4),(4,5); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -4252,6 +4860,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40000 DROP DATABASE IF EXISTS `mysqldump_test_db`*/; @@ -4293,6 +4909,10 @@ /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -5071,6 +5691,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -5092,6 +5720,10 @@ /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -5115,6 +5747,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -5127,6 +5767,10 @@ /*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -5163,6 +5807,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -5186,6 +5838,10 @@ /*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -5231,6 +5887,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; -- -- Table structure for table `t1` @@ -5275,6 +5939,10 @@ INSERT INTO `t2` VALUES (1),(2),(3); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -5327,6 +5995,18 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -5432,3 +6112,66 @@ DROP TABLE t1; DROP TABLE t2; DROP DATABASE db_20772273; +# +# Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERY +# +CREATE DATABASE bug25717383; +use bug25717383; +CREATE TABLE `tab +one` (a int); +CREATE VIEW `view +one` as SELECT * FROM `tab +one`; +CREATE PROCEDURE `proc +one`() SELECT * from `tab +one`; +CREATE TEMPORARY TABLE `temp +one` (id INT); +CREATE TRIGGER `trig +one` BEFORE INSERT ON `tab +one` FOR EACH ROW SET NEW.a = 1; +CREATE EVENT `event +one` ON SCHEDULE AT '2030-01-01 00:00:00' DO SET @a=5; +SHOW TABLES FROM bug25717383; +Tables_in_bug25717383 +tab +one +view +one +SHOW TRIGGERS FROM bug25717383; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trig +one INSERT tab +one SET NEW.a = 1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +SHOW EVENTS FROM bug25717383; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +bug25717383 event +one root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE' + ORDER BY ROUTINE_NAME; +ROUTINE_NAME +proc +one +SHOW TABLES FROM bug25717383; +Tables_in_bug25717383 +tab +one +view +one +SHOW TRIGGERS FROM bug25717383; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trig +one INSERT tab +one SET NEW.a = 1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +SHOW EVENTS FROM bug25717383; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +bug25717383 event +one root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE' + ORDER BY ROUTINE_NAME; +ROUTINE_NAME +proc +one +DROP DATABASE bug25717383; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysql_upgrade.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysql_upgrade.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/mysql_upgrade.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/mysql_upgrade.result 2017-10-19 04:25:29.000000000 +0000 @@ -507,6 +507,8 @@ # Run mysql_upgrade with unauthorized access Warning: Using a password on the command line interface can be insecure. +mysql_upgrade: running mysql with query "show variables like 'datadir'" returned 1 +mysql_upgrade: running mysql with query "show variables like 'version'" returned 1 Error: Failed while fetching Server version! Could be due to unauthorized access. FATAL ERROR: Upgrade failed diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/openssl_1.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/openssl_1.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/openssl_1.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/openssl_1.result 2017-10-19 04:25:29.000000000 +0000 @@ -117,6 +117,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -130,6 +138,10 @@ INSERT INTO `t1` VALUES (1),(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -151,6 +163,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -164,6 +184,10 @@ INSERT INTO `t1` VALUES (1),(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -185,6 +209,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -198,6 +230,10 @@ INSERT INTO `t1` VALUES (1),(2); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/parser.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/parser.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/parser.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/parser.result 2017-10-19 04:25:29.000000000 +0000 @@ -443,6 +443,10 @@ ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' select master_pos_wait(1, 2, 3, 4); ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' +SET @save_sql_mode_before_master_pos_wait=@@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE="STRICT_ALL_TABLES"; +select master_pos_wait('master-bin.999999', 4, -1); +SET @@SESSION.SQL_MODE=@save_sql_mode_before_master_pos_wait; select rand(1, 2, 3); ERROR 42000: Incorrect parameter count in the call to native function 'rand' select round(1, 2, 3); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/partition_symlink.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/partition_symlink.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/partition_symlink.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/partition_symlink.result 2017-10-19 04:25:29.000000000 +0000 @@ -43,6 +43,8 @@ # test.t1 have partitions in mysqltest2-directory! # user root: CREATE USER mysqltest_1@localhost; +# Need FILE permission to use external datadir or indexdir. +GRANT FILE ON *.* TO mysqltest_1@localhost; CREATE DATABASE mysqltest2; USE mysqltest2; CREATE TABLE t1 (a INT) ENGINE = MyISAM; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_bug1617586.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_bug1617586.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_bug1617586.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_bug1617586.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,29 @@ +# +# Bug 1617586 (SELECT DISTINCT x...ORDER BY y LIMIT N,N crashes server) +# +# Loading data +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `field1` varchar(255) DEFAULT NULL, + `field2` int(11) DEFAULT NULL, + `field3` datetime DEFAULT NULL, + `field4` varchar(255) DEFAULT NULL, + `field5` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_audits_on_field2` (`field2`), + KEY `on_field4` (`field4`), + KEY `index_audits_on_field1` (`field1`), + KEY `index_audits_on_field4_and_field5_and_field3` (`field4`,`field5`,`field3`), + KEY `idx_on_field4_and_field5_and_field2` (`field4`,`field5`,`field2`) +) ENGINE=InnoDB AUTO_INCREMENT=8000000 DEFAULT CHARSET=latin1 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT DISTINCT field2 FROM t1 +WHERE (field4 IS NULL AND field5 = 233 AND field1 = 'c6bb07f8b5') +ORDER BY field3 LIMIT 1; +field2 +2272669 +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_bug1657941.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_bug1657941.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_bug1657941.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_bug1657941.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,13 @@ +CREATE TABLE t1( +id INT UNSIGNED NOT NULL, +dttm DATETIME NOT NULL, +PRIMARY KEY(id, dttm) +) ENGINE=InnoDB +PARTITION BY RANGE COLUMNS(dttm) ( +PARTITION pf_201612 VALUES LESS THAN ('20170101') ENGINE=InnoDB +); +SELECT * FROM t1 WHERE dttm > '2017-01-19' ORDER BY id DESC; +id dttm +SELECT * FROM t1 WHERE dttm > '2017-01-19' ORDER BY id ASC; +id dttm +DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_bug1704056.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_bug1704056.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_bug1704056.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_bug1704056.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,13 @@ +# +# Bug 1704056: Enabling and disabling slow query log rotation spuriously +# adds version suffix to the next slow query log file name +# +SET @old_max_slowlog_size = @@GLOBAL.max_slowlog_size; +SET @old_slow_query_log_file = @@GLOBAL.slow_query_log_file; +SET GLOBAL max_slowlog_size = 10240000; +SET GLOBAL slow_query_log_file='MYSQLTEST_VARDIR/bug1704056_1'; +SET GLOBAL max_slowlog_size = @old_max_slowlog_size; +SET GLOBAL slow_query_log_file = @old_slow_query_log_file; +SET GLOBAL slow_query_log_file = 'MYSQLTEST_VARDIR/bug1704056.slog'; +SET GLOBAL slow_query_log_file = @old_slow_query_log_file; +bug1704056.slog diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_expand_fast_index_creation.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_expand_fast_index_creation.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_expand_fast_index_creation.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_expand_fast_index_creation.result 2017-10-19 04:25:29.000000000 +0000 @@ -89,26 +89,9 @@ affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b; -id 1 -select_type SIMPLE -table t1 -type ALL -possible_keys a -key NULL -key_len NULL -ref NULL -rows 16 -Extra NULL -id 1 -select_type SIMPLE -table t2 -type ALL -possible_keys a -key NULL -key_len NULL -ref NULL -rows 16 -Extra Using where; Using join buffer (Block Nested Loop) +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a NULL NULL NULL # NULL +1 SIMPLE t2 ALL a NULL NULL NULL # Using where; Using join buffer (Block Nested Loop) ALTER TABLE t1 DROP KEY a; SET expand_fast_index_creation = 1; SELECT @@expand_fast_index_creation; @@ -118,25 +101,8 @@ affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b; -id 1 -select_type SIMPLE -table t1 -type ALL -possible_keys a -key NULL -key_len NULL -ref NULL -rows 16 -Extra NULL -id 1 -select_type SIMPLE -table t2 -type ALL -possible_keys a -key NULL -key_len NULL -ref NULL -rows 16 -Extra Using where; Using join buffer (Block Nested Loop) +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a NULL NULL NULL # NULL +1 SIMPLE t2 ALL a NULL NULL NULL # Using where; Using join buffer (Block Nested Loop) SET expand_fast_index_creation = 0; DROP TABLE t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_kill_idle_trx.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_kill_idle_trx.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_kill_idle_trx.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_kill_idle_trx.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,27 @@ +# +# Tests for kill_idle_transaction feature that do not depend on transactional SEs +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +SET GLOBAL kill_idle_transaction= 1; +# Autocommitting non-trx SE queries should not result in kills +INSERT INTO t1 VALUES (1); +SELECT * FROM t1; +a +1 +# Should not have been disconnected +INSERT INTO t1 VALUES (2); +SELECT * FROM t1; +a +1 +2 +# An idle transaction should be killed even if it does not use any transactional SE +BEGIN; +# Current connection idle transaction killed, reconnecting +# With a low wait_timeout and high kill_idle_transaction the lower value takes precedence +SET GLOBAL kill_idle_transaction= 100000; +SET SESSION wait_timeout= 5; +BEGIN; +# Current connection idle transaction killed, reconnecting +# Cleanup +DROP TABLE t1; +SET GLOBAL kill_idle_transaction= saved_kill_idle_transaction; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_kill_idle_trx_threadpool.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_kill_idle_trx_threadpool.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_kill_idle_trx_threadpool.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_kill_idle_trx_threadpool.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,30 @@ +# +# Test that threadpool manages kill_idle_transaction timeouts correctly +# +# +# Tests for kill_idle_transaction feature that do not depend on transactional SEs +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +SET GLOBAL kill_idle_transaction= 1; +# Autocommitting non-trx SE queries should not result in kills +INSERT INTO t1 VALUES (1); +SELECT * FROM t1; +a +1 +# Should not have been disconnected +INSERT INTO t1 VALUES (2); +SELECT * FROM t1; +a +1 +2 +# An idle transaction should be killed even if it does not use any transactional SE +BEGIN; +# Current connection idle transaction killed, reconnecting +# With a low wait_timeout and high kill_idle_transaction the lower value takes precedence +SET GLOBAL kill_idle_transaction= 100000; +SET SESSION wait_timeout= 5; +BEGIN; +# Current connection idle transaction killed, reconnecting +# Cleanup +DROP TABLE t1; +SET GLOBAL kill_idle_transaction= saved_kill_idle_transaction; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_log_slow_query_plan.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_log_slow_query_plan.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_log_slow_query_plan.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_log_slow_query_plan.result 2017-10-19 04:25:29.000000000 +0000 @@ -281,3 +281,32 @@ SET SESSION min_examined_row_limit=default; SET SESSION log_slow_verbosity=default; DROP TABLE t1, t2, t3, t4; +# +# Bug#1592694 Query plan temp flag set is missed in +# create_duplicate_weedout_tmp_table +# +create table t1 ( +a int not null, +b int, primary key (a) +) ENGINE=InnoDB; +create table t2 ( +a int not null +) ENGINE=InnoDB; +insert into t1 values (1,10), (2,20), (3,30), (4,40); +insert into t2 values (2), (2), (3), (4), (5); +SET optimizer_switch='firstmatch=off,loosescan=off,materialization=off'; +SET SESSION long_query_time=0; +SET SESSION min_examined_row_limit=0; +SET SESSION log_slow_verbosity='microtime,query_plan'; +SET SESSION log_slow_filter='tmp_table'; +[log_start.inc] percona_slow_query_log.bug1592694.slog +select t1.a from t1 where t1.a in (select a from t2); +a +2 +3 +4 +[log_stop.inc] percona_slow_query_log.bug1592694.slog +[log_grep.inc] file: percona_slow_query_log.bug1592694.slog pattern: ^#.*Tmp_table: Yes Tmp_table_on_disk: No$ expected_matches: 1 +[log_grep.inc] found expected match count: 1 +DROP TABLE t1, t2; +# End of test for bug#1592694. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_log_slow_verbosity.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_log_slow_verbosity.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_log_slow_verbosity.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_log_slow_verbosity.result 2017-10-19 04:25:29.000000000 +0000 @@ -5,30 +5,33 @@ SET SESSION log_slow_verbosity='microtime,innodb,query_plan'; [log_start.inc] percona.slow_extended.log_slow_verbosity_0 INSERT INTO t1 VALUE(0); +BEGIN; +INSERT INTO t1 VALUE(1); +ROLLBACK; [log_stop.inc] percona.slow_extended.log_slow_verbosity_0 log_slow_verbosity='microtime,innodb,query_plan': [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Schema: .+ Last_errno: \d+ Killed: \d+$ -[log_grep.inc] lines: 2 +[log_grep.inc] lines: 5 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^#.*Rows_affected: \d+$ -[log_grep.inc] lines: 2 +[log_grep.inc] lines: 5 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Bytes_sent: \d+.*$ -[log_grep.inc] lines: 2 +[log_grep.inc] lines: 5 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_trx_id: \w+$ -[log_grep.inc] lines: 1 +[log_grep.inc] lines: 3 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ -[log_grep.inc] lines: 2 +[log_grep.inc] lines: 5 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# QC_Hit: (Yes|No) Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)$ -[log_grep.inc] lines: 2 +[log_grep.inc] lines: 5 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+$ -[log_grep.inc] lines: 2 +[log_grep.inc] lines: 5 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_IO_r_ops: \d+ InnoDB_IO_r_bytes: \d+ InnoDB_IO_r_wait: \d*\.\d*$ -[log_grep.inc] lines: 1 +[log_grep.inc] lines: 2 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_rec_lock_wait: \d*\.\d* InnoDB_queue_wait: \d*\.\d*$ -[log_grep.inc] lines: 1 +[log_grep.inc] lines: 2 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# InnoDB_pages_distinct: \d+$ -[log_grep.inc] lines: 1 +[log_grep.inc] lines: 2 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_0 pattern: ^# No InnoDB statistics available for this query$ -[log_grep.inc] lines: 1 +[log_grep.inc] lines: 3 SET SESSION log_slow_verbosity='microtime,innodb,query_plan'; [log_start.inc] percona.slow_extended.log_slow_verbosity_1 SELECT 1; @@ -36,12 +39,12 @@ 1 [log_stop.inc] percona.slow_extended.log_slow_verbosity_1 log_slow_verbosity='microtime,innodb,query_plan': -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Schema: .+ Last_errno: \d+ Killed: \d+$ -[log_grep.inc] lines: 2 -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^#.*Rows_affected: \d+$ -[log_grep.inc] lines: 2 -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Bytes_sent: \d+.*$ -[log_grep.inc] lines: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Schema: .+ Last_errno: \d+ Killed: \d+$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^#.*Rows_affected: \d+$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Bytes_sent: \d+.*$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# InnoDB_trx_id: \w+$ [log_grep.inc] lines: 0 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_1 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ @@ -63,12 +66,12 @@ INSERT INTO t1 VALUE(1); [log_stop.inc] percona.slow_extended.log_slow_verbosity_2 log_slow_verbosity='microtime': -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Schema: .+ Last_errno: \d+ Killed: \d+$ -[log_grep.inc] lines: 2 -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^#.*Rows_affected: \d+$ -[log_grep.inc] lines: 2 -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Bytes_sent: \d+.*$ -[log_grep.inc] lines: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Schema: .+ Last_errno: \d+ Killed: \d+$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^#.*Rows_affected: \d+$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Bytes_sent: \d+.*$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# InnoDB_trx_id: \w+$ [log_grep.inc] lines: 0 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_2 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ @@ -90,12 +93,12 @@ INSERT INTO t1 VALUE(2); [log_stop.inc] percona.slow_extended.log_slow_verbosity_3 log_slow_verbosity='query_plan': -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Schema: .+ Last_errno: \d+ Killed: \d+$ -[log_grep.inc] lines: 2 -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^#.*Rows_affected: \d+$ -[log_grep.inc] lines: 2 -[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Bytes_sent: \d+.*$ -[log_grep.inc] lines: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Schema: .+ Last_errno: \d+ Killed: \d+$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^#.*Rows_affected: \d+$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 +[log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Bytes_sent: \d+.*$ expected_matches: 2 +[log_grep.inc] found expected match count: 2 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# InnoDB_trx_id: \w+$ [log_grep.inc] lines: 0 [log_grep.inc] file: percona.slow_extended.log_slow_verbosity_3 pattern: ^# Bytes_sent: \d+ Tmp_tables: \d+ Tmp_disk_tables: \d+ Tmp_table_sizes: \d+$ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result 2017-10-19 04:25:29.000000000 +0000 @@ -14,6 +14,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -29,6 +37,10 @@ /*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -63,6 +75,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -96,6 +116,10 @@ INSERT INTO `t2` VALUES (0),(1),(2); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -130,6 +154,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -158,6 +190,10 @@ INSERT INTO `t2` VALUES (1),(2),(3); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -226,6 +262,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -286,6 +330,10 @@ ALTER TABLE `t4` ADD UNIQUE KEY `b` (`b`); /*!40000 ALTER TABLE `t4` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -322,6 +370,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -353,6 +409,10 @@ ALTER TABLE `t2` ADD KEY `a` (`a`); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -398,6 +458,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -429,6 +497,10 @@ ALTER TABLE `t2` ADD KEY `k1` (`id`), ADD KEY `k2` (`id`); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -455,6 +527,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -465,6 +545,10 @@ ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; ALTER TABLE `t1` ADD KEY `c` (`c`); +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -496,6 +580,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -512,6 +604,10 @@ /*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -544,6 +640,14 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/*!50112 SELECT COUNT(*) INTO @is_rocksdb_supported FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='rocksdb_bulk_load' */; +/*!50112 SET @save_old_rocksdb_bulk_load = IF (@is_rocksdb_supported, 'SET @old_rocksdb_bulk_load = @@rocksdb_bulk_load', 'SET @dummy_old_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @save_old_rocksdb_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = 1', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @enable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; DROP TABLE IF EXISTS `t1`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -561,6 +665,10 @@ ALTER TABLE `t1` ADD KEY `c1` (`c1`); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; UNLOCK TABLES; +/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */; +/*!50112 PREPARE s FROM @disable_bulk_load */; +/*!50112 EXECUTE s */; +/*!50112 DEALLOCATE PREPARE s */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_show_slave_status_nolock.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_show_slave_status_nolock.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_show_slave_status_nolock.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_show_slave_status_nolock.result 2017-10-19 04:25:29.000000000 +0000 @@ -5,7 +5,6 @@ [connection master] call mtr.add_suppression("Slave SQL: Request to stop slave SQL Thread received while applying a group that has non-transactional changes"); include/rpl_connect.inc [creating slave_lock] -include/rpl_connect.inc [creating slave_nolock] [master] CREATE TABLE t(id INT); [slave] @@ -17,23 +16,8 @@ INSERT INTO t VALUES(0); [slave] check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NONBLOCKING' - both should work fine - -[slave_lock] -SHOW SLAVE STATUS; -SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1'; -SIGNAL after SHOW SLAVE STATUS is -[slave] -SET DEBUG_SYNC='now SIGNAL signal.empty'; -[slave_nolock] SHOW SLAVE STATUS NONBLOCKING; -SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1'; -# should be 'signal.after_show_slave_status' -SIGNAL after SHOW SLAVE STATUS NONBLOCKING is .empty' -[slave] -SET DEBUG_SYNC='now SIGNAL signal.continue'; -[slave] -SET DEBUG_SYNC='now SIGNAL signal.empty'; - +SHOW SLAVE STATUS; [master] INSERT INTO t VALUES(1); [slave] @@ -42,18 +26,11 @@ STOP SLAVE; [slave] check 'SHOW SLAVE STATUS' and 'SHOW SLAVE STATUS NONBLOCKING' - just NONBLOCKING version should works fine - +SHOW SLAVE STATUS NONBLOCKING; [slave_lock] SHOW SLAVE STATUS; SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1'; -SIGNAL after SHOW SLAVE STATUS is .empty' -[slave] -SET DEBUG_SYNC='now SIGNAL signal.empty'; -[slave_nolock] -SHOW SLAVE STATUS NONBLOCKING; -SET DEBUG_SYNC='now WAIT_FOR signal.after_show_slave_status TIMEOUT 1'; -# should be 'signal.after_show_slave_status' -SIGNAL after SHOW SLAVE STATUS NONBLOCKING is .empty' +SIGNAL after SHOW SLAVE STATUS is [slave] SET DEBUG_SYNC='now SIGNAL signal.continue'; [slave] diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_signal_handling.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_signal_handling.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_signal_handling.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_signal_handling.result 2017-10-19 04:25:29.000000000 +0000 @@ -1,3 +1,21 @@ -SELECT 2+2; -2+2 -4 +# +# Test server signal handling with one-thread-per-connection handler +# +SELECT @@GLOBAL.thread_handling; +@@GLOBAL.thread_handling +one-thread-per-connection +# Test SIGPIPE, SIGTSTP, SIGINT, which should be ignored +# Test SIGHUP, which should result in status dump in the error log +SELECT 1; +1 +1 +# +# Bug 805805: attaching to percona-server with gdb disconnects clients +# Bug 1060136: safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT +# +SELECT 1; +1 +1 +# +# Bug 1537554: SIGTERM kills server instead of shutdown w/ threadpool +# diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_signal_handling_threadpool.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_signal_handling_threadpool.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_signal_handling_threadpool.result 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_signal_handling_threadpool.result 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,21 @@ +# +# Test server signal handling with threadpool +# +SELECT @@GLOBAL.thread_handling; +@@GLOBAL.thread_handling +pool-of-threads +# Test SIGPIPE, SIGTSTP, SIGINT, which should be ignored +# Test SIGHUP, which should result in status dump in the error log +SELECT 1; +1 +1 +# +# Bug 805805: attaching to percona-server with gdb disconnects clients +# Bug 1060136: safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT +# +SELECT 1; +1 +1 +# +# Bug 1537554: SIGTERM kills server instead of shutdown w/ threadpool +# diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_slow_extended_error_on_quit.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_slow_extended_error_on_quit.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_slow_extended_error_on_quit.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_slow_extended_error_on_quit.result 2017-10-19 04:25:29.000000000 +0000 @@ -12,15 +12,15 @@ [log_start.inc] percona.slow_extended.error_on_quit_2 # Disconnecting (passing to Slow Query Log "# administrative command: Quit") [log_stop.inc] percona.slow_extended.error_on_quit_2 -[log_grep.inc] file: percona.slow_extended.error_on_quit_2 pattern: Last_errno: 0\s -[log_grep.inc] lines: 2 +[log_grep.inc] file: percona.slow_extended.error_on_quit_2 pattern: Last_errno: 0\s expected_matches: 2 +[log_grep.inc] found expected match count: 2 [log_start.inc] percona.slow_extended.error_on_quit_3 SELECT * FROM t; a # Disconnecting (passing to Slow Query Log "# administrative command: Quit") [log_stop.inc] percona.slow_extended.error_on_quit_3 -[log_grep.inc] file: percona.slow_extended.error_on_quit_3 pattern: Last_errno: 0\s -[log_grep.inc] lines: 3 +[log_grep.inc] file: percona.slow_extended.error_on_quit_3 pattern: Last_errno: 0\s expected_matches: 3 +[log_grep.inc] found expected match count: 3 DROP TABLE t; SET GLOBAL log_slow_admin_statements=default; SET GLOBAL long_query_time=default; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_statement_set.result percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_statement_set.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/r/percona_statement_set.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/r/percona_statement_set.result 2017-10-19 04:25:29.000000000 +0000 @@ -879,6 +879,34 @@ SET STATEMENT max_join_size=1000 FOR SELECT * FROM t3; ERROR HY000: Can't reopen table: 't3' DROP TABLE t3; +# +# Bug 1392375: Crashing repeated execution of SET STATEMENT ... FOR +--echo # + +CREATE VIEW t3 AS SELECT 1 AS a; +PREPARE stmt1 FROM 'SET STATEMENT binlog_format=row FOR SELECT * FROM t3'; +EXECUTE stmt1; +EXECUTE stmt1; + +DEALLOCATE PREPARE stmt1; +DROP VIEW t3; + +--echo # +--echo # Bug 1635927: Memory leak when using per-query variables with subquery temp tables +--echo # + +CREATE TABLE t3 (row_key INT NOT NULL DEFAULT 0, ref_key BIGINT(20) NOT NULL); + +INSERT INTO t3 (ref_key) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +set @row_id := 0; +INSERT INTO t3 (ref_key) SELECT @row_id := @row_id + 11 as ref_key + FROM t3 a1, t3 a2, t3 a3; + +SET STATEMENT myisam_repair_threads=1 FOR +SELECT count(1) FROM t3 s + JOIN (SELECT row_key, ref_key AS ref_key FROM t3 t + WHERE t.row_key IN (SELECT row_key FROM t3)) AS r; + +DROP TABLE t3; + --echo '' --echo '# Cleanup' DROP TABLE t1, t2; @@ -892,4 +922,28 @@ --replace_result $MYSQL_TMP_DIR TMPDIR SELECT @@innodb_tmpdir; +--echo # +--echo # Bug 1385352: SET STATEMENT does not work after SET GLOBAL / SHOW GLOBAL STATUS +--echo # and affects the global value +--echo # + --source include/wait_until_count_sessions.inc + +SHOW GLOBAL STATUS LIKE 'Threads_connected'; + +SELECT @@GLOBAL.sql_mode; +SELECT @@GLOBAL.auto_increment_offset; +SET STATEMENT sql_mode = 'NO_AUTO_CREATE_USER', auto_increment_offset = 123 FOR + SELECT @@SESSION.sql_mode, @@SESSION.auto_increment_offset; +SELECT @@GLOBAL.sql_mode; +SELECT @@GLOBAL.auto_increment_offset; + +SET @saved_general_log = @@GLOBAL.general_log; +SET GLOBAL general_log = 0; + +SET STATEMENT sql_mode='NO_AUTO_CREATE_USER', auto_increment_offset=123 FOR + SELECT @@SESSION.sql_mode, @@SESSION.auto_increment_offset; +SELECT @@GLOBAL.sql_mode; +SELECT @@GLOBAL.auto_increment_offset; + +SET GLOBAL general_log = @saved_general_log; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/percona_userstat_conn_handling.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/percona_userstat_conn_handling.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/percona_userstat_conn_handling.test 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/percona_userstat_conn_handling.test 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,157 @@ +SET @userstat_old= @@userstat; +SET GLOBAL userstat=ON; + +# concurrent connections count tracked only if resource limits enabled globally +# or just for specific users +CREATE USER mysqltest_1@localhost; +GRANT USAGE ON *.* TO mysqltest_1@localhost WITH MAX_USER_CONNECTIONS 100; +CREATE USER mysqltest_2@localhost; +GRANT USAGE ON *.* TO mysqltest_2@localhost WITH MAX_USER_CONNECTIONS 100; + +# Make a single connection for mysqltest_1 user +connect (conn1,localhost,mysqltest_1,,); +SELECT 1; +connection default; + +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: single connection +--let $query_result= query_get_value(SELECT CONCURRENT_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', CONCURRENT_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + +# Make two connections for mysqltest_1 user +connect (conn2,localhost,mysqltest_1,,); +SELECT 1; +connection default; + +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: two connections +--let $query_result= query_get_value(SELECT CONCURRENT_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', CONCURRENT_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 2 +--source include/assert.inc + +# Check if number of concurrent connections decreased +disconnect conn2; +connection default; +let $count_sessions= 2; +--source include/wait_until_count_sessions.inc + +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: handle disconnects +--let $query_result= query_get_value(SELECT CONCURRENT_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', CONCURRENT_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + +# Number of concurrent connections shouldn't be affected by different users +connect (conn3,localhost,mysqltest_2,,); +SELECT 1; +connection default; + +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: connections from other users +--let $query_result= query_get_value(SELECT CONCURRENT_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', CONCURRENT_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + + +# if there is no connections, concurrent connections counter should be zero +disconnect conn1; +connection default; +let $count_sessions= 2; +--source include/wait_until_count_sessions.inc + +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: no connections - zero concurrency +--let $query_result= query_get_value(SELECT COUNT(1) cnt FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1' AND CONCURRENT_CONNECTIONS=0, cnt, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + +disconnect conn3; +connection default; +let $count_sessions= 1; +--source include/wait_until_count_sessions.inc + +# Failed connection attempt should keep number of concurrent connections intact +set password for mysqltest_2@"localhost" = password('foo'); +--disable_query_log +--error ER_ACCESS_DENIED_ERROR +connect (conn4,localhost,mysqltest_2,,); +--enable_query_log +connection default; + +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: wrong password connection +--let $query_result= query_get_value(SELECT COUNT(1) cnt FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_2' AND CONCURRENT_CONNECTIONS=0, cnt, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + +# We need alive connection to check that flush will not remove concurent_connections counter +# and disconnect not causing debug assert +connect (conn1,localhost,mysqltest_1,,); +SELECT 1; +connection default; +# Verify that flush statistics keeps concurent connections counter intact +FLUSH USER_STATISTICS; +connection conn1; +SELECT 1; +connection default; + +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: single connection after flush +--let $query_result= query_get_value(SELECT CONCURRENT_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', CONCURRENT_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 1 +--source include/assert.inc + +disconnect conn1; +connection default; +let $count_sessions= 1; +--source include/wait_until_count_sessions.inc + +# verify flush user statistics with existing connections +# connection concurrency tracked only if it runs queries while userstat=1 + +SET GLOBAL userstat=0; +connect (conn1,localhost,mysqltest_1,,); +connect (conn2,localhost,mysqltest_1,,); +connection default; +SET GLOBAL userstat=1; +FLUSH USER_STATISTICS; +connection conn1; +SELECT 1; + +connection default; +--let $assert_text= I_S.USER_STATISTICS CONCURRENT_CONNECTIONS: two connections after userstat=1 +--let $query_result= query_get_value(SELECT CONCURRENT_CONNECTIONS FROM INFORMATION_SCHEMA.USER_STATISTICS WHERE USER LIKE 'mysqltest_1', CONCURRENT_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 2 +--source include/assert.inc + +disconnect conn2; +disconnect conn1; +connection default; + +let $count_sessions= 1; +--source include/wait_until_count_sessions.inc + + +# verify flush client statistics with existing connections +# connection concurrency tracked only if it runs queries while userstat=1 +SET GLOBAL userstat=0; +connect (conn1,localhost,mysqltest_1,,); +connect (conn2,localhost,mysqltest_1,,); +connection default; +SET GLOBAL userstat=1; +FLUSH CLIENT_STATISTICS; +connection conn1; +SELECT 1; + +connection default; +--let $assert_text= I_S.CLIENT_STATISTICS CONCURRENT_CONNECTIONS: two connections after userstat=1 +--let $query_result= query_get_value(SELECT CONCURRENT_CONNECTIONS FROM INFORMATION_SCHEMA.CLIENT_STATISTICS WHERE CLIENT LIKE 'localhost', CONCURRENT_CONNECTIONS, 1) +--let $assert_cond= "$query_result" = 2 +--source include/assert.inc + +disconnect conn2; +disconnect conn1; +connection default; + +let $count_sessions= 1; +--source include/wait_until_count_sessions.inc + + +DROP USER mysqltest_1@localhost; +DROP USER mysqltest_2@localhost; + +SET GLOBAL userstat= @userstat_old; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/percona_userstat.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/percona_userstat.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/percona_userstat.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/percona_userstat.test 2017-10-19 04:25:29.000000000 +0000 @@ -136,4 +136,27 @@ INFORMATION_SCHEMA.USER_STATISTICS ; +--echo # Bug lp:1659992 "Function over userstat tables cause mysql to crash" + +delimiter |; +CREATE FUNCTION utility_get_global_variable(in_name VARCHAR(64)) RETURNS VARCHAR(1024) CHARSET utf8 DETERMINISTIC SQL SECURITY INVOKER +BEGIN + DECLARE var_value VARCHAR(1024); + IF @@global.version LIKE '5.7.%' THEN + SELECT v.variable_value FROM performance_schema.global_variables v WHERE v.variable_name = in_name INTO var_value; + ELSE + SELECT v.variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES v WHERE v.variable_name = in_name INTO var_value; + END IF; + RETURN var_value; +END| +delimiter ;| + +--disable_result_log +SELECT * + FROM INFORMATION_SCHEMA.TABLE_STATISTICS s + WHERE utility_get_global_variable('userstat') = 'ON'; +--enable_result_log + +DROP FUNCTION utility_get_global_variable; + SET GLOBAL userstat= @userstat_old; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/plugin-load-add-with-path.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/plugin-load-add-with-path.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/plugin-load-add-with-path.test 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/plugin-load-add-with-path.test 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,107 @@ +# Test for ability to use path in --plugin-load and --plugin-load-add options + +--source include/have_dynamic_loading.inc + +# have_example_plugin.inc, have_plugin_auth.inc, have_udf.inc can't be used +# here because they check if plugin_var variable contains the correspondent +# plugin path what is wrong as these plugins are in different subdirs in +# build dir + +# +# Check if the variable EXAMPLE_PLUGIN is set +# +if (!$EXAMPLE_PLUGIN) { + --skip Example plugin requires the environment variable \$EXAMPLE_PLUGIN to be set (normally done by mtr) +} + +# +# Check if the variable PLUGIN_AUTH is set +# +if (!$PLUGIN_AUTH) { + --skip Example plugin requires the environment variable \$PLUGIN_AUTH to be set (normally done by mtr) +} + +# +# Check if the variable UDF_EXAMPLE_LIB is set +# +if (!$UDF_EXAMPLE_LIB) { + --skip UDF requires the environment variable \$UDF_EXAMPLE_LIB to be set (normally done by mtr) +} + +--let MYSQL_BASEDIR= `select @@basedir` + +--echo ### +--echo # Test for loading two plugins both with full path +--echo ### +--let $restart_parameters= restart:$EXAMPLE_PLUGIN_LOAD_PATH $PLUGIN_AUTH_LOAD_ADD_PATH +--source include/restart_mysqld.inc +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'EXAMPLE'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'test_plugin_server'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'cleartext_plugin_server'; + +--echo ### +--echo # Test for loading two plugins one with full path and another with +--echo # just filename +--echo ### +--let $restart_parameters= restart:$PLUGIN_AUTH_OPT $PLUGIN_AUTH_LOAD $EXAMPLE_PLUGIN_LOAD_ADD_PATH +--source include/restart_mysqld.inc +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'EXAMPLE'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'test_plugin_server'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'cleartext_plugin_server'; + +--echo ### +--echo # Test for loading the same plugin two times - both with path and +--echo # without one +--echo ### +--disable_query_log +CALL mtr.add_suppression("Function 'EXAMPLE' already exists"); +--eval call mtr.add_suppression("Couldn't load plugin named 'EXAMPLE' with soname '$EXAMPLE_PLUGIN_DIR/$EXAMPLE_PLUGIN'") +--enable_query_log +--let $restart_parameters= restart:$EXAMPLE_PLUGIN_OPT $EXAMPLE_PLUGIN_LOAD $EXAMPLE_PLUGIN_LOAD_ADD_PATH +--source include/restart_mysqld.inc +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'EXAMPLE'; + +--echo ### +--echo # Test for loading plugins with 'INSTALL PLUGIN' +--echo ### +--let $restart_parameters= restart:$PLUGIN_AUTH_OPT +--source include/restart_mysqld.inc + +# This error message contains path and the message itself is limited by size. +# As path can have different length depending on testing environment the +# content of the error message can be different depending on testing +# environment. That's why we disable result log when this error message +# is expected. +--disable_result_log +--replace_result $EXAMPLE_PLUGIN EXAMPLE_PLUGIN +--error ER_CANT_OPEN_LIBRARY +--eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN' +--enable_result_log +--replace_result $EXAMPLE_PLUGIN_DIR EXAMPLE_PLUGIN_DIR $EXAMPLE_PLUGIN EXAMPLE_PLUGIN +--error ER_UDF_NO_PATHS +--eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN_DIR/$EXAMPLE_PLUGIN' +--replace_regex /\.dll/.so/ +--eval INSTALL PLUGIN test_plugin_server SONAME '$PLUGIN_AUTH' +--replace_regex /\.dll/.so/ +--eval INSTALL PLUGIN cleartext_plugin_server SONAME '$PLUGIN_AUTH' + +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'EXAMPLE'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'test_plugin_server'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'cleartext_plugin_server'; + +UNINSTALL PLUGIN test_plugin_server; +UNINSTALL PLUGIN cleartext_plugin_server; + +--echo ### +--echo # Test for path in UDF library loading +--echo ### +--let $restart_parameters= restart:$UDF_EXAMPLE_LIB_OPT +--source include/restart_mysqld.inc + +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB"; +DROP FUNCTION metaphon; + +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB $UDF_EXAMPLE_LIB_DIR UDF_EXAMPLE_LIB_DIR +--error ER_UDF_NO_PATHS +eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB_DIR/$UDF_EXAMPLE_LIB"; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ps.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ps.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ps.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ps.test 2017-10-19 04:25:29.000000000 +0000 @@ -3519,3 +3519,41 @@ --echo # Connection default connection default; DROP TABLE t1; + + +--echo # +--echo # Bug#19894382 - SERVER SIDE PREPARED STATEMENTS LEADS TO POTENTIAL OFF-BY-SECOND +--echo # TIMESTAMP ON SLAVE. +--echo # + +CREATE TABLE bug19894382(f1 CHAR(64) DEFAULT 'slave', + f2 TIME, f3 TIMESTAMP NULL, f4 DATETIME, + f5 TIME(3), f6 TIMESTAMP(3) NULL, f7 DATETIME(3)); + +--echo # Execute prepared statements from mysql_client_test. +--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/bug19894382.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST -d -u root test_bug19894382 >> $MYSQLTEST_VARDIR/log/bug19894382.out.log 2>&1 + +--echo # Insert tuples from the client_test_db.bug19894382 to the test.bug19894382. +--echo # Tuples in the client_test_db.bug19894382 are inserted from the mysql_client_test. +INSERT INTO bug19894382 SELECT * FROM client_test_db.bug19894382; + +--echo # Replay binlog events +let $MYSQLD_DATADIR= `select @@datadir`; +--let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1) +--exec $MYSQL_BINLOG --force-if-open -d client_test_db $MYSQLD_DATADIR/$master_log_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug19894382.binlog +--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug19894382.binlog" + +--echo # Insert tuples from the client_test_db.bug19894382 to the test.bug19894382. +--echo # Tuples in the client_test_db.bug19894382 are inserted from the binlog. +INSERT INTO bug19894382(f2, f3, f4, f5, f6, f7) + SELECT f2, f3, f4, f5, f6, f7 FROM client_test_db.bug19894382; +--echo # With fix, tuples of "master" and "slave" will be same. There will not be any difference +--echo # in values inserted for time, timestamp and datetime type columns. +SELECT * FROM bug19894382 ORDER BY f2; + +--echo # Cleanup +DROP DATABASE client_test_db; +DROP TABLE bug19894382; +--remove_file $MYSQLTEST_VARDIR/log/bug19894382.out.log +--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug19894382.binlog diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/query_cache.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/query_cache.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/query_cache.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/query_cache.test 2017-10-19 04:25:29.000000000 +0000 @@ -1453,6 +1453,48 @@ --echo #cleanup DROP DATABASE `db-db`; + +--echo # +--echo #Bug #25943038: QUERY WITH DERIVED TABLE IS CACHED IN MVCC SCENARIO +--echo # + +use test; +CREATE TABLE t1(i1 INT, i2 INT, v3 VARCHAR(20)) ENGINE=INNODB; +SET @qc= @@query_cache_size; +SET GLOBAL query_cache_size=16777216; + +SELECT @@query_cache_size, @@query_cache_type; + +connect (con1, localhost, root); +connect (con2, localhost, root); + +--enable_connect_log +connection con1; +START TRANSACTION; +INSERT INTO t1 VALUES(1,1,'a'),(2,1,'b'),(3,2,'c'),(4,2,'d'); + +connection con2; +SHOW GLOBAL STATUS LIKE 'qcache%cache%'; +SELECT * FROM t1; +SELECT * FROM (SELECT i2,SUM(i1) FROM t1 GROUP BY i2) b; +SHOW GLOBAL STATUS LIKE 'qcache%cache%'; + +connection con1; +SHOW GLOBAL STATUS LIKE 'qcache%cache%'; +commit; + +connection con2; +SHOW GLOBAL STATUS LIKE 'qcache%cache%'; +SELECT * FROM t1; +SELECT * FROM (SELECT * FROM t1) a; +SELECT * FROM (SELECT i2,SUM(i1) FROM t1 GROUP BY i2) b; + +disconnect con1; +disconnect con2; +--source include/wait_until_disconnected.inc +connection default; +DROP TABLE t1; + SET GLOBAL query_cache_size = @query_cache_size.saved; --echo # diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/show_processlist_state.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/show_processlist_state.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/show_processlist_state.test 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/show_processlist_state.test 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,11 @@ + +--source include/not_embedded.inc + +# +# Output should be the same with or without the performance schema. +# + +--echo "Test SHOW PROCESSLIST, column INFO" +--replace_column 1 ID 3 HOST 6 TIME 9 ROWS_SENT 10 ROWS_EXAMINED +show processlist; + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/sp-threads.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/sp-threads.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/sp-threads.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/sp-threads.test 2017-10-19 04:25:29.000000000 +0000 @@ -77,9 +77,14 @@ connection con2root; lock tables t2 write; connection con1root; +--let $con1root_id=`SELECT CONNECTION_ID()` send call bug9486(); connection con2root; ---sleep 2 + +let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist WHERE + id=$con1root_id AND state='Waiting for table metadata lock'; +--source include/wait_condition.inc + # There should be call statement in locked state. --replace_column 1 # 3 localhost 6 # 9 # 10 # --replace_result "starting" STATE "init" STATE "cleaning up" STATE diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_bug75311-master.opt percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_bug75311-master.opt --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_bug75311-master.opt 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_bug75311-master.opt 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +--ssl-cipher=DHE-RSA-AES256-SHA diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_bug75311.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_bug75311.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_bug75311.test 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_bug75311.test 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,22 @@ +--source include/have_ssl_communication.inc + +--echo # +--echo # Bug 75311: Error for SSL cipher is unhelpful +--echo # + +--source include/count_sessions.inc + +--connect(con1,localhost,root,,,,,SSL) + +SHOW STATUS LIKE 'Ssl_cipher_list'; + +--disconnect con1 +--connection default + +# The first error string is returned by YaSSL, the second one by OpenSSL < 1.1, +# the third one by OpenSSL >= 1.1 +--replace_result "Failed to set ciphers to use" ERROR "error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure" ERROR "error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure" ERROR +--error 1 +--exec $MYSQL -uroot --ssl-mode=REQUIRED --ssl-cipher='AES128-SHA256' -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1 + +--source include/wait_until_count_sessions.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san_ipv6-master.opt percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san_ipv6-master.opt --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san_ipv6-master.opt 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san_ipv6-master.opt 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +--loose-ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem --loose-ssl-key=$MYSQL_TEST_DIR/std_data/percona-serversan-key.pem --loose-ssl-cert=$MYSQL_TEST_DIR/std_data/percona-serversan-cert.pem --skip-name-resolve --bind-address=:: diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san_ipv6.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san_ipv6.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san_ipv6.test 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san_ipv6.test 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,37 @@ +--source include/not_embedded.inc +--source include/have_ssl.inc + +# As YaSSL does not implement 'X509_get_ext_d2i()' function and always +# returns NULL, '--ssl-verify-server-cert' can only check commonName ('CN') +# entry in the certificate and therefore this test won't pass. +--source include/check_openssl.inc + +--source include/count_sessions.inc + +# As both 'check_ipv6' and 'have_ipv4_mapped' try to establish additional +# connections for testing, put them after 'count_sessions' +--source include/check_ipv6.inc +--source include/have_ipv4_mapped.inc + +# +# lp:1673656 "SSL Certificate Subject ALT Names with IPs or DNS: not respected with --ssl-verify-server-cert" +# Oracle Bug #68052 "SSL Certificate Subject ALT Names with IPs not respected with --ssl-verify-serve" +# + +# This is a IPV6 companion of 'main.ssl_san' MTR test case + +# Check if it is possible to connect to the server via SSL with +# '--ssl-verify-server-cert' option. Although server certificate is issued +# to another server ('CN' == 'percona-server'), it has '::1' in the +# Subject Alternative Names (SAN) list. + +--exec $MYSQL -h ::1 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem -e "SELECT '::1' AS answer" +--exec $MYSQL -h ::1 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem --ssl-verify-server-cert -e "SELECT '::1 (--ssl-verify-server-cert)' AS answer" + +--exec $MYSQL -h ::ffff:127.0.0.1 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem -e "SELECT '::ffff:127.0.0.1' AS answer" +# The next command is expected to fail with CR_SSL_CONNECTION_ERROR (2026) as +# mapped IP V4 address is not in the certificate SAN list +--error 1 +--exec $MYSQL -h ::ffff:127.0.0.1 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem --ssl-verify-server-cert -e "SELECT '::ffff:127.0.0.1 (--ssl-verify-server-cert)' AS answer" + +--source include/wait_until_count_sessions.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san-master.opt percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san-master.opt --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san-master.opt 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san-master.opt 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +--loose-ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem --loose-ssl-key=$MYSQL_TEST_DIR/std_data/percona-serversan-key.pem --loose-ssl-cert=$MYSQL_TEST_DIR/std_data/percona-serversan-cert.pem --skip-name-resolve diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/ssl_san.test 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/ssl_san.test 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,40 @@ +--source include/not_embedded.inc +--source include/have_ssl.inc + +# As YaSSL does not implement 'X509_get_ext_d2i()' function and always +# returns NULL, '--ssl-verify-server-cert' can only check commonName ('CN') +# entry in the certificate and therefore this test won't pass. +--source include/check_openssl.inc + +--source include/count_sessions.inc + +# +# lp:1673656 "SSL Certificate Subject ALT Names with IPs or DNS: not respected with --ssl-verify-server-cert" +# Oracle Bug #68052 "SSL Certificate Subject ALT Names with IPs not respected with --ssl-verify-serve" +# + +# This is a workaround for CentOS 6 (both 64-bit and 32-bit) which +# reports "Host '127.0.0.2' is not allowed to connect to this MySQL server" +# when "$MYSQL -h 127.0.0.2 ..." is executed +GRANT ALL ON test.* TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'; + +# Check if it is possible to connect to the server via SSL with +# '--ssl-verify-server-cert' option. Although server certificate is issued +# to another server ('CN' == 'percona-server'), it has 'localhost' and +# 127.0.0.1 in the Subject Alternative Names (SAN) list. + +--exec $MYSQL -h localhost --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem -e "SELECT 'localhost' AS answer" +--exec $MYSQL -h localhost --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem --ssl-verify-server-cert -e "SELECT 'localhost (--ssl-verify-server-cert)' AS answer" + +--exec $MYSQL -h 127.0.0.1 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem -e "SELECT '127.0.0.1' answer" +--exec $MYSQL -h 127.0.0.1 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem --ssl-verify-server-cert -e "SELECT '127.0.0.1 (--ssl-verify-server-cert)' answer" + +--exec $MYSQL -u mysqltest_1 -h 127.0.0.2 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem -e "SELECT '127.0.0.2' AS answer" +# The next command is expected to fail with CR_SSL_CONNECTION_ERROR (2026) as +# 127.0.0.2 address is not in the certificate SAN list +--error 1 +--exec $MYSQL -u mysqltest_1 -h 127.0.0.2 --ssl --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/percona-cacert.pem --ssl-verify-server-cert -e "SELECT '127.0.0.2 (--ssl-verify-server-cert)' AS answer" + +DROP USER 'mysqltest_1'@'127.0.0.0/255.0.0.0'; + +--source include/wait_until_count_sessions.inc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/status.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/status.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/status.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/status.test 2017-10-19 04:25:29.000000000 +0000 @@ -21,6 +21,8 @@ # PS causes different statistics --disable_ps_protocol +--source include/count_sessions.inc + connect (con1,localhost,root,,); connect (con2,localhost,root,,); @@ -75,6 +77,8 @@ connection default; --echo # Switched to connection: default +--source include/wait_until_count_sessions.inc + # End of 4.1 tests # @@ -196,6 +200,7 @@ disconnect con2; disconnect con1; +--source include/wait_until_count_sessions.inc # # Bug#30377 EXPLAIN loses last_query_cost when used with UNION @@ -251,6 +256,8 @@ disconnect con1; connection default; +--source include/wait_until_count_sessions.inc + # # Bug#30252 Com_create_function is not incremented. # @@ -309,12 +316,8 @@ drop function func37908; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; DROP USER mysqltest_1@localhost; -# Wait till the sessions user1 and root are disconnected -let $wait_condition = - SELECT COUNT(*) = 0 - FROM information_schema.processlist - WHERE id in ('$root_connection_id','$user1_connection_id'); ---source include/wait_condition.inc + +--source include/wait_until_count_sessions.inc # # Bug#41131 "Questions" fails to increment - ignores statements instead stored procs @@ -346,12 +349,13 @@ --disable_query_log let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`; --enable_query_log -eval SELECT $diff; disconnect con1; connection default; DROP PROCEDURE p1; DROP FUNCTION f1; +--source include/wait_until_count_sessions.inc + # End of 5.1 tests diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/symlink.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/symlink.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/symlink.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/symlink.test 2017-10-19 04:25:29.000000000 +0000 @@ -298,3 +298,19 @@ create table t2 like t1; show create table t2; drop tables t1, t2; + +--echo # +--echo # Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE +--echo # WITH DATA DIRECTORY +--echo # + +--echo # Make sure we have no current database +CREATE DATABASE x; +USE x; +DROP DATABASE x; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM +DATA DIRECTORY "$MYSQLTEST_VARDIR/tmp"; + +DROP TABLE test.t1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/type_temporal_fractional.test percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/type_temporal_fractional.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/t/type_temporal_fractional.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/t/type_temporal_fractional.test 2017-10-19 04:25:29.000000000 +0000 @@ -6538,6 +6538,14 @@ KEY col_timestamp_6_key (col_timestamp_6_key)) ENGINE=MEMORY DEFAULT CHARSET=latin1; INSERT INTO t1 VALUES (current_timestamp(5),current_timestamp(6),current_time(6)); + +# In case the inserted timestamp happened to have four trailing zeroes in microseconds, +# it will compare equal with col_time_2_not_null, breaking the testcase +UPDATE t1 SET col_timestamp_6_key + = TIMESTAMPADD(MICROSECOND, + IF(MICROSECOND(col_timestamp_6_key) % 10000, 0, 1), + col_timestamp_6_key); + SELECT col_datetime_5 AS c1 FROM t1 WHERE col_time_2_not_null = GREATEST(CURRENT_DATE(),col_timestamp_6_key) ORDER BY 1; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/valgrind.supp percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/valgrind.supp --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysql-test/valgrind.supp 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysql-test/valgrind.supp 2017-10-19 04:25:29.000000000 +0000 @@ -738,7 +738,7 @@ fun:my_b_flush_io_cache fun:_my_b_write fun:_Z*10write_keysP10Sort_paramP13Filesort_infojP11st_io_cacheS4_ - fun:_Z*13find_all_keysP10Sort_paramP10SQL_SELECTP13Filesort_infoP11st_io_cacheS6_P13Bounded_queueIhhEPy + ... fun:_Z8filesortP3THDP5TABLEP8FilesortbPyS5_ } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/charset.c percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/charset.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/charset.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/charset.c 2017-10-19 04:25:29.000000000 +0000 @@ -416,10 +416,23 @@ int fd; size_t len, tmp_len; MY_STAT stat_info; - - if (!my_stat(filename, &stat_info, MYF(myflags)) || - ((len= (uint)stat_info.st_size) > MY_MAX_ALLOWED_BUF) || - !(buf= (uchar*) my_malloc(len,myflags))) + + if (!my_stat(filename, &stat_info, myflags)) + return TRUE; + + len= stat_info.st_size; + if ((len > MY_MAX_ALLOWED_BUF) && (myflags & MY_WME)) + { + my_printf_error(EE_UNKNOWN_CHARSET, + "Error while reading '%s': its length %llu is larger than " + "maximum allowed length %llu\n", MYF(0), filename, + (unsigned long long)len, + (unsigned long long)MY_MAX_ALLOWED_BUF); + return TRUE; + } + + buf= my_malloc(len, myflags); + if (!buf) return TRUE; if ((fd= mysql_file_open(key_file_charset, filename, O_RDONLY, myflags)) < 0) @@ -505,7 +518,13 @@ my_charset_loader_init_mysys(&loader); strmov(get_charsets_dir(fname), MY_CHARSET_INDEX); - my_read_charset_file(&loader, fname, MYF(0)); + my_read_charset_file(&loader, fname, +#ifdef MYSQL_SERVER + MYF(MY_WME) +#else + MYF(0) +#endif + ); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# 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 @@ -68,7 +68,7 @@ ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES}) TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY} - ${LIBNSL} ${LIBM} ${LIBRT}) + ${LIBNSL} ${LIBM} ${LIBRT} ${LIBEXECINFO}) DTRACE_INSTRUMENT(mysys) # Need explicit pthread for gcc -fsanitize=address diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/lf_alloc-pin.c percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/lf_alloc-pin.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/lf_alloc-pin.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/lf_alloc-pin.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* QQ: TODO multi-pinbox */ -/* 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 @@ -94,23 +94,12 @@ as necessary, old are pushed in the stack for reuse. ABA is solved by versioning a pointer - because we use an array, a pointer to pins is 16 bit, upper 16 bits are used for a version. - - It is assumed that pins belong to a THD and are not transferable - between THD's (LF_PINS::stack_ends_here being a primary reason - for this limitation). */ -#include -#include -#include -#define LF_PINBOX_MAX_PINS 65536 +#include "lf.h" +#include "mysys_priv.h" /* key_memory_lf_node */ -/* - When allocation on stack happens leave this - amount of stack memory for further functions - call. -*/ -#define LF_PINBOX_EXTRA_STACK_SPACE 8192 +#define LF_PINBOX_MAX_PINS 65536 static void _lf_pinbox_real_free(LF_PINS *pins); @@ -146,14 +135,9 @@ DESCRIPTION get a new LF_PINS structure from a stack of unused pins, or allocate a new one out of dynarray. - - NOTE - It is assumed that pins belong to a thread and are not transferable - between threads. */ LF_PINS *_lf_pinbox_get_pins(LF_PINBOX *pinbox) { - struct st_my_thread_var *var; uint32 pins, next, top_ver; LF_PINS *el; /* @@ -163,7 +147,7 @@ pinstack_top_ver is 32 bits; 16 low bits are the index in the array, to the first element of the list. 16 high bits are a version (every time the 16 low bits are updated, the 16 high bits are - incremented). Versioniong prevents the ABA problem. + incremented). Versioning prevents the ABA problem. */ top_ver= pinbox->pinstack_top_ver; do @@ -196,12 +180,6 @@ el->link= pins; el->purgatory_count= 0; el->pinbox= pinbox; - var= my_thread_var; - /* - Threads that do not call my_thread_init() should still be - able to use the LF_HASH. - */ - el->stack_ends_here= (var ? & var->stack_ends_here : NULL); return el; } @@ -251,22 +229,21 @@ } while (!my_atomic_cas32((int32 volatile*) &pinbox->pinstack_top_ver, (int32*) &top_ver, top_ver-pins->link+nr+LF_PINBOX_MAX_PINS)); - return; } -static int ptr_cmp(void **a, void **b) +/* + Get the next pointer in the purgatory list. + Note that next_node is not used to avoid the extra volatile. +*/ +#define pnext_node(P, X) (*((void **)(((char *)(X)) + (P)->free_ptr_offset))) + +static inline void add_to_purgatory(LF_PINS *pins, void *addr) { - return *a < *b ? -1 : *a == *b ? 0 : 1; + pnext_node(pins->pinbox, addr)= pins->purgatory; + pins->purgatory= addr; + pins->purgatory_count++; } -#define add_to_purgatory(PINS, ADDR) \ - do \ - { \ - *(void **)((char *)(ADDR)+(PINS)->pinbox->free_ptr_offset)= \ - (PINS)->purgatory; \ - (PINS)->purgatory= (ADDR); \ - (PINS)->purgatory_count++; \ - } while (0) /* Free an object allocated via pinbox allocator @@ -278,147 +255,88 @@ void _lf_pinbox_free(LF_PINS *pins, void *addr) { add_to_purgatory(pins, addr); - if (pins->purgatory_count % LF_PURGATORY_SIZE) + if (pins->purgatory_count % LF_PURGATORY_SIZE == 0) _lf_pinbox_real_free(pins); } -struct st_harvester { - void **granary; - int npins; +struct st_match_and_save_arg { + LF_PINS *pins; + LF_PINBOX *pinbox; + void *old_purgatory; }; /* - callback for _lf_dynarray_iterate: - scan all pins of all threads and accumulate all pins + Callback for lf_dynarray_iterate: + Scan all pins of all threads, for each active (non-null) pin, + scan the current thread's purgatory. If present there, move it + to a new purgatory. At the end, the old purgatory will contain + pointers not pinned by any thread. */ -static int harvest_pins(LF_PINS *el, struct st_harvester *hv) +static int match_and_save(LF_PINS *el, struct st_match_and_save_arg *arg) { int i; - LF_PINS *el_end= el + MY_MIN(hv->npins, LF_DYNARRAY_LEVEL_LENGTH); + LF_PINS *el_end= el + LF_DYNARRAY_LEVEL_LENGTH; for (; el < el_end; el++) { for (i= 0; i < LF_PINBOX_PINS; i++) { void *p= el->pin[i]; if (p) - *hv->granary++= p; + { + void *cur= arg->old_purgatory; + void **list_prev= &arg->old_purgatory; + while (cur) + { + void *next= pnext_node(arg->pinbox, cur); + + if (p == cur) + { + /* pinned - keeping */ + add_to_purgatory(arg->pins, cur); + /* unlink from old purgatory */ + *list_prev= next; + } + else + list_prev= (void **)((char *)cur+arg->pinbox->free_ptr_offset); + cur= next; + } + if (!arg->old_purgatory) + return 1; + } } } - /* - hv->npins may become negative below, but it means that - we're on the last dynarray page and harvest_pins() won't be - called again. We don't bother to make hv->npins() correct - (that is 0) in this case. - */ - hv->npins-= LF_DYNARRAY_LEVEL_LENGTH; - return 0; -} - -/* - callback for _lf_dynarray_iterate: - scan all pins of all threads and see if addr is present there -*/ -static int match_pins(LF_PINS *el, void *addr) -{ - int i; - LF_PINS *el_end= el+LF_DYNARRAY_LEVEL_LENGTH; - for (; el < el_end; el++) - for (i= 0; i < LF_PINBOX_PINS; i++) - if (el->pin[i] == addr) - return 1; return 0; } -#if STACK_DIRECTION < 0 -#define available_stack_size(CUR,END) (long) ((char*)(CUR) - (char*)(END)) -#else -#define available_stack_size(CUR,END) (long) ((char*)(END) - (char*)(CUR)) -#endif - -#define next_node(P, X) (*((uchar * volatile *)(((uchar *)(X)) + (P)->free_ptr_offset))) -#define anext_node(X) next_node(&allocator->pinbox, (X)) - /* Scan the purgatory and free everything that can be freed */ static void _lf_pinbox_real_free(LF_PINS *pins) { - int npins; - void *list; - void **addr= NULL; - void *first= NULL, *last= NULL; LF_PINBOX *pinbox= pins->pinbox; - npins= pinbox->pins_in_array+1; + /* Store info about current purgatory. */ + struct st_match_and_save_arg arg = {pins, pinbox, pins->purgatory}; + /* Reset purgatory. */ + pins->purgatory= NULL; + pins->purgatory_count= 0; -#ifdef HAVE_ALLOCA - if (pins->stack_ends_here != NULL) - { - int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins; - /* create a sorted list of pinned addresses, to speed up searches */ - if (available_stack_size(&pinbox, *pins->stack_ends_here) > - /* leave LF_PINBOX_EXTRA_STACK_SPACE bytes for qsort() call */ - (alloca_size + LF_PINBOX_EXTRA_STACK_SPACE)) - { - struct st_harvester hv; - addr= (void **) alloca(alloca_size); - hv.granary= addr; - hv.npins= npins; - /* scan the dynarray and accumulate all pinned addresses */ - _lf_dynarray_iterate(&pinbox->pinarray, - (lf_dynarray_func)harvest_pins, &hv); - - npins= hv.granary-addr; - /* and sort them */ - if (npins) - qsort(addr, npins, sizeof(void *), (qsort_cmp)ptr_cmp); - } - } -#endif + lf_dynarray_iterate(&pinbox->pinarray, + (lf_dynarray_func)match_and_save, &arg); - list= pins->purgatory; - pins->purgatory= 0; - pins->purgatory_count= 0; - while (list) + if (arg.old_purgatory) { - void *cur= list; - list= *(void **)((char *)cur+pinbox->free_ptr_offset); - if (npins) - { - if (addr) /* use binary search */ - { - void **a, **b, **c; - for (a= addr, b= addr+npins-1, c= a+(b-a)/2; (b-a) > 1; c= a+(b-a)/2) - if (cur == *c) - a= b= c; - else if (cur > *c) - a= c; - else - b= c; - if (cur == *a || cur == *b) - goto found; - } - else /* no alloca - no cookie. linear search here */ - { - if (_lf_dynarray_iterate(&pinbox->pinarray, - (lf_dynarray_func)match_pins, cur)) - goto found; - } - } - /* not pinned - freeing */ - if (last) - last= next_node(pinbox, last)= (uchar *)cur; - else - first= last= (uchar *)cur; - continue; -found: - /* pinned - keeping */ - add_to_purgatory(pins, cur); + /* Some objects in the old purgatory were not pinned, free them. */ + void *last= arg.old_purgatory; + while (pnext_node(pinbox, last)) + last= pnext_node(pinbox, last); + pinbox->free_func(arg.old_purgatory, last, pinbox->free_func_arg); } - if (last) - pinbox->free_func(first, last, pinbox->free_func_arg); } +#define next_node(P, X) (*((uchar * volatile *)(((uchar *)(X)) + (P)->free_ptr_offset))) +#define anext_node(X) next_node(&allocator->pinbox, (X)) + /* lock-free memory allocator for fixed-size objects */ LF_REQUIRE_PINS(1) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_handler_errors.h percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_handler_errors.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_handler_errors.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_handler_errors.h 2017-10-19 04:25:29.000000000 +0000 @@ -94,7 +94,8 @@ "FTS query exceeds result cache memory limit", "Temporary file write failure", "Operation not allowed when innodb_forced_recovery > 0", - "Too many words in a FTS phrase or proximity search" + "Too many words in a FTS phrase or proximity search", + "Destination schema does not exist" }; extern void my_handler_error_register(void); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_lib.c percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_lib.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_lib.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_lib.c 2017-10-19 04:25:29.000000000 +0000 @@ -20,33 +20,9 @@ #include #include /* Structs used by my_dir,includes sys/types */ #include "mysys_err.h" -#if defined(HAVE_DIRENT_H) +#if !defined(_WIN32) # include -# define NAMLEN(dirent) strlen((dirent)->d_name) -#else -# define dirent direct -# define NAMLEN(dirent) (dirent)->d_namlen -# if defined(HAVE_SYS_NDIR_H) -# include -# endif -# if defined(HAVE_SYS_DIR_H) -# include -# endif -# if defined(HAVE_NDIR_H) -# include -# endif -# if defined(_WIN32) -# ifdef __BORLANDC__ -# include # endif -# endif -#endif - -#if defined(HAVE_READDIR_R) -#define READDIR(A,B,C) ((errno=readdir_r(A,B,&C)) != 0 || !C) -#else -#define READDIR(A,B,C) (!(C=readdir(A))) -#endif /* We are assuming that directory we are reading is either has less than @@ -88,6 +64,8 @@ #if !defined(_WIN32) +static char* directory_file_name(char *dst, const char *src); + MY_DIR *my_dir(const char *path, myf MyFlags) { char *buffer; @@ -96,17 +74,12 @@ DYNAMIC_ARRAY *dir_entries_storage; MEM_ROOT *names_storage; DIR *dirp; - struct dirent *dp; char tmp_path[FN_REFLEN + 2], *tmp_file; - char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1]; + const struct dirent *dp; DBUG_ENTER("my_dir"); DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags)); -#if !defined(HAVE_READDIR_R) - mysql_mutex_lock(&THR_LOCK_open); -#endif - dirp = opendir(directory_file_name(tmp_path,(char *) path)); #if defined(__amiga__) if ((dirp->dd_fd) < 0) /* Directory doesn't exists */ @@ -135,9 +108,7 @@ tmp_file=strend(tmp_path); - dp= (struct dirent*) dirent_tmp; - - while (!(READDIR(dirp,(struct dirent*) dirent_tmp,dp))) + for (dp= readdir(dirp) ; dp; dp= readdir(dirp)) { if (!(finfo.name= strdup_root(names_storage, dp->d_name))) goto error; @@ -162,9 +133,7 @@ } (void) closedir(dirp); -#if !defined(HAVE_READDIR_R) - mysql_mutex_unlock(&THR_LOCK_open); -#endif + result->dir_entry= (FILEINFO *)dir_entries_storage->buffer; result->number_off_files= dir_entries_storage->elements; @@ -174,9 +143,6 @@ DBUG_RETURN(result); error: -#if !defined(HAVE_READDIR_R) - mysql_mutex_unlock(&THR_LOCK_open); -#endif my_errno=errno; if (dirp) (void) closedir(dirp); @@ -198,7 +164,7 @@ * Returns pointer to dst; */ -char * directory_file_name (char * dst, const char *src) +static char* directory_file_name(char *dst, const char *src) { /* Process as Unix format: just remove test the final slash. */ char *end; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_symlink.c percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_symlink.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_symlink.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_symlink.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,11 +107,18 @@ #endif -int my_is_symlink(const char *filename MY_ATTRIBUTE((unused))) +int my_is_symlink(const char *filename MY_ATTRIBUTE((unused)), + ST_FILE_ID *file_id) { #if defined (HAVE_LSTAT) && defined (S_ISLNK) struct stat stat_buff; - return !lstat(filename, &stat_buff) && S_ISLNK(stat_buff.st_mode); + int result= !lstat(filename, &stat_buff) && S_ISLNK(stat_buff.st_mode); + if (file_id && !result) + { + file_id->st_dev= stat_buff.st_dev; + file_id->st_ino= stat_buff.st_ino; + } + return result; #elif defined (_WIN32) DWORD dwAttr = GetFileAttributes(filename); return (dwAttr != INVALID_FILE_ATTRIBUTES) && @@ -180,3 +187,20 @@ #endif return 0; } + + +/** + Return non-zero if the file descriptor and a previously lstat-ed file + identified by file_id point to the same file +*/ +int my_is_same_file(File file, const ST_FILE_ID *file_id) +{ + MY_STAT stat_buf; + if(my_fstat(file, &stat_buf, MYF(0)) == -1) + { + my_errno= errno; + return 0; + } + return (stat_buf.st_dev == file_id->st_dev) + && (stat_buf.st_ino == file_id->st_ino); +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_thr_init.c percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_thr_init.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/my_thr_init.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/my_thr_init.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -299,35 +299,6 @@ mysql_mutex_init(key_my_thread_var_mutex, &tmp->mutex, MY_MUTEX_INIT_FAST); mysql_cond_init(key_my_thread_var_suspend, &tmp->suspend, NULL); -#if defined(_GNU_SOURCE) && (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) - { - pthread_attr_t attr; - char* stack_addr; - size_t stack_size; - - if (pthread_attr_init(&attr) || - pthread_getattr_np(tmp->pthread_self, &attr) || - pthread_attr_getstack(&attr, (void**)&stack_addr, &stack_size)) - { - error= 1; - goto end; - } - tmp->stack_ends_here= stack_addr; - - if (pthread_attr_destroy(&attr)) - { - error= 1; - goto end; - } - } -#else //defined(_GNU_SOURCE) && (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) - /* assuming tmp is located within the first page of the stack */ - tmp->stack_ends_here= (void **)(((long long)&tmp & (~((long long)my_getpagesize() - 1))) + - ((STACK_DIRECTION == 1) ? - my_thread_stack_size : - my_getpagesize() - my_thread_stack_size)); -#endif //defined(_GNU_SOURCE) && (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) - mysql_mutex_lock(&THR_LOCK_threads); tmp->id= ++thread_id; ++THR_thread_count; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/queues.c percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/queues.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/queues.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/queues.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -583,12 +583,13 @@ tot_no_loops= 1024; perform_insert(&queue); result= perform_ins_del(&queue, max_ind); - delete_queue(&queue); if (result) { printf("Error\n"); + delete_queue(&queue); return TRUE; } + delete_queue(&queue); return FALSE; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/stacktrace.c percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/stacktrace.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys/stacktrace.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys/stacktrace.c 2017-10-19 04:25:29.000000000 +0000 @@ -33,19 +33,20 @@ #include #endif +#ifdef __linux__ +/* __bss_start doesn't seem to work on FreeBSD and doesn't exist on OSX/Solaris. */ #define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end) - static char *heap_start; - -#ifdef HAVE_BSS_START extern char *__bss_start; -#endif +#else +#define PTR_SANE(p) (p) +#endif /* __linux */ void my_init_stacktrace() { -#ifdef HAVE_BSS_START +#ifdef __linux__ heap_start = (char*) &__bss_start; -#endif +#endif /* __linux__ */ } #ifdef __linux__ @@ -134,14 +135,15 @@ void my_safe_print_str(const char* val, int max_len) { +#ifdef __linux__ +/* Only needed by the linux version of PTR_SANE */ char *heap_end; -#ifdef __linux__ if (!safe_print_str(val, max_len)) return; -#endif heap_end= (char*) sbrk(0); +#endif if (!PTR_SANE(val)) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys_ssl/my_aes_openssl.cc percona-xtradb-cluster-5.6-5.6.37-26.21/mysys_ssl/my_aes_openssl.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys_ssl/my_aes_openssl.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys_ssl/my_aes_openssl.cc 2017-10-19 04:25:29.000000000 +0000 @@ -108,7 +108,15 @@ const unsigned char *key, uint32 key_length, enum my_aes_opmode mode, const unsigned char *iv) { - EVP_CIPHER_CTX ctx; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX ctx_value; + EVP_CIPHER_CTX *ctx= &ctx_value; +#else + EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new(); + if (unlikely(!ctx)) + return MY_AES_BAD_DATA; +#endif + const EVP_CIPHER *cipher= aes_evp_type(mode); int u_len, f_len; /* The real key to be used for encryption */ @@ -117,29 +125,42 @@ if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && EVP_CIPHER_mode(cipher) != EVP_CIPH_ECB_MODE && !iv)) + { +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + EVP_CIPHER_CTX_free(ctx); +#endif return MY_AES_BAD_DATA; + } - if (!EVP_EncryptInit(&ctx, cipher, rkey, iv)) + if (!EVP_EncryptInit(ctx, cipher, rkey, iv)) goto aes_error; /* Error */ - if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) + if (!EVP_CIPHER_CTX_set_padding(ctx, 1)) goto aes_error; /* Error */ if (source_length > 0) /* workaround for old OpenSSL versions */ { - if (!EVP_EncryptUpdate(&ctx, dest, &u_len, source, source_length)) + if (!EVP_EncryptUpdate(ctx, dest, &u_len, source, source_length)) goto aes_error; /* Error */ } else u_len= 0; - if (!EVP_EncryptFinal(&ctx, dest + u_len, &f_len)) + if (!EVP_EncryptFinal(ctx, dest + u_len, &f_len)) goto aes_error; /* Error */ - EVP_CIPHER_CTX_cleanup(&ctx); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx); +#else + EVP_CIPHER_CTX_free(ctx); +#endif return u_len + f_len; aes_error: /* need to explicitly clean up the error if we want to ignore it */ ERR_clear_error(); - EVP_CIPHER_CTX_cleanup(&ctx); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx); +#else + EVP_CIPHER_CTX_free(ctx); +#endif return MY_AES_BAD_DATA; } @@ -149,8 +170,15 @@ const unsigned char *key, uint32 key_length, enum my_aes_opmode mode, const unsigned char *iv) { +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX ctx_value; + EVP_CIPHER_CTX *ctx= &ctx_value; +#else + EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new(); + if (unlikely(!ctx)) + return MY_AES_BAD_DATA; +#endif - EVP_CIPHER_CTX ctx; const EVP_CIPHER *cipher= aes_evp_type(mode); int u_len, f_len; @@ -160,26 +188,39 @@ my_aes_create_key(key, key_length, rkey, mode); if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && EVP_CIPHER_mode(cipher) != EVP_CIPH_ECB_MODE && !iv)) + { +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + EVP_CIPHER_CTX_free(ctx); +#endif return MY_AES_BAD_DATA; + } - EVP_CIPHER_CTX_init(&ctx); + EVP_CIPHER_CTX_init(ctx); - if (!EVP_DecryptInit(&ctx, aes_evp_type(mode), rkey, iv)) + if (!EVP_DecryptInit(ctx, aes_evp_type(mode), rkey, iv)) goto aes_error; /* Error */ - if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) + if (!EVP_CIPHER_CTX_set_padding(ctx, 1)) goto aes_error; /* Error */ - if (!EVP_DecryptUpdate(&ctx, dest, &u_len, source, source_length)) + if (!EVP_DecryptUpdate(ctx, dest, &u_len, source, source_length)) goto aes_error; /* Error */ - if (!EVP_DecryptFinal_ex(&ctx, dest + u_len, &f_len)) + if (!EVP_DecryptFinal_ex(ctx, dest + u_len, &f_len)) goto aes_error; /* Error */ - EVP_CIPHER_CTX_cleanup(&ctx); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx); +#else + EVP_CIPHER_CTX_free(ctx); +#endif return u_len + f_len; aes_error: /* need to explicitly clean up the error if we want to ignore it */ ERR_clear_error(); - EVP_CIPHER_CTX_cleanup(&ctx); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_CIPHER_CTX_cleanup(ctx); +#else + EVP_CIPHER_CTX_free(ctx); +#endif return MY_AES_BAD_DATA; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/mysys_ssl/my_default.cc percona-xtradb-cluster-5.6-5.6.37-26.21/mysys_ssl/my_default.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/mysys_ssl/my_default.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/mysys_ssl/my_default.cc 2017-10-19 04:25:29.000000000 +0000 @@ -592,6 +592,8 @@ return my_load_defaults(conf_file, groups, argc, argv, &default_directories); } +/** A global to turn off or on reading the mylogin file. On by default */ +my_bool my_defaults_read_login_file= TRUE; /* Read options from configurations files @@ -680,15 +682,18 @@ DBUG_RETURN(error); } - /* Read options from login group. */ - 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, + if (my_defaults_read_login_file) + { + /* Read options from login group. */ + 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, true, found_no_defaults))) - { - delete_dynamic(&args); - free_root(&alloc,MYF(0)); - DBUG_RETURN(error); + { + delete_dynamic(&args); + free_root(&alloc, MYF(0)); + DBUG_RETURN(error); + } } /* diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/changelog.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/changelog.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/changelog.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/changelog.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,176 @@ +mysql-@DEB_PRODUCTNAME@@DEB_PRODUCTSERIES@ (@DEB_SERVERVERSION@@DEB_PLATFORMRELEASE@) @DEB_CODENAME@; urgency=low + + * (backport from 5.7 branch for packaging) + Integrate the provisional 5.7.11 changes for Ubuntu 16.04 "Xenial Xerus" + ("packaging/deb-in/" from Oracle's 5.7.14, + adapted to Codership's "mysql-wsrep" needs, + SysV init files replaced by systemd files) + with 5.7.15, to support both 16.04 LTS "Xenial Xerus" and 14.04 LTS + "Trusty Tahr". + * Update to 5.6.36 upstream release + + -- Jörg Brühe Tue, 01 Nov 2016 09:45:42 +0100 + +mysql-@DEB_PRODUCTNAME@ (@DEB_SERVERVERSION@@DEB_PLATFORMRELEASE@) @DEB_CODENAME@; urgency=low + + [ Akhil Mohan ] + * new upstream release + * Added new libtest_* plugins to source/include-binaries, mysql-*-test.install + * added new plugin to source/include-binaries, mysql-*-test.install + libtest_framework + libtest_services + libtest_services_threaded + locking_service + test_security_context + version_token + * added support for MECAB in + d/{control,rules,mysql-*-server.install,source/include-binaries} + (Closes: #20315007) + * added automatic setup of ssl certs in + d/mysql-*-server.mysql.init + d/extra/mysql-systemd-start + (Closes: #20650118) + * removed pkg mysql-*-bench; sqlbench will not be packaged + (Closes: #21303289) + * removed cleanup statement for client lib symlinks *_r in d/rules + (Closes: #21311067) + + [ Balasubramanian Kandasamy ] + * Added mysqlpump man page to d/mysql-*-client.install + * Added new decompression utilities lz4_decompress and zlib_decompress + binaries. + * Added mysqlx plugin + + [ Lars Tangvald ] + * Added keyring directory and plugin + + -- Balasubramanian Kandasamy Wed, 26 Aug 2015 15:20:12 +0530 + +mysql-@DEB_PRODUCTNAME@ (5.7.7-rc-3ubuntu15.04) vivid; urgency=low + + * new upstream release + * forked packaging source from utopic to vivid + * 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 + * 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 Mon, 15 Jun 2015 16:48:05 +0530 + +mysql-@DEB_PRODUCTNAME@ (5.7.7-rc-2ubuntu15.04) vivid; urgency=low + + * new upstream release + * forked packaging source from utopic to vivid + + -- Akhil Mohan Wed, 15 Apr 2015 20:27:33 +0530 + +mysql-@DEB_PRODUCTNAME@ (5.7.7-rc-1ubuntu14.10) utopic; urgency=low + + * new upstream release + * updated d/extra/my.cnf to remove option sql_mode + * non-essential tools, files and plugins have been moved to + mysql-@DEB_PRODUCTNAME@-test pkg. + mysql-@DEB_PRODUCTNAME@-test now replaces mysql-@DEB_PRODUCTNAME@-{server,client} + (Closes: #20546298) + (Closes: #20636865) + * mysql-@DEB_PRODUCTNAME@-test now depends on perl, python, libmysqlclient-dev + mysql-@DEB_PRODUCTNAME@-server now depends on psmisc + (Closes: #20561621) + * mysql-*-server.{mysql.init,postinst,templates} updated to deprecate + my_i_db and use msyqld --initialize-insecure to create system tables. + Now if user does not provide password or it is not possible to + receive password from user then UNIX socket authentication will be + enabled to secure the deployment by default. + mysql-@DEB_PRODUCTNAME@-server now depends on mysql-@DEB_PRODUCTNAME@-client + (Closes: #20613327) + + -- Akhil Mohan Fri, 27 Feb 2015 10:01:55 +0530 + +mysql-@DEB_PRODUCTNAME@ (5.7.6-m16-1ubuntu14.10) utopic; urgency=low + + * new upstream release + * init script will now run my_i_db if data dir is not present or empty + * 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 + * mysql-@DEB_PRODUCTNAME@-server now recommends mysql-client + * mysql-@DEB_PRODUCTNAME@-server now depends on apparmor + * 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 + * bumped up libmysqlclient version 18 => 20 + * added new plugins to source/include-binaries + replication_observers_example + rewriter + rewrite_example + * new binary mysql_ssl_rsa_setup added to d/mysql-*-server.install + * provisioned handling of data files directory /var/lib/mysql-files + * cmake option to specify data dir in d/rules is now removed + as default path in cmake layout for DEB is now /var/lib/mysql + + -- Akhil Mohan Fri, 23 Jan 2015 19:59:33 +0530 + +mysql-@DEB_PRODUCTNAME@ (5.7.5-m15-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 + * removed extra whitespaces in d/*.postrm + * added CMake option to download boost if not available + * removed extra file modification steps in d/rules + * removed hotcopy, mysql_zap from d/mysql-@DEB_PRODUCTNAME@-server + * removed mysql_waitpid from d/mysql-@DEB_PRODUCTNAME@-client + * added patch for testsuite search paths under d/patches + * modified cmake option for testsuite in d/rules + * removed patch d/fix-mysql_install_db.patch + * enabled one patch 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 + * updated d/source/include-binaries to add mysql_no_login.so + * updated d/rules to increment -j8 as make option + * updated CMake option WITH_EXTRA_CHARSETS from complex to all + * updated d/*-server.postinst to call m_i_db with --datadir --insecure + --mysqld-file + * updated d/*-server.postinst to remove manual creation mysql db dir + * removed test db prompt in d/*-server.{postinst,templates,config} + * updated app armor profile to allow access to socket lock file + + -- Akhil Mohan Fri, 08 Aug 2014 11:27:30 +0530 + +mysql-@DEB_PRODUCTNAME@ (5.7.4-m14-2ubuntu14.04) trusty; urgency=low + + * 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 Mon, 05 May 2014 15:45:10 +0530 + +mysql-@DEB_PRODUCTNAME@ (5.7.4-m14-1ubuntu14.04) trusty; urgency=low + + * new upstream release + + -- Akhil Mohan Fri, 28 Feb 2014 18:06:30 +0530 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,352 @@ +# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# 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(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") + RETURN() +ENDIF() +IF (NOT DEFINED DEB_CODENAME) + execute_process( + COMMAND lsb_release -cs + OUTPUT_VARIABLE DEB_CODENAME + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + SET (DEB_CODENAME ${DEB_CODENAME} CACHE STRING "") +ENDIF() +IF (DEFINED WITH_NDBCLUSTER_STORAGE_ENGINE) + SET (DEB_BASE_PRODUCT "cluster-") + SET (DEB_BASE_PRODUCTC "Cluster ") + SET (DEB_BASE_VERSION ${NDBVERSION}) + SET (DEB_CONTROL_SERVER_CONFLICT_NDB "mysql-community-server, mysql-commercial-server") + SET (DEB_CONTROL_CLIENT_CONFLICT_NDB "mysql-community-client, mysql-commercial-client") +ELSE() + SET (DEB_BASE_PRODUCT "") + SET (DEB_BASE_PRODUCTC "") + SET (DEB_BASE_VERSION ${VERSION}) + SET (DEB_CONTROL_SERVER_CONFLICT_NDB "mysql-cluster-community-server, mysql-cluster-commercial-server") + SET (DEB_CONTROL_CLIENT_CONFLICT_NDB "mysql-cluster-community-client, mysql-cluster-commercial-client") +ENDIF() + +SET (DEB_BASE_VERSION "${DEB_BASE_VERSION}-${WSREP_VERSION}") + +# Commercial or community +IF (DEB_PRODUCT STREQUAL "commercial") + message (FATAL_ERROR "mysql-wsrep is GPL only, no commercial builds") + SET (DEB_COPYRIGHT_UPSTREAMNAME "MySQL Commercial Server ${MYSQL_BASE_VERSION}") + SET (DEB_PRODUCTNAME "${DEB_BASE_PRODUCT}commercial") + SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Commercial") + SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}community") + SET (DEB_LICENSENAME "Advanced") + SET (DEB_INSTALL_LICENSEFILE "LICENSE.mysql") + SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+commercial.1") + # List of plugins that are only in commercial packages + # Plugins that are in both community and commercial should NOT be added here + SET (DEB_INCLUDE_BINARIES_EXTRA +" +debian/extra/audit_log-plugin +debian/extra/authentication_pam-plugin +debian/extra/firewall-plugin +debian/extra/openssl_udf-plugin +debian/extra/thread_pool-plugin +") + SET (DEB_INSTALL_SERVER_PLUGINS +" +usr/lib/mysql/plugin/audit_log.so +usr/lib/mysql/plugin/authentication_pam.so +usr/lib/mysql/plugin/openssl_udf.so +usr/lib/mysql/plugin/thread_pool.so +usr/lib/mysql/plugin/firewall.so +usr/lib/mysql/plugin/debug/audit_log.so +usr/lib/mysql/plugin/debug/authentication_pam.so +usr/lib/mysql/plugin/debug/keyring_okv.so +usr/lib/mysql/plugin/debug/openssl_udf.so +usr/lib/mysql/plugin/debug/thread_pool.so +usr/lib/mysql/plugin/debug/firewall.so +") + SET (DEB_REMOVEPATTERN "gpl.in") +ELSE() + SET (DEB_PRODUCT "${DEB_BASE_PRODUCT}community") + SET (DEB_COPYRIGHT_UPSTREAMNAME "MySQL Server ${MYSQL_BASE_VERSION}") + SET (DEB_PRODUCTNAME "${DEB_BASE_PRODUCT}community") + SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Community") + SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}commercial") + SET (DEB_LICENSENAME "GPL") + SET (DEB_INSTALL_LICENSEFILE "COPYING") + SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+1") + SET (DEB_REMOVEPATTERN "com.in") +ENDIF() + +# mysql-wsrep ! +SET (DEB_PRODUCTNAME "wsrep") +SET (DEB_PRODUCTNAMEC "Wsrep") +SET (DEB_PRODUCTSERIES "-5.6") +SET (DEB_WSREP_README "README-wsrep") + + +SET (FILES_STARTUP_SYSV +" +etc/init.d/mysql +usr/bin/mysqld_safe +") +SET (FILES_STARTUP_UPSTART +" +Not Yet Implememted: Upstart File List +") + +# Platform specifics. The differences are generally only distro version +# and whether or not Systemd and/or apparmor are available +IF (DEB_CODENAME STREQUAL "wheezy") + SET (DEB_PLATFORMRELEASE "debian7") + # Following the Oracle example, we package for Debian 7 + # using only SysV init and no Apparmor. + SET (DEB_CONTROL_BDEPS "") + SET (DEB_INSTALL_SOURCE_XZ "") + SET (DEB_RULES_INSTALL_SYSTEMD "") + SET (DEB_RULES_INSTALL_APPARMOR "") + SET (DEB_RULES_APPARMOR_LOAD "") + SET (DEB_RULES_SYSTEMD_ENABLE "") + SET (DEB_RULES_SYSTEMD_START "") + SET (DEB_INSTALL_SERVER_SYSTEMD "") + SET (DEB_INSTALL_SERVER_APPARMOR "") + SET (DEB_SERVICE_SERVER_EXECPRE "") + SET (DEB_SERVICE_SERVER_EXECPOST "") + SET (DEB_INIT_APPARMOR "") + SET (DEB_STARTUP "SYSV") +ELSEIF(DEB_CODENAME STREQUAL "jessie") + SET (DEB_PLATFORMRELEASE "debian8") + # Improving on Oracle, we would prefer to package for Debian 8 + # using both SysV init and Systemd, but still no Apparmor. + SET (DEB_CONTROL_BDEPS "") + SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") + SET (DEB_RULES_INSTALL_SYSTEMD "") + SET (DEB_RULES_INSTALL_APPARMOR "") + SET (DEB_RULES_APPARMOR_LOAD "") + SET (DEB_SYSTEMD_SERVICE_NAME "") + SET (DEB_RULES_SYSTEMD_ENABLE "") + SET (DEB_RULES_SYSTEMD_START "") + SET (DEB_INSTALL_SERVER_SYSTEMD "") + SET (DEB_INSTALL_SERVER_APPARMOR "") + SET (DEB_SERVICE_SERVER_EXECPRE "") + SET (DEB_SERVICE_SERVER_EXECPOST "") + SET (DEB_INIT_APPARMOR "") + # Debian 8 comes with both SysV init and Systemd, + # but "scripts/CMakeLists.txt" enforces an either-or. + SET (DEB_STARTUP "SYSV") + # For now, we go with Systemd only. +ELSEIF(DEB_CODENAME STREQUAL "stretch") + SET (DEB_PLATFORMRELEASE "debian9") + SET (DEB_CONTROL_BDEPS "") + SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") + SET (DEB_RULES_INSTALL_SYSTEMD "") + SET (DEB_RULES_INSTALL_APPARMOR "") + SET (DEB_RULES_APPARMOR_LOAD "") + SET (DEB_RULES_SYSTEMD_ENABLE "") + SET (DEB_RULES_SYSTEMD_START "") + SET (DEB_INSTALL_SERVER_SYSTEMD "") + SET (DEB_INSTALL_SERVER_APPARMOR "") + SET (DEB_SERVICE_SERVER_EXECPRE "") + SET (DEB_INIT_APPARMOR "") +ELSEIF(DEB_CODENAME STREQUAL "precise") + SET (DEB_PLATFORMRELEASE "ubuntu12.04") + SET (DEB_CONTROL_BDEPS "dh-apparmor") + SET (DEB_INSTALL_SOURCE_XZ "") + SET (DEB_RULES_INSTALL_SYSTEMD "") + SET (DEB_RULES_INSTALL_APPARMOR + "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_RULES_APPARMOR_LOAD + "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") + SET (DEB_RULES_SYSTEMD_ENABLE "") + SET (DEB_RULES_SYSTEMD_START "") + SET (DEB_INSTALL_SERVER_SYSTEMD "") + SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_SERVICE_SERVER_EXECPRE "") + SET (DEB_SERVICE_SERVER_EXECPOST "") + SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld") + SET (DEB_STARTUP "SYSV") +ELSEIF(DEB_CODENAME STREQUAL "trusty") + SET (DEB_PLATFORMRELEASE "ubuntu14.04") + SET (DEB_CONTROL_BDEPS "dh-apparmor") + SET (DEB_INSTALL_SOURCE_XZ "") + SET (DEB_RULES_INSTALL_SYSTEMD "") + SET (DEB_RULES_INSTALL_APPARMOR + "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_RULES_APPARMOR_LOAD + "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") + SET (DEB_RULES_SYSTEMD_ENABLE "") + SET (DEB_RULES_SYSTEMD_START "") + SET (DEB_INSTALL_SERVER_SYSTEMD "") + SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_SERVICE_SERVER_EXECPRE "") + SET (DEB_SERVICE_SERVER_EXECPOST "") + SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld") + SET (DEB_STARTUP "SYSV") +ELSEIF(DEB_CODENAME STREQUAL "wily") + SET (DEB_PLATFORMRELEASE "ubuntu15.10") + SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)") + SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") + SET (DEB_RULES_INSTALL_SYSTEMD + "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/") + SET (DEB_RULES_INSTALL_APPARMOR + "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_RULES_APPARMOR_LOAD + "dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld") + SET (DEB_SYSTEMD_SERVICE_NAME "mysql") + SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --no-enable --name=mysql") + SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade") + SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start") + SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_SERVICE_SERVER_EXECPRE + "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre") + SET (DEB_SERVICE_SERVER_EXECPOST + "ExecStartPost=/usr/share/mysql/mysql-systemd-start post") + SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld") + SET (DEB_STARTUP "SYSTEMD") +ELSEIF(DEB_CODENAME STREQUAL "xenial") + SET (DEB_PLATFORMRELEASE "ubuntu16.04") + SET (DEB_CONTROL_BDEPS "dh-apparmor") + SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") + SET (DEB_RULES_INSTALL_SYSTEMD "") + SET (DEB_RULES_INSTALL_APPARMOR + "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_RULES_APPARMOR_LOAD + "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") + SET (DEB_SYSTEMD_SERVICE_NAME "") + SET (DEB_RULES_SYSTEMD_ENABLE "") + SET (DEB_RULES_SYSTEMD_START "") + SET (DEB_INSTALL_SERVER_SYSTEMD "") + SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_SERVICE_SERVER_EXECPRE "") + SET (DEB_SERVICE_SERVER_EXECPOST "") + SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") + SET (DEB_STARTUP "SYSV") +ELSEIF(DEB_CODENAME STREQUAL "yakkety") + SET (DEB_PLATFORMRELEASE "ubuntu16.10") + SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)") + SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") + SET (DEB_RULES_INSTALL_SYSTEMD + "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/") + SET (DEB_RULES_INSTALL_APPARMOR + "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_RULES_APPARMOR_LOAD + "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") + SET (DEB_SYSTEMD_SERVICE_NAME "mysql") + SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --no-enable --name=mysql") + SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade") + SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start") + SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_SERVICE_SERVER_EXECPRE + "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre") + SET (DEB_SERVICE_SERVER_EXECPOST + "ExecStartPost=/usr/share/mysql/mysql-systemd-start post") + SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") + SET (DEB_STARTUP "SYSTEMD") +ELSEIF(DEB_CODENAME STREQUAL "zesty") + SET (DEB_PLATFORMRELEASE "ubuntu17.04") + SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)") + SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/") + SET (DEB_RULES_INSTALL_SYSTEMD + "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/") + SET (DEB_RULES_INSTALL_APPARMOR + "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_RULES_APPARMOR_LOAD + "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld") + SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql") + SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade") + SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start") + SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld") + SET (DEB_SERVICE_SERVER_EXECPRE + "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre") + SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld") +ELSE() + MESSAGE(STATUS + "Skipping deb packaging on unsupported platform ${DEB_CODENAME}.") + RETURN() +ENDIF() + +# All files are configured and copied to the debian/ directory, which is used +# by debuild to make the packages +# 5.7.11 builds out-of-source. Hack: have duplicate debian/ +SET (DEB_ROOT ${CMAKE_SOURCE_DIR}/packaging/deb-in) +FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/debian) +FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/debian) +FILE(GLOB_RECURSE SOURCEFILES RELATIVE "${DEB_ROOT}" "${DEB_ROOT}/*") +# Skip the copyright file from the "other" product type +LIST(REMOVE_ITEM SOURCEFILES "copyright.${DEB_REMOVEPATTERN}") +LIST(REMOVE_ITEM SOURCEFILES "CMakeLists.txt") +# Combine the list of all startup files to be included, +# skip Debian magical init files unless needed +IF(DEB_PRODUCTNAME STREQUAL "wsrep") + SET(COMMON_WSREP_CONFLICTS "mysql-common (>= 5.7)") + LIST(REMOVE_ITEM SOURCEFILES "mysql-common.install.in") + LIST(REMOVE_ITEM SOURCEFILES "mysql-common.dirs.in") + LIST(REMOVE_ITEM SOURCEFILES "mysql-common.postinst.in") + LIST(REMOVE_ITEM SOURCEFILES "mysql-common.postrm.in") +ENDIF() +IF(DEB_STARTUP MATCHES ".*SYSV.*") + SET (DEB_FILES_STARTUP ${FILES_STARTUP_SYSV}) +ELSE() + LIST(REMOVE_ITEM SOURCEFILES + "mysql-packagesource-server-SERIES.mysql.init.in") +ENDIF() +IF(DEB_STARTUP MATCHES ".*SYSTEMD.*") + SET (DEB_FILES_STARTUP + ${DEB_FILES_STARTUP} + ${FILES_STARTUP_SYSTEMD}) +ELSE() + LIST(REMOVE_ITEM SOURCEFILES + "mysql-packagesource-server-SERIES.mysql.service.in") +ENDIF() +# Don't install systemd file on systems without systemd +IF(DEB_INSTALL_SERVER_SYSTEMD STREQUAL "") + LIST(REMOVE_ITEM SOURCEFILES "mysql-packagesource-server.mysql.service.in") +ENDIF() + +FOREACH (SOURCEFILE ${SOURCEFILES}) + STRING(REGEX REPLACE "-packagesource-" "-${DEB_PRODUCTNAME}-" + TMPFILE ${SOURCEFILE}) + STRING(REGEX REPLACE "-SERIES" "${DEB_PRODUCTSERIES}" TMPFILE ${TMPFILE}) + # Strip away the input file endings from the destination filenames + STRING(REGEX REPLACE ".in$" "" TMPFILE ${TMPFILE}) + STRING(REGEX REPLACE ".gpl$" "" TMPFILE ${TMPFILE}) + STRING(REGEX REPLACE ".com$" "" DESTFILE ${TMPFILE}) + CONFIGURE_FILE("${DEB_ROOT}/${SOURCEFILE}" + "${CMAKE_BINARY_DIR}/debian/${DESTFILE}" @ONLY) + CONFIGURE_FILE("${DEB_ROOT}/${SOURCEFILE}" + "${CMAKE_SOURCE_DIR}/debian/${DESTFILE}" @ONLY) +ENDFOREACH() +EXECUTE_PROCESS( + COMMAND chmod +x ${CMAKE_BINARY_DIR}/debian/rules +) +IF(DEB_PRODUCTNAME STREQUAL "wsrep") +FILE(APPEND "${CMAKE_BINARY_DIR}/debian/control" " +Package: mysql-common +Architecture: any +Pre-depends: debconf (>= 0.2.17), + \${misc:Pre-Depends} +Multi-Arch: foreign +Depends: \${misc:Depends}, + \${shlibs:Depends}, + mysql-wsrep-common +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 and the MySQL database server. + This package is a dummy replacement for the case when using mysql WSREP + implementation to satisfy dependencies of other packages + like libmysqlclient18. It depends on any mysql-wsrep-common +") +ENDIF() diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/compat percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/compat --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/compat 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/compat 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +9 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/control.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/control.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/control.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/control.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,239 @@ +Source: mysql-@DEB_PRODUCTNAME@@DEB_PRODUCTSERIES@ +Maintainer: Codership Oy +Section: database +Priority: optional +Standards-Version: 3.9.6 +Homepage: http://galeracluster.com/ +Build-Depends: bison, + cmake, + debhelper (>= 9.0.0), + fakeroot, + libaio-dev[linux-any], + libmecab-dev, + libncurses5-dev (>= 5.0-6), + libnuma-dev, + lsb-release, + perl, + po-debconf, + psmisc, + quilt, + zlib1g-dev (>= 1:1.1.3-5), + @DEB_CONTROL_BDEPS@ + + +Package: mysql-server +Architecture: any +Depends: mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ (= ${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-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ +Architecture: any +Pre-depends: debconf (>= 0.2.17), adduser +Depends: mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@ (= ${binary:Version}), + mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${binary:Version}), + perl, + psmisc, + rsync, + socat, + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mysql-common (<< 5.6.35), mysql-@DEB_PRODUCTNAME@-client (<< 5.6) +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-@DEB_NOTPRODUCTNAME@-server, + @DEB_CONTROL_SERVER_CONFLICT_NDB@, + mariadb-server-5.5, mariadb-server-core-5.5, + mariadb-server-10.0, mariadb-server-core-10.0, + mariadb-server-10.1, mariadb-server-core-10.1, + mariadb-server-10.2, mariadb-server-core-10.2 +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-@DEB_PRODUCTNAME@-client (<< 5.6), + mysql-@DEB_NOTPRODUCTNAME@-server, + @DEB_CONTROL_SERVER_CONFLICT_NDB@, + mysql-common (<< 5.6.35) +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-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${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-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ +Architecture: any +Depends: mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@ (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Breaks: libmysqlclient-dev (<< 5.6.35), + mysql-common (<< 5.6.35) +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-@DEB_NOTPRODUCTNAME@-client, + @DEB_CONTROL_CLIENT_CONFLICT_NDB@, + mariadb-client-5.5, mariadb-client-core-5.5, + mariadb-client-10.0, mariadb-client-core-10.0, + mariadb-client-10.1, mariadb-client-core-10.1, + mariadb-client-10.2, mariadb-client-core-10.2 +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-@DEB_NOTPRODUCTNAME@-client, + @DEB_CONTROL_CLIENT_CONFLICT_NDB@, + mysql-common (<< 5.6.35), + libmysqlclient-dev (<< 5.6.35) +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-@DEB_PRODUCTNAME@-common, + ${misc:Depends}, + ${shlibs: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-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@ +Architecture: any +Pre-depends: debconf (>= 0.2.17), + ${misc:Pre-Depends} +Multi-Arch: foreign +Depends: ${misc:Depends}, + ${shlibs:Depends}, + mysql-common (= ${binary:Version}) +Conflicts: mysql, + mysql-server-5.6, mysql-server-core-5.6, + mysql-client-5.6, mysql-client-core-5.6, + mysql-server-5.7, mysql-server-core-5.7, + mysql-client-5.7, mysql-client-core-5.7, + mariadb-server-5.5, percona-xtradb-cluster-common-5.5, + mysql-@DEB_PRODUCTNAME@-common (<< 5.6.35), + mysql-@DEB_PRODUCTNAME@-common-5.6, mysql-@DEB_PRODUCTNAME@-common-5.5, + @COMMON_WSREP_CONFLICTS@ +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, + @COMMON_WSREP_CONFLICTS@, mysql-common +Provides: mysql-common, mysql-@DEB_PRODUCTNAME@-common +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 and the MySQL database server. + +Package: libmysqlclient-dev +Architecture: any +Section: libdevel +Depends: libmysqlclient18 (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +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: mysql-@DEB_PRODUCTNAME@@DEB_PRODUCTSERIES@ +Architecture: any +Depends: mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${binary:Version}), + mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ (= ${binary:Version}), + ${misc:Depends} +Description: Metapackage that installs mysql-wsrep client and server packages. + +Package: mysql-testsuite +Architecture: any +Depends: mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@ (= ${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-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@ +Architecture: any +Depends: mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${binary:Version}), + mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ (= ${binary:Version}), + libmysqlclient-dev, + python, + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mysql-@DEB_PRODUCTNAME@-server (<< 5.6.35), + mysql-@DEB_PRODUCTNAME@-client (<< 5.6.35) +Conflicts: mysql, + mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5, + mysql-testsuite-5.6, mysql-@DEB_NOTPRODUCTNAME@-test, + mariadb-test, mariadb-test-data +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-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@ +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. + +@DEB_NDB_CONTROL_EXTRAS@ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/copyright.com.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/copyright.com.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/copyright.com.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/copyright.com.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,64 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: @DEB_COPYRIGHT_UPSTREAMNAME@ +Upstream-Contact: MySQL Release Engineering +Source: http://dev.mysql.com/ + +Files: * +Copyright: 2000, 2016, Oracle and/or its affiliates. All rights reserved. +License: Commercial + This is a release of MySQL, a dual-license SQL database server. + For the avoidance of doubt, this particular copy of the software + is released under a commercial license and the GNU General Public + License does not apply. MySQL is brought to you by Oracle. + . + 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 + . + . + This software and related documentation are provided under a license + agreement containing restrictions on use and disclosure and are protected by + intellectual property laws. Except as expressly permitted in your license + agreement or allowed by law, you may not use, copy, reproduce, translate, + broadcast, modify, license, transmit, distribute, exhibit, perform, publish, + or display any part, in any form, or by any means. Reverse engineering, + disassembly, or decompilation of this software, unless required by law for + interoperability, is prohibited. + . + If this software or related documentation is delivered to the U.S. + Government or anyone licensing it on behalf of the U.S. Government, the + following notice is applicable: + . + U.S. GOVERNMENT RIGHTS Programs, software, databases, and related + documentation and technical data delivered to U.S. Government customers are + "commercial computer software" or "commercial technical data" pursuant to + the applicable Federal Acquisition Regulation and agency-specific + supplemental regulations. As such, the use, duplication, disclosure, + modification, and adaptation shall be subject to the restrictions and + license terms set forth in the applicable Government contract, and, to the + extent applicable by the terms of the Government contract, the additional + rights set forth in FAR 52.227-19, Commercial Computer Software License + (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA + 94065. + . + This software is developed for general use in a variety of information + management applications. It is not developed or intended for use in any + inherently dangerous applications, including applications which may create a + risk of personal injury. If you use this software in dangerous applications, + then you shall be responsible to take all appropriate fail-safe, backup, + redundancy, and other measures to ensure the safe use of this software. + Oracle Corporation and its affiliates disclaim any liability for any damages + caused by use of this software in dangerous applications. + . + Oracle is a registered trademark of Oracle Corporation and/or its + affiliates. Other names may be trademarks of their respective owners. + . + This software and documentation may provide access to or information on + content, products, and services from third parties. Oracle Corporation and + its affiliates are not responsible for and expressly disclaim all warranties + of any kind with respect to third-party content, products, and services. + Oracle Corporation and its affiliates will not be responsible for any loss, + costs, or damages incurred due to your access to or use of third-party + content, products, or services. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/copyright.gpl.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/copyright.gpl.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/copyright.gpl.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/copyright.gpl.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,41 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: @DEB_COPYRIGHT_UPSTREAMNAME@ +Upstream-Contact: MySQL Release Engineering +Source: http://dev.mysql.com/ + +Copyright: 2015, 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 + . + . + 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 + . + . + 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/@DEB_INSTALL_LICENSEFILE@'. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/apparmor-profile percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/apparmor-profile --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/apparmor-profile 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/apparmor-profile 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,68 @@ +#include + +/usr/sbin/mysqld { + #include + #include + #include + #include + #include + +# Allow system resource access + /sys/devices/system/cpu/ r, + /sys/devices/system/node/ r, + /sys/devices/system/node/** r, + /proc/*/status r, + capability sys_resource, + capability dac_override, + capability setuid, + capability setgid, + +# Allow network access + network tcp, + + /etc/hosts.allow r, + /etc/hosts.deny r, + +# Allow config access + /etc/mysql/** r, + +# Allow pid, socket, socket lock file access + /var/run/mysqld/mysqld.pid rw, + /var/run/mysqld/mysqld.sock rw, + /var/run/mysqld/mysqld.sock.lock rw, + /run/mysqld/mysqld.pid rw, + /run/mysqld/mysqld.sock rw, + /run/mysqld/mysqld.sock.lock 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 data files dir access + /var/lib/mysql-files/ r, + /var/lib/mysql-files/** rwk, + +# Allow keyring dir access + /var/lib/mysql-keyring/ r, + /var/lib/mysql-keyring/** rwk, + +# Allow log file access + /var/log/mysql/ r, + /var/log/mysql/** rw, + + # Site-specific additions and overrides. See local/README for details. + #include +} +# The above is taken from Oracle's 5.7.14, parts may be premature. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/conf.d/mysql.cnf percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/conf.d/mysql.cnf --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/conf.d/mysql.cnf 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/conf.d/mysql.cnf 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,22 @@ +# 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 +# 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 @PRODUCTNAMEC@ Client configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysql] diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/configure-symlinks percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/configure-symlinks --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/configure-symlinks 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/configure-symlinks 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +case "$1" in + install) + variant="$2" + my_cnf_path="$3" + update-alternatives --install /etc/mysql/my.cnf my.cnf "$my_cnf_path" 200 + ;; + remove) + variant="$2" + my_cnf_path="$3" + update-alternatives --remove my.cnf "$my_cnf_path" + ;; +esac diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/debian_create_root_user.sql percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/debian_create_root_user.sql --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/debian_create_root_user.sql 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/debian_create_root_user.sql 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,23 @@ +-- Get the hostname, if the hostname has any wildcard character like "_" or "%" +-- add escape character in front of wildcard character to convert "_" or "%" to +-- a plain character +SET @get_hostname= @@hostname; +SELECT REPLACE((SELECT REPLACE(@get_hostname,'_','\_')),'%','\%') INTO @current_hostname; + +-- Fill "user" table with default users allowing root access +-- from local machine if "user" table didn't exist before +CREATE TEMPORARY TABLE tmp_user LIKE user; +INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N'); +REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N' FROM dual WHERE LOWER( @current_hostname) != 'localhost'; +REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N'); +REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N'); +INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; +DROP TABLE tmp_user; + +CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv; +INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now()); +REPLACE INTO tmp_proxies_priv SELECT @current_hostname, 'root', '', '', TRUE, '', now() FROM DUAL WHERE LOWER (@current_hostname) != 'localhost'; +INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0; +DROP TABLE tmp_proxies_priv; +FLUSH PRIVILEGES; + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/debian-start percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/debian-start --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/debian-start 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/debian-start 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,32 @@ +#!/bin/bash +# +# This script is executed by "/etc/init.d/mysql" on every (re)start. +# +# Changes to this file will be preserved when updating the Debian package. +# + +source /usr/share/mysql/debian-start.inc.sh + +MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf" +MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" +MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf" +MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf" +MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables" +MYCHECK_PARAMS="--all-databases --fast --silent" +MYCHECK_RCPT="root" + +# The following commands should be run when the server is up but in background +# where they do not block the server start and in one shell instance so that +# they run sequentially. They are supposed not to echo anything to stdout. +# If you want to disable the check for crashed tables comment +# "check_for_crashed_tables" out. +# (There may be no output to stdout inside the background process!) +echo "Checking for tables which need an upgrade, are corrupt or were " +echo "not closed cleanly." +( + upgrade_system_tables_if_necessary; + check_root_accounts; + check_for_crashed_tables; +) >&2 & + +exit 0 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/debian-start.inc.sh percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/debian-start.inc.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/debian-start.inc.sh 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/debian-start.inc.sh 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,72 @@ +#!/bin/bash +# +# This file is included by /etc/mysql/debian-start +# + +## Check all unclosed tables. +# - Requires the server to be up. +# - Is supposed to run silently in background. +function check_for_crashed_tables() { + set -e + set -u + + # But do it in the background to not stall the boot process. + logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables" + + # Checking for $? is unreliable so the size of the output is checked. + # Some table handlers like HEAP do not support CHECK TABLE. + tempfile=`tempfile` + # We have to use xargs in this case, because a for loop barfs on the + # spaces in the thing to be looped over. + LC_ALL=C $MYSQL --skip-column-names --batch -e ' + select concat('\''select count(*) into @discard from `'\'', + TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'') + from information_schema.TABLES where ENGINE='\''MyISAM'\' | \ + xargs -i $MYSQL --skip-column-names --silent --batch \ + --force -e "{}" >$tempfile + if [ -s $tempfile ]; then + ( + /bin/echo -e "\n" \ + "Improperly closed tables are also reported if clients are accessing\n" \ + "the tables *now*. A list of current connections is below.\n"; + $MYADMIN processlist status + ) >> $tempfile + # Check for presence as a dependency on mailx would require an MTA. + if [ -x /usr/bin/mailx ]; then + mailx -e -s"$MYCHECK_SUBJECT" $MYCHECK_RCPT < $tempfile + fi + (echo "$MYCHECK_SUBJECT"; cat $tempfile) | logger -p daemon.warn -i -t$0 + fi + rm $tempfile +} + +## Check for tables needing an upgrade. +# - Requires the server to be up. +# - Is supposed to run silently in background. +function upgrade_system_tables_if_necessary() { + set -e + set -u + + logger -p daemon.info -i -t$0 "Upgrading MySQL tables if necessary." + + # Filter all "duplicate column", "duplicate key" and "unknown column" + # errors as the script is designed to be idempotent. + LC_ALL=C $MYUPGRADE \ + 2>&1 \ + | egrep -v '^(1|@had|ERROR (1054|1060|1061))' \ + | logger -p daemon.warn -i -t$0 +} + +## Check for the presence of both, root accounts with and without password. +# This might have been caused by a bug related to mysql_install_db (#418672). +function check_root_accounts() { + set -e + set -u + + logger -p daemon.info -i -t$0 "Checking for insecure root accounts." + + ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='';" | $MYSQL --skip-column-names ) + if [ "$ret" -ne "0" ]; then + logger -p daemon.warn -i -t$0 "WARNING: mysql.user contains $ret root accounts without password!" + fi +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/Docs__Images__Makefile.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/Docs__Images__Makefile.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/Docs__Images__Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/Docs__Images__Makefile.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,6 @@ +all: + +distclean: + -rm -f Makefile + +.PHONY: all distclean clean install check diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/Docs__Makefile.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/Docs__Makefile.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/Docs__Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/Docs__Makefile.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,6 @@ +all: + +distclean: + -rm -f Makefile + +.PHONY: all distclean clean install check diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/echo_stderr percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/echo_stderr --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/echo_stderr 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/echo_stderr 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,2 @@ +#!/bin/bash +echo "$*" 1>&2 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/innotop/changelog.innotop percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/innotop/changelog.innotop --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/innotop/changelog.innotop 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/innotop/changelog.innotop 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,357 @@ +Changelog for innotop: + +2009-03-09: version 1.7.1 + + Changes: + * Don't display the CXN column if only one connection is active in + the current view + + Bugs fixed: + * fixed bug where trying to aggregate the time column would result + in a crash if the time column had an undef value in it, which is + the case when a thread is in the 'Connect' state + * updated innotop.spec file to reflect current version + +2009-02-23: version 1.7.0 + + Changes: + * supports a central config (/etc/innotop/innotop.conf) + * changed the default home directory config to ~/.innotop/innotop.conf + (away from .ini) + * embedded InnoDBParser.pm into innotop so it can be run with no + installation + * no longer writes a new config file by default + * added --skipcentral (skip reading central config) and --write (write + a config if none were loaded at start-up) + * if no config file is loaded, connect to a MySQL database on + localhost using mysql_read_default_group=client + * embedded maatkit's DSNParser.pm and added support for --user, + --password, --host, --port + * changed default mode from T (InnoDB Transactions) to Q (Query List) + * in addition to connected threads, now displays running and cached + threads in statusbar + * don't load connections from a config file if any DSN information or + a username or password is specified on the command-line + + Bugs fixed: + * fixed bug preventing utilization of command-line options that + override default config settings if no config file was loaded + * fixed a bug where migrating from an old version of the config will + delete ~/innotop.ini, if it exists. Now uses File::Temp::tempfile(). + +2007-11-09: version 1.6.0 + + * S mode crashed on non-numeric values. + * New user-defined columns crashed upon restart. + * Added --color option to control terminal coloring. + +2007-09-18: version 1.5.2 + + * Added the ability to monitor InnoDB status from a file. + * Changed W mode to L mode; it monitors all locks, not just lock waits. + +2007-09-16: version 1.5.1 + + * Added C (Command Summary) mode. + * Fixed a bug in the 'avg' aggregate function. + +2007-09-10: version 1.5.0 + + Changes: + * Added plugin functionality. + * Added group-by functionality. + * Moved the configuration file to a directory. + * Enhanced filtering and sorting on pivoted tables. + * Many small bug fixes. + +2007-07-16: version 1.4.3 + + Changes: + * Added standard --version command-line option + * Changed colors to cyan instead of blue; more visible on dark terminals. + * Added information to the filter-choosing dialog. + * Added column auto-completion when entering a filter expression. + * Changed Term::ReadKey from optional to mandatory. + * Clarified username in password prompting. + * Ten thousand words of documentation! + + Bugs fixed: + * innotop crashed in W mode when InnoDB status data was truncated. + * innotop didn't display errors in tables if debug was enabled. + * The colored() subroutine wasn't being created in non-interactive mode. + * Don't prompt to save password except the first time. + +2007-05-03: version 1.4.2 + + This version contains all changes to the trunk until revision 239; some + changes in revisions 240:250 are included. + + MAJOR CHANGES: + + * Quick-filters to easily filter any column in any display + * Compatibility with MySQL 3.23 through 6.0 + * Improved error handling when a server is down, permissions denied, etc + * Use additional SHOW INNODB STATUS information in 5.1.x + * Make all modes use tables consistently, so they can all be edited, + filtered, colored and sorted consistently + * Combine V, G and S modes into S mode, with v, g, and s hot-keys + * Let DBD driver read MySQL option files; permit connections without + user/pass/etc + * Compile SQL-like expressions into Perl subroutines; eliminate need to + know Perl + * Do not save all config data to config file, only save user's customizations + * Rewritten and improved command-line option handling + * Added --count, --delay, and other command-line options to support + run-and-exit operation + * Improve built-in variable sets + * Improve help screen with three-part balanced-column layout + * Simplify table-editor and improve hotkey support + * Require Perl to have high-resolution time support (Time::HiRes) + * Help the user choose a query to analyze or kill + * Enable EXPLAIN, show-full-query in T mode just like Q mode + * Let data-extraction access current, previous and incremental data sets + all at once + + MINOR CHANGES: + + * Column stabilizing for Q mode + * New color rules for T, Q, W modes + * Apply slave I/O filter to Q mode + * Improve detection of server version and other meta-data + * Make connection timeout a config variable + * Improve cross-version-compatible SQL syntax + * Get some information from the DBD driver instead of asking MySQL for it + * Improved error messages + * Improve server group creation/editing + * Improve connection/thread killing + * Fix broken key bindings and restore previously mapped hot-keys for + choosing columns + * Some documentation updates (but not nearly enough) + * Allow the user to specify graphing char in S mode (formerly G mode) + * Allow easy switching between variable sets in S mode + * Bind 'n' key globally to choose the 'next' server connection + * Bind '%' key globally to filter displayed tables + * Allow aligning columns on the decimal place for easy readability + * Add hide_hdr config variable to hide column headers in tables + * Add a feature to smartly run PURGE MASTER LOGS in Replication mode + * Enable debug mode as a globally configurable variable + * Improve error messages when an expression or filter doesn't compile or has + a run-time error; die on error when debug is enabled + * Allow user-configurable delays after executing SQL (to let the server + settle down before taking another measurement) + * Add an expression to show how long until a transaction is finished + * Add skip_innodb as a global config variable + * Add '%' after percentages to help disambiguate (user-configurable) + * Add column to M mode to help see how fast slave is catching up to master + + BUG FIXES: + + * T and W modes had wrong value for wait_status column + * Error tracking on connections didn't reset when the connection recovered + * wait_timeout on connections couldn't be set before MySQL 4.0.3 + * There was a crash on 3.23 when wiping deadlocks + * Lettercase changes in some result sets (SHOW MASTER/SLAVE STATUS) between + MySQL versions crashed innotop + * Inactive connections crashed innotop upon access to DBD driver + * set_precision did not respect user defaults for number of digits + * --inc command-line option could not be negated + * InnoDB status parsing was not always parsing all needed information + * S mode (formerly G mode) could crash trying to divide non-numeric data + * M table didn't show Slave_open_temp_tables variable; incorrect lettercase + * DBD drivers with broken AutoCommit would crash innotop + * Some key bindings had incorrect labels + * Some config-file loading routines could load data for things that didn't + exist + * Headers printed too often in S mode + * High-resolution time was not used even when the user had it + * Non-interactive mode printed blank lines sometimes + * Q-mode header and statusbar showed different QPS numbers + * Formulas for key-cache and query-cache hit ratios were wrong + * Mac OS "Darwin" machines were mis-identified as Microsoft Windows + * Some multiplications crashed when given undefined input + * The commify transformation did not check its input and could crash + * Specifying an invalid mode on the command line or config file could crash + innotop + +2007-03-29: version 1.4.1 + + * More tweaks to display of connection errors. + * Fixed a problem with skip-innodb in MySQL 5.1. + * Fix a bug with dead connections in single-connection mode. + * Fix a regex to allow parsing more data from truncated deadlocks. + * Don't load active cxns from the config file if the cxn isn't defined. + +2007-03-03: version 1.4.0 + + * Further tweak error handling and display of connection errors + * More centralization of querying + * Fix forking so it doesn't kill all database connections + * Allow user to run innotop without permissions for GLOBAL variables and status + +2007-02-11: version 1.3.6 + + * Handle some connection failures so innotop doesn't crash because of one server. + * Enable incremental display in more modes. + * Tweaks to colorizing, color editor, and default color rules. + * Tweaks to default sorting rules. + * Use prepared statements for efficiency. + * Bug fixes and code cleanups. + * Data storage is keyed on clock ticks now. + +2007-02-03: version 1.3.5 + + * Bug fixes. + * More tools for editing configuration from within innotop. + * Filters and transformations are constrained to valid values. + * Support for colorizing rows. + * Sorting by multiple columns. + * Compress headers when display is very wide. + * Stabilize and limit column widths. + * Check config file formats when upgrading so upgrades go smoothly. + * Make D mode handle many connections at once. + * Extract simple expressions from data sets in column src property. + This makes innotop more awk-ish. + +2007-01-16: version 1.3 + + * Readline support. + * Can be used unattended, or in a pipe-and-filter mode + where it outputs tab-separated data to standard output. + * You can specify a config file on the command line. + Config files can be marked read-only. + * Monitor multiple servers simultaneously. + * Server groups to help manage many servers conveniently. + * Monitor master/slave status, and control slaves. + * Columns can have user-defined expressions as their data sources. + * Better configuration tools. + * InnoDB status information is merged into SHOW VARIABLES and + SHOW STATUS information, so you can access it all together. + * High-precision time support in more places. + * Lots of tweaks to make things display more readably and compactly. + * Column transformations and filters. + +2007-01-16: version 1.0.1 + * NOTE: innotop is now hosted at Sourceforge, in Subversion not CVS. + The new project homepage is http://sourceforge.net/projects/innotop/ + * Tweak default T/Q mode sort columns to match what people expect. + * Fix broken InnoDBParser.pm documentation (and hence man page). + +2007-01-06: version 1.0 + * NOTE: innotop is now hosted at Sourceforge, in Subversion not CVS. + The new project homepage is http://sourceforge.net/projects/innotop/ + * Prevent control characters from freaking terminal out. + * Set timeout to keep busy servers from closing connection. + * There is only one InnoDB insert buffer. + * Make licenses clear and consistent. + +2006-11-14: innotop 0.1.160, InnoDBParser version 1.69 + * Support for ANSI color on Microsoft Windows (more readable, compact + display; thanks Gisbert W. Selke). + * Better handling of $ENV{HOME} on Windows. + * Added a LICENSE file to the package as per Gentoo bug: + http://bugs.gentoo.org/show_bug.cgi?id=147600 + +2006-11-11: innotop 0.1.157, InnoDBParser version 1.69 + * Add Microsoft Windows support. + +2006-10-19: innotop 0.1.154, InnoDBParser version 1.69 + * Add O (Open Tables) mode + * Add some more checks to handle incomplete InnoDB status information + +2006-09-30: innotop 0.1.152, InnoDBParser version 1.69 + * Figured out what was wrong with package $VERSION variable: it wasn't + after the package declaration! + +2006-09-28: innotop 0.1.152, InnoDBParser version 1.67 + * Make more efforts towards crash-resistance and tolerance of completely + messed-up inputs. If innotop itself is broken, it is now much harder to + tell, because it just keeps on running without complaining. + * Fix a small bug parsing out some information and displaying it. + +2006-09-05: innotop 0.1.149, InnoDBParser version 1.64 + * Try to find and eliminate any parsing code that assumes pattern matches + will succeed. + +2006-09-05: innotop 0.1.149, InnoDBParser version 1.62 + * Make innotop crash-resistant, so I can declare it STABLE finally. + * Instead of using SQL conditional comments, detect MySQL version. + +2006-08-22: innotop 0.1.147, InnoDBParser version 1.60 + * Fix some innotop bugs with undefined values, bad formatting etc. + +2006-08-19: innotop 0.1.146, InnoDBParser version 1.60 + * Make innotop handle some unexpected NULL values in Q mode. + * Add OS wait information to W mode, so it is now "everything that waits." + * Center section captions better. + * Make R mode more readable and compact. + * Make InnoDBParser parse lock waits even when they've been waiting 0 secs. + +2006-08-12: innotop 0.1.139, InnoDBParser version 1.59 + * Add more documentation + * Tweak V mode to show more info in less space. + * Fix a bug in G mode. + +2006-08-10: innotop 0.1.132, InnoDBParser version 1.58 + * Handle yet more types of FK error... it will never end! + * Handle some special cases when DEADLOCK info truncated + * Add a bit more FK info to F mode in innotop + * More tests added to the test suite + +2006-08-07: innotop 0.1.131, InnoDBParser version 1.55 + * Fix another issue with configuration + * Handle another type of FK error + +2006-08-03: innotop 0.1.130, InnoDBParser version 1.54 + * Fix an issue loading config file + * Add heap_no to 'D' (InnoDB Deadlock) mode to ease deadlock debugging. + +2006-08-02: innotop 0.1.128, InnoDBParser version 1.54 + * Parse lock wait information from the TRANSACTION section. + * Even more OS-specific parsing... pain in the butt... + * Add 'W' (InnoDB Lock Wait) mode. + * Fix some minor display issues with statusbar. + +2006-08-02: innotop 0.1.125, InnoDBParser version 1.50 + * Don't try to get references to Perl built-in functions like time() + * Handle more OS-specific variations of InnoDB status text + * Add some more information to various places in innotop + +2006-08-01: innotop 0.1.123, InnoDBParser version 1.47 + + * Enhance S and G modes: clear screen and re-print headers + * Don't crash when deadlock data is truncated + * Make Analyze mode say how to get back to whatever you came from + * Display 'nothing to display' when there is nothing + * Add ability to read InnoDB status text from a file (mostly helps test) + * Add table of Wait Array Information in Row Op/Semaphore mode + * Add table of lock information in InnoDB deadlock mode + * Ensure new features in upgrades don't get masked by existing config files + * Tweak default column choices for T mode + * Enhance foreign key parsing + * Enhance physical record and data tuple parsing + * Enhance lock parsing (handle old-style and new-style formats) + +2006-07-24: innotop 0.1.112, InnoDBParser version 1.36 + + * InnoDBParser enhancements for FK error messages. + * A fix to innotop to prevent it from crashing while trying to display a FK + error message. + * Some minor cosmetic changes to number formatting in innotop. + +2006-07-22: innotop 0.1.106, InnoDBParser version 1.35 + + * InnoDBParser is much more complete and accurate. + * Tons of bug fixes. + * Add partitions to EXPLAIN mode. + * Enhance Q mode header, add T mode header. + * Share some configuration variables across modes. + * Add formatted time columns to Q, T modes. + * Add command-line argument parsing. + * Turn off echo when asking for password. + * Add option to specify port when connecting. + * Let display-optimized-query display multiple notes. + * Lots of small improvements, such as showing more info in statusbar. + +2006-07-02: innotop 0.1.74, InnoDBParser version 1.24 + + * Initial release for public consumption. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/innotop/innotop percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/innotop/innotop --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/innotop/innotop 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/innotop/innotop 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,10946 @@ +#!/usr/bin/perl + +# vim: tw=160:nowrap:expandtab:tabstop=3:shiftwidth=3:softtabstop=3 + +# This program is copyright (c) 2006 Baron Schwartz, baron at xaprb dot com. +# Feedback and improvements are gratefully received. +# +# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# This 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; OR the Perl Artistic License. On UNIX and similar +# systems, you can issue `man perlgpl' or `man perlartistic' to read these + +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place, Suite 330, Boston, MA 02111-1307 USA + +use strict; +use warnings FATAL => 'all'; + +our $VERSION = '1.7.1'; + +# Find the home directory; it's different on different OSes. +our $homepath = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.'; + +# Configuration files +our $default_home_conf = "$homepath/.innotop/innotop.conf"; +our $default_central_conf = "/etc/innotop/innotop.conf"; +our $conf_file = ""; + +## Begin packages ## + +package DSNParser; + +use DBI; +use Data::Dumper; +$Data::Dumper::Indent = 0; +$Data::Dumper::Quotekeys = 0; +use English qw(-no_match_vars); + +use constant MKDEBUG => $ENV{MKDEBUG}; + +# Defaults are built-in, but you can add/replace items by passing them as +# hashrefs of {key, desc, copy, dsn}. The desc and dsn items are optional. +# You can set properties with the prop() sub. Don't set the 'opts' property. +sub new { + my ( $class, @opts ) = @_; + my $self = { + opts => { + A => { + desc => 'Default character set', + dsn => 'charset', + copy => 1, + }, + D => { + desc => 'Database to use', + dsn => 'database', + copy => 1, + }, + F => { + desc => 'Only read default options from the given file', + dsn => 'mysql_read_default_file', + copy => 1, + }, + h => { + desc => 'Connect to host', + dsn => 'host', + copy => 1, + }, + p => { + desc => 'Password to use when connecting', + dsn => 'password', + copy => 1, + }, + P => { + desc => 'Port number to use for connection', + dsn => 'port', + copy => 1, + }, + S => { + desc => 'Socket file to use for connection', + dsn => 'mysql_socket', + copy => 1, + }, + u => { + desc => 'User for login if not current user', + dsn => 'user', + copy => 1, + }, + }, + }; + foreach my $opt ( @opts ) { + MKDEBUG && _d('Adding extra property ' . $opt->{key}); + $self->{opts}->{$opt->{key}} = { desc => $opt->{desc}, copy => $opt->{copy} }; + } + return bless $self, $class; +} + +# Recognized properties: +# * autokey: which key to treat a bareword as (typically h=host). +# * dbidriver: which DBI driver to use; assumes mysql, supports Pg. +# * required: which parts are required (hashref). +# * setvars: a list of variables to set after connecting +sub prop { + my ( $self, $prop, $value ) = @_; + if ( @_ > 2 ) { + MKDEBUG && _d("Setting $prop property"); + $self->{$prop} = $value; + } + return $self->{$prop}; +} + +sub parse { + my ( $self, $dsn, $prev, $defaults ) = @_; + if ( !$dsn ) { + MKDEBUG && _d('No DSN to parse'); + return; + } + MKDEBUG && _d("Parsing $dsn"); + $prev ||= {}; + $defaults ||= {}; + my %given_props; + my %final_props; + my %opts = %{$self->{opts}}; + my $prop_autokey = $self->prop('autokey'); + + # Parse given props + foreach my $dsn_part ( split(/,/, $dsn) ) { + if ( my ($prop_key, $prop_val) = $dsn_part =~ m/^(.)=(.*)$/ ) { + # Handle the typical DSN parts like h=host, P=3306, etc. + $given_props{$prop_key} = $prop_val; + } + elsif ( $prop_autokey ) { + # Handle barewords + MKDEBUG && _d("Interpreting $dsn_part as $prop_autokey=$dsn_part"); + $given_props{$prop_autokey} = $dsn_part; + } + else { + MKDEBUG && _d("Bad DSN part: $dsn_part"); + } + } + + # Fill in final props from given, previous, and/or default props + foreach my $key ( keys %opts ) { + MKDEBUG && _d("Finding value for $key"); + $final_props{$key} = $given_props{$key}; + if ( !defined $final_props{$key} + && defined $prev->{$key} && $opts{$key}->{copy} ) + { + $final_props{$key} = $prev->{$key}; + MKDEBUG && _d("Copying value for $key from previous DSN"); + } + if ( !defined $final_props{$key} ) { + $final_props{$key} = $defaults->{$key}; + MKDEBUG && _d("Copying value for $key from defaults"); + } + } + + # Sanity check props + foreach my $key ( keys %given_props ) { + die "Unrecognized DSN part '$key' in '$dsn'\n" + unless exists $opts{$key}; + } + if ( (my $required = $self->prop('required')) ) { + foreach my $key ( keys %$required ) { + die "Missing DSN part '$key' in '$dsn'\n" unless $final_props{$key}; + } + } + + return \%final_props; +} + +sub as_string { + my ( $self, $dsn ) = @_; + return $dsn unless ref $dsn; + return join(',', + map { "$_=" . ($_ eq 'p' ? '...' : $dsn->{$_}) } + grep { defined $dsn->{$_} && $self->{opts}->{$_} } + sort keys %$dsn ); +} + +sub usage { + my ( $self ) = @_; + my $usage + = "DSN syntax is key=value[,key=value...] Allowable DSN keys:\n" + . " KEY COPY MEANING\n" + . " === ==== =============================================\n"; + my %opts = %{$self->{opts}}; + foreach my $key ( sort keys %opts ) { + $usage .= " $key " + . ($opts{$key}->{copy} ? 'yes ' : 'no ') + . ($opts{$key}->{desc} || '[No description]') + . "\n"; + } + if ( (my $key = $self->prop('autokey')) ) { + $usage .= " If the DSN is a bareword, the word is treated as the '$key' key.\n"; + } + return $usage; +} + +# Supports PostgreSQL via the dbidriver element of $info, but assumes MySQL by +# default. +sub get_cxn_params { + my ( $self, $info ) = @_; + my $dsn; + my %opts = %{$self->{opts}}; + my $driver = $self->prop('dbidriver') || ''; + if ( $driver eq 'Pg' ) { + $dsn = 'DBI:Pg:dbname=' . ( $info->{D} || '' ) . ';' + . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" } + grep { defined $info->{$_} } + qw(h P)); + } + else { + $dsn = 'DBI:mysql:' . ( $info->{D} || '' ) . ';' + . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" } + grep { defined $info->{$_} } + qw(F h P S A)) + . ';mysql_read_default_group=client'; + } + MKDEBUG && _d($dsn); + return ($dsn, $info->{u}, $info->{p}); +} + + +# Fills in missing info from a DSN after successfully connecting to the server. +sub fill_in_dsn { + my ( $self, $dbh, $dsn ) = @_; + my $vars = $dbh->selectall_hashref('SHOW VARIABLES', 'Variable_name'); + my ($user, $db) = $dbh->selectrow_array('SELECT USER(), DATABASE()'); + $user =~ s/@.*//; + $dsn->{h} ||= $vars->{hostname}->{Value}; + $dsn->{S} ||= $vars->{'socket'}->{Value}; + $dsn->{P} ||= $vars->{port}->{Value}; + $dsn->{u} ||= $user; + $dsn->{D} ||= $db; +} + +sub get_dbh { + my ( $self, $cxn_string, $user, $pass, $opts ) = @_; + $opts ||= {}; + my $defaults = { + AutoCommit => 0, + RaiseError => 1, + PrintError => 0, + mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/ ? 1 : 0), + }; + @{$defaults}{ keys %$opts } = values %$opts; + my $dbh; + my $tries = 2; + while ( !$dbh && $tries-- ) { + eval { + MKDEBUG && _d($cxn_string, ' ', $user, ' ', $pass, ' {', + join(', ', map { "$_=>$defaults->{$_}" } keys %$defaults ), '}'); + $dbh = DBI->connect($cxn_string, $user, $pass, $defaults); + # Immediately set character set and binmode on STDOUT. + if ( my ($charset) = $cxn_string =~ m/charset=(\w+)/ ) { + my $sql = "/*!40101 SET NAMES $charset*/"; + MKDEBUG && _d("$dbh: $sql"); + $dbh->do($sql); + MKDEBUG && _d('Enabling charset for STDOUT'); + if ( $charset eq 'utf8' ) { + binmode(STDOUT, ':utf8') + or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR"; + } + else { + binmode(STDOUT) or die "Can't binmode(STDOUT): $OS_ERROR"; + } + } + }; + if ( !$dbh && $EVAL_ERROR ) { + MKDEBUG && _d($EVAL_ERROR); + if ( $EVAL_ERROR =~ m/not a compiled character set|character set utf8/ ) { + MKDEBUG && _d("Going to try again without utf8 support"); + delete $defaults->{mysql_enable_utf8}; + } + if ( !$tries ) { + die $EVAL_ERROR; + } + } + } + # If setvars exists and it's MySQL connection, set them + my $setvars = $self->prop('setvars'); + if ( $cxn_string =~ m/mysql/i && $setvars ) { + my $sql = "SET $setvars"; + MKDEBUG && _d("$dbh: $sql"); + eval { + $dbh->do($sql); + }; + if ( $EVAL_ERROR ) { + MKDEBUG && _d($EVAL_ERROR); + } + } + MKDEBUG && _d('DBH info: ', + $dbh, + Dumper($dbh->selectrow_hashref( + 'SELECT DATABASE(), CONNECTION_ID(), VERSION()/*!50038 , @@hostname*/')), + ' Connection info: ', ($dbh->{mysql_hostinfo} || 'undef'), + ' Character set info: ', + Dumper($dbh->selectall_arrayref( + 'SHOW VARIABLES LIKE "character_set%"', { Slice => {}})), + ' $DBD::mysql::VERSION: ', $DBD::mysql::VERSION, + ' $DBI::VERSION: ', $DBI::VERSION, + ); + return $dbh; +} + +# Tries to figure out a hostname for the connection. +sub get_hostname { + my ( $self, $dbh ) = @_; + if ( my ($host) = ($dbh->{mysql_hostinfo} || '') =~ m/^(\w+) via/ ) { + return $host; + } + my ( $hostname, $one ) = $dbh->selectrow_array( + 'SELECT /*!50038 @@hostname, */ 1'); + return $hostname; +} + +# Disconnects a database handle, but complains verbosely if there are any active +# children. These are usually $sth handles that haven't been finish()ed. +sub disconnect { + my ( $self, $dbh ) = @_; + MKDEBUG && $self->print_active_handles($dbh); + $dbh->disconnect; +} + +sub print_active_handles { + my ( $self, $thing, $level ) = @_; + $level ||= 0; + printf("# Active %sh: %s %s %s\n", ($thing->{Type} || 'undef'), "\t" x $level, + $thing, (($thing->{Type} || '') eq 'st' ? $thing->{Statement} || '' : '')) + or die "Cannot print: $OS_ERROR"; + foreach my $handle ( grep {defined} @{ $thing->{ChildHandles} } ) { + $self->print_active_handles( $handle, $level + 1 ); + } +} + +sub _d { + my ($package, undef, $line) = caller 0; + @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; } + map { defined $_ ? $_ : 'undef' } + @_; + # Use $$ instead of $PID in case the package + # does not use English. + print "# $package:$line $$ ", @_, "\n"; +} + +1; + +package InnoDBParser; + +use Data::Dumper; +$Data::Dumper::Sortkeys = 1; +use English qw(-no_match_vars); +use List::Util qw(max); + +# Some common patterns +my $d = qr/(\d+)/; # Digit +my $f = qr/(\d+\.\d+)/; # Float +my $t = qr/(\d+ \d+)/; # Transaction ID +my $i = qr/((?:\d{1,3}\.){3}\d+)/; # IP address +my $n = qr/([^`\s]+)/; # MySQL object name +my $w = qr/(\w+)/; # Words +my $fl = qr/([\w\.\/]+) line $d/; # Filename and line number +my $h = qr/((?:0x)?[0-9a-f]*)/; # Hex +my $s = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp + +# If you update this variable, also update the SYNOPSIS in the pod. +my %innodb_section_headers = ( + "TRANSACTIONS" => "tx", + "BUFFER POOL AND MEMORY" => "bp", + "SEMAPHORES" => "sm", + "LOG" => "lg", + "ROW OPERATIONS" => "ro", + "INSERT BUFFER AND ADAPTIVE HASH INDEX" => "ib", + "FILE I/O" => "io", + "LATEST DETECTED DEADLOCK" => "dl", + "LATEST FOREIGN KEY ERROR" => "fk", +); + +my %parser_for = ( + tx => \&parse_tx_section, + bp => \&parse_bp_section, + sm => \&parse_sm_section, + lg => \&parse_lg_section, + ro => \&parse_ro_section, + ib => \&parse_ib_section, + io => \&parse_io_section, + dl => \&parse_dl_section, + fk => \&parse_fk_section, +); + +my %fk_parser_for = ( + Transaction => \&parse_fk_transaction_error, + Error => \&parse_fk_bad_constraint_error, + Cannot => \&parse_fk_cant_drop_parent_error, +); + +# A thread's proc_info can be at least 98 different things I've found in the +# source. Fortunately, most of them begin with a gerunded verb. These are +# the ones that don't. +my %is_proc_info = ( + 'After create' => 1, + 'Execution of init_command' => 1, + 'FULLTEXT initialization' => 1, + 'Reopen tables' => 1, + 'Repair done' => 1, + 'Repair with keycache' => 1, + 'System lock' => 1, + 'Table lock' => 1, + 'Thread initialized' => 1, + 'User lock' => 1, + 'copy to tmp table' => 1, + 'discard_or_import_tablespace' => 1, + 'end' => 1, + 'got handler lock' => 1, + 'got old table' => 1, + 'init' => 1, + 'key cache' => 1, + 'locks' => 1, + 'malloc' => 1, + 'query end' => 1, + 'rename result table' => 1, + 'rename' => 1, + 'setup' => 1, + 'statistics' => 1, + 'status' => 1, + 'table cache' => 1, + 'update' => 1, +); + +sub new { + bless {}, shift; +} + +# Parse the status and return it. +# See srv_printf_innodb_monitor in innobase/srv/srv0srv.c +# Pass in the text to parse, whether to be in debugging mode, which sections +# to parse (hashref; if empty, parse all), and whether to parse full info from +# locks and such (probably shouldn't unless you need to). +sub parse_status_text { + my ( $self, $fulltext, $debug, $sections, $full ) = @_; + + die "I can't parse undef" unless defined $fulltext; + $fulltext =~ s/[\r\n]+/\n/g; + + $sections ||= {}; + die '$sections must be a hashref' unless ref($sections) eq 'HASH'; + + my %innodb_data = ( + got_all => 0, # Whether I was able to get the whole thing + ts => '', # Timestamp the server put on it + last_secs => 0, # Num seconds the averages are over + sections => {}, # Parsed values from each section + ); + + if ( $debug ) { + $innodb_data{'fulltext'} = $fulltext; + } + + # Get the most basic info about the status: beginning and end, and whether + # I got the whole thing (if there has been a big deadlock and there are + # too many locks to print, the output might be truncated) + my ( $time_text ) = $fulltext =~ m/^$s INNODB MONITOR OUTPUT$/m; + $innodb_data{'ts'} = [ parse_innodb_timestamp( $time_text ) ]; + $innodb_data{'timestring'} = ts_to_string($innodb_data{'ts'}); + ( $innodb_data{'last_secs'} ) = $fulltext + =~ m/Per second averages calculated from the last $d seconds/; + + ( my $got_all ) = $fulltext =~ m/END OF INNODB MONITOR OUTPUT/; + $innodb_data{'got_all'} = $got_all || 0; + + # Split it into sections. Each section begins with + # ----- + # LABEL + # ----- + my %innodb_sections; + my @matches = $fulltext + =~ m#\n(---+)\n([A-Z /]+)\n\1\n(.*?)(?=\n(---+)\n[A-Z /]+\n\4\n|$)#gs; + while ( my ( $start, $name, $text, $end ) = splice(@matches, 0, 4) ) { + $innodb_sections{$name} = [ $text, $end ? 1 : 0 ]; + } + # The Row Operations section is a special case, because instead of ending + # with the beginning of another section, it ends with the end of the file. + # So this section is complete if the entire file is complete. + $innodb_sections{'ROW OPERATIONS'}->[1] ||= $innodb_data{'got_all'}; + + # Just for sanity's sake, make sure I understand what to do with each + # section + eval { + foreach my $section ( keys %innodb_sections ) { + my $header = $innodb_section_headers{$section}; + die "Unknown section $section in $fulltext\n" + unless $header; + $innodb_data{'sections'}->{ $header } + ->{'fulltext'} = $innodb_sections{$section}->[0]; + $innodb_data{'sections'}->{ $header } + ->{'complete'} = $innodb_sections{$section}->[1]; + } + }; + if ( $EVAL_ERROR ) { + _debug( $debug, $EVAL_ERROR); + } + + # ################################################################ + # Parse the detailed data out of the sections. + # ################################################################ + eval { + foreach my $section ( keys %parser_for ) { + if ( defined $innodb_data{'sections'}->{$section} + && (!%$sections || (defined($sections->{$section} && $sections->{$section})) )) { + $parser_for{$section}->( + $innodb_data{'sections'}->{$section}, + $innodb_data{'sections'}->{$section}->{'complete'}, + $debug, + $full ) + or delete $innodb_data{'sections'}->{$section}; + } + else { + delete $innodb_data{'sections'}->{$section}; + } + } + }; + if ( $EVAL_ERROR ) { + _debug( $debug, $EVAL_ERROR); + } + + return \%innodb_data; +} + +# Parses the status text and returns it flattened out as a single hash. +sub get_status_hash { + my ( $self, $fulltext, $debug, $sections, $full ) = @_; + + # Parse the status text... + my $innodb_status + = $self->parse_status_text($fulltext, $debug, $sections, $full ); + + # Flatten the hierarchical structure into a single list by grabbing desired + # sections from it. + return + (map { 'IB_' . $_ => $innodb_status->{$_} } qw(timestring last_secs got_all)), + (map { 'IB_bp_' . $_ => $innodb_status->{'sections'}->{'bp'}->{$_} } + qw( writes_pending buf_pool_hit_rate total_mem_alloc buf_pool_reads + awe_mem_alloc pages_modified writes_pending_lru page_creates_sec + reads_pending pages_total buf_pool_hits writes_pending_single_page + page_writes_sec pages_read pages_written page_reads_sec + writes_pending_flush_list buf_pool_size add_pool_alloc + dict_mem_alloc pages_created buf_free complete )), + (map { 'IB_tx_' . $_ => $innodb_status->{'sections'}->{'tx'}->{$_} } + qw( num_lock_structs history_list_len purge_done_for transactions + purge_undo_for is_truncated trx_id_counter complete )), + (map { 'IB_ib_' . $_ => $innodb_status->{'sections'}->{'ib'}->{$_} } + qw( hash_table_size hash_searches_s non_hash_searches_s + bufs_in_node_heap used_cells size free_list_len seg_size inserts + merged_recs merges complete )), + (map { 'IB_lg_' . $_ => $innodb_status->{'sections'}->{'lg'}->{$_} } + qw( log_ios_done pending_chkp_writes last_chkp log_ios_s + log_flushed_to log_seq_no pending_log_writes complete )), + (map { 'IB_sm_' . $_ => $innodb_status->{'sections'}->{'sm'}->{$_} } + qw( wait_array_size rw_shared_spins rw_excl_os_waits mutex_os_waits + mutex_spin_rounds mutex_spin_waits rw_excl_spins rw_shared_os_waits + waits signal_count reservation_count complete )), + (map { 'IB_ro_' . $_ => $innodb_status->{'sections'}->{'ro'}->{$_} } + qw( queries_in_queue n_reserved_extents main_thread_state + main_thread_proc_no main_thread_id read_sec del_sec upd_sec ins_sec + read_views_open num_rows_upd num_rows_ins num_rows_read + queries_inside num_rows_del complete )), + (map { 'IB_fk_' . $_ => $innodb_status->{'sections'}->{'fk'}->{$_} } + qw( trigger parent_table child_index parent_index attempted_op + child_db timestring fk_name records col_name reason txn parent_db + type child_table parent_col complete )), + (map { 'IB_io_' . $_ => $innodb_status->{'sections'}->{'io'}->{$_} } + qw( pending_buffer_pool_flushes pending_pwrites pending_preads + pending_normal_aio_reads fsyncs_s os_file_writes pending_sync_ios + reads_s flush_type avg_bytes_s pending_ibuf_aio_reads writes_s + threads os_file_reads pending_aio_writes pending_log_ios os_fsyncs + pending_log_flushes complete )), + (map { 'IB_dl_' . $_ => $innodb_status->{'sections'}->{'dl'}->{$_} } + qw( timestring rolled_back txns complete )); + +} + +sub ts_to_string { + my $parts = shift; + return sprintf('%02d-%02d-%02d %02d:%02d:%02d', @$parts); +} + +sub parse_innodb_timestamp { + my $text = shift; + my ( $y, $m, $d, $h, $i, $s ) + = $text =~ m/^(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)$/; + die("Can't get timestamp from $text\n") unless $y; + $y += 2000; + return ( $y, $m, $d, $h, $i, $s ); +} + +sub parse_fk_section { + my ( $section, $complete, $debug, $full ) = @_; + my $fulltext = $section->{'fulltext'}; + + return 0 unless $fulltext; + + my ( $ts, $type ) = $fulltext =~ m/^$s\s+(\w+)/m; + $section->{'ts'} = [ parse_innodb_timestamp( $ts ) ]; + $section->{'timestring'} = ts_to_string($section->{'ts'}); + $section->{'type'} = $type; + + # Decide which type of FK error happened, and dispatch to the right parser. + if ( $type && $fk_parser_for{$type} ) { + $fk_parser_for{$type}->( $section, $complete, $debug, $fulltext, $full ); + } + + delete $section->{'fulltext'} unless $debug; + + return 1; +} + +sub parse_fk_cant_drop_parent_error { + my ( $section, $complete, $debug, $fulltext, $full ) = @_; + + # Parse the parent/child table info out + @{$section}{ qw(attempted_op parent_db parent_table) } = $fulltext + =~ m{Cannot $w table `(.*)/(.*)`}m; + @{$section}{ qw(child_db child_table) } = $fulltext + =~ m{because it is referenced by `(.*)/(.*)`}m; + + ( $section->{'reason'} ) = $fulltext =~ m/(Cannot .*)/s; + $section->{'reason'} =~ s/\n(?:InnoDB: )?/ /gm + if $section->{'reason'}; + + # Certain data may not be present. Make them '' if not present. + map { $section->{$_} ||= "" } + qw(child_index fk_name col_name parent_col); +} + +# See dict/dict0dict.c, function dict_foreign_error_report +# I don't care much about these. There are lots of different messages, and +# they come from someone trying to create a foreign key, or similar +# statements. They aren't indicative of some transaction trying to insert, +# delete or update data. Sometimes it is possible to parse out a lot of +# information about the tables and indexes involved, but often the message +# contains the DDL string the user entered, which is way too much for this +# module to try to handle. +sub parse_fk_bad_constraint_error { + my ( $section, $complete, $debug, $fulltext, $full ) = @_; + + # Parse the parent/child table and index info out + @{$section}{ qw(child_db child_table) } = $fulltext + =~ m{Error in foreign key constraint of table (.*)/(.*):$}m; + $section->{'attempted_op'} = 'DDL'; + + # FK name, parent info... if possible. + @{$section}{ qw(fk_name col_name parent_db parent_table parent_col) } + = $fulltext + =~ m/CONSTRAINT `?$n`? FOREIGN KEY \(`?$n`?\) REFERENCES (?:`?$n`?\.)?`?$n`? \(`?$n`?\)/; + + if ( !defined($section->{'fk_name'}) ) { + # Try to parse SQL a user might have typed in a CREATE statement or such + @{$section}{ qw(col_name parent_db parent_table parent_col) } + = $fulltext + =~ m/FOREIGN\s+KEY\s*\(`?$n`?\)\s+REFERENCES\s+(?:`?$n`?\.)?`?$n`?\s*\(`?$n`?\)/i; + } + $section->{'parent_db'} ||= $section->{'child_db'}; + + # Name of the child index (index in the same table where the FK is, see + # definition of dict_foreign_struct in include/dict0mem.h, where it is + # called foreign_index, as opposed to referenced_index which is in the + # parent table. This may not be possible to find. + @{$section}{ qw(child_index) } = $fulltext + =~ m/^The index in the foreign key in table is $n$/m; + + @{$section}{ qw(reason) } = $fulltext =~ m/:\s*([^:]+)(?= Constraint:|$)/ms; + $section->{'reason'} =~ s/\s+/ /g + if $section->{'reason'}; + + # Certain data may not be present. Make them '' if not present. + map { $section->{$_} ||= "" } + qw(child_index fk_name col_name parent_table parent_col); +} + +# see source file row/row0ins.c +sub parse_fk_transaction_error { + my ( $section, $complete, $debug, $fulltext, $full ) = @_; + + # Parse the txn info out + my ( $txn ) = $fulltext + =~ m/Transaction:\n(TRANSACTION.*)\nForeign key constraint fails/s; + if ( $txn ) { + $section->{'txn'} = parse_tx_text( $txn, $complete, $debug, $full ); + } + + # Parse the parent/child table and index info out. There are two types: an + # update or a delete of a parent record leaves a child orphaned + # (row_ins_foreign_report_err), and an insert or update of a child record has + # no matching parent record (row_ins_foreign_report_add_err). + + @{$section}{ qw(reason child_db child_table) } + = $fulltext =~ m{^(Foreign key constraint fails for table `(.*)/(.*)`:)$}m; + + @{$section}{ qw(fk_name col_name parent_db parent_table parent_col) } + = $fulltext + =~ m/CONSTRAINT `$n` FOREIGN KEY \(`$n`\) REFERENCES (?:`$n`\.)?`$n` \(`$n`\)/; + $section->{'parent_db'} ||= $section->{'child_db'}; + + # Special case, which I don't know how to trigger, but see + # innobase/row/row0ins.c row_ins_check_foreign_constraint + if ( $fulltext =~ m/ibd file does not currently exist!/ ) { + my ( $attempted_op, $index, $records ) + = $fulltext =~ m/^Trying to (add to index) `$n` tuple:\n(.*))?/sm; + $section->{'child_index'} = $index; + $section->{'attempted_op'} = $attempted_op || ''; + if ( $records && $full ) { + ( $section->{'records'} ) + = parse_innodb_record_dump( $records, $complete, $debug ); + } + @{$section}{qw(parent_db parent_table)} + =~ m/^But the parent table `$n`\.`$n`$/m; + } + else { + my ( $attempted_op, $which, $index ) + = $fulltext =~ m/^Trying to ([\w ]*) in (child|parent) table, in index `$n` tuple:$/m; + if ( $which ) { + $section->{$which . '_index'} = $index; + $section->{'attempted_op'} = $attempted_op || ''; + + # Parse out the related records in the other table. + my ( $search_index, $records ); + if ( $which eq 'child' ) { + ( $search_index, $records ) = $fulltext + =~ m/^But in parent table [^,]*, in index `$n`,\nthe closest match we can find is record:\n(.*)/ms; + $section->{'parent_index'} = $search_index; + } + else { + ( $search_index, $records ) = $fulltext + =~ m/^But in child table [^,]*, in index `$n`, (?:the record is not available|there is a record:\n(.*))?/ms; + $section->{'child_index'} = $search_index; + } + if ( $records && $full ) { + $section->{'records'} + = parse_innodb_record_dump( $records, $complete, $debug ); + } + else { + $section->{'records'} = ''; + } + } + } + + # Parse out the tuple trying to be updated, deleted or inserted. + my ( $trigger ) = $fulltext =~ m/^(DATA TUPLE: \d+ fields;\n.*)$/m; + if ( $trigger ) { + $section->{'trigger'} = parse_innodb_record_dump( $trigger, $complete, $debug ); + } + + # Certain data may not be present. Make them '' if not present. + map { $section->{$_} ||= "" } + qw(child_index fk_name col_name parent_table parent_col); +} + +# There are new-style and old-style record formats. See rem/rem0rec.c +# TODO: write some tests for this +sub parse_innodb_record_dump { + my ( $dump, $complete, $debug ) = @_; + return undef unless $dump; + + my $result = {}; + + if ( $dump =~ m/PHYSICAL RECORD/ ) { + my $style = $dump =~ m/compact format/ ? 'new' : 'old'; + $result->{'style'} = $style; + + # This is a new-style record. + if ( $style eq 'new' ) { + @{$result}{qw( heap_no type num_fields info_bits )} + = $dump + =~ m/^(?:Record lock, heap no $d )?([A-Z ]+): n_fields $d; compact format; info bits $d$/m; + } + + # OK, it's old-style. Unfortunately there are variations here too. + elsif ( $dump =~ m/-byte offs / ) { + # Older-old style. + @{$result}{qw( heap_no type num_fields byte_offset info_bits )} + = $dump + =~ m/^(?:Record lock, heap no $d )?([A-Z ]+): n_fields $d; $d-byte offs [A-Z]+; info bits $d$/m; + if ( $dump !~ m/-byte offs TRUE/ ) { + $result->{'byte_offset'} = 0; + } + } + else { + # Newer-old style. + @{$result}{qw( heap_no type num_fields byte_offset info_bits )} + = $dump + =~ m/^(?:Record lock, heap no $d )?([A-Z ]+): n_fields $d; $d-byte offsets; info bits $d$/m; + } + + } + else { + $result->{'style'} = 'tuple'; + @{$result}{qw( type num_fields )} + = $dump =~ m/^(DATA TUPLE): $d fields;$/m; + } + + # Fill in default values for things that couldn't be parsed. + map { $result->{$_} ||= 0 } + qw(heap_no num_fields byte_offset info_bits); + map { $result->{$_} ||= '' } + qw(style type ); + + my @fields = $dump =~ m/ (\d+:.*?;?);(?=$| \d+:)/gm; + $result->{'fields'} = [ map { parse_field($_, $complete, $debug ) } @fields ]; + + return $result; +} + +# New/old-style applies here. See rem/rem0rec.c +# $text should not include the leading space or the second trailing semicolon. +sub parse_field { + my ( $text, $complete, $debug ) = @_; + + # Sample fields: + # '4: SQL NULL, size 4 ' + # '1: len 6; hex 000000005601; asc V ;' + # '6: SQL NULL' + # '5: len 30; hex 687474703a2f2f7777772e737765657477617465722e636f6d2f73746f72; asc http://www.sweetwater.com/stor;...(truncated)' + my ( $id, $nullsize, $len, $hex, $asc, $truncated ); + ( $id, $nullsize ) = $text =~ m/^$d: SQL NULL, size $d $/; + if ( !defined($id) ) { + ( $id ) = $text =~ m/^$d: SQL NULL$/; + } + if ( !defined($id) ) { + ( $id, $len, $hex, $asc, $truncated ) + = $text =~ m/^$d: len $d; hex $h; asc (.*);(\.\.\.\(truncated\))?$/; + } + + die "Could not parse this field: '$text'" unless defined $id; + return { + id => $id, + len => defined($len) ? $len : defined($nullsize) ? $nullsize : 0, + 'hex' => defined($hex) ? $hex : '', + asc => defined($asc) ? $asc : '', + trunc => $truncated ? 1 : 0, + }; + +} + +sub parse_dl_section { + my ( $dl, $complete, $debug, $full ) = @_; + return unless $dl; + my $fulltext = $dl->{'fulltext'}; + return 0 unless $fulltext; + + my ( $ts ) = $fulltext =~ m/^$s$/m; + return 0 unless $ts; + + $dl->{'ts'} = [ parse_innodb_timestamp( $ts ) ]; + $dl->{'timestring'} = ts_to_string($dl->{'ts'}); + $dl->{'txns'} = {}; + + my @sections + = $fulltext + =~ m{ + ^\*{3}\s([^\n]*) # *** (1) WAITING FOR THIS... + (.*?) # Followed by anything, non-greedy + (?=(?:^\*{3})|\z) # Followed by another three stars or EOF + }gmsx; + + + # Loop through each section. There are no assumptions about how many + # there are, who holds and wants what locks, and who gets rolled back. + while ( my ($header, $body) = splice(@sections, 0, 2) ) { + my ( $txn_id, $what ) = $header =~ m/^\($d\) (.*):$/; + next unless $txn_id; + $dl->{'txns'}->{$txn_id} ||= {}; + my $txn = $dl->{'txns'}->{$txn_id}; + + if ( $what eq 'TRANSACTION' ) { + $txn->{'tx'} = parse_tx_text( $body, $complete, $debug, $full ); + } + else { + push @{$txn->{'locks'}}, parse_innodb_record_locks( $body, $complete, $debug, $full ); + } + } + + @{ $dl }{ qw(rolled_back) } + = $fulltext =~ m/^\*\*\* WE ROLL BACK TRANSACTION \($d\)$/m; + + # Make sure certain values aren't undef + map { $dl->{$_} ||= '' } qw(rolled_back); + + delete $dl->{'fulltext'} unless $debug; + return 1; +} + +sub parse_innodb_record_locks { + my ( $text, $complete, $debug, $full ) = @_; + my @result; + + foreach my $lock ( $text =~ m/(^(?:RECORD|TABLE) LOCKS?.*$)/gm ) { + my $hash = {}; + @{$hash}{ qw(lock_type space_id page_no n_bits index db table txn_id lock_mode) } + = $lock + =~ m{^(RECORD|TABLE) LOCKS? (?:space id $d page no $d n bits $d index `?$n`? of )?table `$n(?:/|`\.`)$n` trx id $t lock.mode (\S+)}m; + ( $hash->{'special'} ) + = $lock =~ m/^(?:RECORD|TABLE) .*? locks (rec but not gap|gap before rec)/m; + $hash->{'insert_intention'} + = $lock =~ m/^(?:RECORD|TABLE) .*? insert intention/m ? 1 : 0; + $hash->{'waiting'} + = $lock =~ m/^(?:RECORD|TABLE) .*? waiting/m ? 1 : 0; + + # Some things may not be in the text, so make sure they are not + # undef. + map { $hash->{$_} ||= 0 } qw(n_bits page_no space_id); + map { $hash->{$_} ||= "" } qw(index special); + push @result, $hash; + } + + return @result; +} + +sub parse_tx_text { + my ( $txn, $complete, $debug, $full ) = @_; + + my ( $txn_id, $txn_status, $active_secs, $proc_no, $os_thread_id ) + = $txn + =~ m/^(?:---)?TRANSACTION $t, (\D*?)(?: $d sec)?, (?:process no $d, )?OS thread id $d/m; + my ( $thread_status, $thread_decl_inside ) + = $txn + =~ m/OS thread id \d+(?: ([^,]+?))?(?:, thread declared inside InnoDB $d)?$/m; + + # Parsing the line that begins 'MySQL thread id' is complicated. The only + # thing always in the line is the thread and query id. See function + # innobase_mysql_print_thd in InnoDB source file sql/ha_innodb.cc. + my ( $thread_line ) = $txn =~ m/^(MySQL thread id .*)$/m; + my ( $mysql_thread_id, $query_id, $hostname, $ip, $user, $query_status ); + + if ( $thread_line ) { + # These parts can always be gotten. + ( $mysql_thread_id, $query_id ) = $thread_line =~ m/^MySQL thread id $d, query id $d/m; + + # If it's a master/slave thread, "Has (read|sent) all" may be the thread's + # proc_info. In these cases, there won't be any host/ip/user info + ( $query_status ) = $thread_line =~ m/(Has (?:read|sent) all .*$)/m; + if ( defined($query_status) ) { + $user = 'system user'; + } + + # It may be the case that the query id is the last thing in the line. + elsif ( $thread_line =~ m/query id \d+ / ) { + # The IP address is the only non-word thing left, so it's the most + # useful marker for where I have to start guessing. + ( $hostname, $ip ) = $thread_line =~ m/query id \d+(?: ([A-Za-z]\S+))? $i/m; + if ( defined $ip ) { + ( $user, $query_status ) = $thread_line =~ m/$ip $w(?: (.*))?$/; + } + else { # OK, there wasn't an IP address. + # There might not be ANYTHING except the query status. + ( $query_status ) = $thread_line =~ m/query id \d+ (.*)$/; + if ( $query_status !~ m/^\w+ing/ && !exists($is_proc_info{$query_status}) ) { + # The remaining tokens are, in order: hostname, user, query_status. + # It's basically impossible to know which is which. + ( $hostname, $user, $query_status ) = $thread_line + =~ m/query id \d+(?: ([A-Za-z]\S+))?(?: $w(?: (.*))?)?$/m; + } + else { + $user = 'system user'; + } + } + } + } + + my ( $lock_wait_status, $lock_structs, $heap_size, $row_locks, $undo_log_entries ) + = $txn + =~ m/^(?:(\D*) )?$d lock struct\(s\), heap size $d(?:, $d row lock\(s\))?(?:, undo log entries $d)?$/m; + my ( $lock_wait_time ) + = $txn + =~ m/^------- TRX HAS BEEN WAITING $d SEC/m; + + my $locks; + # If the transaction has locks, grab the locks. + if ( $txn =~ m/^TABLE LOCK|RECORD LOCKS/ ) { + $locks = [parse_innodb_record_locks($txn, $complete, $debug, $full)]; + } + + my ( $tables_in_use, $tables_locked ) + = $txn + =~ m/^mysql tables in use $d, locked $d$/m; + my ( $txn_doesnt_see_ge, $txn_sees_lt ) + = $txn + =~ m/^Trx read view will not see trx with id >= $t, sees < $t$/m; + my $has_read_view = defined($txn_doesnt_see_ge); + # Only a certain number of bytes of the query text are included here, at least + # under some circumstances. Some versions include 300, some 600. + my ( $query_text ) + = $txn + =~ m{ + ^MySQL\sthread\sid\s[^\n]+\n # This comes before the query text + (.*?) # The query text + (?= # Followed by any of... + ^Trx\sread\sview + |^-------\sTRX\sHAS\sBEEN\sWAITING + |^TABLE\sLOCK + |^RECORD\sLOCKS\sspace\sid + |^(?:---)?TRANSACTION + |^\*\*\*\s\(\d\) + |\Z + ) + }xms; + if ( $query_text ) { + $query_text =~ s/\s+$//; + } + else { + $query_text = ''; + } + + my %stuff = ( + active_secs => $active_secs, + has_read_view => $has_read_view, + heap_size => $heap_size, + hostname => $hostname, + ip => $ip, + lock_structs => $lock_structs, + lock_wait_status => $lock_wait_status, + lock_wait_time => $lock_wait_time, + mysql_thread_id => $mysql_thread_id, + os_thread_id => $os_thread_id, + proc_no => $proc_no, + query_id => $query_id, + query_status => $query_status, + query_text => $query_text, + row_locks => $row_locks, + tables_in_use => $tables_in_use, + tables_locked => $tables_locked, + thread_decl_inside => $thread_decl_inside, + thread_status => $thread_status, + txn_doesnt_see_ge => $txn_doesnt_see_ge, + txn_id => $txn_id, + txn_sees_lt => $txn_sees_lt, + txn_status => $txn_status, + undo_log_entries => $undo_log_entries, + user => $user, + ); + $stuff{'fulltext'} = $txn if $debug; + $stuff{'locks'} = $locks if $locks; + + # Some things may not be in the txn text, so make sure they are not + # undef. + map { $stuff{$_} ||= 0 } qw(active_secs heap_size lock_structs + tables_in_use undo_log_entries tables_locked has_read_view + thread_decl_inside lock_wait_time proc_no row_locks); + map { $stuff{$_} ||= "" } qw(thread_status txn_doesnt_see_ge + txn_sees_lt query_status ip query_text lock_wait_status user); + $stuff{'hostname'} ||= $stuff{'ip'}; + + return \%stuff; +} + +sub parse_tx_section { + my ( $section, $complete, $debug, $full ) = @_; + return unless $section && $section->{'fulltext'}; + my $fulltext = $section->{'fulltext'}; + $section->{'transactions'} = []; + + # Handle the individual transactions + my @transactions = $fulltext =~ m/(---TRANSACTION \d.*?)(?=\n---TRANSACTION|$)/gs; + foreach my $txn ( @transactions ) { + my $stuff = parse_tx_text( $txn, $complete, $debug, $full ); + delete $stuff->{'fulltext'} unless $debug; + push @{$section->{'transactions'}}, $stuff; + } + + # Handle the general info + @{$section}{ 'trx_id_counter' } + = $fulltext =~ m/^Trx id counter $t$/m; + @{$section}{ 'purge_done_for', 'purge_undo_for' } + = $fulltext =~ m/^Purge done for trx's n:o < $t undo n:o < $t$/m; + @{$section}{ 'history_list_len' } # This isn't present in some 4.x versions + = $fulltext =~ m/^History list length $d$/m; + @{$section}{ 'num_lock_structs' } + = $fulltext =~ m/^Total number of lock structs in row lock hash table $d$/m; + @{$section}{ 'is_truncated' } + = $fulltext =~ m/^\.\.\. truncated\.\.\.$/m ? 1 : 0; + + # Fill in things that might not be present + foreach ( qw(history_list_len) ) { + $section->{$_} ||= 0; + } + + delete $section->{'fulltext'} unless $debug; + return 1; +} + +# I've read the source for this section. +sub parse_ro_section { + my ( $section, $complete, $debug, $full ) = @_; + return unless $section && $section->{'fulltext'}; + my $fulltext = $section->{'fulltext'}; + + # Grab the info + @{$section}{ 'queries_inside', 'queries_in_queue' } + = $fulltext =~ m/^$d queries inside InnoDB, $d queries in queue$/m; + ( $section->{ 'read_views_open' } ) + = $fulltext =~ m/^$d read views open inside InnoDB$/m; + ( $section->{ 'n_reserved_extents' } ) + = $fulltext =~ m/^$d tablespace extents now reserved for B-tree/m; + @{$section}{ 'main_thread_proc_no', 'main_thread_id', 'main_thread_state' } + = $fulltext =~ m/^Main thread (?:process no. $d, )?id $d, state: (.*)$/m; + @{$section}{ 'num_rows_ins', 'num_rows_upd', 'num_rows_del', 'num_rows_read' } + = $fulltext =~ m/^Number of rows inserted $d, updated $d, deleted $d, read $d$/m; + @{$section}{ 'ins_sec', 'upd_sec', 'del_sec', 'read_sec' } + = $fulltext =~ m#^$f inserts/s, $f updates/s, $f deletes/s, $f reads/s$#m; + $section->{'main_thread_proc_no'} ||= 0; + + map { $section->{$_} ||= 0 } qw(read_views_open n_reserved_extents); + delete $section->{'fulltext'} unless $debug; + return 1; +} + +sub parse_lg_section { + my ( $section, $complete, $debug, $full ) = @_; + return unless $section; + my $fulltext = $section->{'fulltext'}; + + # Grab the info + ( $section->{ 'log_seq_no' } ) + = $fulltext =~ m/Log sequence number \s*(\d.*)$/m; + ( $section->{ 'log_flushed_to' } ) + = $fulltext =~ m/Log flushed up to \s*(\d.*)$/m; + ( $section->{ 'last_chkp' } ) + = $fulltext =~ m/Last checkpoint at \s*(\d.*)$/m; + @{$section}{ 'pending_log_writes', 'pending_chkp_writes' } + = $fulltext =~ m/$d pending log writes, $d pending chkp writes/; + @{$section}{ 'log_ios_done', 'log_ios_s' } + = $fulltext =~ m#$d log i/o's done, $f log i/o's/second#; + + delete $section->{'fulltext'} unless $debug; + return 1; +} + +sub parse_ib_section { + my ( $section, $complete, $debug, $full ) = @_; + return unless $section && $section->{'fulltext'}; + my $fulltext = $section->{'fulltext'}; + + # Some servers will output ibuf information for tablespace 0, as though there + # might be many tablespaces with insert buffers. (In practice I believe + # the source code shows there will only ever be one). I have to parse both + # cases here, but I assume there will only be one. + @{$section}{ 'size', 'free_list_len', 'seg_size' } + = $fulltext =~ m/^Ibuf(?: for space 0)?: size $d, free list len $d, seg size $d,$/m; + @{$section}{ 'inserts', 'merged_recs', 'merges' } + = $fulltext =~ m/^$d inserts, $d merged recs, $d merges$/m; + + @{$section}{ 'hash_table_size', 'used_cells', 'bufs_in_node_heap' } + = $fulltext =~ m/^Hash table size $d, used cells $d, node heap has $d buffer\(s\)$/m; + @{$section}{ 'hash_searches_s', 'non_hash_searches_s' } + = $fulltext =~ m{^$f hash searches/s, $f non-hash searches/s$}m; + + delete $section->{'fulltext'} unless $debug; + return 1; +} + +sub parse_wait_array { + my ( $text, $complete, $debug, $full ) = @_; + my %result; + + @result{ qw(thread waited_at_filename waited_at_line waited_secs) } + = $text =~ m/^--Thread $d has waited at $fl for $f seconds/m; + + # Depending on whether it's a SYNC_MUTEX,RW_LOCK_EX,RW_LOCK_SHARED, + # there will be different text output + if ( $text =~ m/^Mutex at/m ) { + $result{'request_type'} = 'M'; + @result{ qw( lock_mem_addr lock_cfile_name lock_cline lock_var) } + = $text =~ m/^Mutex at $h created file $fl, lock var $d$/m; + @result{ qw( waiters_flag )} + = $text =~ m/^waiters flag $d$/m; + } + else { + @result{ qw( request_type lock_mem_addr lock_cfile_name lock_cline) } + = $text =~ m/^(.)-lock on RW-latch at $h created in file $fl$/m; + @result{ qw( writer_thread writer_lock_mode ) } + = $text =~ m/^a writer \(thread id $d\) has reserved it in mode (.*)$/m; + @result{ qw( num_readers waiters_flag )} + = $text =~ m/^number of readers $d, waiters flag $d$/m; + @result{ qw(last_s_file_name last_s_line ) } + = $text =~ m/Last time read locked in file $fl$/m; + @result{ qw(last_x_file_name last_x_line ) } + = $text =~ m/Last time write locked in file $fl$/m; + } + + $result{'cell_waiting'} = $text =~ m/^wait has ended$/m ? 0 : 1; + $result{'cell_event_set'} = $text =~ m/^wait is ending$/m ? 1 : 0; + + # Because there are two code paths, some things won't get set. + map { $result{$_} ||= '' } + qw(last_s_file_name last_x_file_name writer_lock_mode); + map { $result{$_} ||= 0 } + qw(num_readers lock_var last_s_line last_x_line writer_thread); + + return \%result; +} + +sub parse_sm_section { + my ( $section, $complete, $debug, $full ) = @_; + return 0 unless $section && $section->{'fulltext'}; + my $fulltext = $section->{'fulltext'}; + + # Grab the info + @{$section}{ 'reservation_count', 'signal_count' } + = $fulltext =~ m/^OS WAIT ARRAY INFO: reservation count $d, signal count $d$/m; + @{$section}{ 'mutex_spin_waits', 'mutex_spin_rounds', 'mutex_os_waits' } + = $fulltext =~ m/^Mutex spin waits $d, rounds $d, OS waits $d$/m; + @{$section}{ 'rw_shared_spins', 'rw_shared_os_waits', 'rw_excl_spins', 'rw_excl_os_waits' } + = $fulltext =~ m/^RW-shared spins $d, OS waits $d; RW-excl spins $d, OS waits $d$/m; + + # Look for info on waits. + my @waits = $fulltext =~ m/^(--Thread.*?)^(?=Mutex spin|--Thread)/gms; + $section->{'waits'} = [ map { parse_wait_array($_, $complete, $debug) } @waits ]; + $section->{'wait_array_size'} = scalar(@waits); + + delete $section->{'fulltext'} unless $debug; + return 1; +} + +# I've read the source for this section. +sub parse_bp_section { + my ( $section, $complete, $debug, $full ) = @_; + return unless $section && $section->{'fulltext'}; + my $fulltext = $section->{'fulltext'}; + + # Grab the info + @{$section}{ 'total_mem_alloc', 'add_pool_alloc' } + = $fulltext =~ m/^Total memory allocated $d; in additional pool allocated $d$/m; + @{$section}{'dict_mem_alloc'} = $fulltext =~ m/Dictionary memory allocated $d/; + @{$section}{'awe_mem_alloc'} = $fulltext =~ m/$d MB of AWE memory/; + @{$section}{'buf_pool_size'} = $fulltext =~ m/^Buffer pool size\s*$d$/m; + @{$section}{'buf_free'} = $fulltext =~ m/^Free buffers\s*$d$/m; + @{$section}{'pages_total'} = $fulltext =~ m/^Database pages\s*$d$/m; + @{$section}{'pages_modified'} = $fulltext =~ m/^Modified db pages\s*$d$/m; + @{$section}{'pages_read', 'pages_created', 'pages_written'} + = $fulltext =~ m/^Pages read $d, created $d, written $d$/m; + @{$section}{'page_reads_sec', 'page_creates_sec', 'page_writes_sec'} + = $fulltext =~ m{^$f reads/s, $f creates/s, $f writes/s$}m; + @{$section}{'buf_pool_hits', 'buf_pool_reads'} + = $fulltext =~ m{Buffer pool hit rate $d / $d$}m; + if ($fulltext =~ m/^No buffer pool page gets since the last printout$/m) { + @{$section}{'buf_pool_hits', 'buf_pool_reads'} = (0, 0); + @{$section}{'buf_pool_hit_rate'} = '--'; + } + else { + @{$section}{'buf_pool_hit_rate'} + = $fulltext =~ m{Buffer pool hit rate (\d+ / \d+)$}m; + } + @{$section}{'reads_pending'} = $fulltext =~ m/^Pending reads $d/m; + @{$section}{'writes_pending_lru', 'writes_pending_flush_list', 'writes_pending_single_page' } + = $fulltext =~ m/^Pending writes: LRU $d, flush list $d, single page $d$/m; + + map { $section->{$_} ||= 0 } + qw(writes_pending_lru writes_pending_flush_list writes_pending_single_page + awe_mem_alloc dict_mem_alloc); + @{$section}{'writes_pending'} = List::Util::sum( + @{$section}{ qw(writes_pending_lru writes_pending_flush_list writes_pending_single_page) }); + + delete $section->{'fulltext'} unless $debug; + return 1; +} + +# I've read the source for this. +sub parse_io_section { + my ( $section, $complete, $debug, $full ) = @_; + return unless $section && $section->{'fulltext'}; + my $fulltext = $section->{'fulltext'}; + $section->{'threads'} = {}; + + # Grab the I/O thread info + my @threads = $fulltext =~ m<^(I/O thread \d+ .*)$>gm; + foreach my $thread (@threads) { + my ( $tid, $state, $purpose, $event_set ) + = $thread =~ m{I/O thread $d state: (.+?) \((.*)\)(?: ev set)?$}m; + if ( defined $tid ) { + $section->{'threads'}->{$tid} = { + thread => $tid, + state => $state, + purpose => $purpose, + event_set => $event_set ? 1 : 0, + }; + } + } + + # Grab the reads/writes/flushes info + @{$section}{ 'pending_normal_aio_reads', 'pending_aio_writes' } + = $fulltext =~ m/^Pending normal aio reads: $d, aio writes: $d,$/m; + @{$section}{ 'pending_ibuf_aio_reads', 'pending_log_ios', 'pending_sync_ios' } + = $fulltext =~ m{^ ibuf aio reads: $d, log i/o's: $d, sync i/o's: $d$}m; + @{$section}{ 'flush_type', 'pending_log_flushes', 'pending_buffer_pool_flushes' } + = $fulltext =~ m/^Pending flushes \($w\) log: $d; buffer pool: $d$/m; + @{$section}{ 'os_file_reads', 'os_file_writes', 'os_fsyncs' } + = $fulltext =~ m/^$d OS file reads, $d OS file writes, $d OS fsyncs$/m; + @{$section}{ 'reads_s', 'avg_bytes_s', 'writes_s', 'fsyncs_s' } + = $fulltext =~ m{^$f reads/s, $d avg bytes/read, $f writes/s, $f fsyncs/s$}m; + @{$section}{ 'pending_preads', 'pending_pwrites' } + = $fulltext =~ m/$d pending preads, $d pending pwrites$/m; + @{$section}{ 'pending_preads', 'pending_pwrites' } = (0, 0) + unless defined($section->{'pending_preads'}); + + delete $section->{'fulltext'} unless $debug; + return 1; +} + +sub _debug { + my ( $debug, $msg ) = @_; + if ( $debug ) { + die $msg; + } + else { + warn $msg; + } + return 1; +} + +1; + +# end_of_package InnoDBParser + +package main; + +use sigtrap qw(handler finish untrapped normal-signals); + +use Data::Dumper; +use DBI; +use English qw(-no_match_vars); +use File::Basename qw(dirname); +use File::Temp; +use Getopt::Long; +use List::Util qw(max min maxstr sum); +use POSIX qw(ceil); +use Time::HiRes qw(time sleep); +use Term::ReadKey qw(ReadMode ReadKey); + +# License and warranty information. {{{1 +# ########################################################################### + +my $innotop_license = <<"LICENSE"; + +This is innotop version $VERSION, a MySQL and InnoDB monitor. + +This program is copyright (c) 2006 Baron Schwartz. +Feedback and improvements are welcome. + +THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +This 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; OR the Perl Artistic License. On UNIX and similar +systems, you can issue `man perlgpl' or `man perlartistic' to read these +licenses. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA. +LICENSE + +# Configuration information and global setup {{{1 +# ########################################################################### + +# Really, really, super-global variables. +my @config_versions = ( + "000-000-000", "001-003-000", # config file was one big name-value hash. + "001-003-000", "001-004-002", # config file contained non-user-defined stuff. +); + +my $clear_screen_sub; +my $dsn_parser = new DSNParser(); + +# This defines expected properties and defaults for the column definitions that +# eventually end up in tbl_meta. +my %col_props = ( + hdr => '', + just => '-', + dec => 0, # Whether to align the column on the decimal point + num => 0, + label => '', + user => 0, + src => '', + tbl => '', # Helps when writing/reading custom columns in config files + minw => 0, + maxw => 0, + trans => [], + agg => 'first', # Aggregate function + aggonly => 0, # Whether to show only when tbl_meta->{aggregate} is true +); + +# Actual DBI connections to MySQL servers. +my %dbhs; + +# Command-line parameters {{{2 +# ########################################################################### + +my @opt_spec = ( + { s => 'help', d => 'Show this help message' }, + { s => 'color|C!', d => 'Use terminal coloring (default)', c => 'color' }, + { s => 'config|c=s', d => 'Config file to read' }, + { s => 'nonint|n', d => 'Non-interactive, output tab-separated fields' }, + { s => 'count=i', d => 'Number of updates before exiting' }, + { s => 'delay|d=f', d => 'Delay between updates in seconds', c => 'interval' }, + { s => 'mode|m=s', d => 'Operating mode to start in', c => 'mode' }, + { s => 'inc|i!', d => 'Measure incremental differences', c => 'status_inc' }, + { s => 'write|w', d => 'Write running configuration into home directory if no config files were loaded' }, + { s => 'skipcentral|s', d => 'Skip reading the central configuration file' }, + { s => 'version', d => 'Output version information and exit' }, + { s => 'user|u=s', d => 'User for login if not current user' }, + { s => 'password|p=s', d => 'Password to use for connection' }, + { s => 'host|h=s', d => 'Connect to host' }, + { s => 'port|P=i', d => 'Port number to use for connection' }, +); + +# This is the container for the command-line options' values to be stored in +# after processing. Initial values are defaults. +my %opts = ( + n => !( -t STDIN && -t STDOUT ), # If in/out aren't to terminals, we're interactive +); +# Post-process... +my %opt_seen; +foreach my $spec ( @opt_spec ) { + my ( $long, $short ) = $spec->{s} =~ m/^(\w+)(?:\|([^!+=]*))?/; + $spec->{k} = $short || $long; + $spec->{l} = $long; + $spec->{t} = $short; + $spec->{n} = $spec->{s} =~ m/!/; + $opts{$spec->{k}} = undef unless defined $opts{$spec->{k}}; + die "Duplicate option $spec->{k}" if $opt_seen{$spec->{k}}++; +} + +Getopt::Long::Configure('no_ignore_case', 'bundling'); +GetOptions( map { $_->{s} => \$opts{$_->{k}} } @opt_spec) or $opts{help} = 1; + +if ( $opts{version} ) { + print "innotop Ver $VERSION\n"; + exit(0); +} + +if ( $opts{c} and ! -f $opts{c} ) { + print $opts{c} . " doesn't exist. Exiting.\n"; + exit(1); +} +if ( $opts{'help'} ) { + print "Usage: innotop \n\n"; + my $maxw = max(map { length($_->{l}) + ($_->{n} ? 4 : 0)} @opt_spec); + foreach my $spec ( sort { $a->{l} cmp $b->{l} } @opt_spec ) { + my $long = $spec->{n} ? "[no]$spec->{l}" : $spec->{l}; + my $short = $spec->{t} ? "-$spec->{t}" : ''; + printf(" --%-${maxw}s %-4s %s\n", $long, $short, $spec->{d}); + } + print < q{my $host = host || hostname || ''; ($host) = $host =~ m/^((?:[\d.]+(?=:))|(?:[a-zA-Z]\w+))/; return $host || ''}, + Port => q{my ($p) = host =~ m/:(.*)$/; return $p || 0}, + OldVersions => q{dulint_to_int(IB_tx_trx_id_counter) - dulint_to_int(IB_tx_purge_done_for)}, + MaxTxnTime => q/max(map{ $_->{active_secs} } @{ IB_tx_transactions }) || 0/, + NumTxns => q{scalar @{ IB_tx_transactions } }, + DirtyBufs => q{ $cur->{IB_bp_pages_modified} / ($cur->{IB_bp_buf_pool_size} || 1) }, + BufPoolFill => q{ $cur->{IB_bp_pages_total} / ($cur->{IB_bp_buf_pool_size} || 1) }, + ServerLoad => q{ $cur->{Threads_connected}/(Questions||1)/Uptime_hires }, + TxnTimeRemain => q{ defined undo_log_entries && defined $pre->{undo_log_entries} && undo_log_entries < $pre->{undo_log_entries} ? undo_log_entries / (($pre->{undo_log_entries} - undo_log_entries)/((active_secs-$pre->{active_secs})||1))||1 : 0}, + SlaveCatchupRate => ' defined $cur->{seconds_behind_master} && defined $pre->{seconds_behind_master} && $cur->{seconds_behind_master} < $pre->{seconds_behind_master} ? ($pre->{seconds_behind_master}-$cur->{seconds_behind_master})/($cur->{Uptime_hires}-$pre->{Uptime_hires}) : 0', + QcacheHitRatio => q{(Qcache_hits||0)/(((Com_select||0)+(Qcache_hits||0))||1)}, +); + +# ########################################################################### +# Column definitions {{{3 +# Defines every column in every table. A named column has the following +# properties: +# * hdr Column header/title +# * label Documentation for humans. +# * num Whether it's numeric (for sorting). +# * just Alignment; generated from num, user-overridable in tbl_meta +# * minw, maxw Auto-generated, user-overridable. +# Values from this hash are just copied to tbl_meta, which is where everything +# else in the program should read from. +# ########################################################################### + +my %columns = ( + active_secs => { hdr => 'SecsActive', num => 1, label => 'Seconds transaction has been active', }, + add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additonal pool allocated' }, + attempted_op => { hdr => 'Action', num => 0, label => 'The action that caused the error' }, + awe_mem_alloc => { hdr => 'AWE Memory', num => 1, label => '[Windows] AWE memory allocated' }, + binlog_cache_overflow => { hdr => 'Binlog Cache', num => 1, label => 'Transactions too big for binlog cache that went to disk' }, + binlog_do_db => { hdr => 'Binlog Do DB', num => 0, label => 'binlog-do-db setting' }, + binlog_ignore_db => { hdr => 'Binlog Ignore DB', num => 0, label => 'binlog-ignore-db setting' }, + bps_in => { hdr => 'BpsIn', num => 1, label => 'Bytes per second received by the server', }, + bps_out => { hdr => 'BpsOut', num => 1, label => 'Bytes per second sent by the server', }, + buf_free => { hdr => 'Free Bufs', num => 1, label => 'Buffers free in the buffer pool' }, + buf_pool_hit_rate => { hdr => 'Hit Rate', num => 0, label => 'Buffer pool hit rate' }, + buf_pool_hits => { hdr => 'Hits', num => 1, label => 'Buffer pool hits' }, + buf_pool_reads => { hdr => 'Reads', num => 1, label => 'Buffer pool reads' }, + buf_pool_size => { hdr => 'Size', num => 1, label => 'Buffer pool size' }, + bufs_in_node_heap => { hdr => 'Node Heap Bufs', num => 1, label => 'Buffers in buffer pool node heap' }, + bytes_behind_master => { hdr => 'ByteLag', num => 1, label => 'Bytes the slave lags the master in binlog' }, + cell_event_set => { hdr => 'Ending?', num => 1, label => 'Whether the cell event is set' }, + cell_waiting => { hdr => 'Waiting?', num => 1, label => 'Whether the cell is waiting' }, + child_db => { hdr => 'Child DB', num => 0, label => 'The database of the child table' }, + child_index => { hdr => 'Child Index', num => 0, label => 'The index in the child table' }, + child_table => { hdr => 'Child Table', num => 0, label => 'The child table' }, + cmd => { hdr => 'Cmd', num => 0, label => 'Type of command being executed', }, + cnt => { hdr => 'Cnt', num => 0, label => 'Count', agg => 'count', aggonly => 1 }, + connect_retry => { hdr => 'Connect Retry', num => 1, label => 'Slave connect-retry timeout' }, + cxn => { hdr => 'CXN', num => 0, label => 'Connection from which the data came', }, + db => { hdr => 'DB', num => 0, label => 'Current database', }, + dict_mem_alloc => { hdr => 'Dict Mem', num => 1, label => 'Dictionary memory allocated' }, + dirty_bufs => { hdr => 'Dirty Buf', num => 1, label => 'Dirty buffer pool pages' }, + dl_txn_num => { hdr => 'Num', num => 0, label => 'Deadlocked transaction number', }, + event_set => { hdr => 'Evt Set?', num => 1, label => '[Win32] if a wait event is set', }, + exec_master_log_pos => { hdr => 'Exec Master Log Pos', num => 1, label => 'Exec Master Log Position' }, + fk_name => { hdr => 'Constraint', num => 0, label => 'The name of the FK constraint' }, + free_list_len => { hdr => 'Free List Len', num => 1, label => 'Length of the free list' }, + has_read_view => { hdr => 'Rd View', num => 1, label => 'Whether the transaction has a read view' }, + hash_searches_s => { hdr => 'Hash/Sec', num => 1, label => 'Number of hash searches/sec' }, + hash_table_size => { hdr => 'Size', num => 1, label => 'Number of non-hash searches/sec' }, + heap_no => { hdr => 'Heap', num => 1, label => 'Heap number' }, + heap_size => { hdr => 'Heap', num => 1, label => 'Heap size' }, + history_list_len => { hdr => 'History', num => 1, label => 'History list length' }, + host_and_domain => { hdr => 'Host', num => 0, label => 'Hostname/IP and domain' }, + host_and_port => { hdr => 'Host/IP', num => 0, label => 'Hostname or IP address, and port number', }, + hostname => { hdr => 'Host', num => 0, label => 'Hostname' }, + index => { hdr => 'Index', num => 0, label => 'The index involved' }, + index_ref => { hdr => 'Index Ref', num => 0, label => 'Index referenced' }, + info => { hdr => 'Query', num => 0, label => 'Info or the current query', }, + insert_intention => { hdr => 'Ins Intent', num => 1, label => 'Whether the thread was trying to insert' }, + inserts => { hdr => 'Inserts', num => 1, label => 'Inserts' }, + io_bytes_s => { hdr => 'Bytes/Sec', num => 1, label => 'Average I/O bytes/sec' }, + io_flush_type => { hdr => 'Flush Type', num => 0, label => 'I/O Flush Type' }, + io_fsyncs_s => { hdr => 'fsyncs/sec', num => 1, label => 'I/O fsyncs/sec' }, + io_reads_s => { hdr => 'Reads/Sec', num => 1, label => 'Average I/O reads/sec' }, + io_writes_s => { hdr => 'Writes/Sec', num => 1, label => 'Average I/O writes/sec' }, + ip => { hdr => 'IP', num => 0, label => 'IP address' }, + is_name_locked => { hdr => 'Locked', num => 1, label => 'Whether table is name locked', }, + key_buffer_hit => { hdr => 'KCacheHit', num => 1, label => 'Key cache hit ratio', }, + key_len => { hdr => 'Key Length', num => 1, label => 'Number of bytes used in the key' }, + last_chkp => { hdr => 'Last Checkpoint', num => 0, label => 'Last log checkpoint' }, + last_errno => { hdr => 'Last Errno', num => 1, label => 'Last error number' }, + last_error => { hdr => 'Last Error', num => 0, label => 'Last error' }, + last_s_file_name => { hdr => 'S-File', num => 0, label => 'Filename where last read locked' }, + last_s_line => { hdr => 'S-Line', num => 1, label => 'Line where last read locked' }, + last_x_file_name => { hdr => 'X-File', num => 0, label => 'Filename where last write locked' }, + last_x_line => { hdr => 'X-Line', num => 1, label => 'Line where last write locked' }, + last_pct => { hdr => 'Pct', num => 1, label => 'Last Percentage' }, + last_total => { hdr => 'Last Total', num => 1, label => 'Last Total' }, + last_value => { hdr => 'Last Incr', num => 1, label => 'Last Value' }, + load => { hdr => 'Load', num => 1, label => 'Server load' }, + lock_cfile_name => { hdr => 'Crtd File', num => 0, label => 'Filename where lock created' }, + lock_cline => { hdr => 'Crtd Line', num => 1, label => 'Line where lock created' }, + lock_mem_addr => { hdr => 'Addr', num => 0, label => 'The lock memory address' }, + lock_mode => { hdr => 'Mode', num => 0, label => 'The lock mode' }, + lock_structs => { hdr => 'LStrcts', num => 1, label => 'Number of lock structs' }, + lock_type => { hdr => 'Type', num => 0, label => 'The lock type' }, + lock_var => { hdr => 'Lck Var', num => 1, label => 'The lock variable' }, + lock_wait_time => { hdr => 'Wait', num => 1, label => 'How long txn has waited for a lock' }, + log_flushed_to => { hdr => 'Flushed To', num => 0, label => 'Log position flushed to' }, + log_ios_done => { hdr => 'IO Done', num => 1, label => 'Log I/Os done' }, + log_ios_s => { hdr => 'IO/Sec', num => 1, label => 'Average log I/Os per sec' }, + log_seq_no => { hdr => 'Sequence No.', num => 0, label => 'Log sequence number' }, + main_thread_id => { hdr => 'Main Thread ID', num => 1, label => 'Main thread ID' }, + main_thread_proc_no => { hdr => 'Main Thread Proc', num => 1, label => 'Main thread process number' }, + main_thread_state => { hdr => 'Main Thread State', num => 0, label => 'Main thread state' }, + master_file => { hdr => 'File', num => 0, label => 'Master file' }, + master_host => { hdr => 'Master', num => 0, label => 'Master server hostname' }, + master_log_file => { hdr => 'Master Log File', num => 0, label => 'Master log file' }, + master_port => { hdr => 'Master Port', num => 1, label => 'Master port' }, + master_pos => { hdr => 'Position', num => 1, label => 'Master position' }, + master_ssl_allowed => { hdr => 'Master SSL Allowed', num => 0, label => 'Master SSL Allowed' }, + master_ssl_ca_file => { hdr => 'Master SSL CA File', num => 0, label => 'Master SSL Cert Auth File' }, + master_ssl_ca_path => { hdr => 'Master SSL CA Path', num => 0, label => 'Master SSL Cert Auth Path' }, + master_ssl_cert => { hdr => 'Master SSL Cert', num => 0, label => 'Master SSL Cert' }, + master_ssl_cipher => { hdr => 'Master SSL Cipher', num => 0, label => 'Master SSL Cipher' }, + master_ssl_key => { hdr => 'Master SSL Key', num => 0, label => 'Master SSL Key' }, + master_user => { hdr => 'Master User', num => 0, label => 'Master username' }, + max_txn => { hdr => 'MaxTxnTime', num => 1, label => 'MaxTxn' }, + merged_recs => { hdr => 'Merged Recs', num => 1, label => 'Merged records' }, + merges => { hdr => 'Merges', num => 1, label => 'Merges' }, + mutex_os_waits => { hdr => 'Waits', num => 1, label => 'Mutex OS Waits' }, + mutex_spin_rounds => { hdr => 'Rounds', num => 1, label => 'Mutex Spin Rounds' }, + mutex_spin_waits => { hdr => 'Spins', num => 1, label => 'Mutex Spin Waits' }, + mysql_thread_id => { hdr => 'ID', num => 1, label => 'MySQL connection (thread) ID', }, + name => { hdr => 'Name', num => 0, label => 'Variable Name' }, + n_bits => { hdr => '# Bits', num => 1, label => 'Number of bits' }, + non_hash_searches_s => { hdr => 'Non-Hash/Sec', num => 1, label => 'Non-hash searches/sec' }, + num_deletes => { hdr => 'Del', num => 1, label => 'Number of deletes' }, + num_deletes_sec => { hdr => 'Del/Sec', num => 1, label => 'Number of deletes' }, + num_inserts => { hdr => 'Ins', num => 1, label => 'Number of inserts' }, + num_inserts_sec => { hdr => 'Ins/Sec', num => 1, label => 'Number of inserts' }, + num_readers => { hdr => 'Readers', num => 1, label => 'Number of readers' }, + num_reads => { hdr => 'Read', num => 1, label => 'Number of reads' }, + num_reads_sec => { hdr => 'Read/Sec', num => 1, label => 'Number of reads' }, + num_res_ext => { hdr => 'BTree Extents', num => 1, label => 'Number of extents reserved for B-Tree' }, + num_rows => { hdr => 'Row Count', num => 1, label => 'Number of rows estimated to examine' }, + num_times_open => { hdr => 'In Use', num => 1, label => '# times table is opened', }, + num_txns => { hdr => 'Txns', num => 1, label => 'Number of transactions' }, + num_updates => { hdr => 'Upd', num => 1, label => 'Number of updates' }, + num_updates_sec => { hdr => 'Upd/Sec', num => 1, label => 'Number of updates' }, + os_file_reads => { hdr => 'OS Reads', num => 1, label => 'OS file reads' }, + os_file_writes => { hdr => 'OS Writes', num => 1, label => 'OS file writes' }, + os_fsyncs => { hdr => 'OS fsyncs', num => 1, label => 'OS fsyncs' }, + os_thread_id => { hdr => 'OS Thread', num => 1, label => 'The operating system thread ID' }, + p_aio_writes => { hdr => 'Async Wrt', num => 1, label => 'Pending asynchronous I/O writes' }, + p_buf_pool_flushes => { hdr => 'Buffer Pool Flushes', num => 1, label => 'Pending buffer pool flushes' }, + p_ibuf_aio_reads => { hdr => 'IBuf Async Rds', num => 1, label => 'Pending insert buffer asynch I/O reads' }, + p_log_flushes => { hdr => 'Log Flushes', num => 1, label => 'Pending log flushes' }, + p_log_ios => { hdr => 'Log I/Os', num => 1, label => 'Pending log I/O operations' }, + p_normal_aio_reads => { hdr => 'Async Rds', num => 1, label => 'Pending asynchronous I/O reads' }, + p_preads => { hdr => 'preads', num => 1, label => 'Pending p-reads' }, + p_pwrites => { hdr => 'pwrites', num => 1, label => 'Pending p-writes' }, + p_sync_ios => { hdr => 'Sync I/Os', num => 1, label => 'Pending synchronous I/O operations' }, + page_creates_sec => { hdr => 'Creates/Sec', num => 1, label => 'Page creates/sec' }, + page_no => { hdr => 'Page', num => 1, label => 'Page number' }, + page_reads_sec => { hdr => 'Reads/Sec', num => 1, label => 'Page reads per second' }, + page_writes_sec => { hdr => 'Writes/Sec', num => 1, label => 'Page writes per second' }, + pages_created => { hdr => 'Created', num => 1, label => 'Pages created' }, + pages_modified => { hdr => 'Dirty Pages', num => 1, label => 'Pages modified (dirty)' }, + pages_read => { hdr => 'Reads', num => 1, label => 'Pages read' }, + pages_total => { hdr => 'Pages', num => 1, label => 'Pages total' }, + pages_written => { hdr => 'Writes', num => 1, label => 'Pages written' }, + parent_col => { hdr => 'Parent Column', num => 0, label => 'The referred column in the parent table', }, + parent_db => { hdr => 'Parent DB', num => 0, label => 'The database of the parent table' }, + parent_index => { hdr => 'Parent Index', num => 0, label => 'The referred index in the parent table' }, + parent_table => { hdr => 'Parent Table', num => 0, label => 'The parent table' }, + part_id => { hdr => 'Part ID', num => 1, label => 'Sub-part ID of the query' }, + partitions => { hdr => 'Partitions', num => 0, label => 'Query partitions used' }, + pct => { hdr => 'Pct', num => 1, label => 'Percentage' }, + pending_chkp_writes => { hdr => 'Chkpt Writes', num => 1, label => 'Pending log checkpoint writes' }, + pending_log_writes => { hdr => 'Log Writes', num => 1, label => 'Pending log writes' }, + port => { hdr => 'Port', num => 1, label => 'Client port number', }, + possible_keys => { hdr => 'Poss. Keys', num => 0, label => 'Possible keys' }, + proc_no => { hdr => 'Proc', num => 1, label => 'Process number' }, + q_cache_hit => { hdr => 'QCacheHit', num => 1, label => 'Query cache hit ratio', }, + qps => { hdr => 'QPS', num => 1, label => 'How many queries/sec', }, + queries_in_queue => { hdr => 'Queries Queued', num => 1, label => 'Queries in queue' }, + queries_inside => { hdr => 'Queries Inside', num => 1, label => 'Queries inside InnoDB' }, + query_id => { hdr => 'Query ID', num => 1, label => 'Query ID' }, + query_status => { hdr => 'Query Status', num => 0, label => 'The query status' }, + query_text => { hdr => 'Query Text', num => 0, label => 'The query text' }, + questions => { hdr => 'Questions', num => 1, label => 'How many queries the server has gotten', }, + read_master_log_pos => { hdr => 'Read Master Pos', num => 1, label => 'Read master log position' }, + read_views_open => { hdr => 'Rd Views', num => 1, label => 'Number of read views open' }, + reads_pending => { hdr => 'Pending Reads', num => 1, label => 'Reads pending' }, + relay_log_file => { hdr => 'Relay File', num => 0, label => 'Relay log file' }, + relay_log_pos => { hdr => 'Relay Pos', num => 1, label => 'Relay log position' }, + relay_log_size => { hdr => 'Relay Size', num => 1, label => 'Relay log size' }, + relay_master_log_file => { hdr => 'Relay Master File', num => 0, label => 'Relay master log file' }, + replicate_do_db => { hdr => 'Do DB', num => 0, label => 'Replicate-do-db setting' }, + replicate_do_table => { hdr => 'Do Table', num => 0, label => 'Replicate-do-table setting' }, + replicate_ignore_db => { hdr => 'Ignore DB', num => 0, label => 'Replicate-ignore-db setting' }, + replicate_ignore_table => { hdr => 'Ignore Table', num => 0, label => 'Replicate-do-table setting' }, + replicate_wild_do_table => { hdr => 'Wild Do Table', num => 0, label => 'Replicate-wild-do-table setting' }, + replicate_wild_ignore_table => { hdr => 'Wild Ignore Table', num => 0, label => 'Replicate-wild-ignore-table setting' }, + request_type => { hdr => 'Type', num => 0, label => 'Type of lock the thread waits for' }, + reservation_count => { hdr => 'ResCnt', num => 1, label => 'Reservation Count' }, + row_locks => { hdr => 'RLocks', num => 1, label => 'Number of row locks' }, + rw_excl_os_waits => { hdr => 'RW Waits', num => 1, label => 'R/W Excl. OS Waits' }, + rw_excl_spins => { hdr => 'RW Spins', num => 1, label => 'R/W Excl. Spins' }, + rw_shared_os_waits => { hdr => 'Sh Waits', num => 1, label => 'R/W Shared OS Waits' }, + rw_shared_spins => { hdr => 'Sh Spins', num => 1, label => 'R/W Shared Spins' }, + scan_type => { hdr => 'Type', num => 0, label => 'Scan type in chosen' }, + seg_size => { hdr => 'Seg. Size', num => 1, label => 'Segment size' }, + select_type => { hdr => 'Select Type', num => 0, label => 'Type of select used' }, + signal_count => { hdr => 'Signals', num => 1, label => 'Signal Count' }, + size => { hdr => 'Size', num => 1, label => 'Size of the tablespace' }, + skip_counter => { hdr => 'Skip Counter', num => 1, label => 'Skip counter' }, + slave_catchup_rate => { hdr => 'Catchup', num => 1, label => 'How fast the slave is catching up in the binlog' }, + slave_io_running => { hdr => 'Slave-IO', num => 0, label => 'Whether the slave I/O thread is running' }, + slave_io_state => { hdr => 'Slave IO State', num => 0, label => 'Slave I/O thread state' }, + slave_open_temp_tables => { hdr => 'Temp', num => 1, label => 'Slave open temp tables' }, + slave_sql_running => { hdr => 'Slave-SQL', num => 0, label => 'Whether the slave SQL thread is running' }, + slow => { hdr => 'Slow', num => 1, label => 'How many slow queries', }, + space_id => { hdr => 'Space', num => 1, label => 'Tablespace ID' }, + special => { hdr => 'Special', num => 0, label => 'Special/Other info' }, + state => { hdr => 'State', num => 0, label => 'Connection state', maxw => 18, }, + tables_in_use => { hdr => 'Tbl Used', num => 1, label => 'Number of tables in use' }, + tables_locked => { hdr => 'Tbl Lck', num => 1, label => 'Number of tables locked' }, + tbl => { hdr => 'Table', num => 0, label => 'Table', }, + thread => { hdr => 'Thread', num => 1, label => 'Thread number' }, + thread_decl_inside => { hdr => 'Thread Inside', num => 0, label => 'What the thread is declared inside' }, + thread_purpose => { hdr => 'Purpose', num => 0, label => "The thread's purpose" }, + thread_status => { hdr => 'Thread Status', num => 0, label => 'The thread status' }, + time => { hdr => 'Time', num => 1, label => 'Time since the last event', }, + time_behind_master => { hdr => 'TimeLag', num => 1, label => 'Time slave lags master' }, + timestring => { hdr => 'Timestring', num => 0, label => 'Time the event occurred' }, + total => { hdr => 'Total', num => 1, label => 'Total' }, + total_mem_alloc => { hdr => 'Memory', num => 1, label => 'Total memory allocated' }, + truncates => { hdr => 'Trunc', num => 0, label => 'Whether the deadlock is truncating InnoDB status' }, + txn_doesnt_see_ge => { hdr => "Txn Won't See", num => 0, label => 'Where txn read view is limited' }, + txn_id => { hdr => 'ID', num => 0, label => 'Transaction ID' }, + txn_sees_lt => { hdr => 'Txn Sees', num => 1, label => 'Where txn read view is limited' }, + txn_status => { hdr => 'Txn Status', num => 0, label => 'Transaction status' }, + txn_time_remain => { hdr => 'Remaining', num => 1, label => 'Time until txn rollback/commit completes' }, + undo_log_entries => { hdr => 'Undo', num => 1, label => 'Number of undo log entries' }, + undo_for => { hdr => 'Undo', num => 0, label => 'Undo for' }, + until_condition => { hdr => 'Until Condition', num => 0, label => 'Slave until condition' }, + until_log_file => { hdr => 'Until Log File', num => 0, label => 'Slave until log file' }, + until_log_pos => { hdr => 'Until Log Pos', num => 1, label => 'Slave until log position' }, + used_cells => { hdr => 'Cells Used', num => 1, label => 'Number of cells used' }, + used_bufs => { hdr => 'Used Bufs', num => 1, label => 'Number of buffer pool pages used' }, + user => { hdr => 'User', num => 0, label => 'Database username', }, + value => { hdr => 'Value', num => 1, label => 'Value' }, + versions => { hdr => 'Versions', num => 1, label => 'Number of InnoDB MVCC versions unpurged' }, + victim => { hdr => 'Victim', num => 0, label => 'Whether this txn was the deadlock victim' }, + wait_array_size => { hdr => 'Wait Array Size', num => 1, label => 'Wait Array Size' }, + wait_status => { hdr => 'Lock Status', num => 0, label => 'Status of txn locks' }, + waited_at_filename => { hdr => 'File', num => 0, label => 'Filename at which thread waits' }, + waited_at_line => { hdr => 'Line', num => 1, label => 'Line at which thread waits' }, + waiters_flag => { hdr => 'Waiters', num => 1, label => 'Waiters Flag' }, + waiting => { hdr => 'Waiting', num => 1, label => 'Whether lock is being waited for' }, + when => { hdr => 'When', num => 0, label => 'Time scale' }, + writer_lock_mode => { hdr => 'Wrtr Lck Mode', num => 0, label => 'Writer lock mode' }, + writer_thread => { hdr => 'Wrtr Thread', num => 1, label => 'Writer thread ID' }, + writes_pending => { hdr => 'Writes', num => 1, label => 'Number of writes pending' }, + writes_pending_flush_list => { hdr => 'Flush List Writes', num => 1, label => 'Number of flush list writes pending' }, + writes_pending_lru => { hdr => 'LRU Writes', num => 1, label => 'Number of LRU writes pending' }, + writes_pending_single_page => { hdr => '1-Page Writes', num => 1, label => 'Number of 1-page writes pending' }, +); + +# Apply a default property or three. By default, columns are not width-constrained, +# aligned left, and sorted alphabetically, not numerically. +foreach my $col ( values %columns ) { + map { $col->{$_} ||= 0 } qw(num minw maxw); + $col->{just} = $col->{num} ? '' : '-'; +} + +# Filters {{{3 +# This hash defines every filter that can be applied to a table. These +# become part of tbl_meta as well. Each filter is just an expression that +# returns true or false. +# Properties of each entry: +# * func: the subroutine +# * name: the name, repeated +# * user: whether it's a user-defined filter (saved in config) +# * text: text of the subroutine +# * note: explanation +my %filters = (); + +# These are pre-processed to live in %filters above, by compiling them. +my %builtin_filters = ( + hide_self => { + text => <<' END', + return ( !$set->{info} || $set->{info} ne 'SHOW FULL PROCESSLIST' ) + && ( !$set->{query_text} || $set->{query_text} !~ m/INNODB STATUS$/ ); + END + note => 'Removes the innotop processes from the list', + tbls => [qw(innodb_transactions processlist)], + }, + hide_inactive => { + text => <<' END', + return ( !defined($set->{txn_status}) || $set->{txn_status} ne 'not started' ) + && ( !defined($set->{cmd}) || $set->{cmd} !~ m/Sleep|Binlog Dump/ ) + && ( !defined($set->{info}) || $set->{info} =~ m/\S/ ); + END + note => 'Removes processes which are not doing anything', + tbls => [qw(innodb_transactions processlist)], + }, + hide_slave_io => { + text => <<' END', + return !$set->{state} || $set->{state} !~ m/^(?:Waiting for master|Has read all relay)/; + END + note => 'Removes slave I/O threads from the list', + tbls => [qw(processlist slave_io_status)], + }, + table_is_open => { + text => <<' END', + return $set->{num_times_open} + $set->{is_name_locked}; + END + note => 'Removes tables that are not in use or locked', + tbls => [qw(open_tables)], + }, + cxn_is_master => { + text => <<' END', + return $set->{master_file} ? 1 : 0; + END + note => 'Removes servers that are not masters', + tbls => [qw(master_status)], + }, + cxn_is_slave => { + text => <<' END', + return $set->{master_host} ? 1 : 0; + END + note => 'Removes servers that are not slaves', + tbls => [qw(slave_io_status slave_sql_status)], + }, + thd_is_not_waiting => { + text => <<' END', + return $set->{thread_status} !~ m#waiting for i/o request#; + END + note => 'Removes idle I/O threads', + tbls => [qw(io_threads)], + }, +); +foreach my $key ( keys %builtin_filters ) { + my ( $sub, $err ) = compile_filter($builtin_filters{$key}->{text}); + $filters{$key} = { + func => $sub, + text => $builtin_filters{$key}->{text}, + user => 0, + name => $key, # useful for later + note => $builtin_filters{$key}->{note}, + tbls => $builtin_filters{$key}->{tbls}, + } +} + +# Variable sets {{{3 +# Sets (arrayrefs) of variables that are used in S mode. They are read/written to +# the config file. +my %var_sets = ( + general => { + text => join( + ', ', + 'set_precision(Questions/Uptime_hires) as QPS', + 'set_precision(Com_commit/Uptime_hires) as Commit_PS', + 'set_precision((Com_rollback||0)/(Com_commit||1)) as Rollback_Commit', + 'set_precision((' + . join('+', map { "($_||0)" } + qw(Com_delete Com_delete_multi Com_insert Com_insert_select Com_replace + Com_replace_select Com_select Com_update Com_update_multi)) + . ')/(Com_commit||1)) as Write_Commit', + 'set_precision((Com_select+(Qcache_hits||0))/((' + . join('+', map { "($_||0)" } + qw(Com_delete Com_delete_multi Com_insert Com_insert_select Com_replace + Com_replace_select Com_select Com_update Com_update_multi)) + . ')||1)) as R_W_Ratio', + 'set_precision(Opened_tables/Uptime_hires) as Opens_PS', + 'percent($cur->{Open_tables}/($cur->{table_cache})) as Table_Cache_Used', + 'set_precision(Threads_created/Uptime_hires) as Threads_PS', + 'percent($cur->{Threads_cached}/($cur->{thread_cache_size}||1)) as Thread_Cache_Used', + 'percent($cur->{Max_used_connections}/($cur->{max_connections}||1)) as CXN_Used_Ever', + 'percent($cur->{Threads_connected}/($cur->{max_connections}||1)) as CXN_Used_Now', + ), + }, + commands => { + text => join( + ', ', + qw(Uptime Questions Com_delete Com_delete_multi Com_insert + Com_insert_select Com_replace Com_replace_select Com_select Com_update + Com_update_multi) + ), + }, + query_status => { + text => join( + ',', + qw( Uptime Select_full_join Select_full_range_join Select_range + Select_range_check Select_scan Slow_queries Sort_merge_passes + Sort_range Sort_rows Sort_scan) + ), + }, + innodb => { + text => join( + ',', + qw( Uptime Innodb_row_lock_current_waits Innodb_row_lock_time + Innodb_row_lock_time_avg Innodb_row_lock_time_max Innodb_row_lock_waits + Innodb_rows_deleted Innodb_rows_inserted Innodb_rows_read + Innodb_rows_updated) + ), + }, + txn => { + text => join( + ',', + qw( Uptime Com_begin Com_commit Com_rollback Com_savepoint + Com_xa_commit Com_xa_end Com_xa_prepare Com_xa_recover Com_xa_rollback + Com_xa_start) + ), + }, + key_cache => { + text => join( + ',', + qw( Uptime Key_blocks_not_flushed Key_blocks_unused Key_blocks_used + Key_read_requests Key_reads Key_write_requests Key_writes ) + ), + }, + query_cache => { + text => join( + ',', + "percent($exprs{QcacheHitRatio}) as Hit_Pct", + 'set_precision((Qcache_hits||0)/(Qcache_inserts||1)) as Hit_Ins', + 'set_precision((Qcache_lowmem_prunes||0)/Uptime_hires) as Lowmem_Prunes_sec', + 'percent(1-((Qcache_free_blocks||0)/(Qcache_total_blocks||1))) as Blocks_used', + qw( Qcache_free_blocks Qcache_free_memory Qcache_not_cached Qcache_queries_in_cache) + ), + }, + handler => { + text => join( + ',', + qw( Uptime Handler_read_key Handler_read_first Handler_read_next + Handler_read_prev Handler_read_rnd Handler_read_rnd_next Handler_delete + Handler_update Handler_write) + ), + }, + cxns_files_threads => { + text => join( + ',', + qw( Uptime Aborted_clients Aborted_connects Bytes_received Bytes_sent + Compression Connections Created_tmp_disk_tables Created_tmp_files + Created_tmp_tables Max_used_connections Open_files Open_streams + Open_tables Opened_tables Table_locks_immediate Table_locks_waited + Threads_cached Threads_connected Threads_created Threads_running) + ), + }, + prep_stmt => { + text => join( + ',', + qw( Uptime Com_dealloc_sql Com_execute_sql Com_prepare_sql Com_reset + Com_stmt_close Com_stmt_execute Com_stmt_fetch Com_stmt_prepare + Com_stmt_reset Com_stmt_send_long_data ) + ), + }, + innodb_health => { + text => join( + ',', + "$exprs{OldVersions} as OldVersions", + qw(IB_sm_mutex_spin_waits IB_sm_mutex_spin_rounds IB_sm_mutex_os_waits), + "$exprs{NumTxns} as NumTxns", + "$exprs{MaxTxnTime} as MaxTxnTime", + qw(IB_ro_queries_inside IB_ro_queries_in_queue), + "set_precision($exprs{DirtyBufs} * 100) as dirty_bufs", + "set_precision($exprs{BufPoolFill} * 100) as buf_fill", + qw(IB_bp_pages_total IB_bp_pages_read IB_bp_pages_written IB_bp_pages_created) + ), + }, + innodb_health2 => { + text => join( + ', ', + 'percent(1-((Innodb_buffer_pool_pages_free||0)/($cur->{Innodb_buffer_pool_pages_total}||1))) as BP_page_cache_usage', + 'percent(1-((Innodb_buffer_pool_reads||0)/(Innodb_buffer_pool_read_requests||1))) as BP_cache_hit_ratio', + 'Innodb_buffer_pool_wait_free', + 'Innodb_log_waits', + ), + }, + slow_queries => { + text => join( + ', ', + 'set_precision(Slow_queries/Uptime_hires) as Slow_PS', + 'set_precision(Select_full_join/Uptime_hires) as Full_Join_PS', + 'percent(Select_full_join/(Com_select||1)) as Full_Join_Ratio', + ), + }, +); + +# Server sets {{{3 +# Defines sets of servers between which the user can quickly switch. +my %server_groups; + +# Connections {{{3 +# This hash defines server connections. Each connection is a string that can be passed to +# the DBI connection. These are saved in the connections section in the config file. +my %connections; +# Defines the parts of connections. +my @conn_parts = qw(user have_user pass have_pass dsn savepass dl_table); + +# Graph widths {{{3 +# This hash defines the max values seen for various status/variable values, for graphing. +# These are stored in their own section in the config file. These are just initial values: +my %mvs = ( + Com_select => 50, + Com_insert => 50, + Com_update => 50, + Com_delete => 50, + Questions => 100, +); + +# ########################################################################### +# Valid Term::ANSIColor color strings. +# ########################################################################### +my %ansicolors = map { $_ => 1 } + qw( black blink blue bold clear concealed cyan dark green magenta on_black + on_blue on_cyan on_green on_magenta on_red on_white on_yellow red reset + reverse underline underscore white yellow); + +# ########################################################################### +# Valid comparison operators for color rules +# ########################################################################### +my %comp_ops = ( + '==' => 'Numeric equality', + '>' => 'Numeric greater-than', + '<' => 'Numeric less-than', + '>=' => 'Numeric greater-than/equal', + '<=' => 'Numeric less-than/equal', + '!=' => 'Numeric not-equal', + 'eq' => 'String equality', + 'gt' => 'String greater-than', + 'lt' => 'String less-than', + 'ge' => 'String greater-than/equal', + 'le' => 'String less-than/equal', + 'ne' => 'String not-equal', + '=~' => 'Pattern match', + '!~' => 'Negated pattern match', +); + +# ########################################################################### +# Valid aggregate functions. +# ########################################################################### +my %agg_funcs = ( + first => sub { + return $_[0] + }, + count => sub { + return 0 + @_; + }, + avg => sub { + my @args = grep { defined $_ } @_; + return (sum(map { m/([\d\.-]+)/g } @args) || 0) / (scalar(@args) || 1); + }, + sum => sub { + my @args = grep { defined $_ } @_; + return sum(@args); + } +); + +# ########################################################################### +# Valid functions for transformations. +# ########################################################################### +my %trans_funcs = ( + shorten => \&shorten, + secs_to_time => \&secs_to_time, + no_ctrl_char => \&no_ctrl_char, + percent => \&percent, + commify => \&commify, + dulint_to_int => \&dulint_to_int, + set_precision => \&set_precision, +); + +# Table definitions {{{3 +# This hash defines every table that can get displayed in every mode. Each +# table specifies columns and column data sources. The column is +# defined by the %columns hash. +# +# Example: foo => { src => 'bar' } means the foo column (look at +# $columns{foo} for its definition) gets its data from the 'bar' element of +# the current data set, whatever that is. +# +# These columns are post-processed after being defined, because they get stuff +# from %columns. After all the config is loaded for columns, there's more +# post-processing too; the subroutines compiled from src get added to +# the hash elements for extract_values to use. +# ########################################################################### + +my %tbl_meta = ( + adaptive_hash_index => { + capt => 'Adaptive Hash Index', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + hash_table_size => { src => 'IB_ib_hash_table_size', trans => [qw(shorten)], }, + used_cells => { src => 'IB_ib_used_cells' }, + bufs_in_node_heap => { src => 'IB_ib_bufs_in_node_heap' }, + hash_searches_s => { src => 'IB_ib_hash_searches_s' }, + non_hash_searches_s => { src => 'IB_ib_non_hash_searches_s' }, + }, + visible => [ qw(cxn hash_table_size used_cells bufs_in_node_heap hash_searches_s non_hash_searches_s) ], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'ib', + group_by => [], + aggregate => 0, + }, + buffer_pool => { + capt => 'Buffer Pool', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + total_mem_alloc => { src => 'IB_bp_total_mem_alloc', trans => [qw(shorten)], }, + awe_mem_alloc => { src => 'IB_bp_awe_mem_alloc', trans => [qw(shorten)], }, + add_pool_alloc => { src => 'IB_bp_add_pool_alloc', trans => [qw(shorten)], }, + buf_pool_size => { src => 'IB_bp_buf_pool_size', trans => [qw(shorten)], }, + buf_free => { src => 'IB_bp_buf_free' }, + buf_pool_hit_rate => { src => 'IB_bp_buf_pool_hit_rate' }, + buf_pool_reads => { src => 'IB_bp_buf_pool_reads' }, + buf_pool_hits => { src => 'IB_bp_buf_pool_hits' }, + dict_mem_alloc => { src => 'IB_bp_dict_mem_alloc' }, + pages_total => { src => 'IB_bp_pages_total' }, + pages_modified => { src => 'IB_bp_pages_modified' }, + reads_pending => { src => 'IB_bp_reads_pending' }, + writes_pending => { src => 'IB_bp_writes_pending' }, + writes_pending_lru => { src => 'IB_bp_writes_pending_lru' }, + writes_pending_flush_list => { src => 'IB_bp_writes_pending_flush_list' }, + writes_pending_single_page => { src => 'IB_bp_writes_pending_single_page' }, + page_creates_sec => { src => 'IB_bp_page_creates_sec' }, + page_reads_sec => { src => 'IB_bp_page_reads_sec' }, + page_writes_sec => { src => 'IB_bp_page_writes_sec' }, + pages_created => { src => 'IB_bp_pages_created' }, + pages_read => { src => 'IB_bp_pages_read' }, + pages_written => { src => 'IB_bp_pages_written' }, + }, + visible => [ qw(cxn buf_pool_size buf_free pages_total pages_modified buf_pool_hit_rate total_mem_alloc add_pool_alloc)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'bp', + group_by => [], + aggregate => 0, + }, + # TODO: a new step in set_to_tbl: join result to itself, grouped? + # TODO: this would also enable pulling Q and T data together. + # TODO: using a SQL-ish language would also allow pivots to be easier -- treat the pivoted data as a view and SELECT from it. + cmd_summary => { + capt => 'Command Summary', + cust => {}, + cols => { + name => { src => 'name' }, + total => { src => 'total' }, + value => { src => 'value', agg => 'sum'}, + pct => { src => 'value/total', trans => [qw(percent)] }, + last_total => { src => 'last_total' }, + last_value => { src => 'last_value', agg => 'sum'}, + last_pct => { src => 'last_value/last_total', trans => [qw(percent)] }, + }, + visible => [qw(name value pct last_value last_pct)], + filters => [qw()], + sort_cols => '-value', + sort_dir => '1', + innodb => '', + group_by => [qw(name)], + aggregate => 1, + }, + deadlock_locks => { + capt => 'Deadlock Locks', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + mysql_thread_id => { src => 'mysql_thread_id' }, + dl_txn_num => { src => 'dl_txn_num' }, + lock_type => { src => 'lock_type' }, + space_id => { src => 'space_id' }, + page_no => { src => 'page_no' }, + heap_no => { src => 'heap_no' }, + n_bits => { src => 'n_bits' }, + index => { src => 'index' }, + db => { src => 'db' }, + tbl => { src => 'table' }, + lock_mode => { src => 'lock_mode' }, + special => { src => 'special' }, + insert_intention => { src => 'insert_intention' }, + waiting => { src => 'waiting' }, + }, + visible => [ qw(cxn mysql_thread_id waiting lock_mode db tbl index special insert_intention)], + filters => [], + sort_cols => 'cxn mysql_thread_id', + sort_dir => '1', + innodb => 'dl', + group_by => [], + aggregate => 0, + }, + deadlock_transactions => { + capt => 'Deadlock Transactions', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + active_secs => { src => 'active_secs' }, + dl_txn_num => { src => 'dl_txn_num' }, + has_read_view => { src => 'has_read_view' }, + heap_size => { src => 'heap_size' }, + host_and_domain => { src => 'hostname' }, + hostname => { src => $exprs{Host} }, + ip => { src => 'ip' }, + lock_structs => { src => 'lock_structs' }, + lock_wait_time => { src => 'lock_wait_time', trans => [ qw(secs_to_time) ] }, + mysql_thread_id => { src => 'mysql_thread_id' }, + os_thread_id => { src => 'os_thread_id' }, + proc_no => { src => 'proc_no' }, + query_id => { src => 'query_id' }, + query_status => { src => 'query_status' }, + query_text => { src => 'query_text', trans => [ qw(no_ctrl_char) ] }, + row_locks => { src => 'row_locks' }, + tables_in_use => { src => 'tables_in_use' }, + tables_locked => { src => 'tables_locked' }, + thread_decl_inside => { src => 'thread_decl_inside' }, + thread_status => { src => 'thread_status' }, + 'time' => { src => 'active_secs', trans => [ qw(secs_to_time) ] }, + timestring => { src => 'timestring' }, + txn_doesnt_see_ge => { src => 'txn_doesnt_see_ge' }, + txn_id => { src => 'txn_id' }, + txn_sees_lt => { src => 'txn_sees_lt' }, + txn_status => { src => 'txn_status' }, + truncates => { src => 'truncates' }, + undo_log_entries => { src => 'undo_log_entries' }, + user => { src => 'user' }, + victim => { src => 'victim' }, + wait_status => { src => 'lock_wait_status' }, + }, + visible => [ qw(cxn mysql_thread_id timestring user hostname victim time undo_log_entries lock_structs query_text)], + filters => [], + sort_cols => 'cxn mysql_thread_id', + sort_dir => '1', + innodb => 'dl', + group_by => [], + aggregate => 0, + }, + explain => { + capt => 'EXPLAIN Results', + cust => {}, + cols => { + part_id => { src => 'id' }, + select_type => { src => 'select_type' }, + tbl => { src => 'table' }, + partitions => { src => 'partitions' }, + scan_type => { src => 'type' }, + possible_keys => { src => 'possible_keys' }, + index => { src => 'key' }, + key_len => { src => 'key_len' }, + index_ref => { src => 'ref' }, + num_rows => { src => 'rows' }, + special => { src => 'extra' }, + }, + visible => [ qw(select_type tbl partitions scan_type possible_keys index key_len index_ref num_rows special)], + filters => [], + sort_cols => '', + sort_dir => '1', + innodb => '', + group_by => [], + aggregate => 0, + }, + file_io_misc => { + capt => 'File I/O Misc', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + io_bytes_s => { src => 'IB_io_avg_bytes_s' }, + io_flush_type => { src => 'IB_io_flush_type' }, + io_fsyncs_s => { src => 'IB_io_fsyncs_s' }, + io_reads_s => { src => 'IB_io_reads_s' }, + io_writes_s => { src => 'IB_io_writes_s' }, + os_file_reads => { src => 'IB_io_os_file_reads' }, + os_file_writes => { src => 'IB_io_os_file_writes' }, + os_fsyncs => { src => 'IB_io_os_fsyncs' }, + }, + visible => [ qw(cxn os_file_reads os_file_writes os_fsyncs io_reads_s io_writes_s io_bytes_s)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'io', + group_by => [], + aggregate => 0, + }, + fk_error => { + capt => 'Foreign Key Error Info', + cust => {}, + cols => { + timestring => { src => 'IB_fk_timestring' }, + child_db => { src => 'IB_fk_child_db' }, + child_table => { src => 'IB_fk_child_table' }, + child_index => { src => 'IB_fk_child_index' }, + fk_name => { src => 'IB_fk_fk_name' }, + parent_db => { src => 'IB_fk_parent_db' }, + parent_table => { src => 'IB_fk_parent_table' }, + parent_col => { src => 'IB_fk_parent_col' }, + parent_index => { src => 'IB_fk_parent_index' }, + attempted_op => { src => 'IB_fk_attempted_op' }, + }, + visible => [ qw(timestring child_db child_table child_index parent_db parent_table parent_col parent_index fk_name attempted_op)], + filters => [], + sort_cols => '', + sort_dir => '1', + innodb => 'fk', + group_by => [], + aggregate => 0, + }, + insert_buffers => { + capt => 'Insert Buffers', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + inserts => { src => 'IB_ib_inserts' }, + merged_recs => { src => 'IB_ib_merged_recs' }, + merges => { src => 'IB_ib_merges' }, + size => { src => 'IB_ib_size' }, + free_list_len => { src => 'IB_ib_free_list_len' }, + seg_size => { src => 'IB_ib_seg_size' }, + }, + visible => [ qw(cxn inserts merged_recs merges size free_list_len seg_size)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'ib', + group_by => [], + aggregate => 0, + }, + innodb_locks => { + capt => 'InnoDB Locks', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + db => { src => 'db' }, + index => { src => 'index' }, + insert_intention => { src => 'insert_intention' }, + lock_mode => { src => 'lock_mode' }, + lock_type => { src => 'lock_type' }, + lock_wait_time => { src => 'lock_wait_time', trans => [ qw(secs_to_time) ] }, + mysql_thread_id => { src => 'mysql_thread_id' }, + n_bits => { src => 'n_bits' }, + page_no => { src => 'page_no' }, + space_id => { src => 'space_id' }, + special => { src => 'special' }, + tbl => { src => 'table' }, + 'time' => { src => 'active_secs', hdr => 'Active', trans => [ qw(secs_to_time) ] }, + txn_id => { src => 'txn_id' }, + waiting => { src => 'waiting' }, + }, + visible => [ qw(cxn mysql_thread_id lock_type waiting lock_wait_time time lock_mode db tbl index insert_intention special)], + filters => [], + sort_cols => 'cxn -lock_wait_time', + sort_dir => '1', + innodb => 'tx', + colors => [ + { col => 'lock_wait_time', op => '>', arg => 60, color => 'red' }, + { col => 'lock_wait_time', op => '>', arg => 30, color => 'yellow' }, + { col => 'lock_wait_time', op => '>', arg => 10, color => 'green' }, + ], + group_by => [], + aggregate => 0, + }, + innodb_transactions => { + capt => 'InnoDB Transactions', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + active_secs => { src => 'active_secs' }, + has_read_view => { src => 'has_read_view' }, + heap_size => { src => 'heap_size' }, + hostname => { src => $exprs{Host} }, + ip => { src => 'ip' }, + wait_status => { src => 'lock_wait_status' }, + lock_wait_time => { src => 'lock_wait_time', trans => [ qw(secs_to_time) ] }, + lock_structs => { src => 'lock_structs' }, + mysql_thread_id => { src => 'mysql_thread_id' }, + os_thread_id => { src => 'os_thread_id' }, + proc_no => { src => 'proc_no' }, + query_id => { src => 'query_id' }, + query_status => { src => 'query_status' }, + query_text => { src => 'query_text', trans => [ qw(no_ctrl_char) ] }, + txn_time_remain => { src => $exprs{TxnTimeRemain}, trans => [ qw(secs_to_time) ] }, + row_locks => { src => 'row_locks' }, + tables_in_use => { src => 'tables_in_use' }, + tables_locked => { src => 'tables_locked' }, + thread_decl_inside => { src => 'thread_decl_inside' }, + thread_status => { src => 'thread_status' }, + 'time' => { src => 'active_secs', trans => [ qw(secs_to_time) ], agg => 'sum' }, + txn_doesnt_see_ge => { src => 'txn_doesnt_see_ge' }, + txn_id => { src => 'txn_id' }, + txn_sees_lt => { src => 'txn_sees_lt' }, + txn_status => { src => 'txn_status', minw => 10, maxw => 10 }, + undo_log_entries => { src => 'undo_log_entries' }, + user => { src => 'user', maxw => 10 }, + cnt => { src => 'mysql_thread_id', minw => 0 }, + }, + visible => [ qw(cxn cnt mysql_thread_id user hostname txn_status time undo_log_entries query_text)], + filters => [ qw( hide_self hide_inactive ) ], + sort_cols => '-active_secs txn_status cxn mysql_thread_id', + sort_dir => '1', + innodb => 'tx', + hide_caption => 1, + colors => [ + { col => 'wait_status', op => 'eq', arg => 'LOCK WAIT', color => 'black on_red' }, + { col => 'time', op => '>', arg => 600, color => 'red' }, + { col => 'time', op => '>', arg => 300, color => 'yellow' }, + { col => 'time', op => '>', arg => 60, color => 'green' }, + { col => 'time', op => '>', arg => 30, color => 'cyan' }, + { col => 'txn_status', op => 'eq', arg => 'not started', color => 'white' }, + ], + group_by => [ qw(cxn txn_status) ], + aggregate => 0, + }, + io_threads => { + capt => 'I/O Threads', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + thread => { src => 'thread' }, + thread_purpose => { src => 'purpose' }, + event_set => { src => 'event_set' }, + thread_status => { src => 'state' }, + }, + visible => [ qw(cxn thread thread_purpose thread_status)], + filters => [ qw() ], + sort_cols => 'cxn thread', + sort_dir => '1', + innodb => 'io', + group_by => [], + aggregate => 0, + }, + log_statistics => { + capt => 'Log Statistics', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + last_chkp => { src => 'IB_lg_last_chkp' }, + log_flushed_to => { src => 'IB_lg_log_flushed_to' }, + log_ios_done => { src => 'IB_lg_log_ios_done' }, + log_ios_s => { src => 'IB_lg_log_ios_s' }, + log_seq_no => { src => 'IB_lg_log_seq_no' }, + pending_chkp_writes => { src => 'IB_lg_pending_chkp_writes' }, + pending_log_writes => { src => 'IB_lg_pending_log_writes' }, + }, + visible => [ qw(cxn log_seq_no log_flushed_to last_chkp log_ios_done log_ios_s)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'lg', + group_by => [], + aggregate => 0, + }, + master_status => { + capt => 'Master Status', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + binlog_do_db => { src => 'binlog_do_db' }, + binlog_ignore_db => { src => 'binlog_ignore_db' }, + master_file => { src => 'file' }, + master_pos => { src => 'position' }, + binlog_cache_overflow => { src => '(Binlog_cache_disk_use||0)/(Binlog_cache_use||1)', trans => [ qw(percent) ] }, + }, + visible => [ qw(cxn master_file master_pos binlog_cache_overflow)], + filters => [ qw(cxn_is_master) ], + sort_cols => 'cxn', + sort_dir => '1', + innodb => '', + group_by => [], + aggregate => 0, + }, + pending_io => { + capt => 'Pending I/O', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + p_normal_aio_reads => { src => 'IB_io_pending_normal_aio_reads' }, + p_aio_writes => { src => 'IB_io_pending_aio_writes' }, + p_ibuf_aio_reads => { src => 'IB_io_pending_ibuf_aio_reads' }, + p_sync_ios => { src => 'IB_io_pending_sync_ios' }, + p_buf_pool_flushes => { src => 'IB_io_pending_buffer_pool_flushes' }, + p_log_flushes => { src => 'IB_io_pending_log_flushes' }, + p_log_ios => { src => 'IB_io_pending_log_ios' }, + p_preads => { src => 'IB_io_pending_preads' }, + p_pwrites => { src => 'IB_io_pending_pwrites' }, + }, + visible => [ qw(cxn p_normal_aio_reads p_aio_writes p_ibuf_aio_reads p_sync_ios p_log_flushes p_log_ios)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'io', + group_by => [], + aggregate => 0, + }, + open_tables => { + capt => 'Open Tables', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + db => { src => 'database' }, + tbl => { src => 'table' }, + num_times_open => { src => 'in_use' }, + is_name_locked => { src => 'name_locked' }, + }, + visible => [ qw(cxn db tbl num_times_open is_name_locked)], + filters => [ qw(table_is_open) ], + sort_cols => '-num_times_open cxn db tbl', + sort_dir => '1', + innodb => '', + group_by => [], + aggregate => 0, + }, + page_statistics => { + capt => 'Page Statistics', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + pages_read => { src => 'IB_bp_pages_read' }, + pages_written => { src => 'IB_bp_pages_written' }, + pages_created => { src => 'IB_bp_pages_created' }, + page_reads_sec => { src => 'IB_bp_page_reads_sec' }, + page_writes_sec => { src => 'IB_bp_page_writes_sec' }, + page_creates_sec => { src => 'IB_bp_page_creates_sec' }, + }, + visible => [ qw(cxn pages_read pages_written pages_created page_reads_sec page_writes_sec page_creates_sec)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'bp', + group_by => [], + aggregate => 0, + }, + processlist => { + capt => 'MySQL Process List', + cust => {}, + cols => { + cxn => { src => 'cxn', minw => 6, maxw => 10 }, + mysql_thread_id => { src => 'id', minw => 6, maxw => 0 }, + user => { src => 'user', minw => 5, maxw => 8 }, + hostname => { src => $exprs{Host}, minw => 13, maxw => 8, }, + port => { src => $exprs{Port}, minw => 0, maxw => 0, }, + host_and_port => { src => 'host', minw => 0, maxw => 0 }, + db => { src => 'db', minw => 6, maxw => 12 }, + cmd => { src => 'command', minw => 5, maxw => 0 }, + time => { src => 'time', minw => 5, maxw => 0, trans => [ qw(secs_to_time) ], agg => 'sum' }, + state => { src => 'state', minw => 0, maxw => 0 }, + info => { src => 'info', minw => 0, maxw => 0, trans => [ qw(no_ctrl_char) ] }, + cnt => { src => 'id', minw => 0, maxw => 0 }, + }, + visible => [ qw(cxn cmd cnt mysql_thread_id state user hostname db time info)], + filters => [ qw(hide_self hide_inactive hide_slave_io) ], + sort_cols => '-time cxn hostname mysql_thread_id', + sort_dir => '1', + innodb => '', + hide_caption => 1, + colors => [ + { col => 'state', op => 'eq', arg => 'Locked', color => 'black on_red' }, + { col => 'cmd', op => 'eq', arg => 'Sleep', color => 'white' }, + { col => 'user', op => 'eq', arg => 'system user', color => 'white' }, + { col => 'cmd', op => 'eq', arg => 'Connect', color => 'white' }, + { col => 'cmd', op => 'eq', arg => 'Binlog Dump', color => 'white' }, + { col => 'time', op => '>', arg => 600, color => 'red' }, + { col => 'time', op => '>', arg => 120, color => 'yellow' }, + { col => 'time', op => '>', arg => 60, color => 'green' }, + { col => 'time', op => '>', arg => 30, color => 'cyan' }, + ], + group_by => [qw(cxn cmd)], + aggregate => 0, + }, + + # TODO: some more columns: + # kb_used=hdr='BufUsed' minw='0' num='0' src='percent(1 - ((Key_blocks_unused * key_cache_block_size) / (key_buffer_size||1)))' dec='0' trans='' tbl='q_header' just='-' user='1' maxw='0' label='User-defined' + # retries=hdr='Retries' minw='0' num='0' src='Slave_retried_transactions' dec='0' trans='' tbl='slave_sql_status' just='-' user='1' maxw='0' label='User-defined' + # thd=hdr='Thd' minw='0' num='0' src='Threads_connected' dec='0' trans='' tbl='slave_sql_status' just='-' user='1' maxw='0' label='User-defined' + + q_header => { + capt => 'Q-mode Header', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + questions => { src => 'Questions' }, + qps => { src => 'Questions/Uptime_hires', dec => 1, trans => [qw(shorten)] }, + load => { src => $exprs{ServerLoad}, dec => 1, trans => [qw(shorten)] }, + slow => { src => 'Slow_queries', dec => 1, trans => [qw(shorten)] }, + q_cache_hit => { src => $exprs{QcacheHitRatio}, dec => 1, trans => [qw(percent)] }, + key_buffer_hit => { src => '1-(Key_reads/(Key_read_requests||1))', dec => 1, trans => [qw(percent)] }, + bps_in => { src => 'Bytes_received/Uptime_hires', dec => 1, trans => [qw(shorten)] }, + bps_out => { src => 'Bytes_sent/Uptime_hires', dec => 1, trans => [qw(shorten)] }, + when => { src => 'when' }, + }, + visible => [ qw(cxn when load qps slow q_cache_hit key_buffer_hit bps_in bps_out)], + filters => [], + sort_cols => 'when cxn', + sort_dir => '1', + innodb => '', + hide_caption => 1, + group_by => [], + aggregate => 0, + }, + row_operations => { + capt => 'InnoDB Row Operations', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + num_inserts => { src => 'IB_ro_num_rows_ins' }, + num_updates => { src => 'IB_ro_num_rows_upd' }, + num_reads => { src => 'IB_ro_num_rows_read' }, + num_deletes => { src => 'IB_ro_num_rows_del' }, + num_inserts_sec => { src => 'IB_ro_ins_sec' }, + num_updates_sec => { src => 'IB_ro_upd_sec' }, + num_reads_sec => { src => 'IB_ro_read_sec' }, + num_deletes_sec => { src => 'IB_ro_del_sec' }, + }, + visible => [ qw(cxn num_inserts num_updates num_reads num_deletes num_inserts_sec + num_updates_sec num_reads_sec num_deletes_sec)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'ro', + group_by => [], + aggregate => 0, + }, + row_operation_misc => { + capt => 'Row Operation Misc', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + queries_in_queue => { src => 'IB_ro_queries_in_queue' }, + queries_inside => { src => 'IB_ro_queries_inside' }, + read_views_open => { src => 'IB_ro_read_views_open' }, + main_thread_id => { src => 'IB_ro_main_thread_id' }, + main_thread_proc_no => { src => 'IB_ro_main_thread_proc_no' }, + main_thread_state => { src => 'IB_ro_main_thread_state' }, + num_res_ext => { src => 'IB_ro_n_reserved_extents' }, + }, + visible => [ qw(cxn queries_in_queue queries_inside read_views_open main_thread_state)], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'ro', + group_by => [], + aggregate => 0, + }, + semaphores => { + capt => 'InnoDB Semaphores', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + mutex_os_waits => { src => 'IB_sm_mutex_os_waits' }, + mutex_spin_rounds => { src => 'IB_sm_mutex_spin_rounds' }, + mutex_spin_waits => { src => 'IB_sm_mutex_spin_waits' }, + reservation_count => { src => 'IB_sm_reservation_count' }, + rw_excl_os_waits => { src => 'IB_sm_rw_excl_os_waits' }, + rw_excl_spins => { src => 'IB_sm_rw_excl_spins' }, + rw_shared_os_waits => { src => 'IB_sm_rw_shared_os_waits' }, + rw_shared_spins => { src => 'IB_sm_rw_shared_spins' }, + signal_count => { src => 'IB_sm_signal_count' }, + wait_array_size => { src => 'IB_sm_wait_array_size' }, + }, + visible => [ qw(cxn mutex_os_waits mutex_spin_waits mutex_spin_rounds + rw_excl_os_waits rw_excl_spins rw_shared_os_waits rw_shared_spins + signal_count reservation_count )], + filters => [], + sort_cols => 'cxn', + sort_dir => '1', + innodb => 'sm', + group_by => [], + aggregate => 0, + }, + slave_io_status => { + capt => 'Slave I/O Status', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + connect_retry => { src => 'connect_retry' }, + master_host => { src => 'master_host', hdr => 'Master'}, + master_log_file => { src => 'master_log_file', hdr => 'File' }, + master_port => { src => 'master_port' }, + master_ssl_allowed => { src => 'master_ssl_allowed' }, + master_ssl_ca_file => { src => 'master_ssl_ca_file' }, + master_ssl_ca_path => { src => 'master_ssl_ca_path' }, + master_ssl_cert => { src => 'master_ssl_cert' }, + master_ssl_cipher => { src => 'master_ssl_cipher' }, + master_ssl_key => { src => 'master_ssl_key' }, + master_user => { src => 'master_user' }, + read_master_log_pos => { src => 'read_master_log_pos', hdr => 'Pos' }, + relay_log_size => { src => 'relay_log_space', trans => [qw(shorten)] }, + slave_io_running => { src => 'slave_io_running', hdr => 'On?' }, + slave_io_state => { src => 'slave_io_state', hdr => 'State' }, + }, + visible => [ qw(cxn master_host slave_io_running master_log_file relay_log_size read_master_log_pos slave_io_state)], + filters => [ qw( cxn_is_slave ) ], + sort_cols => 'slave_io_running cxn', + colors => [ + { col => 'slave_io_running', op => 'ne', arg => 'Yes', color => 'black on_red' }, + ], + sort_dir => '1', + innodb => '', + group_by => [], + aggregate => 0, + }, + slave_sql_status => { + capt => 'Slave SQL Status', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + exec_master_log_pos => { src => 'exec_master_log_pos', hdr => 'Master Pos' }, + last_errno => { src => 'last_errno' }, + last_error => { src => 'last_error' }, + master_host => { src => 'master_host', hdr => 'Master' }, + relay_log_file => { src => 'relay_log_file' }, + relay_log_pos => { src => 'relay_log_pos' }, + relay_log_size => { src => 'relay_log_space', trans => [qw(shorten)] }, + relay_master_log_file => { src => 'relay_master_log_file', hdr => 'Master File' }, + replicate_do_db => { src => 'replicate_do_db' }, + replicate_do_table => { src => 'replicate_do_table' }, + replicate_ignore_db => { src => 'replicate_ignore_db' }, + replicate_ignore_table => { src => 'replicate_ignore_table' }, + replicate_wild_do_table => { src => 'replicate_wild_do_table' }, + replicate_wild_ignore_table => { src => 'replicate_wild_ignore_table' }, + skip_counter => { src => 'skip_counter' }, + slave_sql_running => { src => 'slave_sql_running', hdr => 'On?' }, + until_condition => { src => 'until_condition' }, + until_log_file => { src => 'until_log_file' }, + until_log_pos => { src => 'until_log_pos' }, + time_behind_master => { src => 'seconds_behind_master', trans => [ qw(secs_to_time) ] }, + bytes_behind_master => { src => 'master_log_file && master_log_file eq relay_master_log_file ? read_master_log_pos - exec_master_log_pos : 0', trans => [qw(shorten)] }, + slave_catchup_rate => { src => $exprs{SlaveCatchupRate}, trans => [ qw(set_precision) ] }, + slave_open_temp_tables => { src => 'Slave_open_temp_tables' }, + }, + visible => [ qw(cxn master_host slave_sql_running time_behind_master slave_catchup_rate slave_open_temp_tables relay_log_pos last_error)], + filters => [ qw( cxn_is_slave ) ], + sort_cols => 'slave_sql_running cxn', + sort_dir => '1', + innodb => '', + colors => [ + { col => 'slave_sql_running', op => 'ne', arg => 'Yes', color => 'black on_red' }, + { col => 'time_behind_master', op => '>', arg => 600, color => 'red' }, + { col => 'time_behind_master', op => '>', arg => 60, color => 'yellow' }, + { col => 'time_behind_master', op => '==', arg => 0, color => 'white' }, + ], + group_by => [], + aggregate => 0, + }, + t_header => { + capt => 'T-Mode Header', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + dirty_bufs => { src => $exprs{DirtyBufs}, trans => [qw(percent)] }, + history_list_len => { src => 'IB_tx_history_list_len' }, + lock_structs => { src => 'IB_tx_num_lock_structs' }, + num_txns => { src => $exprs{NumTxns} }, + max_txn => { src => $exprs{MaxTxnTime}, trans => [qw(secs_to_time)] }, + undo_for => { src => 'IB_tx_purge_undo_for' }, + used_bufs => { src => $exprs{BufPoolFill}, trans => [qw(percent)]}, + versions => { src => $exprs{OldVersions} }, + }, + visible => [ qw(cxn history_list_len versions undo_for dirty_bufs used_bufs num_txns max_txn lock_structs)], + filters => [ ], + sort_cols => 'cxn', + sort_dir => '1', + innodb => '', + colors => [], + hide_caption => 1, + group_by => [], + aggregate => 0, + }, + var_status => { + capt => 'Variables & Status', + cust => {}, + cols => {}, # Generated from current varset + visible => [], # Generated from current varset + filters => [], + sort_cols => '', + sort_dir => 1, + innodb => '', + temp => 1, # Do not persist to config file. + hide_caption => 1, + pivot => 0, + group_by => [], + aggregate => 0, + }, + wait_array => { + capt => 'InnoDB Wait Array', + cust => {}, + cols => { + cxn => { src => 'cxn' }, + thread => { src => 'thread' }, + waited_at_filename => { src => 'waited_at_filename' }, + waited_at_line => { src => 'waited_at_line' }, + 'time' => { src => 'waited_secs', trans => [ qw(secs_to_time) ] }, + request_type => { src => 'request_type' }, + lock_mem_addr => { src => 'lock_mem_addr' }, + lock_cfile_name => { src => 'lock_cfile_name' }, + lock_cline => { src => 'lock_cline' }, + writer_thread => { src => 'writer_thread' }, + writer_lock_mode => { src => 'writer_lock_mode' }, + num_readers => { src => 'num_readers' }, + lock_var => { src => 'lock_var' }, + waiters_flag => { src => 'waiters_flag' }, + last_s_file_name => { src => 'last_s_file_name' }, + last_s_line => { src => 'last_s_line' }, + last_x_file_name => { src => 'last_x_file_name' }, + last_x_line => { src => 'last_x_line' }, + cell_waiting => { src => 'cell_waiting' }, + cell_event_set => { src => 'cell_event_set' }, + }, + visible => [ qw(cxn thread time waited_at_filename waited_at_line request_type num_readers lock_var waiters_flag cell_waiting cell_event_set)], + filters => [], + sort_cols => 'cxn -time', + sort_dir => '1', + innodb => 'sm', + group_by => [], + aggregate => 0, + }, +); + +# Initialize %tbl_meta from %columns and do some checks. +foreach my $table_name ( keys %tbl_meta ) { + my $table = $tbl_meta{$table_name}; + my $cols = $table->{cols}; + + foreach my $col_name ( keys %$cols ) { + my $col_def = $table->{cols}->{$col_name}; + die "I can't find a column named '$col_name' for '$table_name'" unless $columns{$col_name}; + $columns{$col_name}->{referenced} = 1; + + foreach my $prop ( keys %col_props ) { + # Each column gets non-existing values set from %columns or defaults from %col_props. + if ( !$col_def->{$prop} ) { + $col_def->{$prop} + = defined($columns{$col_name}->{$prop}) + ? $columns{$col_name}->{$prop} + : $col_props{$prop}; + } + } + + # Ensure transformations and aggregate functions are valid + die "Unknown aggregate function '$col_def->{agg}' " + . "for column '$col_name' in table '$table_name'" + unless exists $agg_funcs{$col_def->{agg}}; + foreach my $trans ( @{$col_def->{trans}} ) { + die "Unknown transformation '$trans' " + . "for column '$col_name' in table '$table_name'" + unless exists $trans_funcs{$trans}; + } + } + + # Ensure each column in visible and group_by exists in cols + foreach my $place ( qw(visible group_by) ) { + foreach my $col_name ( @{$table->{$place}} ) { + if ( !exists $cols->{$col_name} ) { + die "Column '$col_name' is listed in '$place' for '$table_name', but doesn't exist"; + } + } + } + + # Compile sort and color subroutines + $table->{sort_func} = make_sort_func($table); + $table->{color_func} = make_color_func($table); +} + +# This is for code cleanup: +{ + my @unused_cols = grep { !$columns{$_}->{referenced} } sort keys %columns; + if ( @unused_cols ) { + die "The following columns are not used: " + . join(' ', @unused_cols); + } +} + +# ########################################################################### +# Operating modes {{{3 +# ########################################################################### +my %modes = ( + B => { + hdr => 'InnoDB Buffers', + cust => {}, + note => 'Shows buffer info from InnoDB', + action_for => { + i => { + action => sub { toggle_config('status_inc') }, + label => 'Toggle incremental status display', + }, + }, + display_sub => \&display_B, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(buffer_pool page_statistics insert_buffers adaptive_hash_index)], + visible_tables => [qw(buffer_pool page_statistics insert_buffers adaptive_hash_index)], + }, + C => { + hdr => 'Command Summary', + cust => {}, + note => 'Shows relative magnitude of variables', + action_for => { + s => { + action => sub { get_config_interactive('cmd_filter') }, + label => 'Choose variable prefix', + }, + }, + display_sub => \&display_C, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(cmd_summary)], + visible_tables => [qw(cmd_summary)], + }, + D => { + hdr => 'InnoDB Deadlocks', + cust => {}, + note => 'View InnoDB deadlock information', + action_for => { + c => { + action => sub { edit_table('deadlock_transactions') }, + label => 'Choose visible columns', + }, + w => { + action => \&create_deadlock, + label => 'Wipe deadlock status info by creating a deadlock', + }, + }, + display_sub => \&display_D, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(deadlock_transactions deadlock_locks)], + visible_tables => [qw(deadlock_transactions deadlock_locks)], + }, + F => { + hdr => 'InnoDB FK Err', + cust => {}, + note => 'View the latest InnoDB foreign key error', + action_for => {}, + display_sub => \&display_F, + connections => [], + server_group => '', + one_connection => 1, + tables => [qw(fk_error)], + visible_tables => [qw(fk_error)], + }, + I => { + hdr => 'InnoDB I/O Info', + cust => {}, + note => 'Shows I/O info (i/o, log...) from InnoDB', + action_for => { + i => { + action => sub { toggle_config('status_inc') }, + label => 'Toggle incremental status display', + }, + }, + display_sub => \&display_I, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(io_threads pending_io file_io_misc log_statistics)], + visible_tables => [qw(io_threads pending_io file_io_misc log_statistics)], + }, + L => { + hdr => 'Locks', + cust => {}, + note => 'Shows transaction locks', + action_for => { + a => { + action => sub { send_cmd_to_servers('CREATE TABLE IF NOT EXISTS test.innodb_lock_monitor(a int) ENGINE=InnoDB', 0, '', []); }, + label => 'Start the InnoDB Lock Monitor', + }, + o => { + action => sub { send_cmd_to_servers('DROP TABLE IF EXISTS test.innodb_lock_monitor', 0, '', []); }, + label => 'Stop the InnoDB Lock Monitor', + }, + }, + display_sub => \&display_L, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(innodb_locks)], + visible_tables => [qw(innodb_locks)], + }, + M => { + hdr => 'Replication Status', + cust => {}, + note => 'Shows replication (master and slave) status', + action_for => { + a => { + action => sub { send_cmd_to_servers('START SLAVE', 0, 'START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE = ?, MASTER_LOG_POS = ?', []); }, + label => 'Start slave(s)', + }, + i => { + action => sub { toggle_config('status_inc') }, + label => 'Toggle incremental status display', + }, + o => { + action => sub { send_cmd_to_servers('STOP SLAVE', 0, '', []); }, + label => 'Stop slave(s)', + }, + b => { + action => sub { purge_master_logs() }, + label => 'Purge unused master logs', + }, + }, + display_sub => \&display_M, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(slave_sql_status slave_io_status master_status)], + visible_tables => [qw(slave_sql_status slave_io_status master_status)], + }, + O => { + hdr => 'Open Tables', + cust => {}, + note => 'Shows open tables in MySQL', + action_for => { + r => { + action => sub { reverse_sort('open_tables'); }, + label => 'Reverse sort order', + }, + s => { + action => sub { choose_sort_cols('open_tables'); }, + label => "Choose sort column", + }, + }, + display_sub => \&display_O, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(open_tables)], + visible_tables => [qw(open_tables)], + }, + Q => { + hdr => 'Query List', + cust => {}, + note => 'Shows queries from SHOW FULL PROCESSLIST', + action_for => { + a => { + action => sub { toggle_filter('processlist', 'hide_self') }, + label => 'Toggle the innotop process', + }, + c => { + action => sub { edit_table('processlist') }, + label => 'Choose visible columns', + }, + e => { + action => sub { analyze_query('e'); }, + label => "Explain a thread's query", + }, + f => { + action => sub { analyze_query('f'); }, + label => "Show a thread's full query", + }, + h => { + action => sub { toggle_visible_table('Q', 'q_header') }, + label => 'Toggle the header on and off', + }, + i => { + action => sub { toggle_filter('processlist', 'hide_inactive') }, + label => 'Toggle idle processes', + }, + k => { + action => sub { kill_query('CONNECTION') }, + label => "Kill a query's connection", + }, + r => { + action => sub { reverse_sort('processlist'); }, + label => 'Reverse sort order', + }, + s => { + action => sub { choose_sort_cols('processlist'); }, + label => "Change the display's sort column", + }, + x => { + action => sub { kill_query('QUERY') }, + label => "Kill a query", + }, + }, + display_sub => \&display_Q, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(q_header processlist)], + visible_tables => [qw(q_header processlist)], + }, + R => { + hdr => 'InnoDB Row Ops', + cust => {}, + note => 'Shows InnoDB row operation and semaphore info', + action_for => { + i => { + action => sub { toggle_config('status_inc') }, + label => 'Toggle incremental status display', + }, + }, + display_sub => \&display_R, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(row_operations row_operation_misc semaphores wait_array)], + visible_tables => [qw(row_operations row_operation_misc semaphores wait_array)], + }, + S => { + hdr => 'Variables & Status', + cust => {}, + note => 'Shows query load statistics a la vmstat', + action_for => { + '>' => { + action => sub { switch_var_set('S_set', 1) }, + label => 'Switch to next variable set', + }, + '<' => { + action => sub { switch_var_set('S_set', -1) }, + label => 'Switch to prev variable set', + }, + c => { + action => sub { + choose_var_set('S_set'); + start_S_mode(); + }, + label => "Choose which set to display", + }, + e => { + action => \&edit_current_var_set, + label => 'Edit the current set of variables', + }, + i => { + action => sub { $clear_screen_sub->(); toggle_config('status_inc') }, + label => 'Toggle incremental status display', + }, + '-' => { + action => sub { set_display_precision(-1) }, + label => 'Decrease fractional display precision', + }, + '+' => { + action => sub { set_display_precision(1) }, + label => 'Increase fractional display precision', + }, + g => { + action => sub { set_s_mode('g') }, + label => 'Switch to graph (tload) view', + }, + s => { + action => sub { set_s_mode('s') }, + label => 'Switch to standard (vmstat) view', + }, + v => { + action => sub { set_s_mode('v') }, + label => 'Switch to pivoted view', + }, + }, + display_sub => \&display_S, + no_clear_screen => 1, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(var_status)], + visible_tables => [qw(var_status)], + }, + T => { + hdr => 'InnoDB Txns', + cust => {}, + note => 'Shows InnoDB transactions in top-like format', + action_for => { + a => { + action => sub { toggle_filter('innodb_transactions', 'hide_self') }, + label => 'Toggle the innotop process', + }, + c => { + action => sub { edit_table('innodb_transactions') }, + label => 'Choose visible columns', + }, + e => { + action => sub { analyze_query('e'); }, + label => "Explain a thread's query", + }, + f => { + action => sub { analyze_query('f'); }, + label => "Show a thread's full query", + }, + h => { + action => sub { toggle_visible_table('T', 't_header') }, + label => 'Toggle the header on and off', + }, + i => { + action => sub { toggle_filter('innodb_transactions', 'hide_inactive') }, + label => 'Toggle inactive transactions', + }, + k => { + action => sub { kill_query('CONNECTION') }, + label => "Kill a transaction's connection", + }, + r => { + action => sub { reverse_sort('innodb_transactions'); }, + label => 'Reverse sort order', + }, + s => { + action => sub { choose_sort_cols('innodb_transactions'); }, + label => "Change the display's sort column", + }, + x => { + action => sub { kill_query('QUERY') }, + label => "Kill a query", + }, + }, + display_sub => \&display_T, + connections => [], + server_group => '', + one_connection => 0, + tables => [qw(t_header innodb_transactions)], + visible_tables => [qw(t_header innodb_transactions)], + }, +); + +# ########################################################################### +# Global key mappings {{{3 +# Keyed on a single character, which is read from the keyboard. Uppercase +# letters switch modes. Lowercase letters access commands when in a mode. +# These can be overridden by action_for in %modes. +# ########################################################################### +my %action_for = ( + '$' => { + action => \&edit_configuration, + label => 'Edit configuration settings', + }, + '?' => { + action => \&display_help, + label => 'Show help', + }, + '!' => { + action => \&display_license, + label => 'Show license and warranty', + }, + '^' => { + action => \&edit_table, + label => "Edit the displayed table(s)", + }, + '#' => { + action => \&choose_server_groups, + label => 'Select/create server groups', + }, + '@' => { + action => \&choose_servers, + label => 'Select/create server connections', + }, + '/' => { + action => \&add_quick_filter, + label => 'Quickly filter what you see', + }, + '\\' => { + action => \&clear_quick_filters, + label => 'Clear quick-filters', + }, + '%' => { + action => \&choose_filters, + label => 'Choose and edit table filters', + }, + "\t" => { + action => \&next_server_group, + label => 'Switch to the next server group', + key => 'TAB', + }, + '=' => { + action => \&toggle_aggregate, + label => 'Toggle aggregation', + }, + # TODO: can these be auto-generated from %modes? + B => { + action => sub { switch_mode('B') }, + label => '', + }, + C => { + action => sub { switch_mode('C') }, + label => '', + }, + D => { + action => sub { switch_mode('D') }, + label => '', + }, + F => { + action => sub { switch_mode('F') }, + label => '', + }, + I => { + action => sub { switch_mode('I') }, + label => '', + }, + L => { + action => sub { switch_mode('L') }, + label => '', + }, + M => { + action => sub { switch_mode('M') }, + label => '', + }, + O => { + action => sub { switch_mode('O') }, + label => '', + }, + Q => { + action => sub { switch_mode('Q') }, + label => '', + }, + R => { + action => sub { switch_mode('R') }, + label => '', + }, + S => { + action => \&start_S_mode, + label => '', + }, + T => { + action => sub { switch_mode('T') }, + label => '', + }, + d => { + action => sub { get_config_interactive('interval') }, + label => 'Change refresh interval', + }, + n => { action => \&next_server, label => 'Switch to the next connection' }, + p => { action => \&pause, label => 'Pause innotop', }, + q => { action => \&finish, label => 'Quit innotop', }, +); + +# ########################################################################### +# Sleep times after certain statements {{{3 +# ########################################################################### +my %stmt_sleep_time_for = (); + +# ########################################################################### +# Config editor key mappings {{{3 +# ########################################################################### +my %cfg_editor_action = ( + c => { + note => 'Edit columns, etc in the displayed table(s)', + func => \&edit_table, + }, + g => { + note => 'Edit general configuration', + func => \&edit_configuration_variables, + }, + k => { + note => 'Edit row-coloring rules', + func => \&edit_color_rules, + }, + p => { + note => 'Manage plugins', + func => \&edit_plugins, + }, + s => { + note => 'Edit server groups', + func => \&edit_server_groups, + }, + S => { + note => 'Edit SQL statement sleep delays', + func => \&edit_stmt_sleep_times, + }, + t => { + note => 'Choose which table(s) to display in this mode', + func => \&choose_mode_tables, + }, +); + +# ########################################################################### +# Color editor key mappings {{{3 +# ########################################################################### +my %color_editor_action = ( + n => { + note => 'Create a new color rule', + func => sub { + my ( $tbl, $idx ) = @_; + my $meta = $tbl_meta{$tbl}; + + $clear_screen_sub->(); + my $col; + do { + $col = prompt_list( + 'Choose the target column for the rule', + '', + sub { return keys %{$meta->{cols}} }, + { map { $_ => $meta->{cols}->{$_}->{label} } keys %{$meta->{cols}} }); + } while ( !$col ); + ( $col ) = grep { $_ } split(/\W+/, $col); + return $idx unless $col && exists $meta->{cols}->{$col}; + + $clear_screen_sub->(); + my $op; + do { + $op = prompt_list( + 'Choose the comparison operator for the rule', + '', + sub { return keys %comp_ops }, + { map { $_ => $comp_ops{$_} } keys %comp_ops } ); + } until ( $op ); + $op =~ s/\s+//g; + return $idx unless $op && exists $comp_ops{$op}; + + my $arg; + do { + $arg = prompt('Specify an argument for the comparison'); + } until defined $arg; + + my $color; + do { + $color = prompt_list( + 'Choose the color(s) the row should be when the rule matches', + '', + sub { return keys %ansicolors }, + { map { $_ => $_ } keys %ansicolors } ); + } until defined $color; + $color = join(' ', unique(grep { exists $ansicolors{$_} } split(/\W+/, $color))); + return $idx unless $color; + + push @{$tbl_meta{$tbl}->{colors}}, { + col => $col, + op => $op, + arg => $arg, + color => $color + }; + $tbl_meta{$tbl}->{cust}->{colors} = 1; + + return $idx; + }, + }, + d => { + note => 'Remove the selected rule', + func => sub { + my ( $tbl, $idx ) = @_; + my @rules = @{ $tbl_meta{$tbl}->{colors} }; + return 0 unless @rules > 0 && $idx < @rules && $idx >= 0; + splice(@{$tbl_meta{$tbl}->{colors}}, $idx, 1); + $tbl_meta{$tbl}->{cust}->{colors} = 1; + return $idx == @rules ? $#rules : $idx; + }, + }, + j => { + note => 'Move highlight down one', + func => sub { + my ( $tbl, $idx ) = @_; + my $num_rules = scalar @{$tbl_meta{$tbl}->{colors}}; + return ($idx + 1) % $num_rules; + }, + }, + k => { + note => 'Move highlight up one', + func => sub { + my ( $tbl, $idx ) = @_; + my $num_rules = scalar @{$tbl_meta{$tbl}->{colors}}; + return ($idx - 1) % $num_rules; + }, + }, + '+' => { + note => 'Move selected rule up one', + func => sub { + my ( $tbl, $idx ) = @_; + my $meta = $tbl_meta{$tbl}; + my $dest = $idx == 0 ? scalar(@{$meta->{colors}} - 1) : $idx - 1; + my $temp = $meta->{colors}->[$idx]; + $meta->{colors}->[$idx] = $meta->{colors}->[$dest]; + $meta->{colors}->[$dest] = $temp; + $meta->{cust}->{colors} = 1; + return $dest; + }, + }, + '-' => { + note => 'Move selected rule down one', + func => sub { + my ( $tbl, $idx ) = @_; + my $meta = $tbl_meta{$tbl}; + my $dest = $idx == scalar(@{$meta->{colors}} - 1) ? 0 : $idx + 1; + my $temp = $meta->{colors}->[$idx]; + $meta->{colors}->[$idx] = $meta->{colors}->[$dest]; + $meta->{colors}->[$dest] = $temp; + $meta->{cust}->{colors} = 1; + return $dest; + }, + }, +); + +# ########################################################################### +# Plugin editor key mappings {{{3 +# ########################################################################### +my %plugin_editor_action = ( + '*' => { + note => 'Toggle selected plugin active/inactive', + func => sub { + my ( $plugins, $idx ) = @_; + my $plugin = $plugins->[$idx]; + $plugin->{active} = $plugin->{active} ? 0 : 1; + return $idx; + }, + }, + j => { + note => 'Move highlight down one', + func => sub { + my ( $plugins, $idx ) = @_; + return ($idx + 1) % scalar(@$plugins); + }, + }, + k => { + note => 'Move highlight up one', + func => sub { + my ( $plugins, $idx ) = @_; + return $idx == 0 ? @$plugins - 1 : $idx - 1; + }, + }, +); + +# ########################################################################### +# Table editor key mappings {{{3 +# ########################################################################### +my %tbl_editor_action = ( + a => { + note => 'Add a column to the table', + func => sub { + my ( $tbl, $col ) = @_; + my @visible_cols = @{ $tbl_meta{$tbl}->{visible} }; + my %all_cols = %{ $tbl_meta{$tbl}->{cols} }; + delete @all_cols{@visible_cols}; + my $choice = prompt_list( + 'Choose a column', + '', + sub { return keys %all_cols; }, + { map { $_ => $all_cols{$_}->{label} || $all_cols{$_}->{hdr} } keys %all_cols }); + if ( $all_cols{$choice} ) { + push @{$tbl_meta{$tbl}->{visible}}, $choice; + $tbl_meta{$tbl}->{cust}->{visible} = 1; + return $choice; + } + return $col; + }, + }, + n => { + note => 'Create a new column and add it to the table', + func => sub { + my ( $tbl, $col ) = @_; + + $clear_screen_sub->(); + print word_wrap("Choose a name for the column. This name is not displayed, and is used only " + . "for internal reference. It can contain only lowercase letters, numbers, " + . "and underscores."); + print "\n\n"; + do { + $col = prompt("Enter column name"); + $col = '' if $col =~ m/[^a-z0-9_]/; + } while ( !$col ); + + $clear_screen_sub->(); + my $hdr; + do { + $hdr = prompt("Enter column header"); + } while ( !$hdr ); + + $clear_screen_sub->(); + print "Choose a source for the column's data\n\n"; + my ( $src, $sub, $err ); + do { + if ( $err ) { + print "Error: $err\n\n"; + } + $src = prompt("Enter column source"); + if ( $src ) { + ( $sub, $err ) = compile_expr($src); + } + } until ( !$err); + + # TODO: this duplicates %col_props. + $tbl_meta{$tbl}->{cols}->{$col} = { + hdr => $hdr, + src => $src, + just => '-', + num => 0, + label => 'User-defined', + user => 1, + tbl => $tbl, + minw => 0, + maxw => 0, + trans => [], + func => $sub, + dec => 0, + agg => 0, + aggonly => 0, + }; + + $tbl_meta{$tbl}->{visible} = [ unique(@{$tbl_meta{$tbl}->{visible}}, $col) ]; + $tbl_meta{$tbl}->{cust}->{visible} = 1; + return $col; + }, + }, + d => { + note => 'Remove selected column', + func => sub { + my ( $tbl, $col ) = @_; + my @visible_cols = @{ $tbl_meta{$tbl}->{visible} }; + my $idx = 0; + return $col unless @visible_cols > 1; + while ( $visible_cols[$idx] ne $col ) { + $idx++; + } + $tbl_meta{$tbl}->{visible} = [ grep { $_ ne $col } @visible_cols ]; + $tbl_meta{$tbl}->{cust}->{visible} = 1; + return $idx == $#visible_cols ? $visible_cols[$idx - 1] : $visible_cols[$idx + 1]; + }, + }, + e => { + note => 'Edit selected column', + func => sub { + # TODO: make this editor hotkey-driven and give readline support. + my ( $tbl, $col ) = @_; + $clear_screen_sub->(); + my $meta = $tbl_meta{$tbl}->{cols}->{$col}; + my @prop = qw(hdr label src just num minw maxw trans agg); # TODO redundant + + my $answer; + do { + # Do what the user asked... + if ( $answer && grep { $_ eq $answer } @prop ) { + # Some properties are arrays, others scalars. + my $ini = ref $col_props{$answer} ? join(' ', @{$meta->{$answer}}) : $meta->{$answer}; + my $val = prompt("New value for $answer", undef, $ini); + $val = [ split(' ', $val) ] if ref($col_props{$answer}); + if ( $answer eq 'trans' ) { + $val = [ unique(grep{ exists $trans_funcs{$_} } @$val) ]; + } + @{$meta}{$answer, 'user', 'tbl' } = ( $val, 1, $tbl ); + } + + my @display_lines = ( + '', + "You are editing column $tbl.$col.\n", + ); + + push @display_lines, create_table2( + \@prop, + { map { $_ => $_ } @prop }, + { map { $_ => ref $meta->{$_} eq 'ARRAY' ? join(' ', @{$meta->{$_}}) + : ref $meta->{$_} ? '[expression code]' + : $meta->{$_} + } @prop + }, + { sep => ' ' }); + draw_screen(\@display_lines, { raw => 1 }); + print "\n\n"; # One to add space, one to clear readline artifacts + $answer = prompt('Edit what? (q to quit)'); + } while ( $answer ne 'q' ); + + return $col; + }, + }, + j => { + note => 'Move highlight down one', + func => sub { + my ( $tbl, $col ) = @_; + my @visible_cols = @{ $tbl_meta{$tbl}->{visible} }; + my $idx = 0; + while ( $visible_cols[$idx] ne $col ) { + $idx++; + } + return $visible_cols[ ($idx + 1) % @visible_cols ]; + }, + }, + k => { + note => 'Move highlight up one', + func => sub { + my ( $tbl, $col ) = @_; + my @visible_cols = @{ $tbl_meta{$tbl}->{visible} }; + my $idx = 0; + while ( $visible_cols[$idx] ne $col ) { + $idx++; + } + return $visible_cols[ $idx - 1 ]; + }, + }, + '+' => { + note => 'Move selected column up one', + func => sub { + my ( $tbl, $col ) = @_; + my $meta = $tbl_meta{$tbl}; + my @visible_cols = @{$meta->{visible}}; + my $idx = 0; + while ( $visible_cols[$idx] ne $col ) { + $idx++; + } + if ( $idx ) { + $visible_cols[$idx] = $visible_cols[$idx - 1]; + $visible_cols[$idx - 1] = $col; + $meta->{visible} = \@visible_cols; + } + else { + shift @{$meta->{visible}}; + push @{$meta->{visible}}, $col; + } + $meta->{cust}->{visible} = 1; + return $col; + }, + }, + '-' => { + note => 'Move selected column down one', + func => sub { + my ( $tbl, $col ) = @_; + my $meta = $tbl_meta{$tbl}; + my @visible_cols = @{$meta->{visible}}; + my $idx = 0; + while ( $visible_cols[$idx] ne $col ) { + $idx++; + } + if ( $idx == $#visible_cols ) { + unshift @{$meta->{visible}}, $col; + pop @{$meta->{visible}}; + } + else { + $visible_cols[$idx] = $visible_cols[$idx + 1]; + $visible_cols[$idx + 1] = $col; + $meta->{visible} = \@visible_cols; + } + $meta->{cust}->{visible} = 1; + return $col; + }, + }, + f => { + note => 'Choose filters', + func => sub { + my ( $tbl, $col ) = @_; + choose_filters($tbl); + return $col; + }, + }, + o => { + note => 'Edit color rules', + func => sub { + my ( $tbl, $col ) = @_; + edit_color_rules($tbl); + return $col; + }, + }, + s => { + note => 'Choose sort columns', + func => sub { + my ( $tbl, $col ) = @_; + choose_sort_cols($tbl); + return $col; + }, + }, + g => { + note => 'Choose group-by (aggregate) columns', + func => sub { + my ( $tbl, $col ) = @_; + choose_group_cols($tbl); + return $col; + }, + }, +); + +# ########################################################################### +# Global variables and environment {{{2 +# ########################################################################### + +my @this_term_size; # w_chars, h_chars, w_pix, h_pix +my @last_term_size; # w_chars, h_chars, w_pix, h_pix +my $char; +my $windows = $OSNAME =~ m/MSWin/; +my $have_color = 0; +my $MAX_ULONG = 4294967295; # 2^32-1 +my $num_regex = qr/^[+-]?(?=\d|\.)\d*(?:\.\d+)?(?:E[+-]?\d+|)$/i; +my $int_regex = qr/^\d+$/; +my $bool_regex = qr/^[01]$/; +my $term = undef; +my $file = undef; # File to watch for InnoDB monitor output +my $file_mtime = undef; # Status of watched file +my $file_data = undef; # Last chunk of text read from file +my $innodb_parser = InnoDBParser->new; + +my $nonfatal_errs = join('|', + 'Access denied for user', + 'Unknown MySQL server host', + 'Unknown database', + 'Can\'t connect to local MySQL server through socket', + 'Can\'t connect to MySQL server on', + 'MySQL server has gone away', + 'Cannot call SHOW INNODB STATUS', + 'Access denied', + 'AutoCommit', +); + +if ( !$opts{n} ) { + require Term::ReadLine; + $term = Term::ReadLine->new('innotop'); +} + +# Stores status, variables, innodb status, master/slave status etc. +# Keyed on connection name. Each entry is a hashref of current and past data sets, +# keyed on clock tick. +my %vars; +my %info_gotten = (); # Which things have been retrieved for the current clock tick. + +# Stores info on currently displayed queries: cxn, connection ID, query text. +my @current_queries; + +my $lines_printed = 0; +my $clock = 0; # Incremented with every wake-sleep cycle +my $clearing_deadlocks = 0; + +# If terminal coloring is available, use it. The only function I want from +# the module is the colored() function. +eval { + if ( !$opts{n} ) { + if ( $windows ) { + require Win32::Console::ANSI; + } + require Term::ANSIColor; + import Term::ANSIColor qw(colored); + $have_color = 1; + } +}; +if ( $EVAL_ERROR || $opts{n} ) { + # If there was an error, manufacture my own colored() function that does no + # coloring. + *colored = sub { pop @_; @_; }; +} + +if ( $opts{n} ) { + $clear_screen_sub = sub {}; +} +elsif ( $windows ) { + $clear_screen_sub = sub { $lines_printed = 0; system("cls") }; +} +else { + my $clear = `clear`; + $clear_screen_sub = sub { $lines_printed = 0; print $clear }; +} + +# ########################################################################### +# Config storage. {{{2 +# ########################################################################### +my %config = ( + color => { + val => $have_color, + note => 'Whether to use terminal coloring', + conf => 'ALL', + pat => $bool_regex, + }, + cmd_filter => { + val => 'Com_', + note => 'Prefix for values in C mode', + conf => [qw(C)], + }, + plugin_dir => { + val => "$homepath/.innotop/plugins", + note => 'Directory where plugins can be found', + conf => 'ALL', + }, + show_percent => { + val => 1, + note => 'Show the % symbol after percentages', + conf => 'ALL', + pat => $bool_regex, + }, + skip_innodb => { + val => 0, + note => 'Disable SHOW INNODB STATUS', + conf => 'ALL', + pat => $bool_regex, + }, + S_func => { + val => 's', + note => 'What to display in S mode: graph, status, pivoted status', + conf => [qw(S)], + pat => qr/^[gsv]$/, + }, + cxn_timeout => { + val => 28800, + note => 'Connection timeout for keeping unused connections alive', + conf => 'ALL', + pat => $int_regex, + }, + graph_char => { + val => '*', + note => 'Character for drawing graphs', + conf => [ qw(S) ], + pat => qr/^.$/, + }, + show_cxn_errors_in_tbl => { + val => 1, + note => 'Whether to display connection errors as rows in the table', + conf => 'ALL', + pat => $bool_regex, + }, + hide_hdr => { + val => 0, + note => 'Whether to show column headers', + conf => 'ALL', + pat => $bool_regex, + }, + show_cxn_errors => { + val => 1, + note => 'Whether to print connection errors to STDOUT', + conf => 'ALL', + pat => $bool_regex, + }, + readonly => { + val => 1, + note => 'Whether the config file is read-only', + conf => [ qw() ], + pat => $bool_regex, + }, + global => { + val => 1, + note => 'Whether to show GLOBAL variables and status', + conf => 'ALL', + pat => $bool_regex, + }, + header_highlight => { + val => 'bold', + note => 'How to highlight table column headers', + conf => 'ALL', + pat => qr/^(?:bold|underline)$/, + }, + display_table_captions => { + val => 1, + note => 'Whether to put captions on tables', + conf => 'ALL', + pat => $bool_regex, + }, + charset => { + val => 'ascii', + note => 'What type of characters should be displayed in queries (ascii, unicode, none)', + conf => 'ALL', + pat => qr/^(?:ascii|unicode|none)$/, + }, + auto_wipe_dl => { + val => 0, + note => 'Whether to auto-wipe InnoDB deadlocks', + conf => 'ALL', + pat => $bool_regex, + }, + max_height => { + val => 30, + note => '[Win32] Max window height', + conf => 'ALL', + }, + debug => { + val => 0, + pat => $bool_regex, + note => 'Debug mode (more verbose errors, uses more memory)', + conf => 'ALL', + }, + num_digits => { + val => 2, + pat => $int_regex, + note => 'How many digits to show in fractional numbers and percents', + conf => 'ALL', + }, + debugfile => { + val => "$homepath/.innotop/core_dump", + note => 'A debug file in case you are interested in error output', + }, + show_statusbar => { + val => 1, + pat => $bool_regex, + note => 'Whether to show the status bar in the display', + conf => 'ALL', + }, + mode => { + val => "Q", + note => "Which mode to start in", + cmdline => 1, + }, + status_inc => { + val => 0, + note => 'Whether to show raw or incremental values for status variables', + pat => $bool_regex, + }, + interval => { + val => 10, + pat => qr/^(?:(?:\d*?[1-9]\d*(?:\.\d*)?)|(?:\d*\.\d*?[1-9]\d*))$/, + note => "The interval at which the display will be refreshed. Fractional values allowed.", + }, + num_status_sets => { + val => 9, + pat => $int_regex, + note => 'How many sets of STATUS and VARIABLES values to show', + conf => [ qw(S) ], + }, + S_set => { + val => 'general', + pat => qr/^\w+$/, + note => 'Which set of variables to display in S (Variables & Status) mode', + conf => [ qw(S) ], + }, +); + +# ########################################################################### +# Config file sections {{{2 +# The configuration file is broken up into sections like a .ini file. This +# variable defines those sections and the subroutines responsible for reading +# and writing them. +# ########################################################################### +my %config_file_sections = ( + plugins => { + reader => \&load_config_plugins, + writer => \&save_config_plugins, + }, + group_by => { + reader => \&load_config_group_by, + writer => \&save_config_group_by, + }, + filters => { + reader => \&load_config_filters, + writer => \&save_config_filters, + }, + active_filters => { + reader => \&load_config_active_filters, + writer => \&save_config_active_filters, + }, + visible_tables => { + reader => \&load_config_visible_tables, + writer => \&save_config_visible_tables, + }, + sort_cols => { + reader => \&load_config_sort_cols, + writer => \&save_config_sort_cols, + }, + active_columns => { + reader => \&load_config_active_columns, + writer => \&save_config_active_columns, + }, + tbl_meta => { + reader => \&load_config_tbl_meta, + writer => \&save_config_tbl_meta, + }, + general => { + reader => \&load_config_config, + writer => \&save_config_config, + }, + connections => { + reader => \&load_config_connections, + writer => \&save_config_connections, + }, + active_connections => { + reader => \&load_config_active_connections, + writer => \&save_config_active_connections, + }, + server_groups => { + reader => \&load_config_server_groups, + writer => \&save_config_server_groups, + }, + active_server_groups => { + reader => \&load_config_active_server_groups, + writer => \&save_config_active_server_groups, + }, + max_values_seen => { + reader => \&load_config_mvs, + writer => \&save_config_mvs, + }, + varsets => { + reader => \&load_config_varsets, + writer => \&save_config_varsets, + }, + colors => { + reader => \&load_config_colors, + writer => \&save_config_colors, + }, + stmt_sleep_times => { + reader => \&load_config_stmt_sleep_times, + writer => \&save_config_stmt_sleep_times, + }, +); + +# Config file sections have some dependencies, so they have to be read/written in order. +my @ordered_config_file_sections = qw(general plugins filters active_filters tbl_meta + connections active_connections server_groups active_server_groups max_values_seen + active_columns sort_cols visible_tables varsets colors stmt_sleep_times + group_by); + +# All events for which plugins may register themselves. Entries are arrayrefs. +my %event_listener_for = map { $_ => [] } + qw( + extract_values + set_to_tbl_pre_filter set_to_tbl_pre_sort set_to_tbl_pre_group + set_to_tbl_pre_colorize set_to_tbl_pre_transform set_to_tbl_pre_pivot + set_to_tbl_pre_create set_to_tbl_post_create + draw_screen + ); + +# All variables to which plugins have access. +my %pluggable_vars = ( + action_for => \%action_for, + agg_funcs => \%agg_funcs, + config => \%config, + connections => \%connections, + dbhs => \%dbhs, + filters => \%filters, + modes => \%modes, + server_groups => \%server_groups, + tbl_meta => \%tbl_meta, + trans_funcs => \%trans_funcs, + var_sets => \%var_sets, +); + +# ########################################################################### +# Contains logic to generate prepared statements for a given function for a +# given DB connection. Returns a $sth. +# ########################################################################### +my %stmt_maker_for = ( + INNODB_STATUS => sub { + my ( $dbh ) = @_; + return $dbh->prepare(version_ge( $dbh, '5.0.0' ) + ? 'SHOW ENGINE INNODB STATUS' + : 'SHOW INNODB STATUS'); + }, + SHOW_VARIABLES => sub { + my ( $dbh ) = @_; + return $dbh->prepare($config{global}->{val} && version_ge( $dbh, '4.0.3' ) + ? 'SHOW GLOBAL VARIABLES' + : 'SHOW VARIABLES'); + }, + SHOW_STATUS => sub { + my ( $dbh ) = @_; + return $dbh->prepare($config{global}->{val} && version_ge( $dbh, '5.0.2' ) + ? 'SHOW GLOBAL STATUS' + : 'SHOW STATUS'); + }, + KILL_QUERY => sub { + my ( $dbh ) = @_; + return $dbh->prepare(version_ge( $dbh, '5.0.0' ) + ? 'KILL QUERY ?' + : 'KILL ?'); + }, + SHOW_MASTER_LOGS => sub { + my ( $dbh ) = @_; + return $dbh->prepare('SHOW MASTER LOGS'); + }, + SHOW_MASTER_STATUS => sub { + my ( $dbh ) = @_; + return $dbh->prepare('SHOW MASTER STATUS'); + }, + SHOW_SLAVE_STATUS => sub { + my ( $dbh ) = @_; + return $dbh->prepare('SHOW SLAVE STATUS'); + }, + KILL_CONNECTION => sub { + my ( $dbh ) = @_; + return $dbh->prepare(version_ge( $dbh, '5.0.0' ) + ? 'KILL CONNECTION ?' + : 'KILL ?'); + }, + OPEN_TABLES => sub { + my ( $dbh ) = @_; + return version_ge($dbh, '4.0.0') + ? $dbh->prepare('SHOW OPEN TABLES') + : undef; + }, + PROCESSLIST => sub { + my ( $dbh ) = @_; + return $dbh->prepare('SHOW FULL PROCESSLIST'); + }, +); + +# Plugins! +my %plugins = ( +); + +# ########################################################################### +# Run the program {{{1 +# ########################################################################### + +# This config variable is only useful for MS Windows because its terminal +# can't tell how tall it is. +if ( !$windows ) { + delete $config{max_height}; +} + +# Try to lower my priority. +eval { setpriority(0, 0, getpriority(0, 0) + 10); }; + +# Print stuff to the screen immediately, don't wait for a newline. +$OUTPUT_AUTOFLUSH = 1; + +# Clear the screen and load the configuration. +$clear_screen_sub->(); +load_config(); + +# Override config variables with command-line options +my %cmdline = + map { $_->{c} => $opts{$_->{k}} } + grep { exists $_->{c} && exists $opts{$_->{k}} } + @opt_spec; + +foreach my $name (keys %cmdline) { + next if not defined $cmdline{$name}; + my $val = $cmdline{$name}; + if ( exists($config{$name}) and (!$config{$name}->{pat} or $val =~ m/$config{$name}->{pat}/ )) { + $config{$name}->{val} = $val; + } +} + +post_process_tbl_meta(); + +# Make sure no changes are written to config file in non-interactive mode. +if ( $opts{n} ) { + $config{readonly}->{val} = 1; +} + +eval { + + # Open the file for InnoDB status + if ( @ARGV ) { + my $filename = shift @ARGV; + open $file, "<", $filename + or die "Cannot open '$filename': $OS_ERROR"; + } + + # In certain modes we might have to collect data for two cycles + # before printing anything out, so we need to bump up the count one. + if ( $opts{n} && $opts{count} && $config{status_inc}->{val} + && $config{mode}->{val} =~ m/[S]/ ) + { + $opts{count}++; + } + + while (++$clock) { + + my $mode = $config{mode}->{val} || 'Q'; + if ( !$modes{$mode} ) { + die "Mode '$mode' doesn't exist; try one of these:\n" + . join("\n", map { " $_ $modes{$_}->{hdr}" } sort keys %modes) + . "\n"; + } + + if ( !$opts{n} ) { + @last_term_size = @this_term_size; + @this_term_size = Term::ReadKey::GetTerminalSize(\*STDOUT); + if ( $windows ) { + $this_term_size[0]--; + $this_term_size[1] + = min($this_term_size[1], $config{max_height}->{val}); + } + die("Can't read terminal size") unless @this_term_size; + } + + # If there's no connection to a database server, we need to fix that... + if ( !%connections ) { + print "You have not defined any database connections.\n\n"; + add_new_dsn(); + } + + # See whether there are any connections defined for this mode. If there's only one + # connection total, assume the user wants to just use innotop for a single server + # and don't ask which server to connect to. Also, if we're monitoring from a file, + # we just use the first connection. + if ( !get_connections() ) { + if ( $file || 1 == scalar keys %connections ) { + $modes{$config{mode}->{val}}->{connections} = [ keys %connections ]; + } + else { + choose_connections(); + } + } + + # Term::ReadLine might have re-set $OUTPUT_AUTOFLUSH. + $OUTPUT_AUTOFLUSH = 1; + + # Prune old data + my $sets = $config{num_status_sets}->{val}; + foreach my $store ( values %vars ) { + delete @{$store}{ grep { $_ < $clock - $sets } keys %$store }; + } + %info_gotten = (); + + # Call the subroutine to display this mode. + $modes{$mode}->{display_sub}->(); + + # It may be time to quit now. + if ( $opts{count} && $clock >= $opts{count} ) { + finish(); + } + + # Wait for a bit. + if ( $opts{n} ) { + sleep($config{interval}->{val}); + } + else { + ReadMode('cbreak'); + $char = ReadKey($config{interval}->{val}); + ReadMode('normal'); + } + + # Handle whatever action the key indicates. + do_key_action(); + + } +}; +if ( $EVAL_ERROR ) { + core_dump( $EVAL_ERROR ); +} +finish(); + +# Subroutines {{{1 +# Mode functions{{{2 +# switch_mode {{{3 +sub switch_mode { + my $mode = shift; + $config{mode}->{val} = $mode; +} + +# Prompting functions {{{2 +# prompt_list {{{3 +# Prompts the user for a value, given a question, initial value, +# a completion function and a hashref of hints. +sub prompt_list { + die "Can't call in non-interactive mode" if $opts{n}; + my ( $question, $init, $completion, $hints ) = @_; + if ( $hints ) { + # Figure out how wide the table will be + my $max_name = max(map { length($_) } keys %$hints ); + $max_name ||= 0; + $max_name += 3; + my @meta_rows = create_table2( + [ sort keys %$hints ], + { map { $_ => $_ } keys %$hints }, + { map { $_ => trunc($hints->{$_}, $this_term_size[0] - $max_name) } keys %$hints }, + { sep => ' ' }); + if (@meta_rows > 10) { + # Try to split and stack the meta rows next to each other + my $split = int(@meta_rows / 2); + @meta_rows = stack_next( + [@meta_rows[0..$split - 1]], + [@meta_rows[$split..$#meta_rows]], + { pad => ' | '}, + ); + } + print join( "\n", + '', + map { ref $_ ? colored(@$_) : $_ } create_caption('Choose from', @meta_rows), ''), + "\n"; + } + $term->Attribs->{completion_function} = $completion; + my $answer = $term->readline("$question: ", $init); + $OUTPUT_AUTOFLUSH = 1; + $answer = '' if !defined($answer); + $answer =~ s/\s+$//; + return $answer; +} + +# prompt {{{3 +# Prints out a prompt and reads from the keyboard, then validates with the +# validation regex until the input is correct. +sub prompt { + die "Can't call in non-interactive mode" if $opts{n}; + my ( $prompt, $regex, $init, $completion ) = @_; + my $response; + my $success = 0; + do { + if ( $completion ) { + $term->Attribs->{completion_function} = $completion; + } + $response = $term->readline("$prompt: ", $init); + if ( $regex && $response !~ m/$regex/ ) { + print "Invalid response.\n\n"; + } + else { + $success = 1; + } + } while ( !$success ); + $OUTPUT_AUTOFLUSH = 1; + $response =~ s/\s+$//; + return $response; +} + +# prompt_noecho {{{3 +# Unfortunately, suppressing echo with Term::ReadLine isn't reliable; the user might not +# have that library, or it might not support that feature. +sub prompt_noecho { + my ( $prompt ) = @_; + print colored("$prompt: ", 'underline'); + my $response; + ReadMode('noecho'); + $response = ; + chomp($response); + ReadMode('normal'); + return $response; +} + +# do_key_action {{{3 +# Depending on whether a key was read, do something. Keys have certain +# actions defined in lookup tables. Each mode may have its own lookup table, +# which trumps the global table -- so keys can be context-sensitive. The key +# may be read and written in a subroutine, so it's a global. +sub do_key_action { + if ( defined $char ) { + my $mode = $config{mode}->{val}; + my $action + = defined($modes{$mode}->{action_for}->{$char}) + ? $modes{$mode}->{action_for}->{$char}->{action} + : defined($action_for{$char}) + ? $action_for{$char}->{action} + : sub{}; + $action->(); + } +} + +# pause {{{3 +sub pause { + die "Can't call in non-interactive mode" if $opts{n}; + my $msg = shift; + print defined($msg) ? "\n$msg" : "\nPress any key to continue"; + ReadMode('cbreak'); + my $char = ReadKey(0); + ReadMode('normal'); + return $char; +} + +# reverse_sort {{{3 +sub reverse_sort { + my $tbl = shift; + $tbl_meta{$tbl}->{sort_dir} *= -1; +} + +# select_cxn {{{3 +# Selects connection(s). If the mode (or argument list) has only one, returns +# it without prompt. +sub select_cxn { + my ( $prompt, @cxns ) = @_; + if ( !@cxns ) { + @cxns = get_connections(); + } + if ( @cxns == 1 ) { + return $cxns[0]; + } + my $choices = prompt_list( + $prompt, + $cxns[0], + sub{ return @cxns }, + { map { $_ => $connections{$_}->{dsn} } @cxns }); + my @result = unique(grep { my $a = $_; grep { $_ eq $a } @cxns } split(/\s+/, $choices)); + return @result; +} + +# kill_query {{{3 +# Kills a connection, or on new versions, optionally a query but not connection. +sub kill_query { + my ( $q_or_c ) = @_; + + my $info = choose_thread( + sub { 1 }, + 'Select a thread to kill the ' . $q_or_c, + ); + return unless $info; + return unless pause("Kill $info->{id}?") =~ m/y/i; + + eval { + do_stmt($info->{cxn}, $q_or_c eq 'QUERY' ? 'KILL_QUERY' : 'KILL_CONNECTION', $info->{id} ); + }; + + if ( $EVAL_ERROR ) { + print "\nError: $EVAL_ERROR"; + pause(); + } +} + +# set_display_precision {{{3 +sub set_display_precision { + my $dir = shift; + $config{num_digits}->{val} = min(9, max(0, $config{num_digits}->{val} + $dir)); +} + +sub toggle_visible_table { + my ( $mode, $table ) = @_; + my $visible = $modes{$mode}->{visible_tables}; + if ( grep { $_ eq $table } @$visible ) { + $modes{$mode}->{visible_tables} = [ grep { $_ ne $table } @$visible ]; + } + else { + unshift @$visible, $table; + } + $modes{$mode}->{cust}->{visible_tables} = 1; +} + +# toggle_filter{{{3 +sub toggle_filter { + my ( $tbl, $filter ) = @_; + my $filters = $tbl_meta{$tbl}->{filters}; + if ( grep { $_ eq $filter } @$filters ) { + $tbl_meta{$tbl}->{filters} = [ grep { $_ ne $filter } @$filters ]; + } + else { + push @$filters, $filter; + } + $tbl_meta{$tbl}->{cust}->{filters} = 1; +} + +# toggle_config {{{3 +sub toggle_config { + my ( $key ) = @_; + $config{$key}->{val} ^= 1; +} + +# create_deadlock {{{3 +sub create_deadlock { + $clear_screen_sub->(); + + print "This function will deliberately cause a small deadlock, " + . "clearing deadlock information from the InnoDB monitor.\n\n"; + + my $answer = prompt("Are you sure you want to proceed? Say 'y' if you do"); + return 0 unless $answer eq 'y'; + + my ( $cxn ) = select_cxn('Clear on which server? '); + return unless $cxn && exists($connections{$cxn}); + + clear_deadlock($cxn); +} + +# deadlock_thread {{{3 +sub deadlock_thread { + my ( $id, $tbl, $cxn ) = @_; + + eval { + my $dbh = get_new_db_connection($cxn, 1); + my @stmts = ( + "set transaction isolation level serializable", + (version_ge($dbh, '4.0.11') ? "start transaction" : 'begin'), + "select * from $tbl where a = $id", + "update $tbl set a = $id where a <> $id", + ); + + foreach my $stmt (@stmts[0..2]) { + $dbh->do($stmt); + } + sleep(1 + $id); + $dbh->do($stmts[-1]); + }; + if ( $EVAL_ERROR ) { + if ( $EVAL_ERROR !~ m/Deadlock found/ ) { + die $EVAL_ERROR; + } + } + exit(0); +} + +# Purges unused binlogs on the master, up to but not including the latest log. +# TODO: guess which connections are slaves of a given master. +sub purge_master_logs { + my @cxns = get_connections(); + + get_master_slave_status(@cxns); + + # Toss out the rows that don't have master/slave status... + my @vars = + grep { $_ && ($_->{file} || $_->{master_host}) } + map { $vars{$_}->{$clock} } @cxns; + @cxns = map { $_->{cxn} } @vars; + + # Figure out which master to purge ons. + my @masters = map { $_->{cxn} } grep { $_->{file} } @vars; + my ( $master ) = select_cxn('Which master?', @masters ); + return unless $master; + my ($master_status) = grep { $_->{cxn} eq $master } @vars; + + # Figure out the result order (not lexical order) of master logs. + my @master_logs = get_master_logs($master); + my $i = 0; + my %master_logs = map { $_->{log_name} => $i++ } @master_logs; + + # Ask which slave(s) are reading from this master. + my @slave_status = grep { $_->{master_host} } @vars; + my @slaves = map { $_->{cxn} } @slave_status; + @slaves = select_cxn("Which slaves are reading from $master?", @slaves); + @slave_status = grep { my $item = $_; grep { $item->{cxn} eq $_ } @slaves } @slave_status; + return unless @slave_status; + + # Find the minimum binary log in use. + my $min_log = min(map { $master_logs{$_->{master_log_file}} } @slave_status); + my $log_name = $master_logs[$min_log]->{log_name}; + + my $stmt = "PURGE MASTER LOGS TO '$log_name'"; + send_cmd_to_servers($stmt, 0, 'PURGE {MASTER | BINARY} LOGS {TO "log_name" | BEFORE "date"}', [$master]); +} + +sub send_cmd_to_servers { + my ( $cmd, $all, $hint, $cxns ) = @_; + if ( $all ) { + @$cxns = get_connections(); + } + elsif ( !@$cxns ) { + @$cxns = select_cxn('Which servers?', @$cxns); + } + if ( $hint ) { + print "\nHint: $hint\n"; + } + $cmd = prompt('Command to send', undef, $cmd); + foreach my $cxn ( @$cxns ) { + eval { + my $sth = do_query($cxn, $cmd); + }; + if ( $EVAL_ERROR ) { + print "Error from $cxn: $EVAL_ERROR\n"; + } + else { + print "Success on $cxn\n"; + } + } + pause(); +} + +# Display functions {{{2 + +sub set_s_mode { + my ( $func ) = @_; + $clear_screen_sub->(); + $config{S_func}->{val} = $func; +} + +# start_S_mode {{{3 +sub start_S_mode { + $clear_screen_sub->(); + switch_mode('S'); +} + +# display_B {{{3 +sub display_B { + my @display_lines; + my @cxns = get_connections(); + get_innodb_status(\@cxns); + + my @buffer_pool; + my @page_statistics; + my @insert_buffers; + my @adaptive_hash_index; + my %rows_for = ( + buffer_pool => \@buffer_pool, + page_statistics => \@page_statistics, + insert_buffers => \@insert_buffers, + adaptive_hash_index => \@adaptive_hash_index, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + foreach my $cxn ( @cxns ) { + my $set = $vars{$cxn}->{$clock}; + my $pre = $vars{$cxn}->{$clock-1} || $set; + + if ( $set->{IB_bp_complete} ) { + if ( $wanted{buffer_pool} ) { + push @buffer_pool, extract_values($set, $set, $pre, 'buffer_pool'); + } + if ( $wanted{page_statistics} ) { + push @page_statistics, extract_values($set, $set, $pre, 'page_statistics'); + } + } + if ( $set->{IB_ib_complete} ) { + if ( $wanted{insert_buffers} ) { + push @insert_buffers, extract_values( + $config{status_inc}->{val} ? inc(0, $cxn) : $set, $set, $pre, + 'insert_buffers'); + } + if ( $wanted{adaptive_hash_index} ) { + push @adaptive_hash_index, extract_values($set, $set, $pre, 'adaptive_hash_index'); + } + } + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + draw_screen(\@display_lines); +} + +# display_C {{{3 +sub display_C { + my @display_lines; + my @cxns = get_connections(); + get_status_info(@cxns); + + my @cmd_summary; + my %rows_for = ( + cmd_summary => \@cmd_summary, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + # For now, I'm manually pulling these variables out and pivoting. Eventually a SQL-ish + # dialect should let me join a table to a grouped and pivoted table and do this more easily. + # TODO: make it so. + my $prefix = qr/^$config{cmd_filter}->{val}/; # TODO: this is a total hack + my @values; + my ($total, $last_total) = (0, 0); + foreach my $cxn ( @cxns ) { + my $set = $vars{$cxn}->{$clock}; + my $pre = $vars{$cxn}->{$clock-1} || $set; + foreach my $key ( keys %$set ) { + next unless $key =~ m/$prefix/i; + my $val = $set->{$key}; + next unless defined $val && $val =~ m/^\d+$/; + my $last_val = $val - ($pre->{$key} || 0); + $total += $val; + $last_total += $last_val; + push @values, { + name => $key, + value => $val, + last_value => $last_val, + }; + } + } + + # Add aggregation and turn into a real set TODO: total hack + if ( $wanted{cmd_summary} ) { + foreach my $value ( @values ) { + @{$value}{qw(total last_total)} = ($total, $last_total); + push @cmd_summary, extract_values($value, $value, $value, 'cmd_summary'); + } + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + draw_screen(\@display_lines); +} + +# display_D {{{3 +sub display_D { + my @display_lines; + my @cxns = get_connections(); + get_innodb_status(\@cxns); + + my @deadlock_transactions; + my @deadlock_locks; + my %rows_for = ( + deadlock_transactions => \@deadlock_transactions, + deadlock_locks => \@deadlock_locks, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + foreach my $cxn ( @cxns ) { + my $innodb_status = $vars{$cxn}->{$clock}; + my $prev_status = $vars{$cxn}->{$clock-1} || $innodb_status; + + if ( $innodb_status->{IB_dl_timestring} ) { + + my $victim = $innodb_status->{IB_dl_rolled_back} || 0; + + if ( %wanted ) { + foreach my $txn_id ( keys %{$innodb_status->{IB_dl_txns}} ) { + my $txn = $innodb_status->{IB_dl_txns}->{$txn_id}; + my $pre = $prev_status->{IB_dl_txns}->{$txn_id} || $txn; + + if ( $wanted{deadlock_transactions} ) { + my $hash = extract_values($txn->{tx}, $txn->{tx}, $pre->{tx}, 'deadlock_transactions'); + $hash->{cxn} = $cxn; + $hash->{dl_txn_num} = $txn_id; + $hash->{victim} = $txn_id == $victim ? 'Yes' : 'No'; + $hash->{timestring} = $innodb_status->{IB_dl_timestring}; + $hash->{truncates} = $innodb_status->{IB_dl_complete} ? 'No' : 'Yes'; + push @deadlock_transactions, $hash; + } + + if ( $wanted{deadlock_locks} ) { + foreach my $lock ( @{$txn->{locks}} ) { + my $hash = extract_values($lock, $lock, $lock, 'deadlock_locks'); + $hash->{dl_txn_num} = $txn_id; + $hash->{cxn} = $cxn; + $hash->{mysql_thread_id} = $txn->{tx}->{mysql_thread_id}; + push @deadlock_locks, $hash; + } + } + + } + } + } + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + draw_screen(\@display_lines); +} + +# display_F {{{3 +sub display_F { + my @display_lines; + my ( $cxn ) = get_connections(); + get_innodb_status([$cxn]); + my $innodb_status = $vars{$cxn}->{$clock}; + + if ( $innodb_status->{IB_fk_timestring} ) { + + push @display_lines, 'Reason: ' . $innodb_status->{IB_fk_reason}; + + # Display FK errors caused by invalid DML. + if ( $innodb_status->{IB_fk_txn} ) { + my $txn = $innodb_status->{IB_fk_txn}; + push @display_lines, + '', + "User $txn->{user} from $txn->{hostname}, thread $txn->{mysql_thread_id} was executing:", + '', no_ctrl_char($txn->{query_text}); + } + + my @fk_table = create_table2( + $tbl_meta{fk_error}->{visible}, + meta_to_hdr('fk_error'), + extract_values($innodb_status, $innodb_status, $innodb_status, 'fk_error'), + { just => '-', sep => ' '}); + push @display_lines, '', @fk_table; + + } + else { + push @display_lines, '', 'No foreign key error data.'; + } + draw_screen(\@display_lines, { raw => 1 } ); +} + +# display_I {{{3 +sub display_I { + my @display_lines; + my @cxns = get_connections(); + get_innodb_status(\@cxns); + + my @io_threads; + my @pending_io; + my @file_io_misc; + my @log_statistics; + my %rows_for = ( + io_threads => \@io_threads, + pending_io => \@pending_io, + file_io_misc => \@file_io_misc, + log_statistics => \@log_statistics, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + foreach my $cxn ( @cxns ) { + my $set = $vars{$cxn}->{$clock}; + my $pre = $vars{$cxn}->{$clock-1} || $set; + + if ( $set->{IB_io_complete} ) { + if ( $wanted{io_threads} ) { + my $cur_threads = $set->{IB_io_threads}; + my $pre_threads = $pre->{IB_io_threads} || $cur_threads; + foreach my $key ( sort keys %$cur_threads ) { + my $cur_thd = $cur_threads->{$key}; + my $pre_thd = $pre_threads->{$key} || $cur_thd; + my $hash = extract_values($cur_thd, $cur_thd, $pre_thd, 'io_threads'); + $hash->{cxn} = $cxn; + push @io_threads, $hash; + } + } + if ( $wanted{pending_io} ) { + push @pending_io, extract_values($set, $set, $pre, 'pending_io'); + } + if ( $wanted{file_io_misc} ) { + push @file_io_misc, extract_values( + $config{status_inc}->{val} ? inc(0, $cxn) : $set, + $set, $pre, 'file_io_misc'); + } + } + if ( $set->{IB_lg_complete} && $wanted{log_statistics} ) { + push @log_statistics, extract_values($set, $set, $pre, 'log_statistics'); + } + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + draw_screen(\@display_lines); +} + +# display_L {{{3 +sub display_L { + my @display_lines; + my @cxns = get_connections(); + get_innodb_status(\@cxns); + + my @innodb_locks; + my %rows_for = ( + innodb_locks => \@innodb_locks, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + # Get info on locks + foreach my $cxn ( @cxns ) { + my $set = $vars{$cxn}->{$clock} or next; + my $pre = $vars{$cxn}->{$clock-1} || $set; + + if ( $wanted{innodb_locks} && defined $set->{IB_tx_transactions} && @{$set->{IB_tx_transactions}} ) { + + my $cur_txns = $set->{IB_tx_transactions}; + my $pre_txns = $pre->{IB_tx_transactions} || $cur_txns; + my %cur_txns = map { $_->{mysql_thread_id} => $_ } @$cur_txns; + my %pre_txns = map { $_->{mysql_thread_id} => $_ } @$pre_txns; + foreach my $txn ( @$cur_txns ) { + foreach my $lock ( @{$txn->{locks}} ) { + my %hash = map { $_ => $txn->{$_} } qw(txn_id mysql_thread_id lock_wait_time active_secs); + map { $hash{$_} = $lock->{$_} } qw(lock_type space_id page_no n_bits index db table txn_id lock_mode special insert_intention waiting); + $hash{cxn} = $cxn; + push @innodb_locks, extract_values(\%hash, \%hash, \%hash, 'innodb_locks'); + } + } + } + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + draw_screen(\@display_lines); +} + +# display_M {{{3 +sub display_M { + my @display_lines; + my @cxns = get_connections(); + get_master_slave_status(@cxns); + get_status_info(@cxns); + + my @slave_sql_status; + my @slave_io_status; + my @master_status; + my %rows_for = ( + slave_sql_status => \@slave_sql_status, + slave_io_status => \@slave_io_status, + master_status => \@master_status, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + foreach my $cxn ( @cxns ) { + my $set = $config{status_inc}->{val} ? inc(0, $cxn) : $vars{$cxn}->{$clock}; + my $pre = $vars{$cxn}->{$clock - 1} || $set; + if ( $wanted{slave_sql_status} ) { + push @slave_sql_status, extract_values($set, $set, $pre, 'slave_sql_status'); + } + if ( $wanted{slave_io_status} ) { + push @slave_io_status, extract_values($set, $set, $pre, 'slave_io_status'); + } + if ( $wanted{master_status} ) { + push @master_status, extract_values($set, $set, $pre, 'master_status'); + } + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + draw_screen(\@display_lines); +} + +# display_O {{{3 +sub display_O { + my @display_lines = (''); + my @cxns = get_connections(); + my @open_tables = get_open_tables(@cxns); + my @tables = map { extract_values($_, $_, $_, 'open_tables') } @open_tables; + push @display_lines, set_to_tbl(\@tables, 'open_tables'), get_cxn_errors(@cxns); + draw_screen(\@display_lines); +} + +# display_Q {{{3 +sub display_Q { + my @display_lines; + + my @q_header; + my @processlist; + my %rows_for = ( + q_header => \@q_header, + processlist => \@processlist, + ); + + my @visible = $opts{n} ? 'processlist' : get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + # Get the data + my @cxns = get_connections(); + my @full_processlist = get_full_processlist(@cxns); + + # Create header + if ( $wanted{q_header} ) { + get_status_info(@cxns); + foreach my $cxn ( @cxns ) { + my $set = $vars{$cxn}->{$clock}; + my $pre = $vars{$cxn}->{$clock-1} || $set; + my $hash = extract_values($set, $set, $pre, 'q_header'); + $hash->{cxn} = $cxn; + $hash->{when} = 'Total'; + push @q_header, $hash; + + if ( exists $vars{$cxn}->{$clock - 1} ) { + my $inc = inc(0, $cxn); + my $hash = extract_values($inc, $set, $pre, 'q_header'); + $hash->{cxn} = $cxn; + $hash->{when} = 'Now'; + push @q_header, $hash; + } + } + } + + if ( $wanted{processlist} ) { + # TODO: save prev values + push @processlist, map { extract_values($_, $_, $_, 'processlist') } @full_processlist; + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + next unless $wanted{$tbl}; + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + # Save queries in global variable for analysis. The rows in %rows_for have been + # filtered, etc as a side effect of set_to_tbl(), so they are the same as the rows + # that get pushed to the screen. + @current_queries = map { + my %hash; + @hash{ qw(cxn id db query secs) } = @{$_}{ qw(cxn mysql_thread_id db info secs) }; + \%hash; + } @{$rows_for{processlist}}; + + draw_screen(\@display_lines); +} + +# display_R {{{3 +sub display_R { + my @display_lines; + my @cxns = get_connections(); + get_innodb_status(\@cxns); + + my @row_operations; + my @row_operation_misc; + my @semaphores; + my @wait_array; + my %rows_for = ( + row_operations => \@row_operations, + row_operation_misc => \@row_operation_misc, + semaphores => \@semaphores, + wait_array => \@wait_array, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + my $incvar = $config{status_inc}->{val}; + + foreach my $cxn ( @cxns ) { + my $set = $vars{$cxn}->{$clock}; + my $pre = $vars{$cxn}->{$clock-1} || $set; + my $inc; # Only assigned to if wanted + + if ( $set->{IB_ro_complete} ) { + if ( $wanted{row_operations} ) { + $inc ||= $incvar ? inc(0, $cxn) : $set; + push @row_operations, extract_values($inc, $set, $pre, 'row_operations'); + } + if ( $wanted{row_operation_misc} ) { + push @row_operation_misc, extract_values($set, $set, $pre, 'row_operation_misc'), + } + } + + if ( $set->{IB_sm_complete} && $wanted{semaphores} ) { + $inc ||= $incvar ? inc(0, $cxn) : $set; + push @semaphores, extract_values($inc, $set, $pre, 'semaphores'); + } + + if ( $set->{IB_sm_wait_array_size} && $wanted{wait_array} ) { + foreach my $wait ( @{$set->{IB_sm_waits}} ) { + my $hash = extract_values($wait, $wait, $wait, 'wait_array'); + $hash->{cxn} = $cxn; + push @wait_array, $hash; + } + } + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + draw_screen(\@display_lines); +} + +# display_T {{{3 +sub display_T { + my @display_lines; + + my @t_header; + my @innodb_transactions; + my %rows_for = ( + t_header => \@t_header, + innodb_transactions => \@innodb_transactions, + ); + + my @visible = $opts{n} ? 'innodb_transactions' : get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + + my @cxns = get_connections(); + + # If the header is to be shown, buffer pool data is required. + get_innodb_status( \@cxns, [ $wanted{t_header} ? qw(bp) : () ] ); + + foreach my $cxn ( get_connections() ) { + my $set = $vars{$cxn}->{$clock}; + my $pre = $vars{$cxn}->{$clock-1} || $set; + + next unless $set->{IB_tx_transactions}; + + if ( $wanted{t_header} ) { + my $hash = extract_values($set, $set, $pre, 't_header'); + push @t_header, $hash; + } + + if ( $wanted{innodb_transactions} ) { + my $cur_txns = $set->{IB_tx_transactions}; + my $pre_txns = $pre->{IB_tx_transactions} || $cur_txns; + my %cur_txns = map { $_->{mysql_thread_id} => $_ } @$cur_txns; + my %pre_txns = map { $_->{mysql_thread_id} => $_ } @$pre_txns; + foreach my $thd_id ( sort keys %cur_txns ) { + my $cur_txn = $cur_txns{$thd_id}; + my $pre_txn = $pre_txns{$thd_id} || $cur_txn; + my $hash = extract_values($cur_txn, $cur_txn, $pre_txn, 'innodb_transactions'); + $hash->{cxn} = $cxn; + push @innodb_transactions, $hash; + } + } + + } + + my $first_table = 0; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + + # Save queries in global variable for analysis. The rows in %rows_for have been + # filtered, etc as a side effect of set_to_tbl(), so they are the same as the rows + # that get pushed to the screen. + @current_queries = map { + my %hash; + @hash{ qw(cxn id db query secs) } = @{$_}{ qw(cxn mysql_thread_id db query_text active_secs) }; + \%hash; + } @{$rows_for{innodb_transactions}}; + + draw_screen(\@display_lines); +} + +# display_S {{{3 +sub display_S { + my $fmt = get_var_set('S_set'); + my $func = $config{S_func}->{val}; + my $inc = $func eq 'g' || $config{status_inc}->{val}; + + # The table's meta-data is generated from the compiled var_set. + my ( $cols, $visible ); + if ( $tbl_meta{var_status}->{fmt} && $fmt eq $tbl_meta{var_status}->{fmt} ) { + ( $cols, $visible ) = @{$tbl_meta{var_status}}{qw(cols visible)}; + } + else { + ( $cols, $visible ) = compile_select_stmt($fmt); + + # Apply missing values to columns. Always apply averages across all connections. + map { + $_->{agg} = 'avg'; + $_->{label} = $_->{hdr}; + } values %$cols; + + $tbl_meta{var_status}->{cols} = $cols; + $tbl_meta{var_status}->{visible} = $visible; + $tbl_meta{var_status}->{fmt} = $fmt; + map { $tbl_meta{var_status}->{cols}->{$_}->{just} = ''} @$visible; + } + + my @var_status; + my %rows_for = ( + var_status => \@var_status, + ); + + my @visible = get_visible_tables(); + my %wanted = map { $_ => 1 } @visible; + my @cxns = get_connections(); + + get_status_info(@cxns); + get_innodb_status(\@cxns); + + # Set up whether to pivot and how many sets to extract. + $tbl_meta{var_status}->{pivot} = $func eq 'v'; + + my $num_sets + = $func eq 'v' + ? $config{num_status_sets}->{val} + : 0; + foreach my $set ( 0 .. $num_sets ) { + my @rows; + foreach my $cxn ( @cxns ) { + my $vars = $inc ? inc($set, $cxn) : $vars{$cxn}->{$clock - $set}; + my $cur = $vars{$cxn}->{$clock-$set}; + my $pre = $vars{$cxn}->{$clock-$set-1} || $cur; + next unless $vars && %$vars; + my $hash = extract_values($vars, $cur, $pre, 'var_status'); + push @rows, $hash; + } + @rows = apply_group_by('var_status', [], @rows); + push @var_status, @rows; + } + + # Recompile the sort func. TODO: avoid recompiling at every refresh. + # Figure out whether the data is all numeric and decide on a sort type. + # my $cmp + # = scalar( + # grep { !defined $_ || $_ !~ m/^\d+$/ } + # map { my $col = $_; map { $_->{$col} } @var_status } + # $tbl_meta{var_status}->{sort_cols} =~ m/(\w+)/g) + # ? 'cmp' + # : '<=>'; + $tbl_meta{var_status}->{sort_func} = make_sort_func($tbl_meta{var_status}); + + # ################################################################ + # Now there is specific display code based on $config{S_func} + # ################################################################ + if ( $func =~ m/s|g/ ) { + my $min_width = 4; + + # Clear the screen if the display width changed. + if ( @last_term_size && $this_term_size[0] != $last_term_size[0] ) { + $lines_printed = 0; + $clear_screen_sub->(); + } + + if ( $func eq 's' ) { + # Decide how wide columns should be. + my $num_cols = scalar(@$visible); + my $width = $opts{n} ? 0 : max($min_width, int(($this_term_size[0] - $num_cols + 1) / $num_cols)); + my $g_format = $opts{n} ? ( "%s\t" x $num_cols ) : ( "%-${width}s " x $num_cols ); + + # Print headers every now and then. Headers can get really long, so compact them. + my @hdr = @$visible; + if ( $opts{n} ) { + if ( $lines_printed == 0 ) { + print join("\t", @hdr), "\n"; + $lines_printed++; + } + } + elsif ( $lines_printed == 0 || $lines_printed > $this_term_size[1] - 2 ) { + @hdr = map { donut(crunch($_, $width), $width) } @hdr; + print join(' ', map { sprintf( "%${width}s", donut($_, $width)) } @hdr) . "\n"; + $lines_printed = 1; + } + + # Design a column format for the values. + my $format + = $opts{n} + ? join("\t", map { '%s' } @$visible) . "\n" + : join(' ', map { "%${width}s" } @hdr) . "\n"; + + foreach my $row ( @var_status ) { + printf($format, map { defined $_ ? $_ : '' } @{$row}{ @$visible }); + $lines_printed++; + } + } + else { # 'g' mode + # Design a column format for the values. + my $num_cols = scalar(@$visible); + my $width = $opts{n} ? 0 : int(($this_term_size[0] - $num_cols + 1) / $num_cols); + my $format = $opts{n} ? ( "%s\t" x $num_cols ) : ( "%-${width}s " x $num_cols ); + $format =~ s/\s$/\n/; + + # Print headers every now and then. + if ( $opts{n} ) { + if ( $lines_printed == 0 ) { + print join("\t", @$visible), "\n"; + print join("\t", map { shorten($mvs{$_}) } @$visible), "\n"; + } + } + elsif ( $lines_printed == 0 || $lines_printed > $this_term_size[1] - 2 ) { + printf($format, map { donut(crunch($_, $width), $width) } @$visible); + printf($format, map { shorten($mvs{$_} || 0) } @$visible); + $lines_printed = 2; + } + + # Update the max ever seen, and scale by the max ever seen. + my $set = $var_status[0]; + foreach my $col ( @$visible ) { + $set->{$col} = 1 unless defined $set->{$col} && $set->{$col} =~ m/$num_regex/; + $set->{$col} = ($set->{$col} || 1) / ($set->{Uptime_hires} || 1); + $mvs{$col} = max($mvs{$col} || 1, $set->{$col}); + $set->{$col} /= $mvs{$col}; + } + printf($format, map { ( $config{graph_char}->{val} x int( $width * $set->{$_} )) || '.' } @$visible ); + $lines_printed++; + + } + } + else { # 'v' + my $first_table = 0; + my @display_lines; + foreach my $tbl ( @visible ) { + push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl); + push @display_lines, get_cxn_errors(@cxns) + if ( $config{debug}->{val} || !$first_table++ ); + } + $clear_screen_sub->(); + draw_screen( \@display_lines ); + } +} + +# display_explain {{{3 +sub display_explain { + my $info = shift; + my $cxn = $info->{cxn}; + my $db = $info->{db}; + + my ( $mods, $query ) = rewrite_for_explain($info->{query}); + + my @display_lines; + + if ( $query ) { + + my $part = version_ge($dbhs{$cxn}->{dbh}, '5.1.5') ? 'PARTITIONS' : ''; + $query = "EXPLAIN $part\n" . $query; + + eval { + if ( $db ) { + do_query($cxn, "use $db"); + } + my $sth = do_query($cxn, $query); + + my $res; + while ( $res = $sth->fetchrow_hashref() ) { + map { $res->{$_} ||= '' } ( 'partitions', keys %$res); + my @this_table = create_caption("Sub-Part $res->{id}", + create_table2( + $tbl_meta{explain}->{visible}, + meta_to_hdr('explain'), + extract_values($res, $res, $res, 'explain'))); + @display_lines = stack_next(\@display_lines, \@this_table, { pad => ' ', vsep => 2 }); + } + }; + + if ( $EVAL_ERROR ) { + push @display_lines, + '', + "The query could not be explained. Only SELECT queries can be " + . "explained; innotop tries to rewrite certain REPLACE and INSERT queries " + . "into SELECT, but this doesn't always succeed."; + } + + } + else { + push @display_lines, '', 'The query could not be explained.'; + } + + if ( $mods ) { + push @display_lines, '', '[This query has been re-written to be explainable]'; + } + + unshift @display_lines, no_ctrl_char($query); + draw_screen(\@display_lines, { raw => 1 } ); +} + +# rewrite_for_explain {{{3 +sub rewrite_for_explain { + my $query = shift; + + my $mods = 0; + my $orig = $query; + $mods += $query =~ s/^\s*(?:replace|insert).*?select/select/is; + $mods += $query =~ s/^ + \s*create\s+(?:temporary\s+)?table + \s+(?:\S+\s+)as\s+select/select/xis; + $mods += $query =~ s/\s+on\s+duplicate\s+key\s+update.*$//is; + return ( $mods, $query ); +} + +# show_optimized_query {{{3 +sub show_optimized_query { + my $info = shift; + my $cxn = $info->{cxn}; + my $db = $info->{db}; + my $meta = $dbhs{$cxn}; + + my @display_lines; + + my ( $mods, $query ) = rewrite_for_explain($info->{query}); + + if ( $mods ) { + push @display_lines, '[This query has been re-written to be explainable]'; + } + + if ( $query ) { + push @display_lines, no_ctrl_char($info->{query}); + + eval { + if ( $db ) { + do_query($cxn, "use $db"); + } + do_query( $cxn, 'EXPLAIN EXTENDED ' . $query ) or die "Can't explain query"; + my $sth = do_query($cxn, 'SHOW WARNINGS'); + my $res = $sth->fetchall_arrayref({}); + + if ( $res ) { + foreach my $result ( @$res ) { + push @display_lines, 'Note:', no_ctrl_char($result->{message}); + } + } + else { + push @display_lines, '', 'The query optimization could not be generated.'; + } + }; + + if ( $EVAL_ERROR ) { + push @display_lines, '', "The optimization could not be generated: $EVAL_ERROR"; + } + + } + else { + push @display_lines, '', 'The query optimization could not be generated.'; + } + + draw_screen(\@display_lines, { raw => 1 } ); +} + +# display_help {{{3 +sub display_help { + my $mode = $config{mode}->{val}; + + # Get globally mapped keys, then overwrite them with mode-specific ones. + my %keys = map { + $_ => $action_for{$_}->{label} + } keys %action_for; + foreach my $key ( keys %{$modes{$mode}->{action_for}} ) { + $keys{$key} = $modes{$mode}->{action_for}->{$key}->{label}; + } + delete $keys{'?'}; + + # Split them into three kinds of keys: MODE keys, action keys, and + # magic (special character) keys. + my @modes = sort grep { m/[A-Z]/ } keys %keys; + my @actions = sort grep { m/[a-z]/ } keys %keys; + my @magic = sort grep { m/[^A-Z]/i } keys %keys; + + my @display_lines = ( '', 'Switch to a different mode:' ); + + # Mode keys + my @all_modes = map { "$_ $modes{$_}->{hdr}" } @modes; + my @col1 = splice(@all_modes, 0, ceil(@all_modes/3)); + my @col2 = splice(@all_modes, 0, ceil(@all_modes/2)); + my $max1 = max(map {length($_)} @col1); + my $max2 = max(map {length($_)} @col2); + while ( @col1 ) { + push @display_lines, sprintf(" %-${max1}s %-${max2}s %s", + (shift @col1 || ''), + (shift @col2 || ''), + (shift @all_modes || '')); + } + + # Action keys + my @all_actions = map { "$_ $keys{$_}" } @actions; + @col1 = splice(@all_actions, 0, ceil(@all_actions/2)); + $max1 = max(map {length($_)} @col1); + push @display_lines, '', 'Actions:'; + while ( @col1 ) { + push @display_lines, sprintf(" %-${max1}s %s", + (shift @col1 || ''), + (shift @all_actions || '')); + } + + # Magic keys + my @all_magic = map { sprintf('%4s', $action_for{$_}->{key} || $_) . " $keys{$_}" } @magic; + @col1 = splice(@all_magic, 0, ceil(@all_magic/2)); + $max1 = max(map {length($_)} @col1); + push @display_lines, '', 'Other:'; + while ( @col1 ) { + push @display_lines, sprintf("%-${max1}s%s", + (shift @col1 || ''), + (shift @all_magic || '')); + } + + $clear_screen_sub->(); + draw_screen(\@display_lines, { show_all => 1 } ); + pause(); + $clear_screen_sub->(); +} + +# show_full_query {{{3 +sub show_full_query { + my $info = shift; + my @display_lines = no_ctrl_char($info->{query}); + draw_screen(\@display_lines, { raw => 1 }); +} + +# Formatting functions {{{2 + +# create_table2 {{{3 +# Makes a two-column table, labels on left, data on right. +# Takes refs of @cols, %labels and %data, %user_prefs +sub create_table2 { + my ( $cols, $labels, $data, $user_prefs ) = @_; + my @rows; + + if ( @$cols && %$data ) { + + # Override defaults + my $p = { + just => '', + sep => ':', + just1 => '-', + }; + if ( $user_prefs ) { + map { $p->{$_} = $user_prefs->{$_} } keys %$user_prefs; + } + + # Fix undef values + map { $data->{$_} = '' unless defined $data->{$_} } @$cols; + + # Format the table + my $max_l = max(map{ length($labels->{$_}) } @$cols); + my $max_v = max(map{ length($data->{$_}) } @$cols); + my $format = "%$p->{just}${max_l}s$p->{sep} %$p->{just1}${max_v}s"; + foreach my $col ( @$cols ) { + push @rows, sprintf($format, $labels->{$col}, $data->{$col}); + } + } + return @rows; +} + +# stack_next {{{3 +# Stacks one display section next to the other. Accepts left-hand arrayref, +# right-hand arrayref, and options hashref. Tries to stack as high as +# possible, so +# aaaaaa +# bbb +# can stack ccc next to the bbb. +# NOTE: this DOES modify its arguments, even though it returns a new array. +sub stack_next { + my ( $left, $right, $user_prefs ) = @_; + my @result; + + my $p = { + pad => ' ', + vsep => 0, + }; + if ( $user_prefs ) { + map { $p->{$_} = $user_prefs->{$_} } keys %$user_prefs; + } + + # Find out how wide the LHS can be and still let the RHS fit next to it. + my $pad = $p->{pad}; + my $max_r = max( map { length($_) } @$right) || 0; + my $max_l = $this_term_size[0] - $max_r - length($pad); + + # Find the minimum row on the LHS that the RHS will fit next to. + my $i = scalar(@$left) - 1; + while ( $i >= 0 && length($left->[$i]) <= $max_l ) { + $i--; + } + $i++; + my $offset = $i; + + if ( $i < scalar(@$left) ) { + # Find the max width of the section of the LHS against which the RHS + # will sit. + my $max_i_in_common = min($i + scalar(@$right) - 1, scalar(@$left) - 1); + my $max_width = max( map { length($_) } @{$left}[$i..$max_i_in_common]); + + # Append the RHS onto the LHS until one runs out. + while ( $i < @$left && $i - $offset < @$right ) { + my $format = "%-${max_width}s$pad%${max_r}s"; + $left->[$i] = sprintf($format, $left->[$i], $right->[$i - $offset]); + $i++; + } + while ( $i - $offset < @$right ) { + # There is more RHS to push on the end of the array + push @$left, + sprintf("%${max_width}s$pad%${max_r}s", ' ', $right->[$i - $offset]); + $i++; + } + push @result, @$left; + } + else { + # There is no room to put them side by side. Add them below, with + # a blank line above them if specified. + push @result, @$left; + push @result, (' ' x $this_term_size[0]) if $p->{vsep} && @$left; + push @result, @$right; + } + return @result; +} + +# create_caption {{{3 +sub create_caption { + my ( $caption, @rows ) = @_; + if ( @rows ) { + + # Calculate the width of what will be displayed, so it can be centered + # in that space. When the thing is wider than the display, center the + # caption in the display. + my $width = min($this_term_size[0], max(map { length(ref($_) ? $_->[0] : $_) } @rows)); + + my $cap_len = length($caption); + + # It may be narrow enough to pad the sides with underscores and save a + # line on the screen. + if ( $cap_len <= $width - 6 ) { + my $left = int(($width - 2 - $cap_len) / 2); + unshift @rows, + ("_" x $left) . " $caption " . ("_" x ($width - $left - $cap_len - 2)); + } + + # The caption is too wide to add underscores on each side. + else { + + # Color is supported, so we can use terminal underlining. + if ( $config{color}->{val} ) { + my $left = int(($width - $cap_len) / 2); + unshift @rows, [ + (" " x $left) . $caption . (" " x ($width - $left - $cap_len)), + 'underline', + ]; + } + + # Color is not supported, so we have to add a line underneath to separate the + # caption from whatever it's captioning. + else { + my $left = int(($width - $cap_len) / 2); + unshift @rows, ('-' x $width); + unshift @rows, (" " x $left) . $caption . (" " x ($width - $left - $cap_len)); + } + + # The caption is wider than the thing it labels, so we have to pad the + # thing it labels to a consistent width. + if ( $cap_len > $width ) { + @rows = map { + ref($_) + ? [ sprintf('%-' . $cap_len . 's', $_->[0]), $_->[1] ] + : sprintf('%-' . $cap_len . 's', $_); + } @rows; + } + + } + } + return @rows; +} + +# create_table {{{3 +# Input: an arrayref of columns, hashref of col info, and an arrayref of hashes +# Example: [ 'a', 'b' ] +# { a => spec, b => spec } +# [ { a => 1, b => 2}, { a => 3, b => 4 } ] +# The 'spec' is a hashref of hdr => label, just => ('-' or ''). It also supports min and max-widths +# vi the minw and maxw params. +# Output: an array of strings, one per row. +# Example: +# Column One Column Two +# ---------- ---------- +# 1 2 +# 3 4 +sub create_table { + my ( $cols, $info, $data, $prefs ) = @_; + $prefs ||= {}; + $prefs->{no_hdr} ||= ($opts{n} && $clock != 1); + + # Truncate rows that will surely be off screen even if this is the only table. + if ( !$opts{n} && !$prefs->{raw} && !$prefs->{show_all} && $this_term_size[1] < @$data-1 ) { + $data = [ @$data[0..$this_term_size[1] - 1] ]; + } + + my @rows = (); + + if ( @$cols && %$info ) { + + # Fix undef values, collapse whitespace. + foreach my $row ( @$data ) { + map { $row->{$_} = collapse_ws($row->{$_}) } @$cols; + } + + my $col_sep = $opts{n} ? "\t" : ' '; + + # Find each column's max width. + my %width_for; + if ( !$opts{n} ) { + %width_for = map { + my $col_name = $_; + if ( $info->{$_}->{dec} ) { + # Align along the decimal point + my $max_rodp = max(0, map { $_->{$col_name} =~ m/([^\s\d-].*)$/ ? length($1) : 0 } @$data); + foreach my $row ( @$data ) { + my $col = $row->{$col_name}; + my ( $l, $r ) = $col =~ m/^([\s\d]*)(.*)$/; + $row->{$col_name} = sprintf("%s%-${max_rodp}s", $l, $r); + } + } + my $max_width = max( length($info->{$_}->{hdr}), map { length($_->{$col_name}) } @$data); + if ( $info->{$col_name}->{maxw} ) { + $max_width = min( $max_width, $info->{$col_name}->{maxw} ); + } + if ( $info->{$col_name}->{minw} ) { + $max_width = max( $max_width, $info->{$col_name}->{minw} ); + } + $col_name => $max_width; + } @$cols; + } + + # The table header. + if ( !$config{hide_hdr}->{val} && !$prefs->{no_hdr} ) { + push @rows, $opts{n} + ? join( $col_sep, @$cols ) + : join( $col_sep, map { sprintf( "%-$width_for{$_}s", trunc($info->{$_}->{hdr}, $width_for{$_}) ) } @$cols ); + if ( $config{color}->{val} && $config{header_highlight}->{val} ) { + push @rows, [ pop @rows, $config{header_highlight}->{val} ]; + } + elsif ( !$opts{n} ) { + push @rows, join( $col_sep, map { "-" x $width_for{$_} } @$cols ); + } + } + + # The table data. + if ( $opts{n} ) { + foreach my $item ( @$data ) { + push @rows, join($col_sep, map { $item->{$_} } @$cols ); + } + } + else { + my $format = join( $col_sep, + map { "%$info->{$_}->{just}$width_for{$_}s" } @$cols ); + foreach my $item ( @$data ) { + my $row = sprintf($format, map { trunc($item->{$_}, $width_for{$_}) } @$cols ); + if ( $config{color}->{val} && $item->{_color} ) { + push @rows, [ $row, $item->{_color} ]; + } + else { + push @rows, $row; + } + } + } + } + + return @rows; +} + +# Aggregates a table. If $group_by is an arrayref of columns, the grouping key +# is the specified columns; otherwise it's just the empty string (e.g. +# everything is grouped as one group). +sub apply_group_by { + my ( $tbl, $group_by, @rows ) = @_; + my $meta = $tbl_meta{$tbl}; + my %is_group = map { $_ => 1 } @$group_by; + my @non_grp = grep { !$is_group{$_} } keys %{$meta->{cols}}; + + my %temp_table; + foreach my $row ( @rows ) { + my $group_key + = @$group_by + ? '{' . join('}{', map { defined $_ ? $_ : '' } @{$row}{@$group_by}) . '}' + : ''; + $temp_table{$group_key} ||= []; + push @{$temp_table{$group_key}}, $row; + } + + # Crush the rows together... + my @new_rows; + foreach my $key ( sort keys %temp_table ) { + my $group = $temp_table{$key}; + my %new_row; + @new_row{@$group_by} = @{$group->[0]}{@$group_by}; + foreach my $col ( @non_grp ) { + my $agg = $meta->{cols}->{$col}->{agg} || 'first'; + $new_row{$col} = $agg_funcs{$agg}->( map { $_->{$col} } @$group ); + } + push @new_rows, \%new_row; + } + return @new_rows; +} + +# set_to_tbl {{{3 +# Unifies all the work of filtering, sorting etc. Alters the input. +# TODO: pull all the little pieces out into subroutines and stick events in each of them. +sub set_to_tbl { + my ( $rows, $tbl ) = @_; + my $meta = $tbl_meta{$tbl} or die "No such table $tbl in tbl_meta"; + + # don't show cxn if there's only one connection being displayed + my @visible; + if (scalar @{$modes{$config{mode}->{val}}->{connections}} == 1) { + map { push @visible, $_ if $_ !~ /^cxn$/ } @{$meta->{visible}}; + delete $$rows[0]{cxn} if defined $$rows[0]{cxn}; + } + else { + @visible = @{$meta->{visible}}; + } + + if ( !$meta->{pivot} ) { + + # Hook in event listeners + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_filter}} ) { + $listener->set_to_tbl_pre_filter($rows, $tbl); + } + + # Apply filters. Note that if the table is pivoted, filtering and sorting + # are applied later. + foreach my $filter ( @{$meta->{filters}} ) { + eval { + @$rows = grep { $filters{$filter}->{func}->($_) } @$rows; + }; + if ( $EVAL_ERROR && $config{debug}->{val} ) { + die $EVAL_ERROR; + } + } + + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_sort}} ) { + $listener->set_to_tbl_pre_sort($rows, $tbl); + } + + # Sort. Note that if the table is pivoted, sorting might have the wrong + # columns and it could crash. This will only be an issue if it's possible + # to toggle pivoting on and off, which it's not at the moment. + if ( @$rows && $meta->{sort_func} && !$meta->{aggregate} ) { + if ( $meta->{sort_dir} > 0 ) { + @$rows = $meta->{sort_func}->( @$rows ); + } + else { + @$rows = reverse $meta->{sort_func}->( @$rows ); + } + } + + } + + # Stop altering arguments now. + my @rows = @$rows; + + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_group}} ) { + $listener->set_to_tbl_pre_group(\@rows, $tbl); + } + + # Apply group-by. + if ( $meta->{aggregate} ) { + @rows = apply_group_by($tbl, $meta->{group_by}, @rows); + + # Sort. Note that if the table is pivoted, sorting might have the wrong + # columns and it could crash. This will only be an issue if it's possible + # to toggle pivoting on and off, which it's not at the moment. + if ( @rows && $meta->{sort_func} ) { + if ( $meta->{sort_dir} > 0 ) { + @rows = $meta->{sort_func}->( @rows ); + } + else { + @rows = reverse $meta->{sort_func}->( @rows ); + } + } + + } + + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_colorize}} ) { + $listener->set_to_tbl_pre_colorize(\@rows, $tbl); + } + + if ( !$meta->{pivot} ) { + # Colorize. Adds a _color column to rows. + if ( @rows && $meta->{color_func} ) { + eval { + foreach my $row ( @rows ) { + $row->{_color} = $meta->{color_func}->($row); + } + }; + if ( $EVAL_ERROR ) { + pause($EVAL_ERROR); + } + } + } + + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_transform}} ) { + $listener->set_to_tbl_pre_transform(\@rows, $tbl); + } + + # Apply_transformations. + if ( @rows ) { + my $cols = $meta->{cols}; + foreach my $col ( keys %{$rows->[0]} ) { + # Don't auto-vivify $tbl_meta{tbl}-{cols}->{_color}->{trans} + next if $col eq '_color'; + foreach my $trans ( @{$cols->{$col}->{trans}} ) { + map { $_->{$col} = $trans_funcs{$trans}->($_->{$col}) } @rows; + } + } + } + + my ($fmt_cols, $fmt_meta); + + # Pivot. + if ( $meta->{pivot} ) { + + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_pivot}} ) { + $listener->set_to_tbl_pre_pivot(\@rows, $tbl); + } + + my @vars = @{$meta->{visible}}; + my @tmp = map { { name => $_ } } @vars; + my @cols = 'name'; + foreach my $i ( 0..@$rows-1 ) { + my $col = "set_$i"; + push @cols, $col; + foreach my $j ( 0..@vars-1 ) { + $tmp[$j]->{$col} = $rows[$i]->{$vars[$j]}; + } + } + $fmt_meta = { map { $_ => { hdr => $_, just => '-' } } @cols }; + $fmt_cols = \@cols; + @rows = @tmp; + + # Hook in event listeners + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_filter}} ) { + $listener->set_to_tbl_pre_filter($rows, $tbl); + } + + # Apply filters. + foreach my $filter ( @{$meta->{filters}} ) { + eval { + @rows = grep { $filters{$filter}->{func}->($_) } @rows; + }; + if ( $EVAL_ERROR && $config{debug}->{val} ) { + die $EVAL_ERROR; + } + } + + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_sort}} ) { + $listener->set_to_tbl_pre_sort($rows, $tbl); + } + + # Sort. + if ( @rows && $meta->{sort_func} ) { + if ( $meta->{sort_dir} > 0 ) { + @rows = $meta->{sort_func}->( @rows ); + } + else { + @rows = reverse $meta->{sort_func}->( @rows ); + } + } + + } + else { + # If the table isn't pivoted, just show all columns that are supposed to + # be shown; but eliminate aggonly columns if the table isn't aggregated. + my $aggregated = $meta->{aggregate}; + $fmt_cols = [ grep { $aggregated || !$meta->{cols}->{$_}->{aggonly} } @visible ]; + $fmt_meta = { map { $_ => $meta->{cols}->{$_} } @$fmt_cols }; + + # If the table is aggregated, re-order the group_by columns to the left of + # the display. + if ( $aggregated ) { + my %is_group = map { $_ => 1 } @{$meta->{group_by}}; + $fmt_cols = [ @{$meta->{group_by}}, grep { !$is_group{$_} } @$fmt_cols ]; + } + } + + foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_create}} ) { + $listener->set_to_tbl_pre_create(\@rows, $tbl); + } + + @rows = create_table( $fmt_cols, $fmt_meta, \@rows); + if ( !$meta->{hide_caption} && !$opts{n} && $config{display_table_captions}->{val} ) { + @rows = create_caption($meta->{capt}, @rows) + } + + foreach my $listener ( @{$event_listener_for{set_to_tbl_post_create}} ) { + $listener->set_to_tbl_post_create(\@rows, $tbl); + } + + return @rows; +} + +# meta_to_hdr {{{3 +sub meta_to_hdr { + my $tbl = shift; + my $meta = $tbl_meta{$tbl}; + my %labels = map { $_ => $meta->{cols}->{$_}->{hdr} } @{$meta->{visible}}; + return \%labels; +} + +# commify {{{3 +# From perlfaq5: add commas. +sub commify { + my ( $num ) = @_; + $num = 0 unless defined $num; + $num =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; + return $num; +} + +# set_precision {{{3 +# Trim to desired precision. +sub set_precision { + my ( $num, $precision ) = @_; + $precision = $config{num_digits}->{val} if !defined $precision; + sprintf("%.${precision}f", $num); +} + +# percent {{{3 +# Convert to percent +sub percent { + my ( $num ) = @_; + $num = 0 unless defined $num; + my $digits = $config{num_digits}->{val}; + return sprintf("%.${digits}f", $num * 100) + . ($config{show_percent}->{val} ? '%' : ''); +} + +# shorten {{{3 +sub shorten { + my ( $num, $opts ) = @_; + + return $num if !defined($num) || $opts{n} || $num !~ m/$num_regex/; + + $opts ||= {}; + my $pad = defined $opts->{pad} ? $opts->{pad} : ''; + my $num_digits = defined $opts->{num_digits} + ? $opts->{num_digits} + : $config{num_digits}->{val}; + my $force = defined $opts->{force}; + + my $n = 0; + while ( $num >= 1_024 ) { + $num /= 1_024; + ++$n; + } + return sprintf( + $num =~ m/\./ || $n || $force + ? "%.${num_digits}f%s" + : '%d', + $num, ($pad,'k','M','G', 'T')[$n]); + +} + +# Utility functions {{{2 +# unique {{{3 +sub unique { + my %seen; + return grep { !$seen{$_}++ } @_; +} + +# make_color_func {{{3 +sub make_color_func { + my ( $tbl ) = @_; + my @criteria; + foreach my $spec ( @{$tbl->{colors}} ) { + next unless exists $comp_ops{$spec->{op}}; + my $val = $spec->{op} =~ m/^(?:eq|ne|le|ge|lt|gt)$/ ? "'$spec->{arg}'" + : $spec->{op} =~ m/^(?:=~|!~)$/ ? "m/" . quotemeta($spec->{arg}) . "/" + : $spec->{arg}; + push @criteria, + "( defined \$set->{$spec->{col}} && \$set->{$spec->{col}} $spec->{op} $val ) { return '$spec->{color}'; }"; + } + return undef unless @criteria; + my $sub = eval 'sub { my ( $set ) = @_; if ' . join(" elsif ", @criteria) . '}'; + die if $EVAL_ERROR; + return $sub; +} + +# make_sort_func {{{3 +# Gets a list of sort columns from the table, like "+cxn -time" and returns a +# subroutine that will sort that way. +sub make_sort_func { + my ( $tbl ) = @_; + my @criteria; + + # Pivoted tables can be sorted by 'name' and set_x columns; others must be + # sorted by existing columns. TODO: this will crash if you toggle between + # pivoted and nonpivoted. I have several other 'crash' notes about this if + # this ever becomes possible. + + if ( $tbl->{pivot} ) { + # Sort type is not really possible on pivoted columns, because a 'column' + # contains data from an entire non-pivoted row, so there could be a mix of + # numeric and non-numeric data. Thus everything has to be 'cmp' type. + foreach my $col ( split(/\s+/, $tbl->{sort_cols} ) ) { + next unless $col; + my ( $dir, $name ) = $col =~ m/([+-])?(\w+)$/; + next unless $name && $name =~ m/^(?:name|set_\d+)$/; + $dir ||= '+'; + my $op = 'cmp'; + my $df = "''"; + push @criteria, + $dir eq '+' + ? "(\$a->{$name} || $df) $op (\$b->{$name} || $df)" + : "(\$b->{$name} || $df) $op (\$a->{$name} || $df)"; + } + } + else { + foreach my $col ( split(/\s+/, $tbl->{sort_cols} ) ) { + next unless $col; + my ( $dir, $name ) = $col =~ m/([+-])?(\w+)$/; + next unless $name && $tbl->{cols}->{$name}; + $dir ||= '+'; + my $op = $tbl->{cols}->{$name}->{num} ? "<=>" : "cmp"; + my $df = $tbl->{cols}->{$name}->{num} ? "0" : "''"; + push @criteria, + $dir eq '+' + ? "(\$a->{$name} || $df) $op (\$b->{$name} || $df)" + : "(\$b->{$name} || $df) $op (\$a->{$name} || $df)"; + } + } + return sub { return @_ } unless @criteria; + my $sub = eval 'sub { sort {' . join("||", @criteria) . '} @_; }'; + die if $EVAL_ERROR; + return $sub; +} + +# trunc {{{3 +# Shortens text to specified length. +sub trunc { + my ( $text, $len ) = @_; + if ( length($text) <= $len ) { + return $text; + } + return substr($text, 0, $len); +} + +# donut {{{3 +# Takes out the middle of text to shorten it. +sub donut { + my ( $text, $len ) = @_; + return $text if length($text) <= $len; + my $max = length($text) - $len; + my $min = $max - 1; + + # Try to remove a single "word" from somewhere in the center + if ( $text =~ s/_[^_]{$min,$max}_/_/ ) { + return $text; + } + + # Prefer removing the end of a "word" + if ( $text =~ s/([^_]+)[^_]{$max}_/$1_/ ) { + return $text; + } + + $text = substr($text, 0, int($len/2)) + . "_" + . substr($text, int($len/2) + $max + 1); + return $text; +} + +# crunch {{{3 +# Removes vowels and compacts repeated letters to shorten text. +sub crunch { + my ( $text, $len ) = @_; + return $text if $len && length($text) <= $len; + $text =~ s/^IB_\w\w_//; + $text =~ s/(?{val}; + if ( $charset && $charset eq 'unicode' ) { + $text =~ s/ + ("(?:(?!(?{val} ) { + unshift @$display_lines, create_statusbar(); + } + + foreach my $listener ( @{$event_listener_for{draw_screen}} ) { + $listener->draw_screen($display_lines); + } + + $clear_screen_sub->() + if $prefs->{clear} || !$modes{$config{mode}->{val}}->{no_clear_screen}; + if ( $opts{n} || $prefs->{raw} ) { + my $num_lines = 0; + print join("\n", + map { + $num_lines++; + ref $_ + ? colored($_->[0], $_->[1]) + : $_; + } + grep { !$opts{n} || $_ } # Suppress empty lines + @$display_lines); + if ( $opts{n} && $num_lines ) { + print "\n"; + } + } + else { + my $max_lines = $prefs->{show_all} + ? scalar(@$display_lines)- 1 + : min(scalar(@$display_lines), $this_term_size[1]); + print join("\n", + map { + ref $_ + ? colored(substr($_->[0], 0, $this_term_size[0]), $_->[1]) + : substr($_, 0, $this_term_size[0]); + } @$display_lines[0..$max_lines - 1]); + } +} + +# secs_to_time {{{3 +sub secs_to_time { + my ( $secs, $fmt ) = @_; + $secs ||= 0; + return '00:00' unless $secs; + + # Decide what format to use, if not given + $fmt ||= $secs >= 86_400 ? 'd' + : $secs >= 3_600 ? 'h' + : 'm'; + + return + $fmt eq 'd' ? sprintf( + "%d+%02d:%02d:%02d", + int($secs / 86_400), + int(($secs % 86_400) / 3_600), + int(($secs % 3_600) / 60), + $secs % 60) + : $fmt eq 'h' ? sprintf( + "%02d:%02d:%02d", + int(($secs % 86_400) / 3_600), + int(($secs % 3_600) / 60), + $secs % 60) + : sprintf( + "%02d:%02d", + int(($secs % 3_600) / 60), + $secs % 60); +} + +# dulint_to_int {{{3 +# Takes a number that InnoDB formats as two ulint integers, like transaction IDs +# and such, and turns it into a single integer +sub dulint_to_int { + my $num = shift; + return 0 unless $num; + my ( $high, $low ) = $num =~ m/^(\d+) (\d+)$/; + return $low unless $high; + return $low + ( $high * $MAX_ULONG ); +} + +# create_statusbar {{{3 +sub create_statusbar { + my $mode = $config{mode}->{val}; + my @cxns = sort { $a cmp $b } get_connections(); + + my $modeline = ( $config{readonly}->{val} ? '[RO] ' : '' ) + . $modes{$mode}->{hdr} . " (? for help)"; + my $mode_width = length($modeline); + my $remaining_width = $this_term_size[0] - $mode_width - 1; + my $result; + + # The thingie in top-right that says what we're monitoring. + my $cxn = ''; + + if ( 1 == @cxns && $dbhs{$cxns[0]} && $dbhs{$cxns[0]}->{dbh} ) { + $cxn = $dbhs{$cxns[0]}->{dbh}->{mysql_serverinfo} || ''; + } + else { + if ( $modes{$mode}->{server_group} ) { + $cxn = "Servers: " . $modes{$mode}->{server_group}; + my $err_count = grep { $dbhs{$_} && $dbhs{$_}->{err_count} } @cxns; + if ( $err_count ) { + $cxn .= "(" . ( scalar(@cxns) - $err_count ) . "/" . scalar(@cxns) . ")"; + } + } + else { + $cxn = join(' ', map { ($dbhs{$_}->{err_count} ? '!' : '') . $_ } + grep { $dbhs{$_} } @cxns); + } + } + + if ( 1 == @cxns ) { + get_driver_status(@cxns); + my $vars = $vars{$cxns[0]}->{$clock}; + my $inc = inc(0, $cxns[0]); + + # Format server uptime human-readably, calculate QPS... + my $uptime = secs_to_time( $vars->{Uptime_hires} ); + my $qps = ($inc->{Questions}||0) / ($inc->{Uptime_hires}||1); + my $ibinfo = ''; + + if ( exists $vars->{IB_last_secs} ) { + $ibinfo .= "InnoDB $vars->{IB_last_secs}s "; + if ( $vars->{IB_got_all} ) { + if ( ($mode eq 'T' || $mode eq 'W') + && $vars->{IB_tx_is_truncated} ) { + $ibinfo .= ':^|'; + } + else { + $ibinfo .= ':-)'; + } + } + else { + $ibinfo .= ':-('; + } + } + $result = sprintf( + "%-${mode_width}s %${remaining_width}s", + $modeline, + join(', ', grep { $_ } ( + $cxns[0], + $uptime, + $ibinfo, + shorten($qps) . " QPS", + ($vars->{Threads} || 0) . "/" . ($vars->{Threads_running} || 0) . "/" . ($vars->{Threads_cached} || 0) . " con/run/cac thds", + $cxn))); + } + else { + $result = sprintf( + "%-${mode_width}s %${remaining_width}s", + $modeline, + $cxn); + } + + return $config{color}->{val} ? [ $result, 'bold reverse' ] : $result; +} + +# Database connections {{{3 +sub add_new_dsn { + my ( $name, $dsn, $dl_table, $have_user, $user, $have_pass, $pass, $savepass ) = @_; + + if ( defined $name ) { + $name =~ s/[\s:;]//g; + } + + if ( !$name ) { + print word_wrap("Choose a name for the connection. It cannot contain " + . "whitespace, colons or semicolons."), "\n\n"; + do { + $name = prompt("Enter a name"); + $name =~ s/[\s:;]//g; + } until ( $name ); + } + + if ( !$dsn ) { + do { + $clear_screen_sub->(); + print "Typical DSN strings look like\n DBI:mysql:;host=hostname;port=port\n" + . "The db and port are optional and can usually be omitted.\n" + . "If you specify 'mysql_read_default_group=mysql' many options can be read\n" + . "from your mysql options files (~/.my.cnf, /etc/my.cnf).\n\n"; + $dsn = prompt("Enter a DSN string", undef, "DBI:mysql:;mysql_read_default_group=mysql;host=$name"); + } until ( $dsn ); + } + if ( !$dl_table ) { + $clear_screen_sub->(); + my $dl_table = prompt("Optional: enter a table (must not exist) to use when resetting InnoDB deadlock information", + undef, 'test.innotop_dl'); + } + + $connections{$name} = { + dsn => $dsn, + dl_table => $dl_table, + have_user => $have_user, + user => $user, + have_pass => $have_pass, + pass => $pass, + savepass => $savepass + }; +} + +sub add_new_server_group { + my ( $name ) = @_; + + if ( defined $name ) { + $name =~ s/[\s:;]//g; + } + + if ( !$name ) { + print word_wrap("Choose a name for the group. It cannot contain " + . "whitespace, colons or semicolons."), "\n\n"; + do { + $name = prompt("Enter a name"); + $name =~ s/[\s:;]//g; + } until ( $name ); + } + + my @cxns; + do { + $clear_screen_sub->(); + @cxns = select_cxn("Choose servers for $name", keys %connections); + } until ( @cxns ); + + $server_groups{$name} = \@cxns; + return $name; +} + +sub get_var_set { + my ( $name ) = @_; + while ( !$name || !exists($var_sets{$config{$name}->{val}}) ) { + $name = choose_var_set($name); + } + return $var_sets{$config{$name}->{val}}->{text}; +} + +sub add_new_var_set { + my ( $name ) = @_; + + if ( defined $name ) { + $name =~ s/\W//g; + } + + if ( !$name ) { + do { + $name = prompt("Enter a name"); + $name =~ s/\W//g; + } until ( $name ); + } + + my $variables; + do { + $clear_screen_sub->(); + $variables = prompt("Enter variables for $name", undef ); + } until ( $variables ); + + $var_sets{$name} = { text => $variables, user => 1 }; +} + +sub next_server { + my $mode = $config{mode}->{val}; + my @cxns = sort keys %connections; + my ($cur) = get_connections($mode); + $cur ||= $cxns[0]; + my $pos = grep { $_ lt $cur } @cxns; + my $newpos = ($pos + 1) % @cxns; + $modes{$mode}->{server_group} = ''; + $modes{$mode}->{connections} = [ $cxns[$newpos] ]; + $clear_screen_sub->(); +} + +sub next_server_group { + my $mode = shift || $config{mode}->{val}; + my @grps = sort keys %server_groups; + my $curr = $modes{$mode}->{server_group}; + + return unless @grps; + + if ( $curr ) { + # Find the current group's position. + my $pos = 0; + while ( $curr ne $grps[$pos] ) { + $pos++; + } + $modes{$mode}->{server_group} = $grps[ ($pos + 1) % @grps ]; + } + else { + $modes{$mode}->{server_group} = $grps[0]; + } +} + +# Get a list of connection names used in this mode. +sub get_connections { + if ( $file ) { + return qw(file); + } + my $mode = shift || $config{mode}->{val}; + my @connections = $modes{$mode}->{server_group} + ? @{$server_groups{$modes{$mode}->{server_group}}} + : @{$modes{$mode}->{connections}}; + if ( $modes{$mode}->{one_connection} ) { + @connections = @connections ? $connections[0] : (); + } + return unique(@connections); +} + +# Get a list of tables used in this mode. If innotop is running non-interactively, just use the first. +sub get_visible_tables { + my $mode = shift || $config{mode}->{val}; + my @tbls = @{$modes{$mode}->{visible_tables}}; + if ( $opts{n} ) { + return $tbls[0]; + } + else { + return @tbls; + } +} + +# Choose from among available connections or server groups. +# If the mode has a server set in use, prefers that instead. +sub choose_connections { + $clear_screen_sub->(); + my $mode = $config{mode}->{val}; + my $meta = { map { $_ => $connections{$_}->{dsn} } keys %connections }; + foreach my $group ( keys %server_groups ) { + $meta->{"#$group"} = join(' ', @{$server_groups{$group}}); + } + + my $choices = prompt_list("Choose connections or a group for $mode mode", + undef, sub { return keys %$meta }, $meta); + + my @choices = unique(grep { $_ } split(/\s+/, $choices)); + if ( @choices ) { + if ( $choices[0] =~ s/^#// && exists $server_groups{$choices[0]} ) { + $modes{$mode}->{server_group} = $choices[0]; + } + else { + $modes{$mode}->{connections} = [ grep { exists $connections{$_} } @choices ]; + } + } +} + +# Accepts a DB connection name and the name of a prepared query (e.g. status, kill). +# Also a list of params for the prepared query. This allows not storing prepared +# statements globally. Returns a $sth that's been executed. +# ERROR-HANDLING SEMANTICS: if the statement throws an error, propagate, but if the +# connection has gone away or can't connect, DO NOT. Just return undef. +sub do_stmt { + my ( $cxn, $stmt_name, @args ) = @_; + + return undef if $file; + + # Test if the cxn should not even be tried + return undef if $dbhs{$cxn} + && $dbhs{$cxn}->{err_count} + && ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} ) + && $dbhs{$cxn}->{wake_up} > $clock; + + my $sth; + my $retries = 1; + my $success = 0; + TRY: + while ( $retries-- >= 0 && !$success ) { + + eval { + my $dbh = connect_to_db($cxn); + + # If the prepared query doesn't exist, make it. + if ( !exists $dbhs{$cxn}->{stmts}->{$stmt_name} ) { + $dbhs{$cxn}->{stmts}->{$stmt_name} = $stmt_maker_for{$stmt_name}->($dbh); + } + + $sth = $dbhs{$cxn}->{stmts}->{$stmt_name}; + if ( $sth ) { + $sth->execute(@args); + } + $success = 1; + }; + if ( $EVAL_ERROR ) { + if ( $EVAL_ERROR =~ m/$nonfatal_errs/ ) { + handle_cxn_error($cxn, $EVAL_ERROR); + } + else { + die "$cxn $stmt_name: $EVAL_ERROR"; + } + if ( $retries < 0 ) { + $sth = undef; + } + } + } + + if ( $sth && $sth->{NUM_OF_FIELDS} ) { + sleep($stmt_sleep_time_for{$stmt_name}) if $stmt_sleep_time_for{$stmt_name}; + return $sth; + } +} + +# Keeps track of error count, sleep times till retries, etc etc. +# When there's an error we retry the connection every so often, increasing in +# Fibonacci series to prevent too much banging on the server. +sub handle_cxn_error { + my ( $cxn, $err ) = @_; + my $meta = $dbhs{$cxn}; + $meta->{err_count}++; + + # This is used so errors that have to do with permissions needed by the current + # mode will get displayed as long as we're in this mode, but get ignored if the + # mode changes. + $meta->{mode} = $config{mode}->{val}; + + # Strip garbage from the error text if possible. + $err =~ s/\s+/ /g; + if ( $err =~ m/failed: (.*?) at \S*innotop line/ ) { + $err = $1; + } + + $meta->{last_err} = $err; + my $sleep_time = $meta->{this_sleep} + $meta->{prev_sleep}; + $meta->{prev_sleep} = $meta->{this_sleep}; + $meta->{this_sleep} = $sleep_time; + $meta->{wake_up} = $clock + $sleep_time; + if ( $config{show_cxn_errors}->{val} ) { + print STDERR "Error at tick $clock $cxn $err" if $config{debug}->{val}; + } +} + +# Accepts a DB connection name and a (string) query. Returns a $sth that's been +# executed. +sub do_query { + my ( $cxn, $query ) = @_; + + return undef if $file; + + # Test if the cxn should not even be tried + return undef if $dbhs{$cxn} + && $dbhs{$cxn}->{err_count} + && ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} ) + && $dbhs{$cxn}->{wake_up} > $clock; + + my $sth; + my $retries = 1; + my $success = 0; + TRY: + while ( $retries-- >= 0 && !$success ) { + + eval { + my $dbh = connect_to_db($cxn); + + $sth = $dbh->prepare($query); + $sth->execute(); + $success = 1; + }; + if ( $EVAL_ERROR ) { + if ( $EVAL_ERROR =~ m/$nonfatal_errs/ ) { + handle_cxn_error($cxn, $EVAL_ERROR); + } + else { + die $EVAL_ERROR; + } + if ( $retries < 0 ) { + $sth = undef; + } + } + } + + return $sth; +} + +sub get_uptime { + my ( $cxn ) = @_; + $dbhs{$cxn}->{start_time} ||= time(); + # Avoid dividing by zero + return (time() - $dbhs{$cxn}->{start_time}) || .001; +} + +sub connect_to_db { + my ( $cxn ) = @_; + + $dbhs{$cxn} ||= { + stmts => {}, # bucket for prepared statements. + prev_sleep => 0, + this_sleep => 1, + wake_up => 0, + start_time => 0, + dbh => undef, + }; + my $href = $dbhs{$cxn}; + + if ( !$href->{dbh} || ref($href->{dbh}) !~ m/DBI/ || !$href->{dbh}->ping ) { + my $dbh = get_new_db_connection($cxn); + @{$href}{qw(dbh err_count wake_up this_sleep start_time prev_sleep)} + = ($dbh, 0, 0, 1, 0, 0); + + # Derive and store the server's start time in hi-res + my $uptime = $dbh->selectrow_hashref("show status like 'Uptime'")->{value}; + $href->{start_time} = time() - $uptime; + + # Set timeouts so an unused connection stays alive. + # For example, a connection might be used in Q mode but idle in T mode. + if ( version_ge($dbh, '4.0.3')) { + my $timeout = $config{cxn_timeout}->{val}; + $dbh->do("set session wait_timeout=$timeout, interactive_timeout=$timeout"); + } + } + return $href->{dbh}; +} + +# Compares versions like 5.0.27 and 4.1.15-standard-log +sub version_ge { + my ( $dbh, $target ) = @_; + my $version = sprintf('%03d%03d%03d', $dbh->{mysql_serverinfo} =~ m/(\d+)/g); + return $version ge sprintf('%03d%03d%03d', $target =~ m/(\d+)/g); +} + +# Extracts status values that can be gleaned from the DBD driver without doing a whole query. +sub get_driver_status { + my @cxns = @_; + if ( !$info_gotten{driver_status}++ ) { + foreach my $cxn ( @cxns ) { + next unless $dbhs{$cxn} && $dbhs{$cxn}->{dbh} && $dbhs{$cxn}->{dbh}->{Active}; + $vars{$cxn}->{$clock} ||= {}; + my $vars = $vars{$cxn}->{$clock}; + my %res = map { $_ =~ s/ +/_/g; $_ } $dbhs{$cxn}->{dbh}->{mysql_stat} =~ m/(\w[^:]+): ([\d\.]+)/g; + map { $vars->{$_} ||= $res{$_} } keys %res; + $vars->{Uptime_hires} ||= get_uptime($cxn); + $vars->{cxn} = $cxn; + } + } +} + +sub get_new_db_connection { + my ( $connection, $destroy ) = @_; + if ( $file ) { + die "You can't connect to a MySQL server while monitoring a file. This is probably a bug."; + } + + my $dsn = $connections{$connection} + or die "No connection named '$connection' is defined in your configuration"; + + # don't ask for a username if mysql_read_default_group=client is in the DSN + if ( !defined $dsn->{have_user} and $dsn->{dsn} !~ /mysql_read_default_group=client/ ) { + my $answer = prompt("Do you want to specify a username for $connection?", undef, 'n'); + $dsn->{have_user} = $answer && $answer =~ m/1|y/i; + } + + # don't ask for a password if mysql_read_default_group=client is in the DSN + if ( !defined $dsn->{have_pass} and $dsn->{dsn} !~ /mysql_read_default_group=client/ ) { + my $answer = prompt("Do you want to specify a password for $connection?", undef, 'n'); + $dsn->{have_pass} = $answer && $answer =~ m/1|y/i; + } + + if ( !$dsn->{user} && $dsn->{have_user} ) { + my $user = $ENV{USERNAME} || $ENV{USER} || getlogin() || getpwuid($REAL_USER_ID) || undef; + $dsn->{user} = prompt("Enter username for $connection", undef, $user); + } + + if ( !defined $dsn->{user} ) { + $dsn->{user} = ''; + } + + if ( !$dsn->{pass} && !$dsn->{savepass} && $dsn->{have_pass} ) { + $dsn->{pass} = prompt_noecho("Enter password for '$dsn->{user}' on $connection"); + print "\n"; + if ( !defined($dsn->{savepass}) ) { + my $answer = prompt("Save password in plain text in the config file?", undef, 'y'); + $dsn->{savepass} = $answer && $answer =~ m/1|y/i; + } + } + + my $dbh = DBI->connect( + $dsn->{dsn}, $dsn->{user}, $dsn->{pass}, + { RaiseError => 1, PrintError => 0, AutoCommit => 1 }); + $dbh->{InactiveDestroy} = 1 unless $destroy; # Can't be set in $db_options + $dbh->{FetchHashKeyName} = 'NAME_lc'; # Lowercases all column names for fetchrow_hashref + return $dbh; +} + +sub get_cxn_errors { + my @cxns = @_; + return () unless $config{show_cxn_errors_in_tbl}->{val}; + return + map { [ $_ . ': ' . $dbhs{$_}->{last_err}, 'red' ] } + grep { $dbhs{$_} && $dbhs{$_}->{err_count} && $dbhs{$_}->{mode} eq $config{mode}->{val} } + @cxns; +} + +# Setup and tear-down functions {{{2 + +# Takes a string and turns it into a hashref you can apply to %tbl_meta tables. The string +# can be in the form 'foo, bar, foo/bar, foo as bar' much like a SQL SELECT statement. +sub compile_select_stmt { + my ($str) = @_; + my @exps = $str =~ m/\s*([^,]+(?i:\s+as\s+[^,\s]+)?)\s*(?=,|$)/g; + my %cols; + my @visible; + foreach my $exp ( @exps ) { + my ( $text, $colname ); + if ( $exp =~ m/as\s+(\w+)\s*/ ) { + $colname = $1; + $exp =~ s/as\s+(\w+)\s*//; + $text = $exp; + } + else { + $text = $colname = $exp; + } + my ($func, $err) = compile_expr($text); + $cols{$colname} = { + src => $text, + hdr => $colname, + num => 0, + func => $func, + }; + push @visible, $colname; + } + return (\%cols, \@visible); +} + +# compile_filter {{{3 +sub compile_filter { + my ( $text ) = @_; + my ( $sub, $err ); + eval "\$sub = sub { my \$set = shift; $text }"; + if ( $EVAL_ERROR ) { + $EVAL_ERROR =~ s/at \(eval.*$//; + $sub = sub { return $EVAL_ERROR }; + $err = $EVAL_ERROR; + } + return ( $sub, $err ); +} + +# compile_expr {{{3 +sub compile_expr { + my ( $expr ) = @_; + # Leave built-in functions alone so they get called as Perl functions, unless + # they are the only word in $expr, in which case treat them as hash keys. + if ( $expr =~ m/\W/ ) { + $expr =~ s/(?{$1}"/eg; + } + else { + $expr = "\$set->{$expr}"; + } + my ( $sub, $err ); + my $quoted = quotemeta($expr); + eval qq{ + \$sub = sub { + my (\$set, \$cur, \$pre) = \@_; + my \$val = eval { $expr }; + if ( \$EVAL_ERROR && \$config{debug}->{val} ) { + \$EVAL_ERROR =~ s/ at \\(eval.*//s; + die "\$EVAL_ERROR in expression $quoted"; + } + return \$val; + } + }; + if ( $EVAL_ERROR ) { + if ( $config{debug}->{val} ) { + die $EVAL_ERROR; + } + $EVAL_ERROR =~ s/ at \(eval.*$//; + $sub = sub { return $EVAL_ERROR }; + $err = $EVAL_ERROR; + } + return ( $sub, $err ); +} + +# finish {{{3 +# This is a subroutine because it's called from a key to quit the program. +sub finish { + save_config(); + ReadMode('normal') unless $opts{n}; + print "\n"; + exit(0); +} + +# core_dump {{{3 +sub core_dump { + my $msg = shift; + if ($config{debugfile}->{val} && $config{debug}->{val}) { + eval { + open my $file, '>>', $config{debugfile}->{val}; + if ( %vars ) { + print $file "Current variables:\n" . Dumper(\%vars); + } + close $file; + }; + } + print $msg; +} + +# migrate_config {{{3 +sub migrate_config { + + my ($old_filename, $new_filename) = @_; + + # don't proceed if old file doesn't exist + if ( ! -f $old_filename ) { + die "Error migrating '$old_filename': file doesn't exist.\n"; + } + # don't migrate files if new file exists + elsif ( -f $new_filename ) { + die "Error migrating '$old_filename' to '$new_filename': new file already exists.\n"; + } + # if migrating from one file to another in the same directory, just rename them + if (dirname($old_filename) eq dirname($new_filename)) { + rename($old_filename, $new_filename) + or die "Can't rename '$old_filename' to '$new_filename': $OS_ERROR"; + } + # otherwise, move the existing conf file to a temp file, make the necessary directory structure, + # and move the temp conf file to its new home + else { + my $tmp = File::Temp->new( TEMPLATE => 'innotopXXXXX', DIR => $homepath, SUFFIX => '.conf'); + my $tmp_filename = $tmp->filename; + my $dirname = dirname($new_filename); + rename($old_filename, $tmp_filename) + or die "Can't rename '$old_filename' to '$tmp_filename': $OS_ERROR"; + mkdir($dirname) or die "Can't create directory '$dirname': $OS_ERROR"; + mkdir("$dirname/plugins") or die "Can't create directory '$dirname/plugins': $OS_ERROR"; + rename($tmp_filename, $new_filename) + or die "Can't rename '$tmp_filename' to '$new_filename': $OS_ERROR"; + } +} + +# load_config {{{3 +sub load_config { + + my ($old_filename, $answer); + + if ( $opts{u} or $opts{p} or $opts{h} or $opts{P} ) { + my @params = $dsn_parser->get_cxn_params(\%opts); # dsn=$params[0] + add_new_dsn($opts{h} || 'localhost', $params[0], 'test.innotop_dl', + $opts{u} ? 1 : 0, $opts{u}, $opts{p} ? 1 : 0, $opts{p}); + } + if ($opts{c}) { + $conf_file = $opts{c}; + } + # innotop got upgraded and this is an old config file. + elsif ( -f "$homepath/.innotop" or -f "$homepath/.innotop/innotop.ini" ) { + $conf_file = $default_home_conf; + if ( -f "$homepath/.innotop") { + $old_filename = "$homepath/.innotop"; + } + elsif ( -f "$homepath/.innotop/innotop.ini" ) { + $old_filename = "$homepath/.innotop/innotop.ini"; + } + $answer = pause("Innotop's default config location has moved to '$conf_file'. Move old config file '$old_filename' there now? y/n"); + if ( lc $answer eq 'y' ) { + migrate_config($old_filename, $conf_file); + } + else { + print "\nInnotop will now exit so you can fix the config file.\n"; + exit(0); + } + } + elsif ( -f $default_home_conf ) { + $conf_file = $default_home_conf; + } + elsif ( -f $default_central_conf and not $opts{s} ) { + $conf_file = $default_central_conf; + } + else { + # If no config file was loaded, set readonly to 0 if the user wants to + # write a config + $config{readonly}->{val} = 0 if $opts{w}; + # If no connections have been defined, connect to a MySQL database + # on localhost using mysql_read_default_group=client + if (!%connections) { + add_new_dsn('localhost', + 'DBI:mysql:;host=localhost;mysql_read_default_group=client', + 'test.innotop_dl'); + } + } + + if ( -f "$conf_file" ) { + open my $file, "<", $conf_file or die("Can't open '$conf_file': $OS_ERROR"); + + # Check config file version. Just ignore if either innotop or the file has + # garbage in the version number. + if ( defined(my $line = <$file>) && $VERSION =~ m/\d/ ) { + chomp $line; + if ( my ($maj, $min, $rev) = $line =~ m/^version=(\d+)\.(\d+)(?:\.(\d+))?$/ ) { + $rev ||= 0; + my $cfg_ver = sprintf('%03d-%03d-%03d', $maj, $min, $rev); + ( $maj, $min, $rev ) = $VERSION =~ m/^(\d+)\.(\d+)(?:\.(\d+))?$/; + $rev ||= 0; + my $innotop_ver = sprintf('%03d-%03d-%03d', $maj, $min, $rev); + + if ( $cfg_ver gt $innotop_ver ) { + pause("The config file is for a newer version of innotop and may not be read correctly."); + } + else { + my @ver_history = @config_versions; + while ( my ($start, $end) = splice(@ver_history, 0, 2) ) { + # If the config file is between the endpoints and innotop is greater than + # the endpoint, innotop has a newer config file format than the file. + if ( $cfg_ver ge $start && $cfg_ver lt $end && $innotop_ver ge $end ) { + my $msg = "innotop's config file format has changed. Overwrite $conf_file? y or n"; + if ( pause($msg) eq 'n' ) { + $config{readonly}->{val} = 1; + print "\ninnotop will not save any configuration changes you make."; + pause(); + print "\n"; + } + close $file; + return; + } + } + } + } + } + + while ( my $line = <$file> ) { + chomp $line; + next unless $line =~ m/^\[([a-z_]+)\]$/; + if ( exists $config_file_sections{$1} ) { + $config_file_sections{$1}->{reader}->($file); + } + else { + warn "Unknown config file section '$1'"; + } + } + close $file or die("Can't close $conf_file: $OS_ERROR"); + } + +} + +# Do some post-processing on %tbl_meta: compile src properties into func etc. +sub post_process_tbl_meta { + foreach my $table ( values %tbl_meta ) { + foreach my $col_name ( keys %{$table->{cols}} ) { + my $col_def = $table->{cols}->{$col_name}; + my ( $sub, $err ) = compile_expr($col_def->{src}); + $col_def->{func} = $sub; + } + } +} + +# load_config_plugins {{{3 +sub load_config_plugins { + my ( $file ) = @_; + + # First, find a list of all plugins that exist on disk, and get information about them. + my $dir = $config{plugin_dir}->{val}; + foreach my $p_file ( <$dir/*.pm> ) { + my ($package, $desc); + eval { + open my $p_in, "<", $p_file or die $OS_ERROR; + while ( my $line = <$p_in> ) { + chomp $line; + if ( $line =~ m/^package\s+(.*?);/ ) { + $package = $1; + } + elsif ( $line =~ m/^# description: (.*)/ ) { + $desc = $1; + } + last if $package && $desc; + } + close $p_in; + }; + if ( $package ) { + $plugins{$package} = { + file => $p_file, + desc => $desc, + class => $package, + active => 0, + }; + if ( $config{debug}->{val} && $EVAL_ERROR ) { + die $EVAL_ERROR; + } + } + } + + # Now read which ones the user has activated. Each line simply represents an active plugin. + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + next unless $line && $plugins{$line}; + + my $obj; + eval { + require $plugins{$line}->{file}; + $obj = $line->new(%pluggable_vars); + foreach my $event ( $obj->register_for_events() ) { + my $queue = $event_listener_for{$event}; + if ( $queue ) { + push @$queue, $obj; + } + } + }; + if ( $config{debug}->{val} && $EVAL_ERROR ) { + die $EVAL_ERROR; + } + if ( $obj ) { + $plugins{$line}->{active} = 1; + $plugins{$line}->{object} = $obj; + } + } +} + +# save_config_plugins {{{3 +sub save_config_plugins { + my $file = shift; + foreach my $class ( sort keys %plugins ) { + next unless $plugins{$class}->{active}; + print $file "$class\n"; + } +} + +# load_config_active_server_groups {{{3 +sub load_config_active_server_groups { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $mode, $group ) = $line =~ m/^(.*?)=(.*)$/; + next unless $mode && $group + && exists $modes{$mode} && exists $server_groups{$group}; + $modes{$mode}->{server_group} = $group; + } +} + +# save_config_active_server_groups {{{3 +sub save_config_active_server_groups { + my $file = shift; + foreach my $mode ( sort keys %modes ) { + print $file "$mode=$modes{$mode}->{server_group}\n"; + } +} + +# load_config_server_groups {{{3 +sub load_config_server_groups { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $name, $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $name && $rest; + my @vars = unique(grep { $_ && exists $connections{$_} } split(/\s+/, $rest)); + next unless @vars; + $server_groups{$name} = \@vars; + } +} + +# save_config_server_groups {{{3 +sub save_config_server_groups { + my $file = shift; + foreach my $set ( sort keys %server_groups ) { + print $file "$set=", join(' ', @{$server_groups{$set}}), "\n"; + } +} + +# load_config_varsets {{{3 +sub load_config_varsets { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $name, $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $name && $rest; + $var_sets{$name} = { + text => $rest, + user => 1, + }; + } +} + +# save_config_varsets {{{3 +sub save_config_varsets { + my $file = shift; + foreach my $varset ( sort keys %var_sets ) { + next unless $var_sets{$varset}->{user}; + print $file "$varset=$var_sets{$varset}->{text}\n"; + } +} + +# load_config_group_by {{{3 +sub load_config_group_by { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $tbl , $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $tbl && exists $tbl_meta{$tbl}; + my @parts = unique(grep { exists($tbl_meta{$tbl}->{cols}->{$_}) } split(/\s+/, $rest)); + $tbl_meta{$tbl}->{group_by} = [ @parts ]; + $tbl_meta{$tbl}->{cust}->{group_by} = 1; + } +} + +# save_config_group_by {{{3 +sub save_config_group_by { + my $file = shift; + foreach my $tbl ( sort keys %tbl_meta ) { + next if $tbl_meta{$tbl}->{temp}; + next unless $tbl_meta{$tbl}->{cust}->{group_by}; + my $aref = $tbl_meta{$tbl}->{group_by}; + print $file "$tbl=", join(' ', @$aref), "\n"; + } +} + +# load_config_filters {{{3 +sub load_config_filters { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $key, $rest ) = $line =~ m/^(.+?)=(.*)$/; + next unless $key && $rest; + + my %parts = $rest =~ m/(\w+)='((?:(?!(? $sub, + text => $parts{text}, + user => 1, + name => $key, + note => 'User-defined filter', + tbls => \@tbls, + } + } +} + +# save_config_filters {{{3 +sub save_config_filters { + my $file = shift; + foreach my $key ( sort keys %filters ) { + next if !$filters{$key}->{user} || $filters{$key}->{quick}; + my $text = $filters{$key}->{text}; + $text =~ s/([\\'])/\\$1/g; + my $tbls = join(" ", @{$filters{$key}->{tbls}}); + print $file "$key=text='$text' tbls='$tbls'\n"; + } +} + +# load_config_visible_tables {{{3 +sub load_config_visible_tables { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $mode, $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $mode && exists $modes{$mode}; + $modes{$mode}->{visible_tables} = + [ unique(grep { $_ && exists $tbl_meta{$_} } split(/\s+/, $rest)) ]; + $modes{$mode}->{cust}->{visible_tables} = 1; + } +} + +# save_config_visible_tables {{{3 +sub save_config_visible_tables { + my $file = shift; + foreach my $mode ( sort keys %modes ) { + next unless $modes{$mode}->{cust}->{visible_tables}; + my $tables = $modes{$mode}->{visible_tables}; + print $file "$mode=", join(' ', @$tables), "\n"; + } +} + +# load_config_sort_cols {{{3 +sub load_config_sort_cols { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $key && exists $tbl_meta{$key}; + $tbl_meta{$key}->{sort_cols} = $rest; + $tbl_meta{$key}->{cust}->{sort_cols} = 1; + $tbl_meta{$key}->{sort_func} = make_sort_func($tbl_meta{$key}); + } +} + +# save_config_sort_cols {{{3 +sub save_config_sort_cols { + my $file = shift; + foreach my $tbl ( sort keys %tbl_meta ) { + next unless $tbl_meta{$tbl}->{cust}->{sort_cols}; + my $col = $tbl_meta{$tbl}->{sort_cols}; + print $file "$tbl=$col\n"; + } +} + +# load_config_active_filters {{{3 +sub load_config_active_filters { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $tbl , $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $tbl && exists $tbl_meta{$tbl}; + my @parts = unique(grep { exists($filters{$_}) } split(/\s+/, $rest)); + @parts = grep { grep { $tbl eq $_ } @{$filters{$_}->{tbls}} } @parts; + $tbl_meta{$tbl}->{filters} = [ @parts ]; + $tbl_meta{$tbl}->{cust}->{filters} = 1; + } +} + +# save_config_active_filters {{{3 +sub save_config_active_filters { + my $file = shift; + foreach my $tbl ( sort keys %tbl_meta ) { + next if $tbl_meta{$tbl}->{temp}; + next unless $tbl_meta{$tbl}->{cust}->{filters}; + my $aref = $tbl_meta{$tbl}->{filters}; + print $file "$tbl=", join(' ', @$aref), "\n"; + } +} + +# load_config_active_columns {{{3 +sub load_config_active_columns { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $key && exists $tbl_meta{$key}; + my @parts = grep { exists($tbl_meta{$key}->{cols}->{$_}) } unique split(/ /, $rest); + $tbl_meta{$key}->{visible} = [ @parts ]; + $tbl_meta{$key}->{cust}->{visible} = 1; + } +} + +# save_config_active_columns {{{3 +sub save_config_active_columns { + my $file = shift; + foreach my $tbl ( sort keys %tbl_meta ) { + next unless $tbl_meta{$tbl}->{cust}->{visible}; + my $aref = $tbl_meta{$tbl}->{visible}; + print $file "$tbl=", join(' ', @$aref), "\n"; + } +} + +# save_config_tbl_meta {{{3 +sub save_config_tbl_meta { + my $file = shift; + foreach my $tbl ( sort keys %tbl_meta ) { + foreach my $col ( keys %{$tbl_meta{$tbl}->{cols}} ) { + my $meta = $tbl_meta{$tbl}->{cols}->{$col}; + next unless $meta->{user}; + print $file "$col=", join( + " ", + map { + # Some properties (trans) are arrays, others scalars + my $val = ref($meta->{$_}) ? join(',', @{$meta->{$_}}) : $meta->{$_}; + $val =~ s/([\\'])/\\$1/g; # Escape backslashes and single quotes + "$_='$val'"; # Enclose in single quotes + } + grep { $_ ne 'func' } + keys %$meta + ), "\n"; + } + } +} + +# save_config_config {{{3 +sub save_config_config { + my $file = shift; + foreach my $key ( sort keys %config ) { + eval { + if ( $key ne 'password' || $config{savepass}->{val} ) { + print $file "# $config{$key}->{note}\n" + or die "Cannot print to file: $OS_ERROR"; + my $val = $config{$key}->{val}; + $val = '' unless defined($val); + if ( ref( $val ) eq 'ARRAY' ) { + print $file "$key=" + . join( " ", @$val ) . "\n" + or die "Cannot print to file: $OS_ERROR"; + } + elsif ( ref( $val ) eq 'HASH' ) { + print $file "$key=" + . join( " ", + map { "$_:$val->{$_}" } keys %$val + ) . "\n"; + } + else { + print $file "$key=$val\n"; + } + } + }; + if ( $EVAL_ERROR ) { print "$EVAL_ERROR in $key"; }; + } + +} + +# load_config_config {{{3 +sub load_config_config { + my ( $file ) = @_; + + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $name, $val ) = $line =~ m/^(.+?)=(.*)$/; + next unless defined $name && defined $val; + + # Validate the incoming values... + if ( $name && exists( $config{$name} ) ) { + if ( !$config{$name}->{pat} || $val =~ m/$config{$name}->{pat}/ ) { + $config{$name}->{val} = $val; + $config{$name}->{read} = 1; + } + } + } +} + +# load_config_tbl_meta {{{3 +sub load_config_tbl_meta { + my ( $file ) = @_; + + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + # Each tbl_meta section has all the properties defined in %col_props. + my ( $col , $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $col; + my %parts = $rest =~ m/(\w+)='((?:(?!(?{cols}->{$col} ||= {}; + + foreach my $prop ( keys %col_props ) { + if ( !defined($parts{$prop}) ) { + die "Undefined property $prop for column $col in table $tbl"; + } + + # Un-escape escaping + $parts{$prop} =~ s/\\\\/\\/g; + $parts{$prop} =~ s/\\'/'/g; + + if ( ref $col_props{$prop} ) { + if ( $prop eq 'trans' ) { + $meta->{cols}->{$col}->{trans} + = [ unique(grep { exists $trans_funcs{$_} } split(',', $parts{$prop})) ]; + } + else { + $meta->{cols}->{$col}->{$prop} = [ split(',', $parts{$prop}) ]; + } + } + else { + $meta->{cols}->{$col}->{$prop} = $parts{$prop}; + } + } + + } +} + +# save_config {{{3 +sub save_config { + print "\n"; + return if $config{readonly}->{val}; + # return if no config file was loaded and -w wasn't specified + if (not $conf_file) { + if (not $opts{w}) { + return; + } + else { + # if no config was loaded but -w was specified, + # write to $default_home_conf + $conf_file = $default_home_conf; + } + } + elsif ($conf_file and $opts{w}) { + print "Loaded config file on start-up, so ignoring -w (see --help)\n" + } + + my $dirname = dirname($conf_file); + + # if directories don't exist, create them. This could cause errors + # or warnings if a central config doesn't have readonly=1, but being + # flexible requires giving the user enough rope to hang themselves with. + if ( ! -d $dirname ) { + mkdir $dirname + or die "Can't create directory '$dirname': $OS_ERROR"; + } + if ( ! -d "$dirname/plugins" ) { + mkdir "$dirname/plugins" + or warn "Can't create directory '$dirname/plugins': $OS_ERROR\n"; + } + + # Save to a temp file first, so a crash doesn't destroy the main config file + my $tmpfile = File::Temp->new( TEMPLATE => 'innotopXXXXX', DIR => $dirname, SUFFIX => '.conf.tmp'); + open my $file, "+>", $tmpfile + or die("Can't write to $tmpfile: $OS_ERROR"); + print $file "version=$VERSION\n"; + + foreach my $section ( @ordered_config_file_sections ) { + die "No such config file section $section" unless $config_file_sections{$section}; + print $file "\n[$section]\n\n"; + $config_file_sections{$section}->{writer}->($file); + print $file "\n[/$section]\n"; + } + + # Now clobber the main config file with the temp. + close $file or die("Can't close $tmpfile: $OS_ERROR"); + rename($tmpfile, $conf_file) or die("Can't rename $tmpfile to $conf_file: $OS_ERROR"); +} + +# load_config_connections {{{3 +sub load_config_connections { + return if $opts{u} or $opts{p} or $opts{h} or $opts{P}; # don't load connections if DSN or user/pass options used + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $key; + my %parts = $rest =~ m/(\S+?)=(\S*)/g; + my %conn = map { $_ => $parts{$_} || '' } @conn_parts; + $connections{$key} = \%conn; + } +} + +# save_config_connections {{{3 +sub save_config_connections { + my $file = shift; + foreach my $conn ( sort keys %connections ) { + my $href = $connections{$conn}; + my @keys = $href->{savepass} ? @conn_parts : grep { $_ ne 'pass' } @conn_parts; + print $file "$conn=", join(' ', map { "$_=$href->{$_}" } grep { defined $href->{$_} } @keys), "\n"; + } +} + +sub load_config_colors { + my ( $file ) = @_; + my %rule_set_for; + + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $tbl, $rule ) = $line =~ m/^(.*?)=(.*)$/; + next unless $tbl && $rule; + next unless exists $tbl_meta{$tbl}; + my %parts = $rule =~ m/(\w+)='((?:(?!(?{cols}->{$parts{col}}; + next unless $parts{op} && exists $comp_ops{$parts{op}}; + next unless defined $parts{arg}; + next unless defined $parts{color}; + my @colors = unique(grep { exists $ansicolors{$_} } split(/\W+/, $parts{color})); + next unless @colors; + + # Finally! Enough validation... + $rule_set_for{$tbl} ||= []; + push @{$rule_set_for{$tbl}}, \%parts; + } + + foreach my $tbl ( keys %rule_set_for ) { + $tbl_meta{$tbl}->{colors} = $rule_set_for{$tbl}; + $tbl_meta{$tbl}->{color_func} = make_color_func($tbl_meta{$tbl}); + $tbl_meta{$tbl}->{cust}->{colors} = 1; + } +} + +# save_config_colors {{{3 +sub save_config_colors { + my $file = shift; + foreach my $tbl ( sort keys %tbl_meta ) { + my $meta = $tbl_meta{$tbl}; + next unless $meta->{cust}->{colors}; + foreach my $rule ( @{$meta->{colors}} ) { + print $file "$tbl=", join( + ' ', + map { + my $val = $rule->{$_}; + $val =~ s/([\\'])/\\$1/g; # Escape backslashes and single quotes + "$_='$val'"; # Enclose in single quotes + } + qw(col op arg color) + ), "\n"; + } + } +} + +# load_config_active_connections {{{3 +sub load_config_active_connections { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/; + next unless $key && exists $modes{$key}; + my @parts = grep { exists $connections{$_} } split(/ /, $rest); + $modes{$key}->{connections} = [ @parts ] if exists $modes{$key}; + } +} + +# save_config_active_connections {{{3 +sub save_config_active_connections { + my $file = shift; + foreach my $mode ( sort keys %modes ) { + my @connections = get_connections($mode); + print $file "$mode=", join(' ', @connections), "\n"; + } +} + +# load_config_stmt_sleep_times {{{3 +sub load_config_stmt_sleep_times { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $key , $val ) = split('=', $line); + next unless $key && defined $val && $val =~ m/$num_regex/; + $stmt_sleep_time_for{$key} = $val; + } +} + +# save_config_stmt_sleep_times {{{3 +sub save_config_stmt_sleep_times { + my $file = shift; + foreach my $key ( sort keys %stmt_sleep_time_for ) { + print $file "$key=$stmt_sleep_time_for{$key}\n"; + } +} + +# load_config_mvs {{{3 +sub load_config_mvs { + my ( $file ) = @_; + while ( my $line = <$file> ) { + chomp $line; + next if $line =~ m/^#/; + last if $line =~ m/^\[/; + + my ( $key , $val ) = split('=', $line); + next unless $key && defined $val && $val =~ m/$num_regex/; + $mvs{$key} = $val; + } +} + +# save_config_mvs {{{3 +sub save_config_mvs { + my $file = shift; + foreach my $key ( sort keys %mvs ) { + print $file "$key=$mvs{$key}\n"; + } +} + +# edit_configuration {{{3 +sub edit_configuration { + my $key = ''; + while ( $key ne 'q' ) { + $clear_screen_sub->(); + my @display_lines = ''; + + if ( $key && $cfg_editor_action{$key} ) { + $cfg_editor_action{$key}->{func}->(); + } + + # Show help + push @display_lines, create_caption('What configuration do you want to edit?', + create_table2( + [ sort keys %cfg_editor_action ], + { map { $_ => $_ } keys %cfg_editor_action }, + { map { $_ => $cfg_editor_action{$_}->{note} } keys %cfg_editor_action }, + { sep => ' ' })); + + draw_screen(\@display_lines); + $key = pause(''); + } +} + +# edit_configuration_variables {{{3 +sub edit_configuration_variables { + $clear_screen_sub->(); + my $mode = $config{mode}->{val}; + + my %config_choices + = map { $_ => $config{$_}->{note} || '' } + # Only config values that are marked as applying to this mode. + grep { + my $key = $_; + $config{$key}->{conf} && + ( $config{$key}->{conf} eq 'ALL' + || grep { $mode eq $_ } @{$config{$key}->{conf}} ) + } keys %config; + + my $key = prompt_list( + "Enter the name of the variable you wish to configure", + '', + sub{ return keys %config_choices }, + \%config_choices); + + if ( exists($config_choices{$key}) ) { + get_config_interactive($key); + } +} + +# edit_color_rules {{{3 +sub edit_color_rules { + my ( $tbl ) = @_; + $clear_screen_sub->(); + $tbl ||= choose_visible_table(); + if ( $tbl && exists($tbl_meta{$tbl}) ) { + my $meta = $tbl_meta{$tbl}; + my @cols = ('', qw(col op arg color)); + my $info = { map { $_ => { hdr => $_, just => '-', } } @cols }; + $info->{label}->{maxw} = 30; + my $key; + my $selected_rule; + + # This loop builds a tabular view of the rules. + do { + + # Show help + if ( $key && $key eq '?' ) { + my @display_lines = ''; + push @display_lines, create_caption('Editor key mappings', + create_table2( + [ sort keys %color_editor_action ], + { map { $_ => $_ } keys %color_editor_action }, + { map { $_ => $color_editor_action{$_}->{note} } keys %color_editor_action }, + { sep => ' ' })); + draw_screen(\@display_lines); + pause(); + $key = ''; + } + else { + + # Do the action specified + $selected_rule ||= 0; + if ( $key && $color_editor_action{$key} ) { + $selected_rule = $color_editor_action{$key}->{func}->($tbl, $selected_rule); + $selected_rule ||= 0; + } + + # Build the table of rules. If the terminal has color, the selected rule + # will be highlighted; otherwise a > at the left will indicate. + my $data = $meta->{colors} || []; + foreach my $i ( 0..@$data - 1 ) { + $data->[$i]->{''} = $i == $selected_rule ? '>' : ''; + } + my @display_lines = create_table(\@cols, $info, $data); + + # Highlight selected entry + for my $i ( 0 .. $#display_lines ) { + if ( $display_lines[$i] =~ m/^>/ ) { + $display_lines[$i] = [ $display_lines[$i], 'reverse' ]; + } + } + + # Draw the screen and wait for a command. + unshift @display_lines, '', + "Editing color rules for $meta->{capt}. Press ? for help, q to " + . "quit.", ''; + draw_screen(\@display_lines); + print "\n\n", word_wrap('Rules are applied in order from top to ' + . 'bottom. The first matching rule wins and prevents the ' + . 'rest of the rules from being applied.'); + $key = pause(''); + } + } while ( $key ne 'q' ); + $meta->{color_func} = make_color_func($meta); + } +} + +# add_quick_filter {{{3 +sub add_quick_filter { + my $tbl = choose_visible_table(); + if ( $tbl && exists($tbl_meta{$tbl}) ) { + print "\n"; + my $response = prompt_list( + "Enter column name and filter text", + '', + sub { return keys %{$tbl_meta{$tbl}->{cols}} }, + () + ); + my ( $col, $text ) = split(/\s+/, $response, 2); + + # You can't filter on a nonexistent column. But if you filter on a pivoted + # table, the columns are different, so on a pivoted table, allow filtering + # on the 'name' column. + # NOTE: if a table is pivoted and un-pivoted, this will likely cause crashes. + # Currently not an issue since there's no way to toggle pivot/nopivot. + return unless $col && $text && + (exists($tbl_meta{$tbl}->{cols}->{$col}) + || ($tbl_meta{$tbl}->{pivot} && $col eq 'name')); + + my ( $sub, $err ) = compile_filter( "defined \$set->{$col} && \$set->{$col} =~ m/$text/" ); + return if !$sub || $err; + my $name = "quick_$tbl.$col"; + $filters{$name} = { + func => $sub, + text => $text, + user => 1, + quick => 1, + name => $name, + note => 'Quick-filter', + tbls => [$tbl], + }; + push @{$tbl_meta{$tbl}->{filters}}, $name; + } +} + +# clear_quick_filters {{{3 +sub clear_quick_filters { + my $tbl = choose_visible_table( + # Only tables that have quick-filters + sub { + my ( $tbl ) = @_; + return scalar grep { $filters{$_}->{quick} } @{ $tbl_meta{$tbl}->{filters} }; + } + ); + if ( $tbl && exists($tbl_meta{$tbl}) ) { + my @current = @{$tbl_meta{$tbl}->{filters}}; + @current = grep { !$filters{$_}->{quick} } @current; + $tbl_meta{$tbl}->{filters} = \@current; + } +} + +sub edit_plugins { + $clear_screen_sub->(); + + my @cols = ('', qw(class desc active)); + my $info = { map { $_ => { hdr => $_, just => '-', } } @cols }; + my @rows = map { $plugins{$_} } sort keys %plugins; + my $key; + my $selected; + + # This loop builds a tabular view of the plugins. + do { + + # Show help + if ( $key && $key eq '?' ) { + my @display_lines = ''; + push @display_lines, create_caption('Editor key mappings', + create_table2( + [ sort keys %plugin_editor_action ], + { map { $_ => $_ } keys %plugin_editor_action }, + { map { $_ => $plugin_editor_action{$_}->{note} } keys %plugin_editor_action }, + { sep => ' ' })); + draw_screen(\@display_lines); + pause(); + $key = ''; + } + + # Do the action specified + else { + $selected ||= 0; + if ( $key && $plugin_editor_action{$key} ) { + $selected = $plugin_editor_action{$key}->{func}->(\@rows, $selected); + $selected ||= 0; + } + + # Build the table of plugins. + foreach my $row ( 0.. $#rows ) { + $rows[$row]->{''} = $row eq $selected ? '>' : ' '; + } + my @display_lines = create_table(\@cols, $info, \@rows); + + # Highlight selected entry + for my $i ( 0 .. $#display_lines ) { + if ( $display_lines[$i] =~ m/^>/ ) { + $display_lines[$i] = [ $display_lines[$i], 'reverse' ]; + } + } + + # Draw the screen and wait for a command. + unshift @display_lines, '', + "Plugin Management. Press ? for help, q to quit.", ''; + draw_screen(\@display_lines); + $key = pause(''); + } + } while ( $key ne 'q' ); +} + +# edit_table {{{3 +sub edit_table { + $clear_screen_sub->(); + my ( $tbl ) = @_; + $tbl ||= choose_visible_table(); + if ( $tbl && exists($tbl_meta{$tbl}) ) { + my $meta = $tbl_meta{$tbl}; + my @cols = ('', qw(name hdr label src)); + my $info = { map { $_ => { hdr => $_, just => '-', } } @cols }; + $info->{label}->{maxw} = 30; + my $key; + my $selected_column; + + # This loop builds a tabular view of the tbl_meta's structure, showing each column + # in the entry as a row. + do { + + # Show help + if ( $key && $key eq '?' ) { + my @display_lines = ''; + push @display_lines, create_caption('Editor key mappings', + create_table2( + [ sort keys %tbl_editor_action ], + { map { $_ => $_ } keys %tbl_editor_action }, + { map { $_ => $tbl_editor_action{$_}->{note} } keys %tbl_editor_action }, + { sep => ' ' })); + draw_screen(\@display_lines); + pause(); + $key = ''; + } + else { + + # Do the action specified + $selected_column ||= $meta->{visible}->[0]; + if ( $key && $tbl_editor_action{$key} ) { + $selected_column = $tbl_editor_action{$key}->{func}->($tbl, $selected_column); + $selected_column ||= $meta->{visible}->[0]; + } + + # Build the pivoted view of the table's meta-data. If the terminal has color, + # The selected row will be highlighted; otherwise a > at the left will indicate. + my $data = []; + foreach my $row ( @{$meta->{visible}} ) { + my %hash; + @hash{ @cols } = @{$meta->{cols}->{$row}}{@cols}; + $hash{src} = '' if ref $hash{src}; + $hash{name} = $row; + $hash{''} = $row eq $selected_column ? '>' : ' '; + push @$data, \%hash; + } + my @display_lines = create_table(\@cols, $info, $data); + + # Highlight selected entry + for my $i ( 0 .. $#display_lines ) { + if ( $display_lines[$i] =~ m/^>/ ) { + $display_lines[$i] = [ $display_lines[$i], 'reverse' ]; + } + } + + # Draw the screen and wait for a command. + unshift @display_lines, '', + "Editing table definition for $meta->{capt}. Press ? for help, q to quit.", ''; + draw_screen(\@display_lines, { clear => 1 }); + $key = pause(''); + } + } while ( $key ne 'q' ); + } +} + +# choose_mode_tables {{{3 +# Choose which table(s), and in what order, to display in a given mode. +sub choose_mode_tables { + my $mode = $config{mode}->{val}; + my @tbls = @{$modes{$mode}->{visible_tables}}; + my $new = prompt_list( + "Choose tables to display", + join(' ', @tbls), + sub { return @{$modes{$mode}->{tables}} }, + { map { $_ => $tbl_meta{$_}->{capt} } @{$modes{$mode}->{tables}} } + ); + $modes{$mode}->{visible_tables} = + [ unique(grep { $_ && exists $tbl_meta{$_} } split(/\s+/, $new)) ]; + $modes{$mode}->{cust}->{visible_tables} = 1; +} + +# choose_visible_table {{{3 +sub choose_visible_table { + my ( $grep_cond ) = @_; + my $mode = $config{mode}->{val}; + my @tbls + = grep { $grep_cond ? $grep_cond->($_) : 1 } + @{$modes{$mode}->{visible_tables}}; + my $tbl = $tbls[0]; + if ( @tbls > 1 ) { + $tbl = prompt_list( + "Choose a table", + '', + sub { return @tbls }, + { map { $_ => $tbl_meta{$_}->{capt} } @tbls } + ); + } + return $tbl; +} + +sub toggle_aggregate { + my ( $tbl ) = @_; + $tbl ||= choose_visible_table(); + return unless $tbl && exists $tbl_meta{$tbl}; + my $meta = $tbl_meta{$tbl}; + $meta->{aggregate} ^= 1; +} + +sub choose_filters { + my ( $tbl ) = @_; + $tbl ||= choose_visible_table(); + return unless $tbl && exists $tbl_meta{$tbl}; + my $meta = $tbl_meta{$tbl}; + $clear_screen_sub->(); + + print "Choose filters for $meta->{capt}:\n"; + + my $ini = join(' ', @{$meta->{filters}}); + my $val = prompt_list( + 'Choose filters', + $ini, + sub { return keys %filters }, + { + map { $_ => $filters{$_}->{note} } + grep { grep { $tbl eq $_ } @{$filters{$_}->{tbls}} } + keys %filters + } + ); + + my @choices = unique(split(/\s+/, $val)); + foreach my $new ( grep { !exists($filters{$_}) } @choices ) { + my $answer = prompt("There is no filter called '$new'. Create it?", undef, 'y'); + if ( $answer eq 'y' ) { + create_new_filter($new, $tbl); + } + } + @choices = grep { exists $filters{$_} } @choices; + @choices = grep { grep { $tbl eq $_ } @{$filters{$_}->{tbls}} } @choices; + $meta->{filters} = [ @choices ]; + $meta->{cust}->{filters} = 1; +} + +sub choose_group_cols { + my ( $tbl ) = @_; + $tbl ||= choose_visible_table(); + return unless $tbl && exists $tbl_meta{$tbl}; + $clear_screen_sub->(); + my $meta = $tbl_meta{$tbl}; + my $curr = join(', ', @{$meta->{group_by}}); + my $val = prompt_list( + 'Group-by columns', + $curr, + sub { return keys %{$meta->{cols}} }, + { map { $_ => $meta->{cols}->{$_}->{label} } keys %{$meta->{cols}} }); + if ( $curr ne $val ) { + $meta->{group_by} = [ grep { exists $meta->{cols}->{$_} } $val =~ m/(\w+)/g ]; + $meta->{cust}->{group_by} = 1; + } +} + +sub choose_sort_cols { + my ( $tbl ) = @_; + $tbl ||= choose_visible_table(); + return unless $tbl && exists $tbl_meta{$tbl}; + $clear_screen_sub->(); + my $meta = $tbl_meta{$tbl}; + + my ( $cols, $hints ); + if ( $meta->{pivot} ) { + $cols = sub { qw(name set_0) }; + $hints = { name => 'name', set_0 => 'set_0' }; + } + else { + $cols = sub { return keys %{$meta->{cols}} }; + $hints = { map { $_ => $meta->{cols}->{$_}->{label} } keys %{$meta->{cols}} }; + } + + my $val = prompt_list( + 'Sort columns (reverse sort with -col)', + $meta->{sort_cols}, + $cols, + $hints ); + if ( $meta->{sort_cols} ne $val ) { + $meta->{sort_cols} = $val; + $meta->{cust}->{sort_cols} = 1; + $tbl_meta{$tbl}->{sort_func} = make_sort_func($tbl_meta{$tbl}); + } +} + +# create_new_filter {{{3 +sub create_new_filter { + my ( $filter, $tbl ) = @_; + $clear_screen_sub->(); + + if ( !$filter || $filter =~ m/\W/ ) { + print word_wrap("Choose a name for the filter. This name is not displayed, and is only used " + . "for internal reference. It can only contain lowercase letters, numbers, and underscores."); + print "\n\n"; + do { + $filter = prompt("Enter filter name"); + } while ( !$filter || $filter =~ m/\W/ ); + } + + my $completion = sub { keys %{$tbl_meta{$tbl}->{cols}} }; + my ( $err, $sub, $body ); + do { + $clear_screen_sub->(); + print word_wrap("A filter is a Perl subroutine that accepts a hashref of columns " + . "called \$set, and returns a true value if the filter accepts the row. Example:\n" + . " \$set->{active_secs} > 5\n" + . "will only allow rows if their active_secs column is greater than 5."); + print "\n\n"; + if ( $err ) { + print "There's an error in your filter expression: $err\n\n"; + } + $body = prompt("Enter subroutine body", undef, undef, $completion); + ( $sub, $err ) = compile_filter($body); + } while ( $err ); + + $filters{$filter} = { + func => $sub, + text => $body, + user => 1, + name => $filter, + note => 'User-defined filter', + tbls => [$tbl], + }; +} + +# get_config_interactive {{{3 +sub get_config_interactive { + my $key = shift; + $clear_screen_sub->(); + + # Print help first. + print "Enter a new value for '$key' ($config{$key}->{note}).\n"; + + my $current = ref($config{$key}->{val}) ? join(" ", @{$config{$key}->{val}}) : $config{$key}->{val}; + + my $new_value = prompt('Enter a value', $config{$key}->{pat}, $current); + $config{$key}->{val} = $new_value; +} + +sub edit_current_var_set { + my $mode = $config{mode}->{val}; + my $name = $config{"${mode}_set"}->{val}; + my $variables = $var_sets{$name}->{text}; + + my $new = $variables; + do { + $clear_screen_sub->(); + $new = prompt("Enter variables for $name", undef, $variables); + } until ( $new ); + + if ( $new ne $variables ) { + @{$var_sets{$name}}{qw(text user)} = ( $new, 1); + } +} + + +sub choose_var_set { + my ( $key ) = @_; + $clear_screen_sub->(); + + my $new_value = prompt_list( + 'Choose a set of values to display, or enter the name of a new one', + $config{$key}->{val}, + sub { return keys %var_sets }, + { map { $_ => $var_sets{$_}->{text} } keys %var_sets }); + + if ( !exists $var_sets{$new_value} ) { + add_new_var_set($new_value); + } + + $config{$key}->{val} = $new_value if exists $var_sets{$new_value}; +} + +sub switch_var_set { + my ( $cfg_var, $dir ) = @_; + my @var_sets = sort keys %var_sets; + my $cur = $config{$cfg_var}->{val}; + my $pos = grep { $_ lt $cur } @var_sets; + my $newpos = ($pos + $dir) % @var_sets; + $config{$cfg_var}->{val} = $var_sets[$newpos]; + $clear_screen_sub->(); +} + +# Online configuration and prompting functions {{{2 + +# edit_stmt_sleep_times {{{3 +sub edit_stmt_sleep_times { + $clear_screen_sub->(); + my $stmt = prompt_list('Specify a statement', '', sub { return sort keys %stmt_maker_for }); + return unless $stmt && exists $stmt_maker_for{$stmt}; + $clear_screen_sub->(); + my $curr_val = $stmt_sleep_time_for{$stmt} || 0; + my $new_val = prompt('Specify a sleep delay after calling this SQL', $num_regex, $curr_val); + if ( $new_val ) { + $stmt_sleep_time_for{$stmt} = $new_val; + } + else { + delete $stmt_sleep_time_for{$stmt}; + } +} + +# edit_server_groups {{{3 +# Choose which server connections are in a server group. First choose a group, +# then choose which connections are in it. +sub edit_server_groups { + $clear_screen_sub->(); + my $mode = $config{mode}->{val}; + my $group = $modes{$mode}->{server_group}; + my %curr = %server_groups; + my $new = choose_or_create_server_group($group, 'to edit'); + $clear_screen_sub->(); + if ( exists $curr{$new} ) { + # Don't do this step if the user just created a new server group, + # because part of that process was to choose connections. + my $cxns = join(' ', @{$server_groups{$new}}); + my @conns = choose_or_create_connection($cxns, 'for this group'); + $server_groups{$new} = \@conns; + } +} + +# choose_server_groups {{{3 +sub choose_server_groups { + $clear_screen_sub->(); + my $mode = $config{mode}->{val}; + my $group = $modes{$mode}->{server_group}; + my $new = choose_or_create_server_group($group, 'for this mode'); + $modes{$mode}->{server_group} = $new if exists $server_groups{$new}; +} + +sub choose_or_create_server_group { + my ( $group, $prompt ) = @_; + my $new = ''; + + my @available = sort keys %server_groups; + + if ( @available ) { + print "You can enter the name of a new group to create it.\n"; + + $new = prompt_list( + "Choose a server group $prompt", + $group, + sub { return @available }, + { map { $_ => join(' ', @{$server_groups{$_}}) } @available }); + + $new =~ s/\s.*//; + + if ( !exists $server_groups{$new} ) { + my $answer = prompt("There is no server group called '$new'. Create it?", undef, "y"); + if ( $answer eq 'y' ) { + add_new_server_group($new); + } + } + } + else { + $new = add_new_server_group(); + } + return $new; +} + +sub choose_or_create_connection { + my ( $cxns, $prompt ) = @_; + print "You can enter the name of a new connection to create it.\n"; + + my @available = sort keys %connections; + my $new_cxns = prompt_list( + "Choose connections $prompt", + $cxns, + sub { return @available }, + { map { $_ => $connections{$_}->{dsn} } @available }); + + my @new = unique(grep { !exists $connections{$_} } split(/\s+/, $new_cxns)); + foreach my $new ( @new ) { + my $answer = prompt("There is no connection called '$new'. Create it?", undef, "y"); + if ( $answer eq 'y' ) { + add_new_dsn($new); + } + } + + return unique(grep { exists $connections{$_} } split(/\s+/, $new_cxns)); +} + +# choose_servers {{{3 +sub choose_servers { + $clear_screen_sub->(); + my $mode = $config{mode}->{val}; + my $cxns = join(' ', get_connections()); + my @chosen = choose_or_create_connection($cxns, 'for this mode'); + $modes{$mode}->{connections} = \@chosen; + $modes{$mode}->{server_group} = ''; # Clear this because it overrides {connections} +} + +# display_license {{{3 +sub display_license { + $clear_screen_sub->(); + + print $innotop_license; + + pause(); +} + +# Data-retrieval functions {{{2 +# get_status_info {{{3 +# Get SHOW STATUS and SHOW VARIABLES together. +sub get_status_info { + my @cxns = @_; + if ( !$info_gotten{status}++ ) { + foreach my $cxn ( @cxns ) { + $vars{$cxn}->{$clock} ||= {}; + my $vars = $vars{$cxn}->{$clock}; + + my $sth = do_stmt($cxn, 'SHOW_STATUS') or next; + my $res = $sth->fetchall_arrayref(); + map { $vars->{$_->[0]} = $_->[1] || 0 } @$res; + + # Calculate hi-res uptime and add cxn to the hash. This duplicates get_driver_status, + # but it's most important to have consistency. + $vars->{Uptime_hires} ||= get_uptime($cxn); + $vars->{cxn} = $cxn; + + # Add SHOW VARIABLES to the hash + $sth = do_stmt($cxn, 'SHOW_VARIABLES') or next; + $res = $sth->fetchall_arrayref(); + map { $vars->{$_->[0]} = $_->[1] || 0 } @$res; + } + } +} + +# Chooses a thread for explaining, killing, etc... +# First arg is a func that can be called in grep. +sub choose_thread { + my ( $grep_cond, $prompt ) = @_; + + # Narrow the list to queries that can be explained. + my %thread_for = map { + # Eliminate innotop's own threads. + $_ => $dbhs{$_}->{dbh} ? $dbhs{$_}->{dbh}->{mysql_thread_id} : 0 + } keys %connections; + + my @candidates = grep { + $_->{id} != $thread_for{$_->{cxn}} && $grep_cond->($_) + } @current_queries; + return unless @candidates; + + # Find out which server. + my @cxns = unique map { $_->{cxn} } @candidates; + my ( $cxn ) = select_cxn('On which server', @cxns); + return unless $cxn && exists($connections{$cxn}); + + # Re-filter the list of candidates to only those on this server + @candidates = grep { $_->{cxn} eq $cxn } @candidates; + + # Find out which thread to do. + my $info; + if ( @candidates > 1 ) { + + # Sort longest-active first, then longest-idle. + my $sort_func = sub { + my ( $a, $b ) = @_; + return $a->{query} && !$b->{query} ? 1 + : $b->{query} && !$a->{query} ? -1 + : ($a->{time} || 0) <=> ($b->{time} || 0); + }; + my @threads = map { $_->{id} } reverse sort { $sort_func->($a, $b) } @candidates; + + print "\n"; + my $thread = prompt_list($prompt, + $threads[0], + sub { return @threads }); + return unless $thread && $thread =~ m/$int_regex/; + + # Find the info hash of that query on that server. + ( $info ) = grep { $thread == $_->{id} } @candidates; + } + else { + $info = $candidates[0]; + } + return $info; +} + +# analyze_query {{{3 +# Allows the user to show fulltext, explain, show optimized... +sub analyze_query { + my ( $action ) = @_; + + my $info = choose_thread( + sub { $_[0]->{query} }, + 'Select a thread to analyze', + ); + return unless $info; + + my %actions = ( + e => \&display_explain, + f => \&show_full_query, + o => \&show_optimized_query, + ); + do { + $actions{$action}->($info); + print "\n"; + $action = pause('Press e to explain, f for full query, o for optimized query'); + } while ( exists($actions{$action}) ); +} + +# inc {{{3 +# Returns the difference between two sets of variables/status/innodb stuff. +sub inc { + my ( $offset, $cxn ) = @_; + my $vars = $vars{$cxn}; + if ( $offset < 0 ) { + return $vars->{$clock}; + } + elsif ( exists $vars{$clock - $offset} && !exists $vars->{$clock - $offset - 1} ) { + return $vars->{$clock - $offset}; + } + my $cur = $vars->{$clock - $offset}; + my $pre = $vars->{$clock - $offset - 1}; + return { + # Numeric variables get subtracted, non-numeric get passed straight through. + map { + $_ => + ( (defined $cur->{$_} && $cur->{$_} =~ m/$num_regex/) + ? $cur->{$_} - ($pre->{$_} || 0) + : $cur->{$_} ) + } keys %{$cur} + }; +} + +# extract_values {{{3 +# Arguments are a set of values (which may be incremental, derived from +# current and previous), current, and previous values. +# TODO: there are a few places that don't remember prev set so can't pass it. +sub extract_values { + my ( $set, $cur, $pre, $tbl ) = @_; + + # Hook in event listeners + foreach my $listener ( @{$event_listener_for{extract_values}} ) { + $listener->extract_values($set, $cur, $pre, $tbl); + } + + my $result = {}; + my $meta = $tbl_meta{$tbl}; + my $cols = $meta->{cols}; + foreach my $key ( keys %$cols ) { + my $info = $cols->{$key} + or die "Column '$key' doesn't exist in $tbl"; + die "No func defined for '$key' in $tbl" + unless $info->{func}; + eval { + $result->{$key} = $info->{func}->($set, $cur, $pre) + }; + if ( $EVAL_ERROR ) { + if ( $config{debug}->{val} ) { + die $EVAL_ERROR; + } + $result->{$key} = $info->{num} ? 0 : ''; + } + } + return $result; +} + +# get_full_processlist {{{3 +sub get_full_processlist { + my @cxns = @_; + my @result; + foreach my $cxn ( @cxns ) { + my $stmt = do_stmt($cxn, 'PROCESSLIST') or next; + my $arr = $stmt->fetchall_arrayref({}); + push @result, map { $_->{cxn} = $cxn; $_ } @$arr; + } + return @result; +} + +# get_open_tables {{{3 +sub get_open_tables { + my @cxns = @_; + my @result; + foreach my $cxn ( @cxns ) { + my $stmt = do_stmt($cxn, 'OPEN_TABLES') or next; + my $arr = $stmt->fetchall_arrayref({}); + push @result, map { $_->{cxn} = $cxn; $_ } @$arr; + } + return @result; +} + +# get_innodb_status {{{3 +sub get_innodb_status { + my ( $cxns, $addl_sections ) = @_; + if ( !$config{skip_innodb}->{val} && !$info_gotten{innodb_status}++ ) { + + # Determine which sections need to be parsed + my %sections_required = + map { $tbl_meta{$_}->{innodb} => 1 } + grep { $_ && $tbl_meta{$_}->{innodb} } + get_visible_tables(); + + # Add in any other sections the caller requested. + foreach my $sec ( @$addl_sections ) { + $sections_required{$sec} = 1; + } + + foreach my $cxn ( @$cxns ) { + my $innodb_status_text; + + if ( $file ) { # Try to fetch status text from the file. + my @stat = stat($file); + + # Initialize the file. + if ( !$file_mtime ) { + # Initialize to 130k from the end of the file (because the limit + # on the size of innodb status is 128k even with Google's patches) + # and try to grab the last status from the file. + sysseek($file, (-128 * 1_024), 2); + } + + # Read from the file. + my $buffer; + if ( !$file_mtime || $file_mtime != $stat[9] ) { + $file_data = ''; + while ( sysread($file, $buffer, 4096) ) { + $file_data .= $buffer; + } + $file_mtime = $stat[9]; + } + + # Delete everything but the last InnoDB status text from the file. + $file_data =~ s/\A.*(?=^=====================================\n...... ........ INNODB MONITOR OUTPUT)//ms; + $innodb_status_text = $file_data; + } + + else { + my $stmt = do_stmt($cxn, 'INNODB_STATUS') or next; + $innodb_status_text = $stmt->fetchrow_hashref()->{status}; + } + + next unless $innodb_status_text + && substr($innodb_status_text, 0, 100) =~ m/INNODB MONITOR OUTPUT/; + + # Parse and merge into %vars storage + my %innodb_status = ( + $innodb_parser->get_status_hash( + $innodb_status_text, + $config{debug}->{val}, + \%sections_required, + 0, # don't parse full lock information + ) + ); + if ( !$innodb_status{IB_got_all} && $config{auto_wipe_dl}->{val} ) { + clear_deadlock($cxn); + } + + # Merge using a hash slice, which is the fastest way + $vars{$cxn}->{$clock} ||= {}; + my $hash = $vars{$cxn}->{$clock}; + @{$hash}{ keys %innodb_status } = values %innodb_status; + $hash->{cxn} = $cxn; + $hash->{Uptime_hires} ||= get_uptime($cxn); + } + } +} + +# clear_deadlock {{{3 +sub clear_deadlock { + my ( $cxn ) = @_; + return if $clearing_deadlocks++; + my $tbl = $connections{$cxn}->{dl_table}; + return unless $tbl; + + eval { + # Set up the table for creating a deadlock. + my $engine = version_ge($dbhs{$cxn}->{dbh}, '4.1.2') ? 'engine' : 'type'; + return unless do_query($cxn, "drop table if exists $tbl"); + return unless do_query($cxn, "create table $tbl(a int) $engine=innodb"); + return unless do_query($cxn, "delete from $tbl"); + return unless do_query($cxn, "insert into $tbl(a) values(0), (1)"); + return unless do_query($cxn, "commit"); # Or the children will block against the parent + + # Fork off two children to deadlock against each other. + my %children; + foreach my $child ( 0..1 ) { + my $pid = fork(); + if ( defined($pid) && $pid == 0 ) { # I am a child + deadlock_thread( $child, $tbl, $cxn ); + } + elsif ( !defined($pid) ) { + die("Unable to fork for clearing deadlocks!\n"); + } + # I already exited if I'm a child, so I'm the parent. + $children{$child} = $pid; + } + + # Wait for the children to exit. + foreach my $child ( keys %children ) { + my $pid = waitpid($children{$child}, 0); + } + + # Clean up. + do_query($cxn, "drop table $tbl"); + }; + if ( $EVAL_ERROR ) { + print $EVAL_ERROR; + pause(); + } + + $clearing_deadlocks = 0; +} + +sub get_master_logs { + my @cxns = @_; + my @result; + if ( !$info_gotten{master_logs}++ ) { + foreach my $cxn ( @cxns ) { + my $stmt = do_stmt($cxn, 'SHOW_MASTER_LOGS') or next; + push @result, @{$stmt->fetchall_arrayref({})}; + } + } + return @result; +} + +# get_master_slave_status {{{3 +sub get_master_slave_status { + my @cxns = @_; + if ( !$info_gotten{replication_status}++ ) { + foreach my $cxn ( @cxns ) { + $vars{$cxn}->{$clock} ||= {}; + my $vars = $vars{$cxn}->{$clock}; + $vars->{cxn} = $cxn; + + my $stmt = do_stmt($cxn, 'SHOW_MASTER_STATUS') or next; + my $res = $stmt->fetchall_arrayref({})->[0]; + @{$vars}{ keys %$res } = values %$res; + $stmt = do_stmt($cxn, 'SHOW_SLAVE_STATUS') or next; + $res = $stmt->fetchall_arrayref({})->[0]; + @{$vars}{ keys %$res } = values %$res; + $vars->{Uptime_hires} ||= get_uptime($cxn); + } + } +} + +sub is_func { + my ( $word ) = @_; + return defined(&$word) + || eval "my \$x= sub { $word }; 1" + || $EVAL_ERROR !~ m/^Bareword/; +} + +# Documentation {{{1 +# ############################################################################ +# I put this last as per the Dog book. +# ############################################################################ +=pod + +=head1 NAME + +innotop - MySQL and InnoDB transaction/status monitor. + +=head1 SYNOPSIS + +To monitor servers normally: + + innotop + +To monitor InnoDB status information from a file: + + innotop /var/log/mysql/mysqld.err + +To run innotop non-interactively in a pipe-and-filter configuration: + + innotop --count 5 -d 1 -n + +To monitor a database on another system using a particular username and password: + + innotop -u -p -h + +=head1 DESCRIPTION + +innotop monitors MySQL servers. Each of its modes shows you a different aspect +of what's happening in the server. For example, there's a mode for monitoring +replication, one for queries, and one for transactions. innotop refreshes its +data periodically, so you see an updating view. + +innotop has lots of features for power users, but you can start and run it with +virtually no configuration. If you're just getting started, see +L<"QUICK-START">. Press '?' at any time while running innotop for +context-sensitive help. + +=head1 QUICK-START + +To start innotop, open a terminal or command prompt. If you have installed +innotop on your system, you should be able to just type "innotop" and press +Enter; otherwise, you will need to change to innotop's directory and type "perl +innotop". + +With no options specified, innotop will attempt to connect to a MySQL server on +localhost using mysql_read_default_group=client for other connection +parameters. If you need to specify a different username and password, use the +-u and -p options, respectively. To monitor a MySQL database on another +host, use the -h option. + +After you've connected, innotop should show you something like the following: + + [RO] Query List (? for help) localhost, 01:11:19, 449.44 QPS, 14/7/163 con/run + + CXN When Load QPS Slow QCacheHit KCacheHit BpsIn BpsOut + localhost Total 0.00 1.07k 697 0.00% 98.17% 476.83k 242.83k + + CXN Cmd ID User Host DB Time Query + localhost Query 766446598 test 10.0.0.1 foo 00:02 INSERT INTO table ( + + +(This sample is truncated at the right so it will fit on a terminal when running +'man innotop') + +If your server is busy, you'll see more output. Notice the first line on the +screen, which tells you that readonly is set to true ([RO]), what mode you're +in and what server you're connected to. You can change to other modes with +keystrokes; press 'T' to switch to a list of InnoDB transactions, for example. + +Press the '?' key to see what keys are active in the current mode. You can +press any of these keys and innotop will either take the requested action or +prompt you for more input. If your system has Term::ReadLine support, you can +use TAB and other keys to auto-complete and edit input. + +To quit innotop, press the 'q' key. + +=head1 OPTIONS + +innotop is mostly configured via its configuration file, but some of the +configuration options can come from the command line. You can also specify a +file to monitor for InnoDB status output; see L<"MONITORING A FILE"> for more +details. + +You can negate some options by prefixing the option name with --no. For +example, --noinc (or --no-inc) negates L<"--inc">. + +=over + +=item --color + +Enable or disable terminal coloring. Corresponds to the L<"color"> config file +setting. + +=item --config + +Specifies a configuration file to read. This option is non-sticky, that is to +say it does not persist to the configuration file itself. + +=item --count + +Refresh only the specified number of times (ticks) before exiting. Each refresh +is a pause for L<"interval"> seconds, followed by requesting data from MySQL +connections and printing it to the terminal. + +=item --delay + +Specifies the amount of time to pause between ticks (refreshes). Corresponds to +the configuration option L<"interval">. + +=item --help + +Print a summary of command-line usage and exit. + +=item --host + +Host to connect to. + +=item --inc + +Specifies whether innotop should display absolute numbers or relative numbers +(offsets from their previous values). Corresponds to the configuration option +L<"status_inc">. + +=item --mode + +Specifies the mode in which innotop should start. Corresponds to the +configuration option L<"mode">. + +=item --nonint + +Enable non-interactive operation. See L<"NON-INTERACTIVE OPERATION"> for more. + +=item --password + +Password to use for connection. + +=item --port + +Port to use for connection. + +=item --skipcentral + +Don't read the central configuration file. + +=item --user + +User to use for connection. + +=item --version + +Output version information and exit. + +=item --write + +Sets the configuration option L<"readonly"> to 0, making innotop write the +running configuration to ~/.innotop/innotop.conf on exit, if no configuration +file was loaded at start-up. + +=back + +=head1 HOTKEYS + +innotop is interactive, and you control it with key-presses. + +=over + +=item * + +Uppercase keys switch between modes. + +=item * + +Lowercase keys initiate some action within the current mode. + +=item * + +Other keys do something special like change configuration or show the +innotop license. + +=back + +Press '?' at any time to see the currently active keys and what they do. + +=head1 MODES + +Each of innotop's modes retrieves and displays a particular type of data from +the servers you're monitoring. You switch between modes with uppercase keys. +The following is a brief description of each mode, in alphabetical order. To +switch to the mode, press the key listed in front of its heading in the +following list: + +=over + +=item B: InnoDB Buffers + +This mode displays information about the InnoDB buffer pool, page statistics, +insert buffer, and adaptive hash index. The data comes from SHOW INNODB STATUS. + +This mode contains the L<"buffer_pool">, L<"page_statistics">, +L<"insert_buffers">, and L<"adaptive_hash_index"> tables by default. + +=item C: Command Summary + +This mode is similar to mytop's Command Summary mode. It shows the +L<"cmd_summary"> table, which looks something like the following: + + Command Summary (? for help) localhost, 25+07:16:43, 2.45 QPS, 3 thd, 5.0.40 + _____________________ Command Summary _____________________ + Name Value Pct Last Incr Pct + Select_scan 3244858 69.89% 2 100.00% + Select_range 1354177 29.17% 0 0.00% + Select_full_join 39479 0.85% 0 0.00% + Select_full_range_join 4097 0.09% 0 0.00% + Select_range_check 0 0.00% 0 0.00% + +The command summary table is built by extracting variables from +L<"STATUS_VARIABLES">. The variables must be numeric and must match the prefix +given by the L<"cmd_filter"> configuration variable. The variables are then +sorted by value descending and compared to the last variable, as shown above. +The percentage columns are percentage of the total of all variables in the +table, so you can see the relative weight of the variables. + +The example shows what you see if the prefix is "Select_". The default +prefix is "Com_". You can choose a prefix with the 's' key. + +It's rather like running SHOW VARIABLES LIKE "prefix%" with memory and +nice formatting. + +Values are aggregated across all servers. The Pct columns are not correctly +aggregated across multiple servers. This is a known limitation of the grouping +algorithm that may be fixed in the future. + +=item D: InnoDB Deadlocks + +This mode shows the transactions involved in the last InnoDB deadlock. A second +table shows the locks each transaction held and waited for. A deadlock is +caused by a cycle in the waits-for graph, so there should be two locks held and +one waited for unless the deadlock information is truncated. + +InnoDB puts deadlock information before some other information in the SHOW +INNODB STATUS output. If there are a lot of locks, the deadlock information can +grow very large, and there is a limit on the size of the SHOW INNODB +STATUS output. A large deadlock can fill the entire output, or even be +truncated, and prevent you from seeing other information at all. If you are +running innotop in another mode, for example T mode, and suddenly you don't see +anything, you might want to check and see if a deadlock has wiped out the data +you need. + +If it has, you can create a small deadlock to replace the large one. Use the +'w' key to 'wipe' the large deadlock with a small one. This will not work +unless you have defined a deadlock table for the connection (see L<"SERVER +CONNECTIONS">). + +You can also configure innotop to automatically detect when a large deadlock +needs to be replaced with a small one (see L<"auto_wipe_dl">). + +This mode displays the L<"deadlock_transactions"> and L<"deadlock_locks"> tables +by default. + +=item F: InnoDB Foreign Key Errors + +This mode shows the last InnoDB foreign key error information, such as the +table where it happened, when and who and what query caused it, and so on. + +InnoDB has a huge variety of foreign key error messages, and many of them are +just hard to parse. innotop doesn't always do the best job here, but there's +so much code devoted to parsing this messy, unparseable output that innotop is +likely never to be perfect in this regard. If innotop doesn't show you what +you need to see, just look at the status text directly. + +This mode displays the L<"fk_error"> table by default. + +=item I: InnoDB I/O Info + +This mode shows InnoDB's I/O statistics, including the I/O threads, pending I/O, +file I/O miscellaneous, and log statistics. It displays the L<"io_threads">, +L<"pending_io">, L<"file_io_misc">, and L<"log_statistics"> tables by default. + +=item L: Locks + +This mode shows information about current locks. At the moment only InnoDB +locks are supported, and by default you'll only see locks for which transactions +are waiting. This information comes from the TRANSACTIONS section of the InnoDB +status text. If you have a very busy server, you may have frequent lock waits; +it helps to be able to see which tables and indexes are the "hot spot" for +locks. If your server is running pretty well, this mode should show nothing. + +You can configure MySQL and innotop to monitor not only locks for which a +transaction is waiting, but those currently held, too. You can do this with the +InnoDB Lock Monitor (L). It's +not documented in the MySQL manual, but creating the lock monitor with the +following statement also affects the output of SHOW INNODB STATUS, which innotop +uses: + + CREATE TABLE innodb_lock_monitor(a int) ENGINE=INNODB; + +This causes InnoDB to print its output to the MySQL file every 16 seconds or so, +as stated in the manual, but it also makes the normal SHOW INNODB STATUS output +include lock information, which innotop can parse and display (that's the +undocumented feature). + +This means you can do what may have seemed impossible: to a limited extent +(InnoDB truncates some information in the output), you can see which transaction +holds the locks something else is waiting for. You can also enable and disable +the InnoDB Lock Monitor with the key mappings in this mode. + +This mode displays the L<"innodb_locks"> table by default. Here's a sample of +the screen when one connection is waiting for locks another connection holds: + + _________________________________ InnoDB Locks __________________________ + CXN ID Type Waiting Wait Active Mode DB Table Index + localhost 12 RECORD 1 00:10 00:10 X test t1 PRIMARY + localhost 12 TABLE 0 00:10 00:10 IX test t1 + localhost 12 RECORD 1 00:10 00:10 X test t1 PRIMARY + localhost 11 TABLE 0 00:00 00:25 IX test t1 + localhost 11 RECORD 0 00:00 00:25 X test t1 PRIMARY + +You can see the first connection, ID 12, is waiting for a lock on the PRIMARY +key on test.t1, and has been waiting for 10 seconds. The second connection +isn't waiting, because the Waiting column is 0, but it holds locks on the same +index. That tells you connection 11 is blocking connection 12. + +=item M: Master/Slave Replication Status + +This mode shows the output of SHOW SLAVE STATUS and SHOW MASTER STATUS in three +tables. The first two divide the slave's status into SQL and I/O thread status, +and the last shows master status. Filters are applied to eliminate non-slave +servers from the slave tables, and non-master servers from the master table. + +This mode displays the L<"slave_sql_status">, L<"slave_io_status">, and +L<"master_status"> tables by default. + +=item O: Open Tables + +This section comes from MySQL's SHOW OPEN TABLES command. By default it is +filtered to show tables which are in use by one or more queries, so you can +get a quick look at which tables are 'hot'. You can use this to guess which +tables might be locked implicitly. + +This mode displays the L<"open_tables"> mode by default. + +=item Q: Query List + +This mode displays the output from SHOW FULL PROCESSLIST, much like B's +query list mode. This mode does B show InnoDB-related information. This +is probably one of the most useful modes for general usage. + +There is an informative header that shows general status information about +your server. You can toggle it on and off with the 'h' key. By default, +innotop hides inactive processes and its own process. You can toggle these on +and off with the 'i' and 'a' keys. + +You can EXPLAIN a query from this mode with the 'e' key. This displays the +query's full text, the results of EXPLAIN, and in newer MySQL versions, even +the optimized query resulting from EXPLAIN EXTENDED. innotop also tries to +rewrite certain queries to make them EXPLAIN-able. For example, INSERT/SELECT +statements are rewritable. + +This mode displays the L<"q_header"> and L<"processlist"> tables by default. + +=item R: InnoDB Row Operations and Semaphores + +This mode shows InnoDB row operations, row operation miscellaneous, semaphores, +and information from the wait array. It displays the L<"row_operations">, +L<"row_operation_misc">, L<"semaphores">, and L<"wait_array"> tables by default. + +=item S: Variables & Status + +This mode calculates statistics, such as queries per second, and prints them out +in several different styles. You can show absolute values, or incremental values +between ticks. + +You can switch between the views by pressing a key. The 's' key prints a +single line each time the screen updates, in the style of B. The 'g' +key changes the view to a graph of the same numbers, sort of like B. +The 'v' key changes the view to a pivoted table of variable names on the left, +with successive updates scrolling across the screen from left to right. You can +choose how many updates to put on the screen with the L<"num_status_sets"> +configuration variable. + +Headers may be abbreviated to fit on the screen in interactive operation. You +choose which variables to display with the 'c' key, which selects from +predefined sets, or lets you create your own sets. You can edit the current set +with the 'e' key. + +This mode doesn't really display any tables like other modes. Instead, it uses +a table definition to extract and format the data, but it then transforms the +result in special ways before outputting it. It uses the L<"var_status"> table +definition for this. + +=item T: InnoDB Transactions + +This mode shows transactions from the InnoDB monitor's output, in B-like +format. This mode is the reason I wrote innotop. + +You can kill queries or processes with the 'k' and 'x' keys, and EXPLAIN a query +with the 'e' or 'f' keys. InnoDB doesn't print the full query in transactions, +so explaining may not work right if the query is truncated. + +The informational header can be toggled on and off with the 'h' key. By +default, innotop hides inactive transactions and its own transaction. You can +toggle this on and off with the 'i' and 'a' keys. + +This mode displays the L<"t_header"> and L<"innodb_transactions"> tables by +default. + +=back + +=head1 INNOTOP STATUS + +The first line innotop displays is a "status bar" of sorts. What it contains +depends on the mode you're in, and what servers you're monitoring. The first +few words are always [RO] (if readonly is set to 1), the innotop mode, such as +"InnoDB Txns" for T mode, followed by a reminder to press '?' for help at any +time. + +=head2 ONE SERVER + +The simplest case is when you're monitoring a single server. In this case, the +name of the connection is next on the status line. This is the name you gave +when you created the connection -- most likely the MySQL server's hostname. +This is followed by the server's uptime. + +If you're in an InnoDB mode, such as T or B, the next word is "InnoDB" followed +by some information about the SHOW INNODB STATUS output used to render the +screen. The first word is the number of seconds since the last SHOW INNODB +STATUS, which InnoDB uses to calculate some per-second statistics. The next is +a smiley face indicating whether the InnoDB output is truncated. If the smiley +face is a :-), all is well; there is no truncation. A :^| means the transaction +list is so long, InnoDB has only printed out some of the transactions. Finally, +a frown :-( means the output is incomplete, which is probably due to a deadlock +printing too much lock information (see L<"D: InnoDB Deadlocks">). + +The next two words indicate the server's queries per second (QPS) and how many +threads (connections) exist. Finally, the server's version number is the last +thing on the line. + +=head2 MULTIPLE SERVERS + +If you are monitoring multiple servers (see L<"SERVER CONNECTIONS">), the status +line does not show any details about individual servers. Instead, it shows the +names of the connections that are active. Again, these are connection names you +specified, which are likely to be the server's hostname. A connection that has +an error is prefixed with an exclamation point. + +If you are monitoring a group of servers (see L<"SERVER GROUPS">), the status +line shows the name of the group. If any connection in the group has an +error, the group's name is followed by the fraction of the connections that +don't have errors. + +See L<"ERROR HANDLING"> for more details about innotop's error handling. + +=head2 MONITORING A FILE + +If you give a filename on the command line, innotop will not connect to ANY +servers at all. It will watch the specified file for InnoDB status output and +use that as its data source. It will always show a single connection called +'file'. And since it can't connect to a server, it can't determine how long the +server it's monitoring has been up; so it calculates the server's uptime as time +since innotop started running. + +=head1 SERVER ADMINISTRATION + +While innotop is primarily a monitor that lets you watch and analyze your +servers, it can also send commands to servers. The most frequently useful +commands are killing queries and stopping or starting slaves. + +You can kill a connection, or in newer versions of MySQL kill a query but not a +connection, from L<"Q: Query List"> and L<"T: InnoDB Transactions"> modes. +Press 'k' to issue a KILL command, or 'x' to issue a KILL QUERY command. +innotop will prompt you for the server and/or connection ID to kill (innotop +does not prompt you if there is only one possible choice for any input). +innotop pre-selects the longest-running query, or the oldest connection. +Confirm the command with 'y'. + +In L<"M: Master/Slave Replication Status"> mode, you can start and stop slaves +with the 'a' and 'o' keys, respectively. You can send these commands to many +slaves at once. innotop fills in a default command of START SLAVE or STOP SLAVE +for you, but you can actually edit the command and send anything you wish, such +as SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1 to make the slave skip one binlog event +when it starts. + +You can also ask innotop to calculate the earliest binlog in use by any slave +and issue a PURGE MASTER LOGS on the master. Use the 'b' key for this. innotop +will prompt you for a master to run the command on, then prompt you for the +connection names of that master's slaves (there is no way for innotop to +determine this reliably itself). innotop will find the minimum binlog in use by +these slave connections and suggest it as the argument to PURGE MASTER LOGS. + +=head1 SERVER CONNECTIONS + +When you create a server connection using '@', innotop asks you for a series of +inputs, as follows: + +=over + +=item DSN + +A DSN is a Data Source Name, which is the initial argument passed to the DBI +module for connecting to a server. It is usually of the form + + DBI:mysql:;mysql_read_default_group=mysql;host=HOSTNAME + +Since this DSN is passed to the DBD::mysql driver, you should read the driver's +documentation at L<"http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm"> for +the exact details on all the options you can pass the driver in the DSN. You +can read more about DBI at L, and especially at +L. + +The mysql_read_default_group=mysql option lets the DBD driver read your MySQL +options files, such as ~/.my.cnf on UNIX-ish systems. You can use this to avoid +specifying a username or password for the connection. + +=item InnoDB Deadlock Table + +This optional item tells innotop a table name it can use to deliberately create +a small deadlock (see L<"D: InnoDB Deadlocks">). If you specify this option, +you just need to be sure the table doesn't exist, and that innotop can create +and drop the table with the InnoDB storage engine. You can safely omit or just +accept the default if you don't intend to use this. + +=item Username + +innotop will ask you if you want to specify a username. If you say 'y', it will +then prompt you for a user name. If you have a MySQL option file that specifies +your username, you don't have to specify a username. + +The username defaults to your login name on the system you're running innotop on. + +=item Password + +innotop will ask you if you want to specify a password. Like the username, the +password is optional, but there's an additional prompt that asks if you want to +save the password in the innotop configuration file. If you don't save it in +the configuration file, innotop will prompt you for a password each time it +starts. Passwords in the innotop configuration file are saved in plain text, +not encrypted in any way. + +=back + +Once you finish answering these questions, you should be connected to a server. +But innotop isn't limited to monitoring a single server; you can define many +server connections and switch between them by pressing the '@' key. See +L<"SWITCHING BETWEEN CONNECTIONS">. + +=head1 SERVER GROUPS + +If you have multiple MySQL instances, you can put them into named groups, such +as 'all', 'masters', and 'slaves', which innotop can monitor all together. + +You can choose which group to monitor with the '#' key, and you can press the +TAB key to switch to the next group. If you're not currently monitoring a +group, pressing TAB selects the first group. + +To create a group, press the '#' key and type the name of your new group, then +type the names of the connections you want the group to contain. + +=head1 SWITCHING BETWEEN CONNECTIONS + +innotop lets you quickly switch which servers you're monitoring. The most basic +way is by pressing the '@' key and typing the name(s) of the connection(s) you +want to use. This setting is per-mode, so you can monitor different connections +in each mode, and innotop remembers which connections you choose. + +You can quickly switch to the 'next' connection in alphabetical order with the +'n' key. If you're monitoring a server group (see L<"SERVER GROUPS">) this will +switch to the first connection. + +You can also type many connection names, and innotop will fetch and display data +from them all. Just separate the connection names with spaces, for example +"server1 server2." Again, if you type the name of a connection that doesn't +exist, innotop will prompt you for connection information and create the +connection. + +Another way to monitor multiple connections at once is with server groups. You +can use the TAB key to switch to the 'next' group in alphabetical order, or if +you're not monitoring any groups, TAB will switch to the first group. + +innotop does not fetch data in parallel from connections, so if you are +monitoring a large group or many connections, you may notice increased delay +between ticks. + +When you monitor more than one connection, innotop's status bar changes. See +L<"INNOTOP STATUS">. + +=head1 ERROR HANDLING + +Error handling is not that important when monitoring a single connection, but is +crucial when you have many active connections. A crashed server or lost +connection should not crash innotop. As a result, innotop will continue to run +even when there is an error; it just won't display any information from the +connection that had an error. Because of this, innotop's behavior might confuse +you. It's a feature, not a bug! + +innotop does not continue to query connections that have errors, because they +may slow innotop and make it hard to use, especially if the error is a problem +connecting and causes a long time-out. Instead, innotop retries the connection +occasionally to see if the error still exists. If so, it will wait until some +point in the future. The wait time increases in ticks as the Fibonacci series, +so it tries less frequently as time passes. + +Since errors might only happen in certain modes because of the SQL commands +issued in those modes, innotop keeps track of which mode caused the error. If +you switch to a different mode, innotop will retry the connection instead of +waiting. + +By default innotop will display the problem in red text at the bottom of the +first table on the screen. You can disable this behavior with the +L<"show_cxn_errors_in_tbl"> configuration option, which is enabled by default. +If the L<"debug"> option is enabled, innotop will display the error at the +bottom of every table, not just the first. And if L<"show_cxn_errors"> is +enabled, innotop will print the error text to STDOUT as well. Error messages +might only display in the mode that caused the error, depending on the mode and +whether innotop is avoiding querying that connection. + +=head1 NON-INTERACTIVE OPERATION + +You can run innotop in non-interactive mode, in which case it is entirely +controlled from the configuration file and command-line options. To start +innotop in non-interactive mode, give the L"<--nonint"> command-line option. +This changes innotop's behavior in the following ways: + +=over + +=item * + +Certain Perl modules are not loaded. Term::Readline is not loaded, since +innotop doesn't prompt interactively. Term::ANSIColor and Win32::Console::ANSI +modules are not loaded. Term::ReadKey is still used, since innotop may have to +prompt for connection passwords when starting up. + +=item * + +innotop does not clear the screen after each tick. + +=item * + +innotop does not persist any changes to the configuration file. + +=item * + +If L<"--count"> is given and innotop is in incremental mode (see L<"status_inc"> +and L<"--inc">), innotop actually refreshes one more time than specified so it +can print incremental statistics. This suppresses output during the first +tick, so innotop may appear to hang. + +=item * + +innotop only displays the first table in each mode. This is so the output can +be easily processed with other command-line utilities such as awk and sed. To +change which tables display in each mode, see L<"TABLES">. Since L<"Q: Query +List"> mode is so important, innotop automatically disables the L<"q_header"> +table. This ensures you'll see the L<"processlist"> table, even if you have +innotop configured to show the q_header table during interactive operation. +Similarly, in L<"T: InnoDB Transactions"> mode, the L<"t_header"> table is +suppressed so you see only the L<"innodb_transactions"> table. + +=item * + +All output is tab-separated instead of being column-aligned with whitespace, and +innotop prints the full contents of each table instead of only printing one +screenful at a time. + +=item * + +innotop only prints column headers once instead of every tick (see +L<"hide_hdr">). innotop does not print table captions (see +L<"display_table_captions">). innotop ensures there are no empty lines in the +output. + +=item * + +innotop does not honor the L<"shorten"> transformation, which normally shortens +some numbers to human-readable formats. + +=item * + +innotop does not print a status line (see L<"INNOTOP STATUS">). + +=back + +=head1 CONFIGURING + +Nearly everything about innotop is configurable. Most things are possible to +change with built-in commands, but you can also edit the configuration file. + +While running innotop, press the '$' key to bring up the configuration editing +dialog. Press another key to select the type of data you want to edit: + +=over + +=item S: Statement Sleep Times + +Edits SQL statement sleep delays, which make innotop pause for the specified +amount of time after executing a statement. See L<"SQL STATEMENTS"> for a +definition of each statement and what it does. By default innotop does not +delay after any statements. + +This feature is included so you can customize the side-effects caused by +monitoring your server. You may not see any effects, but some innotop users +have noticed that certain MySQL versions under very high load with InnoDB +enabled take longer than usual to execute SHOW GLOBAL STATUS. If innotop calls +SHOW FULL PROCESSLIST immediately afterward, the processlist contains more +queries than the machine actually averages at any given moment. Configuring +innotop to pause briefly after calling SHOW GLOBAL STATUS alleviates this +effect. + +Sleep times are stored in the L<"stmt_sleep_times"> section of the configuration +file. Fractional-second sleeps are supported, subject to your hardware's +limitations. + +=item c: Edit Columns + +Starts the table editor on one of the displayed tables. See L<"TABLE EDITOR">. +An alternative way to start the table editor without entering the configuration +dialog is with the '^' key. + +=item g: General Configuration + +Starts the configuration editor to edit global and mode-specific configuration +variables (see L<"MODES">). innotop prompts you to choose a variable from among +the global and mode-specific ones depending on the current mode. + +=item k: Row-Coloring Rules + +Starts the row-coloring rules editor on one of the displayed table(s). See +L<"COLORS"> for details. + +=item p: Manage Plugins + +Starts the plugin configuration editor. See L<"PLUGINS"> for details. + +=item s: Server Groups + +Lets you create and edit server groups. See L<"SERVER GROUPS">. + +=item t: Choose Displayed Tables + +Lets you choose which tables to display in this mode. See L<"MODES"> and +L<"TABLES">. + +=back + +=head1 CONFIGURATION FILE + +innotop's default configuration file locations are $HOME/.innotop and +/etc/innotop/innotop.conf, and they are looked for in that order. If the first +configuration file exists, the second will not be processed. Those can be +overridden with the L<"--config"> command-line option. You can edit it by hand +safely, however innotop reads the configuration file when it starts, and, if +readonly is set to 0, writes it out again when it exits. Thus, if readonly is +set to 0, any changes you make by hand while innotop is running will be lost. + +innotop doesn't store its entire configuration in the configuration file. It +has a huge set of default configuration values that it holds only in memory, +and the configuration file only overrides these defaults. When you customize a +default setting, innotop notices, and then stores the customizations into the +file. This keeps the file size down, makes it easier to edit, and makes +upgrades easier. + +A configuration file is read-only be default. You can override that with +L<"--write">. See L<"readonly">. + +The configuration file is arranged into sections like an INI file. Each +section begins with [section-name] and ends with [/section-name]. Each +section's entries have a different syntax depending on the data they need to +store. You can put comments in the file; any line that begins with a # +character is a comment. innotop will not read the comments, so it won't write +them back out to the file when it exits. Comments in read-only configuration +files are still useful, though. + +The first line in the file is innotop's version number. This lets innotop +notice when the file format is not backwards-compatible, and upgrade smoothly +without destroying your customized configuration. + +The following list describes each section of the configuration file and the data +it contains: + +=over + +=item general + +The 'general' section contains global configuration variables and variables that +may be mode-specific, but don't belong in any other section. The syntax is a +simple key=value list. innotop writes a comment above each value to help you +edit the file by hand. + +=over + +=item S_func + +Controls S mode presentation (see L<"S: Variables & Status">). If g, values are +graphed; if s, values are like vmstat; if p, values are in a pivoted table. + +=item S_set + +Specifies which set of variables to display in L<"S: Variables & Status"> mode. +See L<"VARIABLE SETS">. + +=item auto_wipe_dl + +Instructs innotop to automatically wipe large deadlocks when it notices them. +When this happens you may notice a slight delay. At the next tick, you will +usually see the information that was being truncated by the large deadlock. + +=item charset + +Specifies what kind of characters to allow through the L<"no_ctrl_char"> +transformation. This keeps non-printable characters from confusing a +terminal when you monitor queries that contain binary data, such as images. + +The default is 'ascii', which considers anything outside normal ASCII to be a +control character. The other allowable values are 'unicode' and 'none'. 'none' +considers every character a control character, which can be useful for +collapsing ALL text fields in queries. + +=item cmd_filter + +This is the prefix that filters variables in L<"C: Command Summary"> mode. + +=item color + +Whether terminal coloring is permitted. + +=item cxn_timeout + +On MySQL versions 4.0.3 and newer, this variable is used to set the connection's +timeout, so MySQL doesn't close the connection if it is not used for a while. +This might happen because a connection isn't monitored in a particular mode, for +example. + +=item debug + +This option enables more verbose errors and makes innotop more strict in some +places. It can help in debugging filters and other user-defined code. It also +makes innotop write a lot of information to L<"debugfile"> when there is a +crash. + +=item debugfile + +A file to which innotop will write information when there is a crash. See +L<"FILES">. + +=item display_table_captions + +innotop displays a table caption above most tables. This variable suppresses or +shows captions on all tables globally. Some tables are configured with the +hide_caption property, which overrides this. + +=item global + +Whether to show GLOBAL variables and status. innotop only tries to do this on +servers which support the GLOBAL option to SHOW VARIABLES and SHOW STATUS. In +some MySQL versions, you need certain privileges to do this; if you don't have +them, innotop will not be able to fetch any variable and status data. This +configuration variable lets you run innotop and fetch what data you can even +without the elevated privileges. + +I can no longer find or reproduce the situation where GLOBAL wasn't allowed, but +I know there was one. + +=item graph_char + +Defines the character to use when drawing graphs in L<"S: Variables & Status"> +mode. + +=item header_highlight + +Defines how to highlight column headers. This only works if Term::ANSIColor is +available. Valid values are 'bold' and 'underline'. + +=item hide_hdr + +Hides column headers globally. + +=item interval + +The interval at which innotop will refresh its data (ticks). The interval is +implemented as a sleep time between ticks, so the true interval will vary +depending on how long it takes innotop to fetch and render data. + +This variable accepts fractions of a second. + +=item mode + +The mode in which innotop should start. Allowable arguments are the same as the +key presses that select a mode interactively. See L<"MODES">. + +=item num_digits + +How many digits to show in fractional numbers and percents. This variable's +range is between 0 and 9 and can be set directly from L<"S: Variables & Status"> +mode with the '+' and '-' keys. It is used in the L<"set_precision">, +L<"shorten">, and L<"percent"> transformations. + +=item num_status_sets + +Controls how many sets of status variables to display in pivoted L<"S: Variables +& Status"> mode. It also controls the number of old sets of variables innotop +keeps in its memory, so the larger this variable is, the more memory innotop +uses. + +=item plugin_dir + +Specifies where plugins can be found. By default, innotop stores plugins in the +'plugins' subdirectory of your innotop configuration directory. + +=item readonly + +Whether the configuration file is readonly. This cannot be set interactively. + +=item show_cxn_errors + +Makes innotop print connection errors to STDOUT. See L<"ERROR HANDLING">. + +=item show_cxn_errors_in_tbl + +Makes innotop display connection errors as rows in the first table on screen. +See L<"ERROR HANDLING">. + +=item show_percent + +Adds a '%' character after the value returned by the L<"percent"> +transformation. + +=item show_statusbar + +Controls whether to show the status bar in the display. See L<"INNOTOP +STATUS">. + +=item skip_innodb + +Disables fetching SHOW INNODB STATUS, in case your server(s) do not have InnoDB +enabled and you don't want innotop to try to fetch it. This can also be useful +when you don't have the SUPER privilege, required to run SHOW INNODB STATUS. + +=item status_inc + +Whether to show absolute or incremental values for status variables. +Incremental values are calculated as an offset from the last value innotop saw +for that variable. This is a global setting, but will probably become +mode-specific at some point. Right now it is honored a bit inconsistently; some +modes don't pay attention to it. + +=back + +=item plugins + +This section holds a list of package names of active plugins. If the plugin +exists, innotop will activate it. See L<"PLUGINS"> for more information. + +=item filters + +This section holds user-defined filters (see L<"FILTERS">). Each line is in the +format filter_name=text='filter text' tbls='table list'. + +The filter text is the text of the subroutine's code. The table list is a list +of tables to which the filter can apply. By default, user-defined filters apply +to the table for which they were created, but you can manually override that by +editing the definition in the configuration file. + +=item active_filters + +This section stores which filters are active on each table. Each line is in the +format table_name=filter_list. + +=item tbl_meta + +This section stores user-defined or user-customized columns (see L<"COLUMNS">). +Each line is in the format col_name=properties, where the properties are a +name=quoted-value list. + +=item connections + +This section holds the server connections you have defined. Each line is in +the format name=properties, where the properties are a name=value list. The +properties are self-explanatory, and the only one that is treated specially is +'pass' which is only present if 'savepass' is set. This section of the +configuration file will be skipped if any DSN, username, or password +command-line options are used. See L<"SERVER CONNECTIONS">. + +=item active_connections + +This section holds a list of which connections are active in each mode. Each +line is in the format mode_name=connection_list. + +=item server_groups + +This section holds server groups. Each line is in the format +name=connection_list. See L<"SERVER GROUPS">. + +=item active_server_groups + +This section holds a list of which server group is active in each mode. Each +line is in the format mode_name=server_group. + +=item max_values_seen + +This section holds the maximum values seen for variables. This is used to scale +the graphs in L<"S: Variables & Status"> mode. Each line is in the format +name=value. + +=item active_columns + +This section holds table column lists. Each line is in the format +tbl_name=column_list. See L<"COLUMNS">. + +=item sort_cols + +This section holds the sort definition. Each line is in the format +tbl_name=column_list. If a column is prefixed with '-', that column sorts +descending. See L<"SORTING">. + +=item visible_tables + +This section defines which tables are visible in each mode. Each line is in the +format mode_name=table_list. See L<"TABLES">. + +=item varsets + +This section defines variable sets for use in L<"S: Status & Variables"> mode. +Each line is in the format name=variable_list. See L<"VARIABLE SETS">. + +=item colors + +This section defines colorization rules. Each line is in the format +tbl_name=property_list. See L<"COLORS">. + +=item stmt_sleep_times + +This section contains statement sleep times. Each line is in the format +statement_name=sleep_time. See L<"S: Statement Sleep Times">. + +=item group_by + +This section contains column lists for table group_by expressions. Each line is +in the format tbl_name=column_list. See L<"GROUPING">. + +=back + +=head1 CUSTOMIZING + +You can customize innotop a great deal. For example, you can: + +=over + +=item * + +Choose which tables to display, and in what order. + +=item * + +Choose which columns are in those tables, and create new columns. + +=item * + +Filter which rows display with built-in filters, user-defined filters, and +quick-filters. + +=item * + +Sort the rows to put important data first or group together related rows. + +=item * + +Highlight rows with color. + +=item * + +Customize the alignment, width, and formatting of columns, and apply +transformations to columns to extract parts of their values or format the values +as you wish (for example, shortening large numbers to familiar units). + +=item * + +Design your own expressions to extract and combine data as you need. This gives +you unlimited flexibility. + +=back + +All these and more are explained in the following sections. + +=head2 TABLES + +A table is what you'd expect: a collection of columns. It also has some other +properties, such as a caption. Filters, sorting rules, and colorization rules +belong to tables and are covered in later sections. + +Internally, table meta-data is defined in a data structure called %tbl_meta. +This hash holds all built-in table definitions, which contain a lot of default +instructions to innotop. The meta-data includes the caption, a list of columns +the user has customized, a list of columns, a list of visible columns, a list of +filters, color rules, a sort-column list, sort direction, and some information +about the table's data sources. Most of this is customizable via the table +editor (see L<"TABLE EDITOR">). + +You can choose which tables to show by pressing the '$' key. See L<"MODES"> and +L<"TABLES">. + +The table life-cycle is as follows: + +=over + +=item * + +Each table begins with a data source, which is an array of hashes. See below +for details on data sources. + +=item * + +Each element of the data source becomes a row in the final table. + +=item * + +For each element in the data source, innotop extracts values from the source and +creates a row. This row is another hash, which later steps will refer to as +$set. The values innotop extracts are determined by the table's columns. Each +column has an extraction subroutine, compiled from an expression (see +L<"EXPRESSIONS">). The resulting row is a hash whose keys are named the same as +the column name. + +=item * + +innotop filters the rows, removing those that don't need to be displayed. See +L<"FILTERS">. + +=item * + +innotop sorts the rows. See L<"SORTING">. + +=item * + +innotop groups the rows together, if specified. See L<"GROUPING">. + +=item * + +innotop colorizes the rows. See L<"COLORS">. + +=item * + +innotop transforms the column values in each row. See L<"TRANSFORMATIONS">. + +=item * + +innotop optionally pivots the rows (see L<"PIVOTING">), then filters and sorts +them. + +=item * + +innotop formats and justifies the rows as a table. During this step, innotop +applies further formatting to the column values, including alignment, maximum +and minimum widths. innotop also does final error checking to ensure there are +no crashes due to undefined values. innotop then adds a caption if specified, +and the table is ready to print. + +=back + +The lifecycle is slightly different if the table is pivoted, as noted above. To +clarify, if the table is pivoted, the process is extract, group, transform, +pivot, filter, sort, create. If it's not pivoted, the process is extract, +filter, sort, group, color, transform, create. This slightly convoluted process +doesn't map all that well to SQL, but pivoting complicates things pretty +thoroughly. Roughly speaking, filtering and sorting happen as late as needed to +effect the final result as you might expect, but as early as possible for +efficiency. + +Each built-in table is described below: + +=over + +=item adaptive_hash_index + +Displays data about InnoDB's adaptive hash index. Data source: +L<"STATUS_VARIABLES">. + +=item buffer_pool + +Displays data about InnoDB's buffer pool. Data source: L<"STATUS_VARIABLES">. + +=item cmd_summary + +Displays weighted status variables. Data source: L<"STATUS_VARIABLES">. + +=item deadlock_locks + +Shows which locks were held and waited for by the last detected deadlock. Data +source: L<"DEADLOCK_LOCKS">. + +=item deadlock_transactions + +Shows transactions involved in the last detected deadlock. Data source: +L<"DEADLOCK_TRANSACTIONS">. + +=item explain + +Shows the output of EXPLAIN. Data source: L<"EXPLAIN">. + +=item file_io_misc + +Displays data about InnoDB's file and I/O operations. Data source: +L<"STATUS_VARIABLES">. + +=item fk_error + +Displays various data about InnoDB's last foreign key error. Data source: +L<"STATUS_VARIABLES">. + +=item innodb_locks + +Displays InnoDB locks. Data source: L<"INNODB_LOCKS">. + +=item innodb_transactions + +Displays data about InnoDB's current transactions. Data source: +L<"INNODB_TRANSACTIONS">. + +=item insert_buffers + +Displays data about InnoDB's insert buffer. Data source: L<"STATUS_VARIABLES">. + +=item io_threads + +Displays data about InnoDB's I/O threads. Data source: L<"IO_THREADS">. + +=item log_statistics + +Displays data about InnoDB's logging system. Data source: L<"STATUS_VARIABLES">. + +=item master_status + +Displays replication master status. Data source: L<"STATUS_VARIABLES">. + +=item open_tables + +Displays open tables. Data source: L<"OPEN_TABLES">. + +=item page_statistics + +Displays InnoDB page statistics. Data source: L<"STATUS_VARIABLES">. + +=item pending_io + +Displays InnoDB pending I/O operations. Data source: L<"STATUS_VARIABLES">. + +=item processlist + +Displays current MySQL processes (threads/connections). Data source: +L<"PROCESSLIST">. + +=item q_header + +Displays various status values. Data source: L<"STATUS_VARIABLES">. + +=item row_operation_misc + +Displays data about InnoDB's row operations. Data source: +L<"STATUS_VARIABLES">. + +=item row_operations + +Displays data about InnoDB's row operations. Data source: +L<"STATUS_VARIABLES">. + +=item semaphores + +Displays data about InnoDB's semaphores and mutexes. Data source: +L<"STATUS_VARIABLES">. + +=item slave_io_status + +Displays data about the slave I/O thread. Data source: +L<"STATUS_VARIABLES">. + +=item slave_sql_status + +Displays data about the slave SQL thread. Data source: L<"STATUS_VARIABLES">. + +=item t_header + +Displays various InnoDB status values. Data source: L<"STATUS_VARIABLES">. + +=item var_status + +Displays user-configurable data. Data source: L<"STATUS_VARIABLES">. + +=item wait_array + +Displays data about InnoDB's OS wait array. Data source: L<"OS_WAIT_ARRAY">. + +=back + +=head2 COLUMNS + +Columns belong to tables. You can choose a table's columns by pressing the '^' +key, which starts the L<"TABLE EDITOR"> and lets you choose and edit columns. +Pressing 'e' from within the table editor lets you edit the column's properties: + +=over + +=item * + +hdr: a column header. This appears in the first row of the table. + +=item * + +just: justification. '-' means left-justified and '' means right-justified, +just as with printf formatting codes (not a coincidence). + +=item * + +dec: whether to further align the column on the decimal point. + +=item * + +num: whether the column is numeric. This affects how values are sorted +(lexically or numerically). + +=item * + +label: a small note about the column, which appears in dialogs that help the +user choose columns. + +=item * + +src: an expression that innotop uses to extract the column's data from its +source (see L<"DATA SOURCES">). See L<"EXPRESSIONS"> for more on expressions. + +=item * + +minw: specifies a minimum display width. This helps stabilize the display, +which makes it easier to read if the data is changing frequently. + +=item * + +maxw: similar to minw. + +=item * + +trans: a list of column transformations. See L<"TRANSFORMATIONS">. + +=item * + +agg: an aggregate function. See L<"GROUPING">. The default is L<"first">. + +=item * + +aggonly: controls whether the column only shows when grouping is enabled on the +table (see L<"GROUPING">). By default, this is disabled. This means columns +will always be shown by default, whether grouping is enabled or not. If a +column's aggonly is set true, the column will appear when you toggle grouping on +the table. Several columns are set this way, such as the count column on +L<"processlist"> and L<"innodb_transactions">, so you don't see a count when the +grouping isn't enabled, but you do when it is. + +=back + +=head2 FILTERS + +Filters remove rows from the display. They behave much like a WHERE clause in +SQL. innotop has several built-in filters, which remove irrelevant information +like inactive queries, but you can define your own as well. innotop also lets +you create quick-filters, which do not get saved to the configuration file, and +are just an easy way to quickly view only some rows. + +You can enable or disable a filter on any table. Press the '%' key (mnemonic: % +looks kind of like a line being filtered between two circles) and choose which +table you want to filter, if asked. You'll then see a list of possible filters +and a list of filters currently enabled for that table. Type the names of +filters you want to apply and press Enter. + +=head3 USER-DEFINED FILTERS + +If you type a name that doesn't exist, innotop will prompt you to create the +filter. Filters are easy to create if you know Perl, and not hard if you don't. +What you're doing is creating a subroutine that returns true if the row should +be displayed. The row is a hash reference passed to your subroutine as $set. + +For example, imagine you want to filter the processlist table so you only see +queries that have been running more than five minutes. Type a new name for your +filter, and when prompted for the subroutine body, press TAB to initiate your +terminal's auto-completion. You'll see the names of the columns in the +L<"processlist"> table (innotop generally tries to help you with auto-completion +lists). You want to filter on the 'time' column. Type the text "$set->{time} > +300" to return true when the query is more than five minutes old. That's all +you need to do. + +In other words, the code you're typing is surrounded by an implicit context, +which looks like this: + + sub filter { + my ( $set ) = @_; + # YOUR CODE HERE + } + +If your filter doesn't work, or if something else suddenly behaves differently, +you might have made an error in your filter, and innotop is silently catching +the error. Try enabling L<"debug"> to make innotop throw an error instead. + +=head3 QUICK-FILTERS + +innotop's quick-filters are a shortcut to create a temporary filter that doesn't +persist when you restart innotop. To create a quick-filter, press the '/' key. +innotop will prompt you for the column name and filter text. Again, you can use +auto-completion on column names. The filter text can be just the text you want +to "search for." For example, to filter the L<"processlist"> table on queries +that refer to the products table, type '/' and then 'info product'. + +The filter text can actually be any Perl regular expression, but of course a +literal string like 'product' works fine as a regular expression. + +Behind the scenes innotop compiles the quick-filter into a specially tagged +filter that is otherwise like any other filter. It just isn't saved to the +configuration file. + +To clear quick-filters, press the '\' key and innotop will clear them all at +once. + +=head2 SORTING + +innotop has sensible built-in defaults to sort the most important rows to the +top of the table. Like anything else in innotop, you can customize how any +table is sorted. + +To start the sort dialog, start the L<"TABLE EDITOR"> with the '^' key, choose a +table if necessary, and press the 's' key. You'll see a list of columns you can +use in the sort expression and the current sort expression, if any. Enter a +list of columns by which you want to sort and press Enter. If you want to +reverse sort, prefix the column name with a minus sign. For example, if you +want to sort by column a ascending, then column b descending, type 'a -b'. You +can also explicitly add a + in front of columns you want to sort ascending, but +it's not required. + +Some modes have keys mapped to open this dialog directly, and to quickly reverse +sort direction. Press '?' as usual to see which keys are mapped in any mode. + +=head2 GROUPING + +innotop can group, or aggregate, rows together (the terms are used +interchangeably). This is quite similar to an SQL GROUP BY clause. You can +specify to group on certain columns, or if you don't specify any, the entire set +of rows is treated as one group. This is quite like SQL so far, but unlike SQL, +you can also select un-grouped columns. innotop actually aggregates every +column. If you don't explicitly specify a grouping function, the default is +'first'. This is basically a convenience so you don't have to specify an +aggregate function for every column you want in the result. + +You can quickly toggle grouping on a table with the '=' key, which toggles its +aggregate property. This property doesn't persist to the config file. + +The columns by which the table is grouped are specified in its group_by +property. When you turn grouping on, innotop places the group_by columns at the +far left of the table, even if they're not supposed to be visible. The rest of +the visible columns appear in order after them. + +Two tables have default group_by lists and a count column built in: +L<"processlist"> and L<"innodb_transactions">. The grouping is by connection +and status, so you can quickly see how many queries or transactions are in a +given status on each server you're monitoring. The time columns are aggregated +as a sum; other columns are left at the default 'first' aggregation. + +By default, the table shown in L<"S: Variables & Status"> mode also uses +grouping so you can monitor variables and status across many servers. The +default aggregation function in this mode is 'avg'. + +Valid grouping functions are defined in the %agg_funcs hash. They include + +=over + +=item first + +Returns the first element in the group. + +=item count + +Returns the number of elements in the group, including undefined elements, much +like SQL's COUNT(*). + +=item avg + +Returns the average of defined elements in the group. + +=item sum + +Returns the sum of elements in the group. + +=back + +Here's an example of grouping at work. Suppose you have a very busy server with +hundreds of open connections, and you want to see how many connections are in +what status. Using the built-in grouping rules, you can press 'Q' to enter +L<"Q: Query List"> mode. Press '=' to toggle grouping (if necessary, select the +L<"processlist"> table when prompted). + +Your display might now look like the following: + + Query List (? for help) localhost, 32:33, 0.11 QPS, 1 thd, 5.0.38-log + + CXN Cmd Cnt ID User Host Time Query + localhost Query 49 12933 webusr localhost 19:38 SELECT * FROM + localhost Sending Da 23 2383 webusr localhost 12:43 SELECT col1, + localhost Sleep 120 140 webusr localhost 5:18:12 + localhost Statistics 12 19213 webusr localhost 01:19 SELECT * FROM + +That's actually quite a worrisome picture. You've got a lot of idle connections +(Sleep), and some connections executing queries (Query and Sending Data). +That's okay, but you also have a lot in Statistics status, collectively spending +over a minute. That means the query optimizer is having a really hard time +optimizing your statements. Something is wrong; it should normally take +milliseconds to optimize queries. You might not have seen this pattern if you +didn't look at your connections in aggregate. (This is a made-up example, but +it can happen in real life). + +=head2 PIVOTING + +innotop can pivot a table for more compact display, similar to a Pivot Table in +a spreadsheet (also known as a crosstab). Pivoting a table makes columns into +rows. Assume you start with this table: + + foo bar + === === + 1 3 + 2 4 + +After pivoting, the table will look like this: + + name set0 set1 + ==== ==== ==== + foo 1 2 + bar 3 4 + +To get reasonable results, you might need to group as well as pivoting. +innotop currently does this for L<"S: Variables & Status"> mode. + +=head2 COLORS + +By default, innotop highlights rows with color so you can see at a glance which +rows are more important. You can customize the colorization rules and add your +own to any table. Open the table editor with the '^' key, choose a table if +needed, and press 'o' to open the color editor dialog. + +The color editor dialog displays the rules applied to the table, in the order +they are evaluated. Each row is evaluated against each rule to see if the rule +matches the row; if it does, the row gets the specified color, and no further +rules are evaluated. The rules look like the following: + + state eq Locked black on_red + cmd eq Sleep white + user eq system user white + cmd eq Connect white + cmd eq Binlog Dump white + time > 600 red + time > 120 yellow + time > 60 green + time > 30 cyan + +This is the default rule set for the L<"processlist"> table. In order of +priority, these rules make locked queries black on a red background, "gray out" +connections from replication and sleeping queries, and make queries turn from +cyan to red as they run longer. + +(For some reason, the ANSI color code "white" is actually a light gray. Your +terminal's display may vary; experiment to find colors you like). + +You can use keystrokes to move the rules up and down, which re-orders their +priority. You can also delete rules and add new ones. If you add a new rule, +innotop prompts you for the column, an operator for the comparison, a value +against which to compare the column, and a color to assign if the rule matches. +There is auto-completion and prompting at each step. + +The value in the third step needs to be correctly quoted. innotop does not try +to quote the value because it doesn't know whether it should treat the value as +a string or a number. If you want to compare the column against a string, as +for example in the first rule above, you should enter 'Locked' surrounded by +quotes. If you get an error message about a bareword, you probably should have +quoted something. + +=head2 EXPRESSIONS + +Expressions are at the core of how innotop works, and are what enables you to +extend innotop as you wish. Recall the table lifecycle explained in +L<"TABLES">. Expressions are used in the earliest step, where it extracts +values from a data source to form rows. + +It does this by calling a subroutine for each column, passing it the source data +set, a set of current values, and a set of previous values. These are all +needed so the subroutine can calculate things like the difference between this +tick and the previous tick. + +The subroutines that extract the data from the set are compiled from +expressions. This gives significantly more power than just naming the values to +fill the columns, because it allows the column's value to be calculated from +whatever data is necessary, but avoids the need to write complicated and lengthy +Perl code. + +innotop begins with a string of text that can look as simple as a value's name +or as complicated as a full-fledged Perl expression. It looks at each +'bareword' token in the string and decides whether it's supposed to be a key +into the $set hash. A bareword is an unquoted value that isn't already +surrounded by code-ish things like dollar signs or curly brackets. If innotop +decides that the bareword isn't a function or other valid Perl code, it converts +it into a hash access. After the whole string is processed, innotop compiles a +subroutine, like this: + + sub compute_column_value { + my ( $set, $cur, $pre ) = @_; + my $val = # EXPANDED STRING GOES HERE + return $val; + } + +Here's a concrete example, taken from the header table L<"q_header"> in L<"Q: +Query List"> mode. This expression calculates the qps, or Queries Per Second, +column's values, from the values returned by SHOW STATUS: + + Questions/Uptime_hires + +innotop decides both words are barewords, and transforms this expression into +the following Perl code: + + $set->{Questions}/$set->{Uptime_hires} + +When surrounded by the rest of the subroutine's code, this is executable Perl +that calculates a high-resolution queries-per-second value. + +The arguments to the subroutine are named $set, $cur, and $pre. In most cases, +$set and $cur will be the same values. However, if L<"status_inc"> is set, $cur +will not be the same as $set, because $set will already contain values that are +the incremental difference between $cur and $pre. + +Every column in innotop is computed by subroutines compiled in the same fashion. +There is no difference between innotop's built-in columns and user-defined +columns. This keeps things consistent and predictable. + +=head2 TRANSFORMATIONS + +Transformations change how a value is rendered. For example, they can take a +number of seconds and display it in H:M:S format. The following transformations +are defined: + +=over + +=item commify + +Adds commas to large numbers every three decimal places. + +=item dulint_to_int + +Accepts two unsigned integers and converts them into a single longlong. This is +useful for certain operations with InnoDB, which uses two integers as +transaction identifiers, for example. + +=item no_ctrl_char + +Removes quoted control characters from the value. This is affected by the +L<"charset"> configuration variable. + +This transformation only operates within quoted strings, for example, values to +a SET clause in an UPDATE statement. It will not alter the UPDATE statement, +but will collapse the quoted string to [BINARY] or [TEXT], depending on the +charset. + +=item percent + +Converts a number to a percentage by multiplying it by two, formatting it with +L<"num_digits"> digits after the decimal point, and optionally adding a percent +sign (see L<"show_percent">). + +=item secs_to_time + +Formats a number of seconds as time in days+hours:minutes:seconds format. + +=item set_precision + +Formats numbers with L<"num_digits"> number of digits after the decimal point. + +=item shorten + +Formats a number as a unit of 1024 (k/M/G/T) and with L<"num_digits"> number of +digits after the decimal point. + +=back + +=head2 TABLE EDITOR + +The innotop table editor lets you customize tables with keystrokes. You start +the table editor with the '^' key. If there's more than one table on the +screen, it will prompt you to choose one of them. Once you do, innotop will +show you something like this: + + Editing table definition for Buffer Pool. Press ? for help, q to quit. + + name hdr label src + cxn CXN Connection from which cxn + buf_pool_size Size Buffer pool size IB_bp_buf_poo + buf_free Free Bufs Buffers free in the b IB_bp_buf_fre + pages_total Pages Pages total IB_bp_pages_t + pages_modified Dirty Pages Pages modified (dirty IB_bp_pages_m + buf_pool_hit_rate Hit Rate Buffer pool hit rate IB_bp_buf_poo + total_mem_alloc Memory Total memory allocate IB_bp_total_m + add_pool_alloc Add'l Pool Additonal pool alloca IB_bp_add_poo + +The first line shows which table you're editing, and reminds you again to press +'?' for a list of key mappings. The rest is a tabular representation of the +table's columns, because that's likely what you're trying to edit. However, you +can edit more than just the table's columns; this screen can start the filter +editor, color rule editor, and more. + +Each row in the display shows a single column in the table you're editing, along +with a couple of its properties such as its header and source expression (see +L<"EXPRESSIONS">). + +The key mappings are Vim-style, as in many other places. Pressing 'j' and 'k' +moves the highlight up or down. You can then (d)elete or (e)dit the highlighted +column. You can also (a)dd a column to the table. This actually just activates +one of the columns already defined for the table; it prompts you to choose from +among the columns available but not currently displayed. Finally, you can +re-order the columns with the '+' and '-' keys. + +You can do more than just edit the columns with the table editor, you can also +edit other properties, such as the table's sort expression and group-by +expression. Press '?' to see the full list, of course. + +If you want to really customize and create your own column, as opposed to just +activating a built-in one that's not currently displayed, press the (n)ew key, +and innotop will prompt you for the information it needs: + +=over + +=item * + +The column name: this needs to be a word without any funny characters, e.g. just +letters, numbers and underscores. + +=item * + +The column header: this is the label that appears at the top of the column, in +the table header. This can have spaces and funny characters, but be careful not +to make it too wide and waste space on-screen. + +=item * + +The column's data source: this is an expression that determines what data from +the source (see L<"TABLES">) innotop will put into the column. This can just be +the name of an item in the source, or it can be a more complex expression, as +described in L<"EXPRESSIONS">. + +=back + +Once you've entered the required data, your table has a new column. There is no +difference between this column and the built-in ones; it can have all the same +properties and behaviors. innotop will write the column's definition to the +configuration file, so it will persist across sessions. + +Here's an example: suppose you want to track how many times your slaves have +retried transactions. According to the MySQL manual, the +Slave_retried_transactions status variable gives you that data: "The total +number of times since startup that the replication slave SQL thread has retried +transactions. This variable was added in version 5.0.4." This is appropriate to +add to the L<"slave_sql_status"> table. + +To add the column, switch to the replication-monitoring mode with the 'M' key, +and press the '^' key to start the table editor. When prompted, choose +slave_sql_status as the table, then press 'n' to create the column. Type +'retries' as the column name, 'Retries' as the column header, and +'Slave_retried_transactions' as the source. Now the column is created, and you +see the table editor screen again. Press 'q' to exit the table editor, and +you'll see your column at the end of the table. + +=head1 VARIABLE SETS + +Variable sets are used in L<"S: Variables & Status"> mode to define more easily +what variables you want to monitor. Behind the scenes they are compiled to a +list of expressions, and then into a column list so they can be treated just +like columns in any other table, in terms of data extraction and +transformations. However, you're protected from the tedious details by a syntax +that ought to feel very natural to you: a SQL SELECT list. + +The data source for variable sets, and indeed the entire S mode, is the +combination of SHOW STATUS, SHOW VARIABLES, and SHOW INNODB STATUS. Imagine +that you had a huge table with one column per variable returned from those +statements. That's the data source for variable sets. You can now query this +data source just like you'd expect. For example: + + Questions, Uptime, Questions/Uptime as QPS + +Behind the scenes innotop will split that variable set into three expressions, +compile them and turn them into a table definition, then extract as usual. This +becomes a "variable set," or a "list of variables you want to monitor." + +innotop lets you name and save your variable sets, and writes them to the +configuration file. You can choose which variable set you want to see with the +'c' key, or activate the next and previous sets with the '>' and '<' keys. +There are many built-in variable sets as well, which should give you a good +start for creating your own. Press 'e' to edit the current variable set, or +just to see how it's defined. To create a new one, just press 'c' and type its +name. + +You may want to use some of the functions listed in L<"TRANSFORMATIONS"> to help +format the results. In particular, L<"set_precision"> is often useful to limit +the number of digits you see. Extending the above example, here's how: + + Questions, Uptime, set_precision(Questions/Uptime) as QPS + +Actually, this still needs a little more work. If your L<"interval"> is less +than one second, you might be dividing by zero because Uptime is incremental in +this mode by default. Instead, use Uptime_hires: + + Questions, Uptime, set_precision(Questions/Uptime_hires) as QPS + +This example is simple, but it shows how easy it is to choose which variables +you want to monitor. + +=head1 PLUGINS + +innotop has a simple but powerful plugin mechanism by which you can extend +or modify its existing functionality, and add new functionality. innotop's +plugin functionality is event-based: plugins register themselves to be called +when events happen. They then have a chance to influence the event. + +An innotop plugin is a Perl module placed in innotop's L<"plugin_dir"> +directory. On UNIX systems, you can place a symbolic link to the module instead +of putting the actual file there. innotop automatically discovers the file. If +there is a corresponding entry in the L<"plugins"> configuration file section, +innotop loads and activates the plugin. + +The module must conform to innotop's plugin interface. Additionally, the source +code of the module must be written in such a way that innotop can inspect the +file and determine the package name and description. + +=head2 Package Source Convention + +innotop inspects the plugin module's source to determine the Perl package name. +It looks for a line of the form "package Foo;" and if found, considers the +plugin's package name to be Foo. Of course the package name can be a valid Perl +package name, with double semicolons and so on. + +It also looks for a description in the source code, to make the plugin editor +more human-friendly. The description is a comment line of the form "# +description: Foo", where "Foo" is the text innotop will consider to be the +plugin's description. + +=head2 Plugin Interface + +The innotop plugin interface is quite simple: innotop expects the plugin to be +an object-oriented module it can call certain methods on. The methods are + +=over + +=item new(%variables) + +This is the plugin's constructor. It is passed a hash of innotop's variables, +which it can manipulate (see L<"Plugin Variables">). It must return a reference +to the newly created plugin object. + +At construction time, innotop has only loaded the general configuration and +created the default built-in variables with their default contents (which is +quite a lot). Therefore, the state of the program is exactly as in the innotop +source code, plus the configuration variables from the L<"general"> section in +the config file. + +If your plugin manipulates the variables, it is changing global data, which is +shared by innotop and all plugins. Plugins are loaded in the order they're +listed in the config file. Your plugin may load before or after another plugin, +so there is a potential for conflict or interaction between plugins if they +modify data other plugins use or modify. + +=item register_for_events() + +This method must return a list of events in which the plugin is interested, if +any. See L<"Plugin Events"> for the defined events. If the plugin returns an +event that's not defined, the event is ignored. + +=item event handlers + +The plugin must implement a method named the same as each event for which it has +registered. In other words, if the plugin returns qw(foo bar) from +register_for_events(), it must have foo() and bar() methods. These methods are +callbacks for the events. See L<"Plugin Events"> for more details about each +event. + +=back + +=head2 Plugin Variables + +The plugin's constructor is passed a hash of innotop's variables, which it can +manipulate. It is probably a good idea if the plugin object saves a copy of it +for later use. The variables are defined in the innotop variable +%pluggable_vars, and are as follows: + +=over + +=item action_for + +A hashref of key mappings. These are innotop's global hot-keys. + +=item agg_funcs + +A hashref of functions that can be used for grouping. See L<"GROUPING">. + +=item config + +The global configuration hash. + +=item connections + +A hashref of connection specifications. These are just specifications of how to +connect to a server. + +=item dbhs + +A hashref of innotop's database connections. These are actual DBI connection +objects. + +=item filters + +A hashref of filters applied to table rows. See L<"FILTERS"> for more. + +=item modes + +A hashref of modes. See L<"MODES"> for more. + +=item server_groups + +A hashref of server groups. See L<"SERVER GROUPS">. + +=item tbl_meta + +A hashref of innotop's table meta-data, with one entry per table (see +L<"TABLES"> for more information). + +=item trans_funcs + +A hashref of transformation functions. See L<"TRANSFORMATIONS">. + +=item var_sets + +A hashref of variable sets. See L<"VARIABLE SETS">. + +=back + +=head2 Plugin Events + +Each event is defined somewhere in the innotop source code. When innotop runs +that code, it executes the callback function for each plugin that expressed its +interest in the event. innotop passes some data for each event. The events are +defined in the %event_listener_for variable, and are as follows: + +=over + +=item extract_values($set, $cur, $pre, $tbl) + +This event occurs inside the function that extracts values from a data source. +The arguments are the set of values, the current values, the previous values, +and the table name. + +=item set_to_tbl + +Events are defined at many places in this subroutine, which is responsible for +turning an arrayref of hashrefs into an arrayref of lines that can be printed to +the screen. The events all pass the same data: an arrayref of rows and the name +of the table being created. The events are set_to_tbl_pre_filter, +set_to_tbl_pre_sort,set_to_tbl_pre_group, set_to_tbl_pre_colorize, +set_to_tbl_pre_transform, set_to_tbl_pre_pivot, set_to_tbl_pre_create, +set_to_tbl_post_create. + +=item draw_screen($lines) + +This event occurs inside the subroutine that prints the lines to the screen. +$lines is an arrayref of strings. + +=back + +=head2 Simple Plugin Example + +The easiest way to explain the plugin functionality is probably with a simple +example. The following module adds a column to the beginning of every table and +sets its value to 1. + + use strict; + use warnings FATAL => 'all'; + + package Innotop::Plugin::Example; + # description: Adds an 'example' column to every table + + sub new { + my ( $class, %vars ) = @_; + # Store reference to innotop's variables in $self + my $self = bless { %vars }, $class; + + # Design the example column + my $col = { + hdr => 'Example', + just => '', + dec => 0, + num => 1, + label => 'Example', + src => 'example', # Get data from this column in the data source + tbl => '', + trans => [], + }; + + # Add the column to every table. + my $tbl_meta = $vars{tbl_meta}; + foreach my $tbl ( values %$tbl_meta ) { + # Add the column to the list of defined columns + $tbl->{cols}->{example} = $col; + # Add the column to the list of visible columns + unshift @{$tbl->{visible}}, 'example'; + } + + # Be sure to return a reference to the object. + return $self; + } + + # I'd like to be called when a data set is being rendered into a table, please. + sub register_for_events { + my ( $self ) = @_; + return qw(set_to_tbl_pre_filter); + } + + # This method will be called when the event fires. + sub set_to_tbl_pre_filter { + my ( $self, $rows, $tbl ) = @_; + # Set the example column's data source to the value 1. + foreach my $row ( @$rows ) { + $row->{example} = 1; + } + } + + 1; + +=head2 Plugin Editor + +The plugin editor lets you view the plugins innotop discovered and activate or +deactivate them. Start the editor by pressing $ to start the configuration +editor from any mode. Press the 'p' key to start the plugin editor. You'll see +a list of plugins innotop discovered. You can use the 'j' and 'k' keys to move +the highlight to the desired one, then press the * key to toggle it active or +inactive. Exit the editor and restart innotop for the changes to take effect. + +=head1 SQL STATEMENTS + +innotop uses a limited set of SQL statements to retrieve data from MySQL for +display. The statements are customized depending on the server version against +which they are executed; for example, on MySQL 5 and newer, INNODB_STATUS +executes "SHOW ENGINE INNODB STATUS", while on earlier versions it executes +"SHOW INNODB STATUS". The statements are as follows: + + Statement SQL executed + =================== =============================== + INNODB_STATUS SHOW [ENGINE] INNODB STATUS + KILL_CONNECTION KILL + KILL_QUERY KILL QUERY + OPEN_TABLES SHOW OPEN TABLES + PROCESSLIST SHOW FULL PROCESSLIST + SHOW_MASTER_LOGS SHOW MASTER LOGS + SHOW_MASTER_STATUS SHOW MASTER STATUS + SHOW_SLAVE_STATUS SHOW SLAVE STATUS + SHOW_STATUS SHOW [GLOBAL] STATUS + SHOW_VARIABLES SHOW [GLOBAL] VARIABLES + +=head1 DATA SOURCES + +Each time innotop extracts values to create a table (see L<"EXPRESSIONS"> and +L<"TABLES">), it does so from a particular data source. Largely because of the +complex data extracted from SHOW INNODB STATUS, this is slightly messy. SHOW +INNODB STATUS contains a mixture of single values and repeated values that form +nested data sets. + +Whenever innotop fetches data from MySQL, it adds two extra bits to each set: +cxn and Uptime_hires. cxn is the name of the connection from which the data +came. Uptime_hires is a high-resolution version of the server's Uptime status +variable, which is important if your L<"interval"> setting is sub-second. + +Here are the kinds of data sources from which data is extracted: + +=over + +=item STATUS_VARIABLES + +This is the broadest category, into which the most kinds of data fall. It +begins with the combination of SHOW STATUS and SHOW VARIABLES, but other sources +may be included as needed, for example, SHOW MASTER STATUS and SHOW SLAVE +STATUS, as well as many of the non-repeated values from SHOW INNODB STATUS. + +=item DEADLOCK_LOCKS + +This data is extracted from the transaction list in the LATEST DETECTED DEADLOCK +section of SHOW INNODB STATUS. It is nested two levels deep: transactions, then +locks. + +=item DEADLOCK_TRANSACTIONS + +This data is from the transaction list in the LATEST DETECTED DEADLOCK +section of SHOW INNODB STATUS. It is nested one level deep. + +=item EXPLAIN + +This data is from the result set returned by EXPLAIN. + +=item INNODB_TRANSACTIONS + +This data is from the TRANSACTIONS section of SHOW INNODB STATUS. + +=item IO_THREADS + +This data is from the list of threads in the the FILE I/O section of SHOW INNODB +STATUS. + +=item INNODB_LOCKS + +This data is from the TRANSACTIONS section of SHOW INNODB STATUS and is nested +two levels deep. + +=item OPEN_TABLES + +This data is from SHOW OPEN TABLES. + +=item PROCESSLIST + +This data is from SHOW FULL PROCESSLIST. + +=item OS_WAIT_ARRAY + +This data is from the SEMAPHORES section of SHOW INNODB STATUS and is nested one +level deep. It comes from the lines that look like this: + + --Thread 1568861104 has waited at btr0cur.c line 424 .... + +=back + +=head1 MYSQL PRIVILEGES + +=over + +=item * + +You must connect to MySQL as a user who has the SUPER privilege for many of the +functions. + +=item * + +If you don't have the SUPER privilege, you can still run some functions, but you +won't necessarily see all the same data. + +=item * + +You need the PROCESS privilege to see the list of currently running queries in Q +mode. + +=item * + +You need special privileges to start and stop slave servers. + +=item * + +You need appropriate privileges to create and drop the deadlock tables if needed +(see L<"SERVER CONNECTIONS">). + +=back + +=head1 SYSTEM REQUIREMENTS + +You need Perl to run innotop, of course. You also need a few Perl modules: DBI, +DBD::mysql, Term::ReadKey, and Time::HiRes. These should be included with most +Perl distributions, but in case they are not, I recommend using versions +distributed with your operating system or Perl distribution, not from CPAN. +Term::ReadKey in particular has been known to cause problems if installed from +CPAN. + +If you have Term::ANSIColor, innotop will use it to format headers more readably +and compactly. (Under Microsoft Windows, you also need Win32::Console::ANSI for +terminal formatting codes to be honored). If you install Term::ReadLine, +preferably Term::ReadLine::Gnu, you'll get nice auto-completion support. + +I run innotop on Gentoo GNU/Linux, Debian and Ubuntu, and I've had feedback from +people successfully running it on Red Hat, CentOS, Solaris, and Mac OSX. I +don't see any reason why it won't work on other UNIX-ish operating systems, but +I don't know for sure. It also runs on Windows under ActivePerl without +problem. + +innotop has been used on MySQL versions 3.23.58, 4.0.27, 4.1.0, 4.1.22, 5.0.26, +5.1.15, and 5.2.3. If it doesn't run correctly for you, that is a bug that +should be reported. + +=head1 FILES + +$HOMEDIR/.innotop and/or /etc/innotop are used to store +configuration information. Files include the configuration file innotop.conf, +the core_dump file which contains verbose error messages if L<"debug"> is +enabled, and the plugins/ subdirectory. + +=head1 GLOSSARY OF TERMS + +=over + +=item tick + +A tick is a refresh event, when innotop re-fetches data from connections and +displays it. + +=back + +=head1 ACKNOWLEDGEMENTS + +The following people and organizations are acknowledged for various reasons. +Hopefully no one has been forgotten. + +Allen K. Smith, +Aurimas Mikalauskas, +Bartosz Fenski, +Brian Miezejewski, +Christian Hammers, +Cyril Scetbon, +Dane Miller, +David Multer, +Dr. Frank Ullrich, +Giuseppe Maxia, +Google.com Site Reliability Engineers, +Google Code, +Jan Pieter Kunst, +Jari Aalto, +Jay Pipes, +Jeremy Zawodny, +Johan Idren, +Kristian Kohntopp, +Lenz Grimmer, +Maciej Dobrzanski, +Michiel Betel, +MySQL AB, +Paul McCullagh, +Sebastien Estienne, +Sourceforge.net, +Steven Kreuzer, +The Gentoo MySQL Team, +Trevor Price, +Yaar Schnitman, +and probably more people that have not been included. + +(If your name has been misspelled, it's probably out of fear of putting +international characters into this documentation; earlier versions of Perl might +not be able to compile it then). + +=head1 COPYRIGHT, LICENSE AND WARRANTY + +This program is copyright (c) 2006 Baron Schwartz. +Feedback and improvements are welcome. + +THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +This 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; OR the Perl Artistic License. On UNIX and similar +systems, you can issue `man perlgpl' or `man perlartistic' to read these +licenses. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA. + +Execute innotop and press '!' to see this information at any time. + +=head1 AUTHOR + +Originally written by Baron Schwartz; currently maintained by Aaron Racine. + +=head1 BUGS + +You can report bugs, ask for improvements, and get other help and support at +L. There are mailing lists, a source code +browser, a bug tracker, etc. Please use these instead of contacting the +maintainer or author directly, as it makes our job easier and benefits others if the +discussions are permanent and public. Of course, if you need to contact us in +private, please do. + +=cut diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/innotop/innotop.1 percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/innotop/innotop.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/innotop/innotop.1 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/innotop/innotop.1 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,2084 @@ +.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.07) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "INNOTOP 1" +.TH INNOTOP 1 "2009-03-09" "perl v5.10.0" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +innotop \- MySQL and InnoDB transaction/status monitor. +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +To monitor servers normally: +.PP +.Vb 1 +\& innotop +.Ve +.PP +To monitor InnoDB status information from a file: +.PP +.Vb 1 +\& innotop /var/log/mysql/mysqld.err +.Ve +.PP +To run innotop non-interactively in a pipe-and-filter configuration: +.PP +.Vb 1 +\& innotop \-\-count 5 \-d 1 \-n +.Ve +.PP +To monitor a database on another system using a particular username and password: +.PP +.Vb 1 +\& innotop \-u \-p \-h +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +innotop monitors MySQL servers. Each of its modes shows you a different aspect +of what's happening in the server. For example, there's a mode for monitoring +replication, one for queries, and one for transactions. innotop refreshes its +data periodically, so you see an updating view. +.PP +innotop has lots of features for power users, but you can start and run it with +virtually no configuration. If you're just getting started, see +\&\*(L"QUICK-START\*(R". Press '?' at any time while running innotop for +context-sensitive help. +.SH "QUICK-START" +.IX Header "QUICK-START" +To start innotop, open a terminal or command prompt. If you have installed +innotop on your system, you should be able to just type \*(L"innotop\*(R" and press +Enter; otherwise, you will need to change to innotop's directory and type \*(L"perl +innotop\*(R". +.PP +With no options specified, innotop will attempt to connect to a MySQL server on +localhost using mysql_read_default_group=client for other connection +parameters. If you need to specify a different username and password, use the +\&\-u and \-p options, respectively. To monitor a MySQL database on another +host, use the \-h option. +.PP +After you've connected, innotop should show you something like the following: +.PP +.Vb 1 +\& [RO] Query List (? for help) localhost, 01:11:19, 449.44 QPS, 14/7/163 con/run +\& +\& CXN When Load QPS Slow QCacheHit KCacheHit BpsIn BpsOut +\& localhost Total 0.00 1.07k 697 0.00% 98.17% 476.83k 242.83k +\& +\& CXN Cmd ID User Host DB Time Query +\& localhost Query 766446598 test 10.0.0.1 foo 00:02 INSERT INTO table ( +.Ve +.PP +(This sample is truncated at the right so it will fit on a terminal when running +\&'man innotop') +.PP +If your server is busy, you'll see more output. Notice the first line on the +screen, which tells you that readonly is set to true ([\s-1RO\s0]), what mode you're +in and what server you're connected to. You can change to other modes with +keystrokes; press 'T' to switch to a list of InnoDB transactions, for example. +.PP +Press the '?' key to see what keys are active in the current mode. You can +press any of these keys and innotop will either take the requested action or +prompt you for more input. If your system has Term::ReadLine support, you can +use \s-1TAB\s0 and other keys to auto-complete and edit input. +.PP +To quit innotop, press the 'q' key. +.SH "OPTIONS" +.IX Header "OPTIONS" +innotop is mostly configured via its configuration file, but some of the +configuration options can come from the command line. You can also specify a +file to monitor for InnoDB status output; see \*(L"\s-1MONITORING\s0 A \s-1FILE\s0\*(R" for more +details. +.PP +You can negate some options by prefixing the option name with \-\-no. For +example, \-\-noinc (or \-\-no\-inc) negates \*(L"\-\-inc\*(R". +.IP "\-\-color" 4 +.IX Item "--color" +Enable or disable terminal coloring. Corresponds to the \*(L"color\*(R" config file +setting. +.IP "\-\-config" 4 +.IX Item "--config" +Specifies a configuration file to read. This option is non-sticky, that is to +say it does not persist to the configuration file itself. +.IP "\-\-count" 4 +.IX Item "--count" +Refresh only the specified number of times (ticks) before exiting. Each refresh +is a pause for \*(L"interval\*(R" seconds, followed by requesting data from MySQL +connections and printing it to the terminal. +.IP "\-\-delay" 4 +.IX Item "--delay" +Specifies the amount of time to pause between ticks (refreshes). Corresponds to +the configuration option \*(L"interval\*(R". +.IP "\-\-help" 4 +.IX Item "--help" +Print a summary of command-line usage and exit. +.IP "\-\-host" 4 +.IX Item "--host" +Host to connect to. +.IP "\-\-inc" 4 +.IX Item "--inc" +Specifies whether innotop should display absolute numbers or relative numbers +(offsets from their previous values). Corresponds to the configuration option +\&\*(L"status_inc\*(R". +.IP "\-\-mode" 4 +.IX Item "--mode" +Specifies the mode in which innotop should start. Corresponds to the +configuration option \*(L"mode\*(R". +.IP "\-\-nonint" 4 +.IX Item "--nonint" +Enable non-interactive operation. See \*(L"NON-INTERACTIVE \s-1OPERATION\s0\*(R" for more. +.IP "\-\-password" 4 +.IX Item "--password" +Password to use for connection. +.IP "\-\-port" 4 +.IX Item "--port" +Port to use for connection. +.IP "\-\-skipcentral" 4 +.IX Item "--skipcentral" +Don't read the central configuration file. +.IP "\-\-user" 4 +.IX Item "--user" +User to use for connection. +.IP "\-\-version" 4 +.IX Item "--version" +Output version information and exit. +.IP "\-\-write" 4 +.IX Item "--write" +Sets the configuration option \*(L"readonly\*(R" to 0, making innotop write the +running configuration to ~/.innotop/innotop.conf on exit, if no configuration +file was loaded at start-up. +.SH "HOTKEYS" +.IX Header "HOTKEYS" +innotop is interactive, and you control it with key-presses. +.IP "\(bu" 4 +Uppercase keys switch between modes. +.IP "\(bu" 4 +Lowercase keys initiate some action within the current mode. +.IP "\(bu" 4 +Other keys do something special like change configuration or show the +innotop license. +.PP +Press '?' at any time to see the currently active keys and what they do. +.SH "MODES" +.IX Header "MODES" +Each of innotop's modes retrieves and displays a particular type of data from +the servers you're monitoring. You switch between modes with uppercase keys. +The following is a brief description of each mode, in alphabetical order. To +switch to the mode, press the key listed in front of its heading in the +following list: +.IP "B: InnoDB Buffers" 4 +.IX Item "B: InnoDB Buffers" +This mode displays information about the InnoDB buffer pool, page statistics, +insert buffer, and adaptive hash index. The data comes from \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0. +.Sp +This mode contains the \*(L"buffer_pool\*(R", \*(L"page_statistics\*(R", +\&\*(L"insert_buffers\*(R", and \*(L"adaptive_hash_index\*(R" tables by default. +.IP "C: Command Summary" 4 +.IX Item "C: Command Summary" +This mode is similar to mytop's Command Summary mode. It shows the +\&\*(L"cmd_summary\*(R" table, which looks something like the following: +.Sp +.Vb 8 +\& Command Summary (? for help) localhost, 25+07:16:43, 2.45 QPS, 3 thd, 5.0.40 +\& _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ Command Summary _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ +\& Name Value Pct Last Incr Pct +\& Select_scan 3244858 69.89% 2 100.00% +\& Select_range 1354177 29.17% 0 0.00% +\& Select_full_join 39479 0.85% 0 0.00% +\& Select_full_range_join 4097 0.09% 0 0.00% +\& Select_range_check 0 0.00% 0 0.00% +.Ve +.Sp +The command summary table is built by extracting variables from +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". The variables must be numeric and must match the prefix +given by the \*(L"cmd_filter\*(R" configuration variable. The variables are then +sorted by value descending and compared to the last variable, as shown above. +The percentage columns are percentage of the total of all variables in the +table, so you can see the relative weight of the variables. +.Sp +The example shows what you see if the prefix is \*(L"Select_\*(R". The default +prefix is \*(L"Com_\*(R". You can choose a prefix with the 's' key. +.Sp +It's rather like running \s-1SHOW\s0 \s-1VARIABLES\s0 \s-1LIKE\s0 \*(L"prefix%\*(R" with memory and +nice formatting. +.Sp +Values are aggregated across all servers. The Pct columns are not correctly +aggregated across multiple servers. This is a known limitation of the grouping +algorithm that may be fixed in the future. +.IP "D: InnoDB Deadlocks" 4 +.IX Item "D: InnoDB Deadlocks" +This mode shows the transactions involved in the last InnoDB deadlock. A second +table shows the locks each transaction held and waited for. A deadlock is +caused by a cycle in the waits-for graph, so there should be two locks held and +one waited for unless the deadlock information is truncated. +.Sp +InnoDB puts deadlock information before some other information in the \s-1SHOW\s0 +\&\s-1INNODB\s0 \s-1STATUS\s0 output. If there are a lot of locks, the deadlock information can +grow very large, and there is a limit on the size of the \s-1SHOW\s0 \s-1INNODB\s0 +\&\s-1STATUS\s0 output. A large deadlock can fill the entire output, or even be +truncated, and prevent you from seeing other information at all. If you are +running innotop in another mode, for example T mode, and suddenly you don't see +anything, you might want to check and see if a deadlock has wiped out the data +you need. +.Sp +If it has, you can create a small deadlock to replace the large one. Use the +\&'w' key to 'wipe' the large deadlock with a small one. This will not work +unless you have defined a deadlock table for the connection (see \*(L"\s-1SERVER\s0 +\&\s-1CONNECTIONS\s0\*(R"). +.Sp +You can also configure innotop to automatically detect when a large deadlock +needs to be replaced with a small one (see \*(L"auto_wipe_dl\*(R"). +.Sp +This mode displays the \*(L"deadlock_transactions\*(R" and \*(L"deadlock_locks\*(R" tables +by default. +.IP "F: InnoDB Foreign Key Errors" 4 +.IX Item "F: InnoDB Foreign Key Errors" +This mode shows the last InnoDB foreign key error information, such as the +table where it happened, when and who and what query caused it, and so on. +.Sp +InnoDB has a huge variety of foreign key error messages, and many of them are +just hard to parse. innotop doesn't always do the best job here, but there's +so much code devoted to parsing this messy, unparseable output that innotop is +likely never to be perfect in this regard. If innotop doesn't show you what +you need to see, just look at the status text directly. +.Sp +This mode displays the \*(L"fk_error\*(R" table by default. +.IP "I: InnoDB I/O Info" 4 +.IX Item "I: InnoDB I/O Info" +This mode shows InnoDB's I/O statistics, including the I/O threads, pending I/O, +file I/O miscellaneous, and log statistics. It displays the \*(L"io_threads\*(R", +\&\*(L"pending_io\*(R", \*(L"file_io_misc\*(R", and \*(L"log_statistics\*(R" tables by default. +.IP "L: Locks" 4 +.IX Item "L: Locks" +This mode shows information about current locks. At the moment only InnoDB +locks are supported, and by default you'll only see locks for which transactions +are waiting. This information comes from the \s-1TRANSACTIONS\s0 section of the InnoDB +status text. If you have a very busy server, you may have frequent lock waits; +it helps to be able to see which tables and indexes are the \*(L"hot spot\*(R" for +locks. If your server is running pretty well, this mode should show nothing. +.Sp +You can configure MySQL and innotop to monitor not only locks for which a +transaction is waiting, but those currently held, too. You can do this with the +InnoDB Lock Monitor (). It's +not documented in the MySQL manual, but creating the lock monitor with the +following statement also affects the output of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0, which innotop +uses: +.Sp +.Vb 1 +\& CREATE TABLE innodb_lock_monitor(a int) ENGINE=INNODB; +.Ve +.Sp +This causes InnoDB to print its output to the MySQL file every 16 seconds or so, +as stated in the manual, but it also makes the normal \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 output +include lock information, which innotop can parse and display (that's the +undocumented feature). +.Sp +This means you can do what may have seemed impossible: to a limited extent +(InnoDB truncates some information in the output), you can see which transaction +holds the locks something else is waiting for. You can also enable and disable +the InnoDB Lock Monitor with the key mappings in this mode. +.Sp +This mode displays the \*(L"innodb_locks\*(R" table by default. Here's a sample of +the screen when one connection is waiting for locks another connection holds: +.Sp +.Vb 7 +\& _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ InnoDB Locks _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ +\& CXN ID Type Waiting Wait Active Mode DB Table Index +\& localhost 12 RECORD 1 00:10 00:10 X test t1 PRIMARY +\& localhost 12 TABLE 0 00:10 00:10 IX test t1 +\& localhost 12 RECORD 1 00:10 00:10 X test t1 PRIMARY +\& localhost 11 TABLE 0 00:00 00:25 IX test t1 +\& localhost 11 RECORD 0 00:00 00:25 X test t1 PRIMARY +.Ve +.Sp +You can see the first connection, \s-1ID\s0 12, is waiting for a lock on the \s-1PRIMARY\s0 +key on test.t1, and has been waiting for 10 seconds. The second connection +isn't waiting, because the Waiting column is 0, but it holds locks on the same +index. That tells you connection 11 is blocking connection 12. +.IP "M: Master/Slave Replication Status" 4 +.IX Item "M: Master/Slave Replication Status" +This mode shows the output of \s-1SHOW\s0 \s-1SLAVE\s0 \s-1STATUS\s0 and \s-1SHOW\s0 \s-1MASTER\s0 \s-1STATUS\s0 in three +tables. The first two divide the slave's status into \s-1SQL\s0 and I/O thread status, +and the last shows master status. Filters are applied to eliminate non-slave +servers from the slave tables, and non-master servers from the master table. +.Sp +This mode displays the \*(L"slave_sql_status\*(R", \*(L"slave_io_status\*(R", and +\&\*(L"master_status\*(R" tables by default. +.IP "O: Open Tables" 4 +.IX Item "O: Open Tables" +This section comes from MySQL's \s-1SHOW\s0 \s-1OPEN\s0 \s-1TABLES\s0 command. By default it is +filtered to show tables which are in use by one or more queries, so you can +get a quick look at which tables are 'hot'. You can use this to guess which +tables might be locked implicitly. +.Sp +This mode displays the \*(L"open_tables\*(R" mode by default. +.IP "Q: Query List" 4 +.IX Item "Q: Query List" +This mode displays the output from \s-1SHOW\s0 \s-1FULL\s0 \s-1PROCESSLIST\s0, much like \fBmytop\fR's +query list mode. This mode does \fBnot\fR show InnoDB-related information. This +is probably one of the most useful modes for general usage. +.Sp +There is an informative header that shows general status information about +your server. You can toggle it on and off with the 'h' key. By default, +innotop hides inactive processes and its own process. You can toggle these on +and off with the 'i' and 'a' keys. +.Sp +You can \s-1EXPLAIN\s0 a query from this mode with the 'e' key. This displays the +query's full text, the results of \s-1EXPLAIN\s0, and in newer MySQL versions, even +the optimized query resulting from \s-1EXPLAIN\s0 \s-1EXTENDED\s0. innotop also tries to +rewrite certain queries to make them EXPLAIN-able. For example, \s-1INSERT/SELECT\s0 +statements are rewritable. +.Sp +This mode displays the \*(L"q_header\*(R" and \*(L"processlist\*(R" tables by default. +.IP "R: InnoDB Row Operations and Semaphores" 4 +.IX Item "R: InnoDB Row Operations and Semaphores" +This mode shows InnoDB row operations, row operation miscellaneous, semaphores, +and information from the wait array. It displays the \*(L"row_operations\*(R", +\&\*(L"row_operation_misc\*(R", \*(L"semaphores\*(R", and \*(L"wait_array\*(R" tables by default. +.IP "S: Variables & Status" 4 +.IX Item "S: Variables & Status" +This mode calculates statistics, such as queries per second, and prints them out +in several different styles. You can show absolute values, or incremental values +between ticks. +.Sp +You can switch between the views by pressing a key. The 's' key prints a +single line each time the screen updates, in the style of \fBvmstat\fR. The 'g' +key changes the view to a graph of the same numbers, sort of like \fBtload\fR. +The 'v' key changes the view to a pivoted table of variable names on the left, +with successive updates scrolling across the screen from left to right. You can +choose how many updates to put on the screen with the \*(L"num_status_sets\*(R" +configuration variable. +.Sp +Headers may be abbreviated to fit on the screen in interactive operation. You +choose which variables to display with the 'c' key, which selects from +predefined sets, or lets you create your own sets. You can edit the current set +with the 'e' key. +.Sp +This mode doesn't really display any tables like other modes. Instead, it uses +a table definition to extract and format the data, but it then transforms the +result in special ways before outputting it. It uses the \*(L"var_status\*(R" table +definition for this. +.IP "T: InnoDB Transactions" 4 +.IX Item "T: InnoDB Transactions" +This mode shows transactions from the InnoDB monitor's output, in \fBtop\fR\-like +format. This mode is the reason I wrote innotop. +.Sp +You can kill queries or processes with the 'k' and 'x' keys, and \s-1EXPLAIN\s0 a query +with the 'e' or 'f' keys. InnoDB doesn't print the full query in transactions, +so explaining may not work right if the query is truncated. +.Sp +The informational header can be toggled on and off with the 'h' key. By +default, innotop hides inactive transactions and its own transaction. You can +toggle this on and off with the 'i' and 'a' keys. +.Sp +This mode displays the \*(L"t_header\*(R" and \*(L"innodb_transactions\*(R" tables by +default. +.SH "INNOTOP STATUS" +.IX Header "INNOTOP STATUS" +The first line innotop displays is a \*(L"status bar\*(R" of sorts. What it contains +depends on the mode you're in, and what servers you're monitoring. The first +few words are always [\s-1RO\s0] (if readonly is set to 1), the innotop mode, such as +\&\*(L"InnoDB Txns\*(R" for T mode, followed by a reminder to press '?' for help at any +time. +.SS "\s-1ONE\s0 \s-1SERVER\s0" +.IX Subsection "ONE SERVER" +The simplest case is when you're monitoring a single server. In this case, the +name of the connection is next on the status line. This is the name you gave +when you created the connection \*(-- most likely the MySQL server's hostname. +This is followed by the server's uptime. +.PP +If you're in an InnoDB mode, such as T or B, the next word is \*(L"InnoDB\*(R" followed +by some information about the \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 output used to render the +screen. The first word is the number of seconds since the last \s-1SHOW\s0 \s-1INNODB\s0 +\&\s-1STATUS\s0, which InnoDB uses to calculate some per-second statistics. The next is +a smiley face indicating whether the InnoDB output is truncated. If the smiley +face is a :\-), all is well; there is no truncation. A :^| means the transaction +list is so long, InnoDB has only printed out some of the transactions. Finally, +a frown :\-( means the output is incomplete, which is probably due to a deadlock +printing too much lock information (see \*(L"D: InnoDB Deadlocks\*(R"). +.PP +The next two words indicate the server's queries per second (\s-1QPS\s0) and how many +threads (connections) exist. Finally, the server's version number is the last +thing on the line. +.SS "\s-1MULTIPLE\s0 \s-1SERVERS\s0" +.IX Subsection "MULTIPLE SERVERS" +If you are monitoring multiple servers (see \*(L"\s-1SERVER\s0 \s-1CONNECTIONS\s0\*(R"), the status +line does not show any details about individual servers. Instead, it shows the +names of the connections that are active. Again, these are connection names you +specified, which are likely to be the server's hostname. A connection that has +an error is prefixed with an exclamation point. +.PP +If you are monitoring a group of servers (see \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R"), the status +line shows the name of the group. If any connection in the group has an +error, the group's name is followed by the fraction of the connections that +don't have errors. +.PP +See \*(L"\s-1ERROR\s0 \s-1HANDLING\s0\*(R" for more details about innotop's error handling. +.SS "\s-1MONITORING\s0 A \s-1FILE\s0" +.IX Subsection "MONITORING A FILE" +If you give a filename on the command line, innotop will not connect to \s-1ANY\s0 +servers at all. It will watch the specified file for InnoDB status output and +use that as its data source. It will always show a single connection called +\&'file'. And since it can't connect to a server, it can't determine how long the +server it's monitoring has been up; so it calculates the server's uptime as time +since innotop started running. +.SH "SERVER ADMINISTRATION" +.IX Header "SERVER ADMINISTRATION" +While innotop is primarily a monitor that lets you watch and analyze your +servers, it can also send commands to servers. The most frequently useful +commands are killing queries and stopping or starting slaves. +.PP +You can kill a connection, or in newer versions of MySQL kill a query but not a +connection, from \*(L"Q: Query List\*(R" and \*(L"T: InnoDB Transactions\*(R" modes. +Press 'k' to issue a \s-1KILL\s0 command, or 'x' to issue a \s-1KILL\s0 \s-1QUERY\s0 command. +innotop will prompt you for the server and/or connection \s-1ID\s0 to kill (innotop +does not prompt you if there is only one possible choice for any input). +innotop pre-selects the longest-running query, or the oldest connection. +Confirm the command with 'y'. +.PP +In \*(L"Slave Replication Status\*(R"\*(L" in \*(R"M: Master mode, you can start and stop slaves +with the 'a' and 'o' keys, respectively. You can send these commands to many +slaves at once. innotop fills in a default command of \s-1START\s0 \s-1SLAVE\s0 or \s-1STOP\s0 \s-1SLAVE\s0 +for you, but you can actually edit the command and send anything you wish, such +as \s-1SET\s0 \s-1GLOBAL\s0 SQL_SLAVE_SKIP_COUNTER=1 to make the slave skip one binlog event +when it starts. +.PP +You can also ask innotop to calculate the earliest binlog in use by any slave +and issue a \s-1PURGE\s0 \s-1MASTER\s0 \s-1LOGS\s0 on the master. Use the 'b' key for this. innotop +will prompt you for a master to run the command on, then prompt you for the +connection names of that master's slaves (there is no way for innotop to +determine this reliably itself). innotop will find the minimum binlog in use by +these slave connections and suggest it as the argument to \s-1PURGE\s0 \s-1MASTER\s0 \s-1LOGS\s0. +.SH "SERVER CONNECTIONS" +.IX Header "SERVER CONNECTIONS" +When you create a server connection using '@', innotop asks you for a series of +inputs, as follows: +.IP "\s-1DSN\s0" 4 +.IX Item "DSN" +A \s-1DSN\s0 is a Data Source Name, which is the initial argument passed to the \s-1DBI\s0 +module for connecting to a server. It is usually of the form +.Sp +.Vb 1 +\& DBI:mysql:;mysql_read_default_group=mysql;host=HOSTNAME +.Ve +.Sp +Since this \s-1DSN\s0 is passed to the DBD::mysql driver, you should read the driver's +documentation at \*(L"/search.cpan.org/dist/DBD\-mysql/lib/DBD/mysql.pm\*(R"\*(L" in \*(R"http: for +the exact details on all the options you can pass the driver in the \s-1DSN\s0. You +can read more about \s-1DBI\s0 at , and especially at +. +.Sp +The mysql_read_default_group=mysql option lets the \s-1DBD\s0 driver read your MySQL +options files, such as ~/.my.cnf on UNIX-ish systems. You can use this to avoid +specifying a username or password for the connection. +.IP "InnoDB Deadlock Table" 4 +.IX Item "InnoDB Deadlock Table" +This optional item tells innotop a table name it can use to deliberately create +a small deadlock (see \*(L"D: InnoDB Deadlocks\*(R"). If you specify this option, +you just need to be sure the table doesn't exist, and that innotop can create +and drop the table with the InnoDB storage engine. You can safely omit or just +accept the default if you don't intend to use this. +.IP "Username" 4 +.IX Item "Username" +innotop will ask you if you want to specify a username. If you say 'y', it will +then prompt you for a user name. If you have a MySQL option file that specifies +your username, you don't have to specify a username. +.Sp +The username defaults to your login name on the system you're running innotop on. +.IP "Password" 4 +.IX Item "Password" +innotop will ask you if you want to specify a password. Like the username, the +password is optional, but there's an additional prompt that asks if you want to +save the password in the innotop configuration file. If you don't save it in +the configuration file, innotop will prompt you for a password each time it +starts. Passwords in the innotop configuration file are saved in plain text, +not encrypted in any way. +.PP +Once you finish answering these questions, you should be connected to a server. +But innotop isn't limited to monitoring a single server; you can define many +server connections and switch between them by pressing the '@' key. See +\&\*(L"\s-1SWITCHING\s0 \s-1BETWEEN\s0 \s-1CONNECTIONS\s0\*(R". +.SH "SERVER GROUPS" +.IX Header "SERVER GROUPS" +If you have multiple MySQL instances, you can put them into named groups, such +as 'all', 'masters', and 'slaves', which innotop can monitor all together. +.PP +You can choose which group to monitor with the '#' key, and you can press the +\&\s-1TAB\s0 key to switch to the next group. If you're not currently monitoring a +group, pressing \s-1TAB\s0 selects the first group. +.PP +To create a group, press the '#' key and type the name of your new group, then +type the names of the connections you want the group to contain. +.SH "SWITCHING BETWEEN CONNECTIONS" +.IX Header "SWITCHING BETWEEN CONNECTIONS" +innotop lets you quickly switch which servers you're monitoring. The most basic +way is by pressing the '@' key and typing the name(s) of the connection(s) you +want to use. This setting is per-mode, so you can monitor different connections +in each mode, and innotop remembers which connections you choose. +.PP +You can quickly switch to the 'next' connection in alphabetical order with the +\&'n' key. If you're monitoring a server group (see \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R") this will +switch to the first connection. +.PP +You can also type many connection names, and innotop will fetch and display data +from them all. Just separate the connection names with spaces, for example +\&\*(L"server1 server2.\*(R" Again, if you type the name of a connection that doesn't +exist, innotop will prompt you for connection information and create the +connection. +.PP +Another way to monitor multiple connections at once is with server groups. You +can use the \s-1TAB\s0 key to switch to the 'next' group in alphabetical order, or if +you're not monitoring any groups, \s-1TAB\s0 will switch to the first group. +.PP +innotop does not fetch data in parallel from connections, so if you are +monitoring a large group or many connections, you may notice increased delay +between ticks. +.PP +When you monitor more than one connection, innotop's status bar changes. See +\&\*(L"\s-1INNOTOP\s0 \s-1STATUS\s0\*(R". +.SH "ERROR HANDLING" +.IX Header "ERROR HANDLING" +Error handling is not that important when monitoring a single connection, but is +crucial when you have many active connections. A crashed server or lost +connection should not crash innotop. As a result, innotop will continue to run +even when there is an error; it just won't display any information from the +connection that had an error. Because of this, innotop's behavior might confuse +you. It's a feature, not a bug! +.PP +innotop does not continue to query connections that have errors, because they +may slow innotop and make it hard to use, especially if the error is a problem +connecting and causes a long time-out. Instead, innotop retries the connection +occasionally to see if the error still exists. If so, it will wait until some +point in the future. The wait time increases in ticks as the Fibonacci series, +so it tries less frequently as time passes. +.PP +Since errors might only happen in certain modes because of the \s-1SQL\s0 commands +issued in those modes, innotop keeps track of which mode caused the error. If +you switch to a different mode, innotop will retry the connection instead of +waiting. +.PP +By default innotop will display the problem in red text at the bottom of the +first table on the screen. You can disable this behavior with the +\&\*(L"show_cxn_errors_in_tbl\*(R" configuration option, which is enabled by default. +If the \*(L"debug\*(R" option is enabled, innotop will display the error at the +bottom of every table, not just the first. And if \*(L"show_cxn_errors\*(R" is +enabled, innotop will print the error text to \s-1STDOUT\s0 as well. Error messages +might only display in the mode that caused the error, depending on the mode and +whether innotop is avoiding querying that connection. +.SH "NON-INTERACTIVE OPERATION" +.IX Header "NON-INTERACTIVE OPERATION" +You can run innotop in non-interactive mode, in which case it is entirely +controlled from the configuration file and command-line options. To start +innotop in non-interactive mode, give the L\*(L"<\-\-nonint\*(R"> command-line option. +This changes innotop's behavior in the following ways: +.IP "\(bu" 4 +Certain Perl modules are not loaded. Term::Readline is not loaded, since +innotop doesn't prompt interactively. Term::ANSIColor and Win32::Console::ANSI +modules are not loaded. Term::ReadKey is still used, since innotop may have to +prompt for connection passwords when starting up. +.IP "\(bu" 4 +innotop does not clear the screen after each tick. +.IP "\(bu" 4 +innotop does not persist any changes to the configuration file. +.IP "\(bu" 4 +If \*(L"\-\-count\*(R" is given and innotop is in incremental mode (see \*(L"status_inc\*(R" +and \*(L"\-\-inc\*(R"), innotop actually refreshes one more time than specified so it +can print incremental statistics. This suppresses output during the first +tick, so innotop may appear to hang. +.IP "\(bu" 4 +innotop only displays the first table in each mode. This is so the output can +be easily processed with other command-line utilities such as awk and sed. To +change which tables display in each mode, see \*(L"\s-1TABLES\s0\*(R". Since \*(L"Q: Query +List\*(R" mode is so important, innotop automatically disables the \*(L"q_header\*(R" +table. This ensures you'll see the \*(L"processlist\*(R" table, even if you have +innotop configured to show the q_header table during interactive operation. +Similarly, in \*(L"T: InnoDB Transactions\*(R" mode, the \*(L"t_header\*(R" table is +suppressed so you see only the \*(L"innodb_transactions\*(R" table. +.IP "\(bu" 4 +All output is tab-separated instead of being column-aligned with whitespace, and +innotop prints the full contents of each table instead of only printing one +screenful at a time. +.IP "\(bu" 4 +innotop only prints column headers once instead of every tick (see +\&\*(L"hide_hdr\*(R"). innotop does not print table captions (see +\&\*(L"display_table_captions\*(R"). innotop ensures there are no empty lines in the +output. +.IP "\(bu" 4 +innotop does not honor the \*(L"shorten\*(R" transformation, which normally shortens +some numbers to human-readable formats. +.IP "\(bu" 4 +innotop does not print a status line (see \*(L"\s-1INNOTOP\s0 \s-1STATUS\s0\*(R"). +.SH "CONFIGURING" +.IX Header "CONFIGURING" +Nearly everything about innotop is configurable. Most things are possible to +change with built-in commands, but you can also edit the configuration file. +.PP +While running innotop, press the '$' key to bring up the configuration editing +dialog. Press another key to select the type of data you want to edit: +.IP "S: Statement Sleep Times" 4 +.IX Item "S: Statement Sleep Times" +Edits \s-1SQL\s0 statement sleep delays, which make innotop pause for the specified +amount of time after executing a statement. See \*(L"\s-1SQL\s0 \s-1STATEMENTS\s0\*(R" for a +definition of each statement and what it does. By default innotop does not +delay after any statements. +.Sp +This feature is included so you can customize the side-effects caused by +monitoring your server. You may not see any effects, but some innotop users +have noticed that certain MySQL versions under very high load with InnoDB +enabled take longer than usual to execute \s-1SHOW\s0 \s-1GLOBAL\s0 \s-1STATUS\s0. If innotop calls +\&\s-1SHOW\s0 \s-1FULL\s0 \s-1PROCESSLIST\s0 immediately afterward, the processlist contains more +queries than the machine actually averages at any given moment. Configuring +innotop to pause briefly after calling \s-1SHOW\s0 \s-1GLOBAL\s0 \s-1STATUS\s0 alleviates this +effect. +.Sp +Sleep times are stored in the \*(L"stmt_sleep_times\*(R" section of the configuration +file. Fractional-second sleeps are supported, subject to your hardware's +limitations. +.IP "c: Edit Columns" 4 +.IX Item "c: Edit Columns" +Starts the table editor on one of the displayed tables. See \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R". +An alternative way to start the table editor without entering the configuration +dialog is with the '^' key. +.IP "g: General Configuration" 4 +.IX Item "g: General Configuration" +Starts the configuration editor to edit global and mode-specific configuration +variables (see \*(L"\s-1MODES\s0\*(R"). innotop prompts you to choose a variable from among +the global and mode-specific ones depending on the current mode. +.IP "k: Row-Coloring Rules" 4 +.IX Item "k: Row-Coloring Rules" +Starts the row-coloring rules editor on one of the displayed table(s). See +\&\*(L"\s-1COLORS\s0\*(R" for details. +.IP "p: Manage Plugins" 4 +.IX Item "p: Manage Plugins" +Starts the plugin configuration editor. See \*(L"\s-1PLUGINS\s0\*(R" for details. +.IP "s: Server Groups" 4 +.IX Item "s: Server Groups" +Lets you create and edit server groups. See \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R". +.IP "t: Choose Displayed Tables" 4 +.IX Item "t: Choose Displayed Tables" +Lets you choose which tables to display in this mode. See \*(L"\s-1MODES\s0\*(R" and +\&\*(L"\s-1TABLES\s0\*(R". +.SH "CONFIGURATION FILE" +.IX Header "CONFIGURATION FILE" +innotop's default configuration file locations are \f(CW$HOME\fR/.innotop and +/etc/innotop/innotop.conf, and they are looked for in that order. If the first +configuration file exists, the second will not be processed. Those can be +overridden with the \*(L"\-\-config\*(R" command-line option. You can edit it by hand +safely, however innotop reads the configuration file when it starts, and, if +readonly is set to 0, writes it out again when it exits. Thus, if readonly is +set to 0, any changes you make by hand while innotop is running will be lost. +.PP +innotop doesn't store its entire configuration in the configuration file. It +has a huge set of default configuration values that it holds only in memory, +and the configuration file only overrides these defaults. When you customize a +default setting, innotop notices, and then stores the customizations into the +file. This keeps the file size down, makes it easier to edit, and makes +upgrades easier. +.PP +A configuration file is read-only be default. You can override that with +\&\*(L"\-\-write\*(R". See \*(L"readonly\*(R". +.PP +The configuration file is arranged into sections like an \s-1INI\s0 file. Each +section begins with [section\-name] and ends with [/section\-name]. Each +section's entries have a different syntax depending on the data they need to +store. You can put comments in the file; any line that begins with a # +character is a comment. innotop will not read the comments, so it won't write +them back out to the file when it exits. Comments in read-only configuration +files are still useful, though. +.PP +The first line in the file is innotop's version number. This lets innotop +notice when the file format is not backwards-compatible, and upgrade smoothly +without destroying your customized configuration. +.PP +The following list describes each section of the configuration file and the data +it contains: +.IP "general" 4 +.IX Item "general" +The 'general' section contains global configuration variables and variables that +may be mode-specific, but don't belong in any other section. The syntax is a +simple key=value list. innotop writes a comment above each value to help you +edit the file by hand. +.RS 4 +.IP "S_func" 4 +.IX Item "S_func" +Controls S mode presentation (see \*(L"S: Variables & Status\*(R"). If g, values are +graphed; if s, values are like vmstat; if p, values are in a pivoted table. +.IP "S_set" 4 +.IX Item "S_set" +Specifies which set of variables to display in \*(L"S: Variables & Status\*(R" mode. +See \*(L"\s-1VARIABLE\s0 \s-1SETS\s0\*(R". +.IP "auto_wipe_dl" 4 +.IX Item "auto_wipe_dl" +Instructs innotop to automatically wipe large deadlocks when it notices them. +When this happens you may notice a slight delay. At the next tick, you will +usually see the information that was being truncated by the large deadlock. +.IP "charset" 4 +.IX Item "charset" +Specifies what kind of characters to allow through the \*(L"no_ctrl_char\*(R" +transformation. This keeps non-printable characters from confusing a +terminal when you monitor queries that contain binary data, such as images. +.Sp +The default is 'ascii', which considers anything outside normal \s-1ASCII\s0 to be a +control character. The other allowable values are 'unicode' and 'none'. 'none' +considers every character a control character, which can be useful for +collapsing \s-1ALL\s0 text fields in queries. +.IP "cmd_filter" 4 +.IX Item "cmd_filter" +This is the prefix that filters variables in \*(L"C: Command Summary\*(R" mode. +.IP "color" 4 +.IX Item "color" +Whether terminal coloring is permitted. +.IP "cxn_timeout" 4 +.IX Item "cxn_timeout" +On MySQL versions 4.0.3 and newer, this variable is used to set the connection's +timeout, so MySQL doesn't close the connection if it is not used for a while. +This might happen because a connection isn't monitored in a particular mode, for +example. +.IP "debug" 4 +.IX Item "debug" +This option enables more verbose errors and makes innotop more strict in some +places. It can help in debugging filters and other user-defined code. It also +makes innotop write a lot of information to \*(L"debugfile\*(R" when there is a +crash. +.IP "debugfile" 4 +.IX Item "debugfile" +A file to which innotop will write information when there is a crash. See +\&\*(L"\s-1FILES\s0\*(R". +.IP "display_table_captions" 4 +.IX Item "display_table_captions" +innotop displays a table caption above most tables. This variable suppresses or +shows captions on all tables globally. Some tables are configured with the +hide_caption property, which overrides this. +.IP "global" 4 +.IX Item "global" +Whether to show \s-1GLOBAL\s0 variables and status. innotop only tries to do this on +servers which support the \s-1GLOBAL\s0 option to \s-1SHOW\s0 \s-1VARIABLES\s0 and \s-1SHOW\s0 \s-1STATUS\s0. In +some MySQL versions, you need certain privileges to do this; if you don't have +them, innotop will not be able to fetch any variable and status data. This +configuration variable lets you run innotop and fetch what data you can even +without the elevated privileges. +.Sp +I can no longer find or reproduce the situation where \s-1GLOBAL\s0 wasn't allowed, but +I know there was one. +.IP "graph_char" 4 +.IX Item "graph_char" +Defines the character to use when drawing graphs in \*(L"S: Variables & Status\*(R" +mode. +.IP "header_highlight" 4 +.IX Item "header_highlight" +Defines how to highlight column headers. This only works if Term::ANSIColor is +available. Valid values are 'bold' and 'underline'. +.IP "hide_hdr" 4 +.IX Item "hide_hdr" +Hides column headers globally. +.IP "interval" 4 +.IX Item "interval" +The interval at which innotop will refresh its data (ticks). The interval is +implemented as a sleep time between ticks, so the true interval will vary +depending on how long it takes innotop to fetch and render data. +.Sp +This variable accepts fractions of a second. +.IP "mode" 4 +.IX Item "mode" +The mode in which innotop should start. Allowable arguments are the same as the +key presses that select a mode interactively. See \*(L"\s-1MODES\s0\*(R". +.IP "num_digits" 4 +.IX Item "num_digits" +How many digits to show in fractional numbers and percents. This variable's +range is between 0 and 9 and can be set directly from \*(L"S: Variables & Status\*(R" +mode with the '+' and '\-' keys. It is used in the \*(L"set_precision\*(R", +\&\*(L"shorten\*(R", and \*(L"percent\*(R" transformations. +.IP "num_status_sets" 4 +.IX Item "num_status_sets" +Controls how many sets of status variables to display in pivoted \*(L"S: Variables +& Status\*(R" mode. It also controls the number of old sets of variables innotop +keeps in its memory, so the larger this variable is, the more memory innotop +uses. +.IP "plugin_dir" 4 +.IX Item "plugin_dir" +Specifies where plugins can be found. By default, innotop stores plugins in the +\&'plugins' subdirectory of your innotop configuration directory. +.IP "readonly" 4 +.IX Item "readonly" +Whether the configuration file is readonly. This cannot be set interactively. +.IP "show_cxn_errors" 4 +.IX Item "show_cxn_errors" +Makes innotop print connection errors to \s-1STDOUT\s0. See \*(L"\s-1ERROR\s0 \s-1HANDLING\s0\*(R". +.IP "show_cxn_errors_in_tbl" 4 +.IX Item "show_cxn_errors_in_tbl" +Makes innotop display connection errors as rows in the first table on screen. +See \*(L"\s-1ERROR\s0 \s-1HANDLING\s0\*(R". +.IP "show_percent" 4 +.IX Item "show_percent" +Adds a '%' character after the value returned by the \*(L"percent\*(R" +transformation. +.IP "show_statusbar" 4 +.IX Item "show_statusbar" +Controls whether to show the status bar in the display. See \*(L"\s-1INNOTOP\s0 +\&\s-1STATUS\s0\*(R". +.IP "skip_innodb" 4 +.IX Item "skip_innodb" +Disables fetching \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0, in case your server(s) do not have InnoDB +enabled and you don't want innotop to try to fetch it. This can also be useful +when you don't have the \s-1SUPER\s0 privilege, required to run \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0. +.IP "status_inc" 4 +.IX Item "status_inc" +Whether to show absolute or incremental values for status variables. +Incremental values are calculated as an offset from the last value innotop saw +for that variable. This is a global setting, but will probably become +mode-specific at some point. Right now it is honored a bit inconsistently; some +modes don't pay attention to it. +.RE +.RS 4 +.RE +.IP "plugins" 4 +.IX Item "plugins" +This section holds a list of package names of active plugins. If the plugin +exists, innotop will activate it. See \*(L"\s-1PLUGINS\s0\*(R" for more information. +.IP "filters" 4 +.IX Item "filters" +This section holds user-defined filters (see \*(L"\s-1FILTERS\s0\*(R"). Each line is in the +format filter_name=text='filter text' tbls='table list'. +.Sp +The filter text is the text of the subroutine's code. The table list is a list +of tables to which the filter can apply. By default, user-defined filters apply +to the table for which they were created, but you can manually override that by +editing the definition in the configuration file. +.IP "active_filters" 4 +.IX Item "active_filters" +This section stores which filters are active on each table. Each line is in the +format table_name=filter_list. +.IP "tbl_meta" 4 +.IX Item "tbl_meta" +This section stores user-defined or user-customized columns (see \*(L"\s-1COLUMNS\s0\*(R"). +Each line is in the format col_name=properties, where the properties are a +name=quoted\-value list. +.IP "connections" 4 +.IX Item "connections" +This section holds the server connections you have defined. Each line is in +the format name=properties, where the properties are a name=value list. The +properties are self-explanatory, and the only one that is treated specially is +\&'pass' which is only present if 'savepass' is set. This section of the +configuration file will be skipped if any \s-1DSN\s0, username, or password +command-line options are used. See \*(L"\s-1SERVER\s0 \s-1CONNECTIONS\s0\*(R". +.IP "active_connections" 4 +.IX Item "active_connections" +This section holds a list of which connections are active in each mode. Each +line is in the format mode_name=connection_list. +.IP "server_groups" 4 +.IX Item "server_groups" +This section holds server groups. Each line is in the format +name=connection_list. See \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R". +.IP "active_server_groups" 4 +.IX Item "active_server_groups" +This section holds a list of which server group is active in each mode. Each +line is in the format mode_name=server_group. +.IP "max_values_seen" 4 +.IX Item "max_values_seen" +This section holds the maximum values seen for variables. This is used to scale +the graphs in \*(L"S: Variables & Status\*(R" mode. Each line is in the format +name=value. +.IP "active_columns" 4 +.IX Item "active_columns" +This section holds table column lists. Each line is in the format +tbl_name=column_list. See \*(L"\s-1COLUMNS\s0\*(R". +.IP "sort_cols" 4 +.IX Item "sort_cols" +This section holds the sort definition. Each line is in the format +tbl_name=column_list. If a column is prefixed with '\-', that column sorts +descending. See \*(L"\s-1SORTING\s0\*(R". +.IP "visible_tables" 4 +.IX Item "visible_tables" +This section defines which tables are visible in each mode. Each line is in the +format mode_name=table_list. See \*(L"\s-1TABLES\s0\*(R". +.IP "varsets" 4 +.IX Item "varsets" +This section defines variable sets for use in \*(L"S: Status & Variables\*(R" mode. +Each line is in the format name=variable_list. See \*(L"\s-1VARIABLE\s0 \s-1SETS\s0\*(R". +.IP "colors" 4 +.IX Item "colors" +This section defines colorization rules. Each line is in the format +tbl_name=property_list. See \*(L"\s-1COLORS\s0\*(R". +.IP "stmt_sleep_times" 4 +.IX Item "stmt_sleep_times" +This section contains statement sleep times. Each line is in the format +statement_name=sleep_time. See \*(L"S: Statement Sleep Times\*(R". +.IP "group_by" 4 +.IX Item "group_by" +This section contains column lists for table group_by expressions. Each line is +in the format tbl_name=column_list. See \*(L"\s-1GROUPING\s0\*(R". +.SH "CUSTOMIZING" +.IX Header "CUSTOMIZING" +You can customize innotop a great deal. For example, you can: +.IP "\(bu" 4 +Choose which tables to display, and in what order. +.IP "\(bu" 4 +Choose which columns are in those tables, and create new columns. +.IP "\(bu" 4 +Filter which rows display with built-in filters, user-defined filters, and +quick-filters. +.IP "\(bu" 4 +Sort the rows to put important data first or group together related rows. +.IP "\(bu" 4 +Highlight rows with color. +.IP "\(bu" 4 +Customize the alignment, width, and formatting of columns, and apply +transformations to columns to extract parts of their values or format the values +as you wish (for example, shortening large numbers to familiar units). +.IP "\(bu" 4 +Design your own expressions to extract and combine data as you need. This gives +you unlimited flexibility. +.PP +All these and more are explained in the following sections. +.SS "\s-1TABLES\s0" +.IX Subsection "TABLES" +A table is what you'd expect: a collection of columns. It also has some other +properties, such as a caption. Filters, sorting rules, and colorization rules +belong to tables and are covered in later sections. +.PP +Internally, table meta-data is defined in a data structure called \f(CW%tbl_meta\fR. +This hash holds all built-in table definitions, which contain a lot of default +instructions to innotop. The meta-data includes the caption, a list of columns +the user has customized, a list of columns, a list of visible columns, a list of +filters, color rules, a sort-column list, sort direction, and some information +about the table's data sources. Most of this is customizable via the table +editor (see \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R"). +.PP +You can choose which tables to show by pressing the '$' key. See \*(L"\s-1MODES\s0\*(R" and +\&\*(L"\s-1TABLES\s0\*(R". +.PP +The table life-cycle is as follows: +.IP "\(bu" 4 +Each table begins with a data source, which is an array of hashes. See below +for details on data sources. +.IP "\(bu" 4 +Each element of the data source becomes a row in the final table. +.IP "\(bu" 4 +For each element in the data source, innotop extracts values from the source and +creates a row. This row is another hash, which later steps will refer to as +\&\f(CW$set\fR. The values innotop extracts are determined by the table's columns. Each +column has an extraction subroutine, compiled from an expression (see +\&\*(L"\s-1EXPRESSIONS\s0\*(R"). The resulting row is a hash whose keys are named the same as +the column name. +.IP "\(bu" 4 +innotop filters the rows, removing those that don't need to be displayed. See +\&\*(L"\s-1FILTERS\s0\*(R". +.IP "\(bu" 4 +innotop sorts the rows. See \*(L"\s-1SORTING\s0\*(R". +.IP "\(bu" 4 +innotop groups the rows together, if specified. See \*(L"\s-1GROUPING\s0\*(R". +.IP "\(bu" 4 +innotop colorizes the rows. See \*(L"\s-1COLORS\s0\*(R". +.IP "\(bu" 4 +innotop transforms the column values in each row. See \*(L"\s-1TRANSFORMATIONS\s0\*(R". +.IP "\(bu" 4 +innotop optionally pivots the rows (see \*(L"\s-1PIVOTING\s0\*(R"), then filters and sorts +them. +.IP "\(bu" 4 +innotop formats and justifies the rows as a table. During this step, innotop +applies further formatting to the column values, including alignment, maximum +and minimum widths. innotop also does final error checking to ensure there are +no crashes due to undefined values. innotop then adds a caption if specified, +and the table is ready to print. +.PP +The lifecycle is slightly different if the table is pivoted, as noted above. To +clarify, if the table is pivoted, the process is extract, group, transform, +pivot, filter, sort, create. If it's not pivoted, the process is extract, +filter, sort, group, color, transform, create. This slightly convoluted process +doesn't map all that well to \s-1SQL\s0, but pivoting complicates things pretty +thoroughly. Roughly speaking, filtering and sorting happen as late as needed to +effect the final result as you might expect, but as early as possible for +efficiency. +.PP +Each built-in table is described below: +.IP "adaptive_hash_index" 4 +.IX Item "adaptive_hash_index" +Displays data about InnoDB's adaptive hash index. Data source: +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "buffer_pool" 4 +.IX Item "buffer_pool" +Displays data about InnoDB's buffer pool. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "cmd_summary" 4 +.IX Item "cmd_summary" +Displays weighted status variables. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "deadlock_locks" 4 +.IX Item "deadlock_locks" +Shows which locks were held and waited for by the last detected deadlock. Data +source: \*(L"\s-1DEADLOCK_LOCKS\s0\*(R". +.IP "deadlock_transactions" 4 +.IX Item "deadlock_transactions" +Shows transactions involved in the last detected deadlock. Data source: +\&\*(L"\s-1DEADLOCK_TRANSACTIONS\s0\*(R". +.IP "explain" 4 +.IX Item "explain" +Shows the output of \s-1EXPLAIN\s0. Data source: \*(L"\s-1EXPLAIN\s0\*(R". +.IP "file_io_misc" 4 +.IX Item "file_io_misc" +Displays data about InnoDB's file and I/O operations. Data source: +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "fk_error" 4 +.IX Item "fk_error" +Displays various data about InnoDB's last foreign key error. Data source: +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "innodb_locks" 4 +.IX Item "innodb_locks" +Displays InnoDB locks. Data source: \*(L"\s-1INNODB_LOCKS\s0\*(R". +.IP "innodb_transactions" 4 +.IX Item "innodb_transactions" +Displays data about InnoDB's current transactions. Data source: +\&\*(L"\s-1INNODB_TRANSACTIONS\s0\*(R". +.IP "insert_buffers" 4 +.IX Item "insert_buffers" +Displays data about InnoDB's insert buffer. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "io_threads" 4 +.IX Item "io_threads" +Displays data about InnoDB's I/O threads. Data source: \*(L"\s-1IO_THREADS\s0\*(R". +.IP "log_statistics" 4 +.IX Item "log_statistics" +Displays data about InnoDB's logging system. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "master_status" 4 +.IX Item "master_status" +Displays replication master status. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "open_tables" 4 +.IX Item "open_tables" +Displays open tables. Data source: \*(L"\s-1OPEN_TABLES\s0\*(R". +.IP "page_statistics" 4 +.IX Item "page_statistics" +Displays InnoDB page statistics. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "pending_io" 4 +.IX Item "pending_io" +Displays InnoDB pending I/O operations. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "processlist" 4 +.IX Item "processlist" +Displays current MySQL processes (threads/connections). Data source: +\&\*(L"\s-1PROCESSLIST\s0\*(R". +.IP "q_header" 4 +.IX Item "q_header" +Displays various status values. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "row_operation_misc" 4 +.IX Item "row_operation_misc" +Displays data about InnoDB's row operations. Data source: +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "row_operations" 4 +.IX Item "row_operations" +Displays data about InnoDB's row operations. Data source: +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "semaphores" 4 +.IX Item "semaphores" +Displays data about InnoDB's semaphores and mutexes. Data source: +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "slave_io_status" 4 +.IX Item "slave_io_status" +Displays data about the slave I/O thread. Data source: +\&\*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "slave_sql_status" 4 +.IX Item "slave_sql_status" +Displays data about the slave \s-1SQL\s0 thread. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "t_header" 4 +.IX Item "t_header" +Displays various InnoDB status values. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "var_status" 4 +.IX Item "var_status" +Displays user-configurable data. Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R". +.IP "wait_array" 4 +.IX Item "wait_array" +Displays data about InnoDB's \s-1OS\s0 wait array. Data source: \*(L"\s-1OS_WAIT_ARRAY\s0\*(R". +.SS "\s-1COLUMNS\s0" +.IX Subsection "COLUMNS" +Columns belong to tables. You can choose a table's columns by pressing the '^' +key, which starts the \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R" and lets you choose and edit columns. +Pressing 'e' from within the table editor lets you edit the column's properties: +.IP "\(bu" 4 +hdr: a column header. This appears in the first row of the table. +.IP "\(bu" 4 +just: justification. '\-' means left-justified and '' means right-justified, +just as with printf formatting codes (not a coincidence). +.IP "\(bu" 4 +dec: whether to further align the column on the decimal point. +.IP "\(bu" 4 +num: whether the column is numeric. This affects how values are sorted +(lexically or numerically). +.IP "\(bu" 4 +label: a small note about the column, which appears in dialogs that help the +user choose columns. +.IP "\(bu" 4 +src: an expression that innotop uses to extract the column's data from its +source (see \*(L"\s-1DATA\s0 \s-1SOURCES\s0\*(R"). See \*(L"\s-1EXPRESSIONS\s0\*(R" for more on expressions. +.IP "\(bu" 4 +minw: specifies a minimum display width. This helps stabilize the display, +which makes it easier to read if the data is changing frequently. +.IP "\(bu" 4 +maxw: similar to minw. +.IP "\(bu" 4 +trans: a list of column transformations. See \*(L"\s-1TRANSFORMATIONS\s0\*(R". +.IP "\(bu" 4 +agg: an aggregate function. See \*(L"\s-1GROUPING\s0\*(R". The default is \*(L"first\*(R". +.IP "\(bu" 4 +aggonly: controls whether the column only shows when grouping is enabled on the +table (see \*(L"\s-1GROUPING\s0\*(R"). By default, this is disabled. This means columns +will always be shown by default, whether grouping is enabled or not. If a +column's aggonly is set true, the column will appear when you toggle grouping on +the table. Several columns are set this way, such as the count column on +\&\*(L"processlist\*(R" and \*(L"innodb_transactions\*(R", so you don't see a count when the +grouping isn't enabled, but you do when it is. +.SS "\s-1FILTERS\s0" +.IX Subsection "FILTERS" +Filters remove rows from the display. They behave much like a \s-1WHERE\s0 clause in +\&\s-1SQL\s0. innotop has several built-in filters, which remove irrelevant information +like inactive queries, but you can define your own as well. innotop also lets +you create quick-filters, which do not get saved to the configuration file, and +are just an easy way to quickly view only some rows. +.PP +You can enable or disable a filter on any table. Press the '%' key (mnemonic: % +looks kind of like a line being filtered between two circles) and choose which +table you want to filter, if asked. You'll then see a list of possible filters +and a list of filters currently enabled for that table. Type the names of +filters you want to apply and press Enter. +.PP +\fIUSER-DEFINED \s-1FILTERS\s0\fR +.IX Subsection "USER-DEFINED FILTERS" +.PP +If you type a name that doesn't exist, innotop will prompt you to create the +filter. Filters are easy to create if you know Perl, and not hard if you don't. +What you're doing is creating a subroutine that returns true if the row should +be displayed. The row is a hash reference passed to your subroutine as \f(CW$set\fR. +.PP +For example, imagine you want to filter the processlist table so you only see +queries that have been running more than five minutes. Type a new name for your +filter, and when prompted for the subroutine body, press \s-1TAB\s0 to initiate your +terminal's auto-completion. You'll see the names of the columns in the +\&\*(L"processlist\*(R" table (innotop generally tries to help you with auto-completion +lists). You want to filter on the 'time' column. Type the text \*(L"$set\->{time} > +300\*(R" to return true when the query is more than five minutes old. That's all +you need to do. +.PP +In other words, the code you're typing is surrounded by an implicit context, +which looks like this: +.PP +.Vb 4 +\& sub filter { +\& my ( $set ) = @_; +\& # YOUR CODE HERE +\& } +.Ve +.PP +If your filter doesn't work, or if something else suddenly behaves differently, +you might have made an error in your filter, and innotop is silently catching +the error. Try enabling \*(L"debug\*(R" to make innotop throw an error instead. +.PP +\fIQUICK-FILTERS\fR +.IX Subsection "QUICK-FILTERS" +.PP +innotop's quick-filters are a shortcut to create a temporary filter that doesn't +persist when you restart innotop. To create a quick-filter, press the '/' key. +innotop will prompt you for the column name and filter text. Again, you can use +auto-completion on column names. The filter text can be just the text you want +to \*(L"search for.\*(R" For example, to filter the \*(L"processlist\*(R" table on queries +that refer to the products table, type '/' and then 'info product'. +.PP +The filter text can actually be any Perl regular expression, but of course a +literal string like 'product' works fine as a regular expression. +.PP +Behind the scenes innotop compiles the quick-filter into a specially tagged +filter that is otherwise like any other filter. It just isn't saved to the +configuration file. +.PP +To clear quick-filters, press the '\e' key and innotop will clear them all at +once. +.SS "\s-1SORTING\s0" +.IX Subsection "SORTING" +innotop has sensible built-in defaults to sort the most important rows to the +top of the table. Like anything else in innotop, you can customize how any +table is sorted. +.PP +To start the sort dialog, start the \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R" with the '^' key, choose a +table if necessary, and press the 's' key. You'll see a list of columns you can +use in the sort expression and the current sort expression, if any. Enter a +list of columns by which you want to sort and press Enter. If you want to +reverse sort, prefix the column name with a minus sign. For example, if you +want to sort by column a ascending, then column b descending, type 'a \-b'. You +can also explicitly add a + in front of columns you want to sort ascending, but +it's not required. +.PP +Some modes have keys mapped to open this dialog directly, and to quickly reverse +sort direction. Press '?' as usual to see which keys are mapped in any mode. +.SS "\s-1GROUPING\s0" +.IX Subsection "GROUPING" +innotop can group, or aggregate, rows together (the terms are used +interchangeably). This is quite similar to an \s-1SQL\s0 \s-1GROUP\s0 \s-1BY\s0 clause. You can +specify to group on certain columns, or if you don't specify any, the entire set +of rows is treated as one group. This is quite like \s-1SQL\s0 so far, but unlike \s-1SQL\s0, +you can also select un-grouped columns. innotop actually aggregates every +column. If you don't explicitly specify a grouping function, the default is +\&'first'. This is basically a convenience so you don't have to specify an +aggregate function for every column you want in the result. +.PP +You can quickly toggle grouping on a table with the '=' key, which toggles its +aggregate property. This property doesn't persist to the config file. +.PP +The columns by which the table is grouped are specified in its group_by +property. When you turn grouping on, innotop places the group_by columns at the +far left of the table, even if they're not supposed to be visible. The rest of +the visible columns appear in order after them. +.PP +Two tables have default group_by lists and a count column built in: +\&\*(L"processlist\*(R" and \*(L"innodb_transactions\*(R". The grouping is by connection +and status, so you can quickly see how many queries or transactions are in a +given status on each server you're monitoring. The time columns are aggregated +as a sum; other columns are left at the default 'first' aggregation. +.PP +By default, the table shown in \*(L"S: Variables & Status\*(R" mode also uses +grouping so you can monitor variables and status across many servers. The +default aggregation function in this mode is 'avg'. +.PP +Valid grouping functions are defined in the \f(CW%agg_funcs\fR hash. They include +.IP "first" 4 +.IX Item "first" +Returns the first element in the group. +.IP "count" 4 +.IX Item "count" +Returns the number of elements in the group, including undefined elements, much +like \s-1SQL\s0's \s-1COUNT\s0(*). +.IP "avg" 4 +.IX Item "avg" +Returns the average of defined elements in the group. +.IP "sum" 4 +.IX Item "sum" +Returns the sum of elements in the group. +.PP +Here's an example of grouping at work. Suppose you have a very busy server with +hundreds of open connections, and you want to see how many connections are in +what status. Using the built-in grouping rules, you can press 'Q' to enter +\&\*(L"Q: Query List\*(R" mode. Press '=' to toggle grouping (if necessary, select the +\&\*(L"processlist\*(R" table when prompted). +.PP +Your display might now look like the following: +.PP +.Vb 1 +\& Query List (? for help) localhost, 32:33, 0.11 QPS, 1 thd, 5.0.38\-log +\& +\& CXN Cmd Cnt ID User Host Time Query +\& localhost Query 49 12933 webusr localhost 19:38 SELECT * FROM +\& localhost Sending Da 23 2383 webusr localhost 12:43 SELECT col1, +\& localhost Sleep 120 140 webusr localhost 5:18:12 +\& localhost Statistics 12 19213 webusr localhost 01:19 SELECT * FROM +.Ve +.PP +That's actually quite a worrisome picture. You've got a lot of idle connections +(Sleep), and some connections executing queries (Query and Sending Data). +That's okay, but you also have a lot in Statistics status, collectively spending +over a minute. That means the query optimizer is having a really hard time +optimizing your statements. Something is wrong; it should normally take +milliseconds to optimize queries. You might not have seen this pattern if you +didn't look at your connections in aggregate. (This is a made-up example, but +it can happen in real life). +.SS "\s-1PIVOTING\s0" +.IX Subsection "PIVOTING" +innotop can pivot a table for more compact display, similar to a Pivot Table in +a spreadsheet (also known as a crosstab). Pivoting a table makes columns into +rows. Assume you start with this table: +.PP +.Vb 4 +\& foo bar +\& === === +\& 1 3 +\& 2 4 +.Ve +.PP +After pivoting, the table will look like this: +.PP +.Vb 4 +\& name set0 set1 +\& ==== ==== ==== +\& foo 1 2 +\& bar 3 4 +.Ve +.PP +To get reasonable results, you might need to group as well as pivoting. +innotop currently does this for \*(L"S: Variables & Status\*(R" mode. +.SS "\s-1COLORS\s0" +.IX Subsection "COLORS" +By default, innotop highlights rows with color so you can see at a glance which +rows are more important. You can customize the colorization rules and add your +own to any table. Open the table editor with the '^' key, choose a table if +needed, and press 'o' to open the color editor dialog. +.PP +The color editor dialog displays the rules applied to the table, in the order +they are evaluated. Each row is evaluated against each rule to see if the rule +matches the row; if it does, the row gets the specified color, and no further +rules are evaluated. The rules look like the following: +.PP +.Vb 9 +\& state eq Locked black on_red +\& cmd eq Sleep white +\& user eq system user white +\& cmd eq Connect white +\& cmd eq Binlog Dump white +\& time > 600 red +\& time > 120 yellow +\& time > 60 green +\& time > 30 cyan +.Ve +.PP +This is the default rule set for the \*(L"processlist\*(R" table. In order of +priority, these rules make locked queries black on a red background, \*(L"gray out\*(R" +connections from replication and sleeping queries, and make queries turn from +cyan to red as they run longer. +.PP +(For some reason, the \s-1ANSI\s0 color code \*(L"white\*(R" is actually a light gray. Your +terminal's display may vary; experiment to find colors you like). +.PP +You can use keystrokes to move the rules up and down, which re-orders their +priority. You can also delete rules and add new ones. If you add a new rule, +innotop prompts you for the column, an operator for the comparison, a value +against which to compare the column, and a color to assign if the rule matches. +There is auto-completion and prompting at each step. +.PP +The value in the third step needs to be correctly quoted. innotop does not try +to quote the value because it doesn't know whether it should treat the value as +a string or a number. If you want to compare the column against a string, as +for example in the first rule above, you should enter 'Locked' surrounded by +quotes. If you get an error message about a bareword, you probably should have +quoted something. +.SS "\s-1EXPRESSIONS\s0" +.IX Subsection "EXPRESSIONS" +Expressions are at the core of how innotop works, and are what enables you to +extend innotop as you wish. Recall the table lifecycle explained in +\&\*(L"\s-1TABLES\s0\*(R". Expressions are used in the earliest step, where it extracts +values from a data source to form rows. +.PP +It does this by calling a subroutine for each column, passing it the source data +set, a set of current values, and a set of previous values. These are all +needed so the subroutine can calculate things like the difference between this +tick and the previous tick. +.PP +The subroutines that extract the data from the set are compiled from +expressions. This gives significantly more power than just naming the values to +fill the columns, because it allows the column's value to be calculated from +whatever data is necessary, but avoids the need to write complicated and lengthy +Perl code. +.PP +innotop begins with a string of text that can look as simple as a value's name +or as complicated as a full-fledged Perl expression. It looks at each +\&'bareword' token in the string and decides whether it's supposed to be a key +into the \f(CW$set\fR hash. A bareword is an unquoted value that isn't already +surrounded by code-ish things like dollar signs or curly brackets. If innotop +decides that the bareword isn't a function or other valid Perl code, it converts +it into a hash access. After the whole string is processed, innotop compiles a +subroutine, like this: +.PP +.Vb 5 +\& sub compute_column_value { +\& my ( $set, $cur, $pre ) = @_; +\& my $val = # EXPANDED STRING GOES HERE +\& return $val; +\& } +.Ve +.PP +Here's a concrete example, taken from the header table \*(L"q_header\*(R" in \*(L"Q: +Query List\*(R" mode. This expression calculates the qps, or Queries Per Second, +column's values, from the values returned by \s-1SHOW\s0 \s-1STATUS:\s0 +.PP +.Vb 1 +\& Questions/Uptime_hires +.Ve +.PP +innotop decides both words are barewords, and transforms this expression into +the following Perl code: +.PP +.Vb 1 +\& $set\->{Questions}/$set\->{Uptime_hires} +.Ve +.PP +When surrounded by the rest of the subroutine's code, this is executable Perl +that calculates a high-resolution queries-per-second value. +.PP +The arguments to the subroutine are named \f(CW$set\fR, \f(CW$cur\fR, and \f(CW$pre\fR. In most cases, +\&\f(CW$set\fR and \f(CW$cur\fR will be the same values. However, if \*(L"status_inc\*(R" is set, \f(CW$cur\fR +will not be the same as \f(CW$set\fR, because \f(CW$set\fR will already contain values that are +the incremental difference between \f(CW$cur\fR and \f(CW$pre\fR. +.PP +Every column in innotop is computed by subroutines compiled in the same fashion. +There is no difference between innotop's built-in columns and user-defined +columns. This keeps things consistent and predictable. +.SS "\s-1TRANSFORMATIONS\s0" +.IX Subsection "TRANSFORMATIONS" +Transformations change how a value is rendered. For example, they can take a +number of seconds and display it in H:M:S format. The following transformations +are defined: +.IP "commify" 4 +.IX Item "commify" +Adds commas to large numbers every three decimal places. +.IP "dulint_to_int" 4 +.IX Item "dulint_to_int" +Accepts two unsigned integers and converts them into a single longlong. This is +useful for certain operations with InnoDB, which uses two integers as +transaction identifiers, for example. +.IP "no_ctrl_char" 4 +.IX Item "no_ctrl_char" +Removes quoted control characters from the value. This is affected by the +\&\*(L"charset\*(R" configuration variable. +.Sp +This transformation only operates within quoted strings, for example, values to +a \s-1SET\s0 clause in an \s-1UPDATE\s0 statement. It will not alter the \s-1UPDATE\s0 statement, +but will collapse the quoted string to [\s-1BINARY\s0] or [\s-1TEXT\s0], depending on the +charset. +.IP "percent" 4 +.IX Item "percent" +Converts a number to a percentage by multiplying it by two, formatting it with +\&\*(L"num_digits\*(R" digits after the decimal point, and optionally adding a percent +sign (see \*(L"show_percent\*(R"). +.IP "secs_to_time" 4 +.IX Item "secs_to_time" +Formats a number of seconds as time in days+hours:minutes:seconds format. +.IP "set_precision" 4 +.IX Item "set_precision" +Formats numbers with \*(L"num_digits\*(R" number of digits after the decimal point. +.IP "shorten" 4 +.IX Item "shorten" +Formats a number as a unit of 1024 (k/M/G/T) and with \*(L"num_digits\*(R" number of +digits after the decimal point. +.SS "\s-1TABLE\s0 \s-1EDITOR\s0" +.IX Subsection "TABLE EDITOR" +The innotop table editor lets you customize tables with keystrokes. You start +the table editor with the '^' key. If there's more than one table on the +screen, it will prompt you to choose one of them. Once you do, innotop will +show you something like this: +.PP +.Vb 1 +\& Editing table definition for Buffer Pool. Press ? for help, q to quit. +\& +\& name hdr label src +\& cxn CXN Connection from which cxn +\& buf_pool_size Size Buffer pool size IB_bp_buf_poo +\& buf_free Free Bufs Buffers free in the b IB_bp_buf_fre +\& pages_total Pages Pages total IB_bp_pages_t +\& pages_modified Dirty Pages Pages modified (dirty IB_bp_pages_m +\& buf_pool_hit_rate Hit Rate Buffer pool hit rate IB_bp_buf_poo +\& total_mem_alloc Memory Total memory allocate IB_bp_total_m +\& add_pool_alloc Add\*(Aql Pool Additonal pool alloca IB_bp_add_poo +.Ve +.PP +The first line shows which table you're editing, and reminds you again to press +\&'?' for a list of key mappings. The rest is a tabular representation of the +table's columns, because that's likely what you're trying to edit. However, you +can edit more than just the table's columns; this screen can start the filter +editor, color rule editor, and more. +.PP +Each row in the display shows a single column in the table you're editing, along +with a couple of its properties such as its header and source expression (see +\&\*(L"\s-1EXPRESSIONS\s0\*(R"). +.PP +The key mappings are Vim-style, as in many other places. Pressing 'j' and 'k' +moves the highlight up or down. You can then (d)elete or (e)dit the highlighted +column. You can also (a)dd a column to the table. This actually just activates +one of the columns already defined for the table; it prompts you to choose from +among the columns available but not currently displayed. Finally, you can +re-order the columns with the '+' and '\-' keys. +.PP +You can do more than just edit the columns with the table editor, you can also +edit other properties, such as the table's sort expression and group-by +expression. Press '?' to see the full list, of course. +.PP +If you want to really customize and create your own column, as opposed to just +activating a built-in one that's not currently displayed, press the (n)ew key, +and innotop will prompt you for the information it needs: +.IP "\(bu" 4 +The column name: this needs to be a word without any funny characters, e.g. just +letters, numbers and underscores. +.IP "\(bu" 4 +The column header: this is the label that appears at the top of the column, in +the table header. This can have spaces and funny characters, but be careful not +to make it too wide and waste space on-screen. +.IP "\(bu" 4 +The column's data source: this is an expression that determines what data from +the source (see \*(L"\s-1TABLES\s0\*(R") innotop will put into the column. This can just be +the name of an item in the source, or it can be a more complex expression, as +described in \*(L"\s-1EXPRESSIONS\s0\*(R". +.PP +Once you've entered the required data, your table has a new column. There is no +difference between this column and the built-in ones; it can have all the same +properties and behaviors. innotop will write the column's definition to the +configuration file, so it will persist across sessions. +.PP +Here's an example: suppose you want to track how many times your slaves have +retried transactions. According to the MySQL manual, the +Slave_retried_transactions status variable gives you that data: \*(L"The total +number of times since startup that the replication slave \s-1SQL\s0 thread has retried +transactions. This variable was added in version 5.0.4.\*(R" This is appropriate to +add to the \*(L"slave_sql_status\*(R" table. +.PP +To add the column, switch to the replication-monitoring mode with the 'M' key, +and press the '^' key to start the table editor. When prompted, choose +slave_sql_status as the table, then press 'n' to create the column. Type +\&'retries' as the column name, 'Retries' as the column header, and +\&'Slave_retried_transactions' as the source. Now the column is created, and you +see the table editor screen again. Press 'q' to exit the table editor, and +you'll see your column at the end of the table. +.SH "VARIABLE SETS" +.IX Header "VARIABLE SETS" +Variable sets are used in \*(L"S: Variables & Status\*(R" mode to define more easily +what variables you want to monitor. Behind the scenes they are compiled to a +list of expressions, and then into a column list so they can be treated just +like columns in any other table, in terms of data extraction and +transformations. However, you're protected from the tedious details by a syntax +that ought to feel very natural to you: a \s-1SQL\s0 \s-1SELECT\s0 list. +.PP +The data source for variable sets, and indeed the entire S mode, is the +combination of \s-1SHOW\s0 \s-1STATUS\s0, \s-1SHOW\s0 \s-1VARIABLES\s0, and \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0. Imagine +that you had a huge table with one column per variable returned from those +statements. That's the data source for variable sets. You can now query this +data source just like you'd expect. For example: +.PP +.Vb 1 +\& Questions, Uptime, Questions/Uptime as QPS +.Ve +.PP +Behind the scenes innotop will split that variable set into three expressions, +compile them and turn them into a table definition, then extract as usual. This +becomes a \*(L"variable set,\*(R" or a \*(L"list of variables you want to monitor.\*(R" +.PP +innotop lets you name and save your variable sets, and writes them to the +configuration file. You can choose which variable set you want to see with the +\&'c' key, or activate the next and previous sets with the '>' and '<' keys. +There are many built-in variable sets as well, which should give you a good +start for creating your own. Press 'e' to edit the current variable set, or +just to see how it's defined. To create a new one, just press 'c' and type its +name. +.PP +You may want to use some of the functions listed in \*(L"\s-1TRANSFORMATIONS\s0\*(R" to help +format the results. In particular, \*(L"set_precision\*(R" is often useful to limit +the number of digits you see. Extending the above example, here's how: +.PP +.Vb 1 +\& Questions, Uptime, set_precision(Questions/Uptime) as QPS +.Ve +.PP +Actually, this still needs a little more work. If your \*(L"interval\*(R" is less +than one second, you might be dividing by zero because Uptime is incremental in +this mode by default. Instead, use Uptime_hires: +.PP +.Vb 1 +\& Questions, Uptime, set_precision(Questions/Uptime_hires) as QPS +.Ve +.PP +This example is simple, but it shows how easy it is to choose which variables +you want to monitor. +.SH "PLUGINS" +.IX Header "PLUGINS" +innotop has a simple but powerful plugin mechanism by which you can extend +or modify its existing functionality, and add new functionality. innotop's +plugin functionality is event-based: plugins register themselves to be called +when events happen. They then have a chance to influence the event. +.PP +An innotop plugin is a Perl module placed in innotop's \*(L"plugin_dir\*(R" +directory. On \s-1UNIX\s0 systems, you can place a symbolic link to the module instead +of putting the actual file there. innotop automatically discovers the file. If +there is a corresponding entry in the \*(L"plugins\*(R" configuration file section, +innotop loads and activates the plugin. +.PP +The module must conform to innotop's plugin interface. Additionally, the source +code of the module must be written in such a way that innotop can inspect the +file and determine the package name and description. +.SS "Package Source Convention" +.IX Subsection "Package Source Convention" +innotop inspects the plugin module's source to determine the Perl package name. +It looks for a line of the form \*(L"package Foo;\*(R" and if found, considers the +plugin's package name to be Foo. Of course the package name can be a valid Perl +package name, with double semicolons and so on. +.PP +It also looks for a description in the source code, to make the plugin editor +more human-friendly. The description is a comment line of the form \*(L"# +description: Foo\*(R", where \*(L"Foo\*(R" is the text innotop will consider to be the +plugin's description. +.SS "Plugin Interface" +.IX Subsection "Plugin Interface" +The innotop plugin interface is quite simple: innotop expects the plugin to be +an object-oriented module it can call certain methods on. The methods are +.IP "new(%variables)" 4 +.IX Item "new(%variables)" +This is the plugin's constructor. It is passed a hash of innotop's variables, +which it can manipulate (see \*(L"Plugin Variables\*(R"). It must return a reference +to the newly created plugin object. +.Sp +At construction time, innotop has only loaded the general configuration and +created the default built-in variables with their default contents (which is +quite a lot). Therefore, the state of the program is exactly as in the innotop +source code, plus the configuration variables from the \*(L"general\*(R" section in +the config file. +.Sp +If your plugin manipulates the variables, it is changing global data, which is +shared by innotop and all plugins. Plugins are loaded in the order they're +listed in the config file. Your plugin may load before or after another plugin, +so there is a potential for conflict or interaction between plugins if they +modify data other plugins use or modify. +.IP "\fIregister_for_events()\fR" 4 +.IX Item "register_for_events()" +This method must return a list of events in which the plugin is interested, if +any. See \*(L"Plugin Events\*(R" for the defined events. If the plugin returns an +event that's not defined, the event is ignored. +.IP "event handlers" 4 +.IX Item "event handlers" +The plugin must implement a method named the same as each event for which it has +registered. In other words, if the plugin returns qw(foo bar) from +\&\fIregister_for_events()\fR, it must have \fIfoo()\fR and \fIbar()\fR methods. These methods are +callbacks for the events. See \*(L"Plugin Events\*(R" for more details about each +event. +.SS "Plugin Variables" +.IX Subsection "Plugin Variables" +The plugin's constructor is passed a hash of innotop's variables, which it can +manipulate. It is probably a good idea if the plugin object saves a copy of it +for later use. The variables are defined in the innotop variable +\&\f(CW%pluggable_vars\fR, and are as follows: +.IP "action_for" 4 +.IX Item "action_for" +A hashref of key mappings. These are innotop's global hot-keys. +.IP "agg_funcs" 4 +.IX Item "agg_funcs" +A hashref of functions that can be used for grouping. See \*(L"\s-1GROUPING\s0\*(R". +.IP "config" 4 +.IX Item "config" +The global configuration hash. +.IP "connections" 4 +.IX Item "connections" +A hashref of connection specifications. These are just specifications of how to +connect to a server. +.IP "dbhs" 4 +.IX Item "dbhs" +A hashref of innotop's database connections. These are actual \s-1DBI\s0 connection +objects. +.IP "filters" 4 +.IX Item "filters" +A hashref of filters applied to table rows. See \*(L"\s-1FILTERS\s0\*(R" for more. +.IP "modes" 4 +.IX Item "modes" +A hashref of modes. See \*(L"\s-1MODES\s0\*(R" for more. +.IP "server_groups" 4 +.IX Item "server_groups" +A hashref of server groups. See \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R". +.IP "tbl_meta" 4 +.IX Item "tbl_meta" +A hashref of innotop's table meta-data, with one entry per table (see +\&\*(L"\s-1TABLES\s0\*(R" for more information). +.IP "trans_funcs" 4 +.IX Item "trans_funcs" +A hashref of transformation functions. See \*(L"\s-1TRANSFORMATIONS\s0\*(R". +.IP "var_sets" 4 +.IX Item "var_sets" +A hashref of variable sets. See \*(L"\s-1VARIABLE\s0 \s-1SETS\s0\*(R". +.SS "Plugin Events" +.IX Subsection "Plugin Events" +Each event is defined somewhere in the innotop source code. When innotop runs +that code, it executes the callback function for each plugin that expressed its +interest in the event. innotop passes some data for each event. The events are +defined in the \f(CW%event_listener_for\fR variable, and are as follows: +.ie n .IP "extract_values($set, $cur, $pre, $tbl)" 4 +.el .IP "extract_values($set, \f(CW$cur\fR, \f(CW$pre\fR, \f(CW$tbl\fR)" 4 +.IX Item "extract_values($set, $cur, $pre, $tbl)" +This event occurs inside the function that extracts values from a data source. +The arguments are the set of values, the current values, the previous values, +and the table name. +.IP "set_to_tbl" 4 +.IX Item "set_to_tbl" +Events are defined at many places in this subroutine, which is responsible for +turning an arrayref of hashrefs into an arrayref of lines that can be printed to +the screen. The events all pass the same data: an arrayref of rows and the name +of the table being created. The events are set_to_tbl_pre_filter, +set_to_tbl_pre_sort,set_to_tbl_pre_group, set_to_tbl_pre_colorize, +set_to_tbl_pre_transform, set_to_tbl_pre_pivot, set_to_tbl_pre_create, +set_to_tbl_post_create. +.IP "draw_screen($lines)" 4 +.IX Item "draw_screen($lines)" +This event occurs inside the subroutine that prints the lines to the screen. +\&\f(CW$lines\fR is an arrayref of strings. +.SS "Simple Plugin Example" +.IX Subsection "Simple Plugin Example" +The easiest way to explain the plugin functionality is probably with a simple +example. The following module adds a column to the beginning of every table and +sets its value to 1. +.PP +.Vb 2 +\& use strict; +\& use warnings FATAL => \*(Aqall\*(Aq; +\& +\& package Innotop::Plugin::Example; +\& # description: Adds an \*(Aqexample\*(Aq column to every table +\& +\& sub new { +\& my ( $class, %vars ) = @_; +\& # Store reference to innotop\*(Aqs variables in $self +\& my $self = bless { %vars }, $class; +\& +\& # Design the example column +\& my $col = { +\& hdr => \*(AqExample\*(Aq, +\& just => \*(Aq\*(Aq, +\& dec => 0, +\& num => 1, +\& label => \*(AqExample\*(Aq, +\& src => \*(Aqexample\*(Aq, # Get data from this column in the data source +\& tbl => \*(Aq\*(Aq, +\& trans => [], +\& }; +\& +\& # Add the column to every table. +\& my $tbl_meta = $vars{tbl_meta}; +\& foreach my $tbl ( values %$tbl_meta ) { +\& # Add the column to the list of defined columns +\& $tbl\->{cols}\->{example} = $col; +\& # Add the column to the list of visible columns +\& unshift @{$tbl\->{visible}}, \*(Aqexample\*(Aq; +\& } +\& +\& # Be sure to return a reference to the object. +\& return $self; +\& } +\& +\& # I\*(Aqd like to be called when a data set is being rendered into a table, please. +\& sub register_for_events { +\& my ( $self ) = @_; +\& return qw(set_to_tbl_pre_filter); +\& } +\& +\& # This method will be called when the event fires. +\& sub set_to_tbl_pre_filter { +\& my ( $self, $rows, $tbl ) = @_; +\& # Set the example column\*(Aqs data source to the value 1. +\& foreach my $row ( @$rows ) { +\& $row\->{example} = 1; +\& } +\& } +\& +\& 1; +.Ve +.SS "Plugin Editor" +.IX Subsection "Plugin Editor" +The plugin editor lets you view the plugins innotop discovered and activate or +deactivate them. Start the editor by pressing $ to start the configuration +editor from any mode. Press the 'p' key to start the plugin editor. You'll see +a list of plugins innotop discovered. You can use the 'j' and 'k' keys to move +the highlight to the desired one, then press the * key to toggle it active or +inactive. Exit the editor and restart innotop for the changes to take effect. +.SH "SQL STATEMENTS" +.IX Header "SQL STATEMENTS" +innotop uses a limited set of \s-1SQL\s0 statements to retrieve data from MySQL for +display. The statements are customized depending on the server version against +which they are executed; for example, on MySQL 5 and newer, \s-1INNODB_STATUS\s0 +executes \*(L"\s-1SHOW\s0 \s-1ENGINE\s0 \s-1INNODB\s0 \s-1STATUS\s0\*(R", while on earlier versions it executes +\&\*(L"\s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0\*(R". The statements are as follows: +.PP +.Vb 12 +\& Statement SQL executed +\& =================== =============================== +\& INNODB_STATUS SHOW [ENGINE] INNODB STATUS +\& KILL_CONNECTION KILL +\& KILL_QUERY KILL QUERY +\& OPEN_TABLES SHOW OPEN TABLES +\& PROCESSLIST SHOW FULL PROCESSLIST +\& SHOW_MASTER_LOGS SHOW MASTER LOGS +\& SHOW_MASTER_STATUS SHOW MASTER STATUS +\& SHOW_SLAVE_STATUS SHOW SLAVE STATUS +\& SHOW_STATUS SHOW [GLOBAL] STATUS +\& SHOW_VARIABLES SHOW [GLOBAL] VARIABLES +.Ve +.SH "DATA SOURCES" +.IX Header "DATA SOURCES" +Each time innotop extracts values to create a table (see \*(L"\s-1EXPRESSIONS\s0\*(R" and +\&\*(L"\s-1TABLES\s0\*(R"), it does so from a particular data source. Largely because of the +complex data extracted from \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0, this is slightly messy. \s-1SHOW\s0 +\&\s-1INNODB\s0 \s-1STATUS\s0 contains a mixture of single values and repeated values that form +nested data sets. +.PP +Whenever innotop fetches data from MySQL, it adds two extra bits to each set: +cxn and Uptime_hires. cxn is the name of the connection from which the data +came. Uptime_hires is a high-resolution version of the server's Uptime status +variable, which is important if your \*(L"interval\*(R" setting is sub-second. +.PP +Here are the kinds of data sources from which data is extracted: +.IP "\s-1STATUS_VARIABLES\s0" 4 +.IX Item "STATUS_VARIABLES" +This is the broadest category, into which the most kinds of data fall. It +begins with the combination of \s-1SHOW\s0 \s-1STATUS\s0 and \s-1SHOW\s0 \s-1VARIABLES\s0, but other sources +may be included as needed, for example, \s-1SHOW\s0 \s-1MASTER\s0 \s-1STATUS\s0 and \s-1SHOW\s0 \s-1SLAVE\s0 +\&\s-1STATUS\s0, as well as many of the non-repeated values from \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0. +.IP "\s-1DEADLOCK_LOCKS\s0" 4 +.IX Item "DEADLOCK_LOCKS" +This data is extracted from the transaction list in the \s-1LATEST\s0 \s-1DETECTED\s0 \s-1DEADLOCK\s0 +section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0. It is nested two levels deep: transactions, then +locks. +.IP "\s-1DEADLOCK_TRANSACTIONS\s0" 4 +.IX Item "DEADLOCK_TRANSACTIONS" +This data is from the transaction list in the \s-1LATEST\s0 \s-1DETECTED\s0 \s-1DEADLOCK\s0 +section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0. It is nested one level deep. +.IP "\s-1EXPLAIN\s0" 4 +.IX Item "EXPLAIN" +This data is from the result set returned by \s-1EXPLAIN\s0. +.IP "\s-1INNODB_TRANSACTIONS\s0" 4 +.IX Item "INNODB_TRANSACTIONS" +This data is from the \s-1TRANSACTIONS\s0 section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0. +.IP "\s-1IO_THREADS\s0" 4 +.IX Item "IO_THREADS" +This data is from the list of threads in the the \s-1FILE\s0 I/O section of \s-1SHOW\s0 \s-1INNODB\s0 +\&\s-1STATUS\s0. +.IP "\s-1INNODB_LOCKS\s0" 4 +.IX Item "INNODB_LOCKS" +This data is from the \s-1TRANSACTIONS\s0 section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 and is nested +two levels deep. +.IP "\s-1OPEN_TABLES\s0" 4 +.IX Item "OPEN_TABLES" +This data is from \s-1SHOW\s0 \s-1OPEN\s0 \s-1TABLES\s0. +.IP "\s-1PROCESSLIST\s0" 4 +.IX Item "PROCESSLIST" +This data is from \s-1SHOW\s0 \s-1FULL\s0 \s-1PROCESSLIST\s0. +.IP "\s-1OS_WAIT_ARRAY\s0" 4 +.IX Item "OS_WAIT_ARRAY" +This data is from the \s-1SEMAPHORES\s0 section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 and is nested one +level deep. It comes from the lines that look like this: +.Sp +.Vb 1 +\& \-\-Thread 1568861104 has waited at btr0cur.c line 424 .... +.Ve +.SH "MYSQL PRIVILEGES" +.IX Header "MYSQL PRIVILEGES" +.IP "\(bu" 4 +You must connect to MySQL as a user who has the \s-1SUPER\s0 privilege for many of the +functions. +.IP "\(bu" 4 +If you don't have the \s-1SUPER\s0 privilege, you can still run some functions, but you +won't necessarily see all the same data. +.IP "\(bu" 4 +You need the \s-1PROCESS\s0 privilege to see the list of currently running queries in Q +mode. +.IP "\(bu" 4 +You need special privileges to start and stop slave servers. +.IP "\(bu" 4 +You need appropriate privileges to create and drop the deadlock tables if needed +(see \*(L"\s-1SERVER\s0 \s-1CONNECTIONS\s0\*(R"). +.SH "SYSTEM REQUIREMENTS" +.IX Header "SYSTEM REQUIREMENTS" +You need Perl to run innotop, of course. You also need a few Perl modules: \s-1DBI\s0, +DBD::mysql, Term::ReadKey, and Time::HiRes. These should be included with most +Perl distributions, but in case they are not, I recommend using versions +distributed with your operating system or Perl distribution, not from \s-1CPAN\s0. +Term::ReadKey in particular has been known to cause problems if installed from +\&\s-1CPAN\s0. +.PP +If you have Term::ANSIColor, innotop will use it to format headers more readably +and compactly. (Under Microsoft Windows, you also need Win32::Console::ANSI for +terminal formatting codes to be honored). If you install Term::ReadLine, +preferably Term::ReadLine::Gnu, you'll get nice auto-completion support. +.PP +I run innotop on Gentoo GNU/Linux, Debian and Ubuntu, and I've had feedback from +people successfully running it on Red Hat, CentOS, Solaris, and Mac \s-1OSX\s0. I +don't see any reason why it won't work on other UNIX-ish operating systems, but +I don't know for sure. It also runs on Windows under ActivePerl without +problem. +.PP +innotop has been used on MySQL versions 3.23.58, 4.0.27, 4.1.0, 4.1.22, 5.0.26, +5.1.15, and 5.2.3. If it doesn't run correctly for you, that is a bug that +should be reported. +.SH "FILES" +.IX Header "FILES" +\&\f(CW$HOMEDIR\fR/.innotop and/or /etc/innotop are used to store +configuration information. Files include the configuration file innotop.conf, +the core_dump file which contains verbose error messages if \*(L"debug\*(R" is +enabled, and the plugins/ subdirectory. +.SH "GLOSSARY OF TERMS" +.IX Header "GLOSSARY OF TERMS" +.IP "tick" 4 +.IX Item "tick" +A tick is a refresh event, when innotop re-fetches data from connections and +displays it. +.SH "ACKNOWLEDGEMENTS" +.IX Header "ACKNOWLEDGEMENTS" +The following people and organizations are acknowledged for various reasons. +Hopefully no one has been forgotten. +.PP +Allen K. Smith, +Aurimas Mikalauskas, +Bartosz Fenski, +Brian Miezejewski, +Christian Hammers, +Cyril Scetbon, +Dane Miller, +David Multer, +Dr. Frank Ullrich, +Giuseppe Maxia, +Google.com Site Reliability Engineers, +Google Code, +Jan Pieter Kunst, +Jari Aalto, +Jay Pipes, +Jeremy Zawodny, +Johan Idren, +Kristian Kohntopp, +Lenz Grimmer, +Maciej Dobrzanski, +Michiel Betel, +MySQL \s-1AB\s0, +Paul McCullagh, +Sebastien Estienne, +Sourceforge.net, +Steven Kreuzer, +The Gentoo MySQL Team, +Trevor Price, +Yaar Schnitman, +and probably more people that have not been included. +.PP +(If your name has been misspelled, it's probably out of fear of putting +international characters into this documentation; earlier versions of Perl might +not be able to compile it then). +.SH "COPYRIGHT, LICENSE AND WARRANTY" +.IX Header "COPYRIGHT, LICENSE AND WARRANTY" +This program is copyright (c) 2006 Baron Schwartz. +Feedback and improvements are welcome. +.PP +\&\s-1THIS\s0 \s-1PROGRAM\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 +\&\s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 +\&\s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. +.PP +This program is free software; you can redistribute it and/or modify it under +the terms of the \s-1GNU\s0 General Public License as published by the Free Software +Foundation, version 2; \s-1OR\s0 the Perl Artistic License. On \s-1UNIX\s0 and similar +systems, you can issue `man perlgpl' or `man perlartistic' to read these +licenses. +.PP +You should have received a copy of the \s-1GNU\s0 General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, \s-1MA\s0 02111\-1307 \s-1USA\s0. +.PP +Execute innotop and press '!' to see this information at any time. +.SH "AUTHOR" +.IX Header "AUTHOR" +Originally written by Baron Schwartz; currently maintained by Aaron Racine. +.SH "BUGS" +.IX Header "BUGS" +You can report bugs, ask for improvements, and get other help and support at +. There are mailing lists, a source code +browser, a bug tracker, etc. Please use these instead of contacting the +maintainer or author directly, as it makes our job easier and benefits others if the +discussions are permanent and public. Of course, if you need to contact us in +private, please do. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/my.cnf.fallback percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/my.cnf.fallback --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/my.cnf.fallback 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/my.cnf.fallback 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,43 @@ +# 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 +# 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 @DEB_PRODUCTNAMEC@ 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. +# + +# You can copy this to one of: +# - "/etc/mysql/my.cnf" to set global options, +# - "~/.my.cnf" to set user-specific options. +# +# One can use all long options that the program supports. +# Run program with --help to get a list of available options and with +# --print-defaults to see which it would actually understand and use. +# + +# This will be passed to all mysql clients +# It has been reported that passwords should be enclosed with ticks/quotes +# escpecially if they contain "#" chars... +# Remember to edit /etc/mysql/debian.cnf when changing the socket location. + +# Here is entries for some specific programs +# The following values assume you have at least 32M ram + +!includedir /etc/mysql/conf.d/ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql.cnf percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql.cnf --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql.cnf 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql.cnf 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,36 @@ +# 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 database server configuration file. +# +# You can copy this to one of: +# - "/etc/mysql/my.cnf" to set global options, +# - "~/.my.cnf" to set user-specific options. +# +# One can use all long options that the program supports. +# Run program with --help to get a list of available options and with +# --print-defaults to see which it would actually understand and use. +# +# 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/ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql.conf.d/mysqld.cnf percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql.conf.d/mysqld.cnf --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql.conf.d/mysqld.cnf 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql.conf.d/mysqld.cnf 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,100 @@ +# +# The MySQL database server configuration file. +# +# You can copy this to one of: +# - "/etc/mysql/my.cnf" to set global options, +# - "~/.my.cnf" to set user-specific options. +# +# One can use all long options that the program supports. +# Run program with --help to get a list of available options and with +# --print-defaults to see which it would actually understand and use. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +# This will be passed to all mysql clients +# It has been reported that passwords should be enclosed with ticks/quotes +# escpecially if they contain "#" chars... +# Remember to edit /etc/mysql/debian.cnf when changing the socket location. + +# Here is entries for some specific programs +# The following values assume you have at least 32M ram + +[mysqld] +# +# * Basic Settings +# +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 +skip-external-locking +# +# 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 +# +# * Fine Tuning +# +key_buffer_size = 16M +max_allowed_packet = 16M +thread_stack = 192K +thread_cache_size = 8 +# This replaces the startup script and checks MyISAM tables if needed +# the first time they are touched +myisam-recover-options = BACKUP +#max_connections = 100 +#table_cache = 64 +#thread_concurrency = 10 +# +# * Query Cache Configuration +# +query_cache_limit = 1M +query_cache_size = 16M +# +# * Logging and Replication +# +# Both location gets rotated by the cronjob. +# Be aware that this log type is a performance killer. +# As of 5.1 you can enable the log at runtime! +#general_log_file = /var/log/mysql/mysql.log +#general_log = 1 +# +# Error log - should be very few entries. +# +log_error = /var/log/mysql/error.log +# +# Here you can see queries with especially long duration +#log_slow_queries = /var/log/mysql/mysql-slow.log +#long_query_time = 2 +#log-queries-not-using-indexes +# +# The following can be used as easy to replay backup logs or for replication. +# note: if you are setting up a replication slave, see README.Debian about +# other settings you may need to change. +#server-id = 1 +#log_bin = /var/log/mysql/mysql-bin.log +expire_logs_days = 10 +max_binlog_size = 100M +#binlog_do_db = include_database_name +#binlog_ignore_db = include_database_name +# +# * InnoDB +# +# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. +# Read the manual for more InnoDB related options. There are many! +# +# * Security Features +# +# Read the manual, too, if you want chroot! +# chroot = /var/lib/mysql/ +# +# For generating SSL certificates I recommend the OpenSSL GUI "tinyca". +# +# ssl-ca=/etc/mysql/cacert.pem +# ssl-cert=/etc/mysql/server-cert.pem +# ssl-key=/etc/mysql/server-key.pem diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql.conf.d/mysqld_safe_syslog.cnf percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql.conf.d/mysqld_safe_syslog.cnf --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql.conf.d/mysqld_safe_syslog.cnf 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql.conf.d/mysqld_safe_syslog.cnf 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,2 @@ +[mysqld_safe] +syslog diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysqld.cnf percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysqld.cnf --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysqld.cnf 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysqld.cnf 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,28 @@ +# 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 + +# +# The MySQL @PRODUCTNAMEC@ Server configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysqld] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +datadir = /var/lib/mysql +log-error = /var/log/mysql/error.log +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql_embedded.1 percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql_embedded.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql_embedded.1 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql_embedded.1 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +.so man1/mysql.1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql-helpers percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql-helpers --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql-helpers 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql-helpers 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,181 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Wait for server to start up (this requires the client package) +pinger () { + while /bin/true ; do + sleep 1 + mysqladmin ping >/dev/null 2>&1 && break + done +} + +# To avoid having hardcoded paths in the script, we do a search on the path, as suggested at: +# https://www.debian.org/doc/manuals/developers-reference/ch06.en.html#bpp-debian-maint-scripts +pathfind() { + OLDIFS="$IFS" + IFS=: + for p in $PATH; do + if [ -x "$p/$*" ]; then + IFS="$OLDIFS" + return 0 + fi + done + IFS="$OLDIFS" + return 1 +} + +# Fetch value from config files +# Usage: get_mysql_option [section] [option] [default value] +get_mysql_option() { + if pathfind my_print_defaults; then + RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1) + fi + if [ -z "$RESULT" ]; then + RESULT="$3" + fi + echo $RESULT +} + +# Check if server is running +get_running () { + MYSQLDATA=$(get_mysql_option mysqld datadir "/var/lib/mysql") + 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 +} + +# Runs an arbitrary init sql file supplied in $1. Does not require login access +run_init_sql() { + tmpdir=$(mktemp -d) + chown mysql:mysql "$tmpdir" + mysqld --bootstrap --user=mysql --socket="$tmpdir/mysqld.sock" --pid-file="$tmpdir/mysqld.pid" > /dev/null 2>&1 < "$1" + result=$? + rm -rf "$tmpdir" + return $result +} + +# Verify that everything the server needs to run is set up +verify_ready() { + + MYSQLDATA=$(get_mysql_option mysqld datadir "/var/lib/mysql") + MYSQLFILES=$(get_mysql_option mysqld secure-file-priv "/var/lib/mysql-files") + MYSQLKEYRING=$(dirname $(get_mysql_option mysqld keyring-file-data "/var/lib/mysql-keyring/keyring")) + MYSQLLOG=$(dirname $(get_mysql_option mysqld log-error "/var/log/mysql/error.log")) + 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 + ERROR_FLAG=0 + if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ]; then + if [ "$(dirname "${MYSQLDATA}")" = "/var/lib" ]; then + install -d -m0750 -omysql -gmysql ${MYSQLDATA} + else + echo "Error: Datadir ${MYSQLDATA} does not exist. For security reasons the service will not automatically create directories outside /var/lib.." + ERROR_FLAG=1 + fi + fi + + if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ]; then + if [ "$(dirname "${MYSQLFILES}")" = "/var/lib" -o ${MYSQLFILES} = NULL ]; then + install -d -m0770 -omysql -gmysql ${MYSQLFILES} + else + echo "Error: Secure-file-priv dir ${MYSQLFILES} does not exist. For security reasons the service will not automatically create directories outside /var/lib." + ERROR_FLAG=1 + fi + fi + + if [ ! -d ${MYSQLKEYRING} -a ! -L ${MYSQLKEYRING} ]; then + if [ "$(dirname "${MYSQLKEYRING}")" = "/var/lib" ]; then + install -d -m0750 -omysql -gmysql ${MYSQLKEYRING} + else + echo "Warning: Keyring dir ${MYSQLKEYRING} does not exist. For security reasons the service will not automatically create directories outside /var/lib. The server may not start correctly." + fi + fi + + if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ]; then + if [ "$(dirname "${MYSQLLOG}")" = "/var/log" ]; then + install -d -m0750 -omysql -gadm ${MYSQLLOG} + install /dev/null -m0640 -omysql -gadm ${MYSQLLOG}/error.log + else + echo "Error: Log dir ${MYSQLLOG} does not exist. For security reasons the service will not automatically create directories outside /var/log." + ERROR_FLAG=1 + fi + fi + + if [ ${ERROR_FLAG} = 1 ]; then + echo "Errors found. Aborting." + exit 1 + fi + + if [ ! -d ${MYSQLRUN} -a ! -L ${MYSQLRUN} ]; then + install -d -m0755 -omysql -gmysql ${MYSQLRUN} + fi +} + +# Verify the database exists and is ssl ready +verify_database() { + MYSQLDATA=$(get_mysql_option mysqld datadir "/var/lib/mysql") + MYSQLFILES=$(get_mysql_option mysqld secure-file-priv "/var/lib/mysql-files") + + if [ ! -d "${MYSQLDATA}/mysql" ] && [ -d "${MYSQLFILES}" ]; then + su - mysql -s /bin/bash -c "mysql_install_db --user=mysql > /dev/null" + fi + + if [ -x /usr/bin/mysql_ssl_rsa_setup -a ! -e "${MYSQLDATA}/server-key.pem" ]; then + mysql_ssl_rsa_setup --datadir="${MYSQLDATA}" --uid=mysql >/dev/null 2>&1 + fi +} + +verify_server () { + TIMEOUT=0 + if [ "${1}" = "start" ]; then + TIMEOUT=${STARTTIMEOUT} + elif [ "${1}" = "stop" ]; then + TIMEOUT=${STOPTIMEOUT} + fi + + COUNT=0 + while [ ${COUNT} -lt ${TIMEOUT} ]; + do + COUNT=$(( COUNT+1 )) + echo -n . + if [ "${1}" = "start" ] && [ "$(get_running)" = 1 ]; then + if [ -z ${2} ]; then + echo + fi + return 0 + fi + if [ "${1}" = "stop" ] && [ "$(get_running)" = 0 ]; then + if [ -z ${2} ]; then + echo + fi + return 0 + fi + sleep 1 + done + return 1 +} + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysqlreport percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysqlreport --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysqlreport 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysqlreport 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,1298 @@ +#!/usr/bin/perl -w + +# mysqlreport v3.5 Apr 16 2008 +# http://hackmysql.com/mysqlreport + +# mysqlreport makes an easy-to-read report of important MySQL status values. +# Copyright 2006-2008 Daniel Nichter +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The GNU General Public License is available at: +# http://www.gnu.org/copyleft/gpl.html + +use strict; +use File::Temp qw(tempfile); +use DBI; +use Getopt::Long; +eval { require Term::ReadKey; }; +my $RK = ($@ ? 0 : 1); + +sub have_op; + +my $WIN = ($^O eq 'MSWin32' ? 1 : 0); +my %op; +my %mycnf; # ~/.my.cnf +my ($tmpfile_fh, $tmpfile); +my ($stat_name, $stat_val, $stat_label); +my $MySQL_version; +my (%stats, %vars); # SHOW STATUS, SHOW VARIABLES +my (%DMS_vals, %Com_vals, %ib_vals); +my ($dbh, $query); +my ($questions, $key_read_ratio, $key_write_ratio, $dms, $slow_query_t); +my ($key_cache_block_size, $key_buffer_used, $key_buffer_usage); +my ($qc_mem_used, $qc_hi_r, $qc_ip_r); # Query Cache +my $have_innodb_vals; +my ($ib_bp_used, $ib_bp_total, $ib_bp_read_ratio); +my ($relative_live, $relative_infiles); +my $real_uptime; +my (%stats_present, %stats_past); # For relative reports + +GetOptions ( + \%op, + "user=s", + "password:s", + "host=s", + "port=s", + "socket=s", + "no-mycnf", + "infile|in=s", + "outfile=s", + "flush-status", + "email=s", + "r|relative:i", + "c|report-count=i", + "detach", + "help|?", + "debug" +); + +show_help_and_exit() if $op{'help'}; + +get_user_mycnf() unless $op{'no-mycnf'}; + +# Command line options override ~/.my.cnf +$mycnf{'host'} = $op{'host'} if have_op 'host'; +$mycnf{'port'} = $op{'port'} if have_op 'port'; +$mycnf{'socket'} = $op{'socket'} if have_op 'socket'; +$mycnf{'user'} = $op{'user'} if have_op 'user'; + +$mycnf{'user'} ||= $ENV{'USER'}; + +if(exists $op{'password'}) +{ + if($op{'password'} eq '') # Prompt for password + { + Term::ReadKey::ReadMode(2) if $RK; + print "Password for database user $mycnf{'user'}: "; + chomp($mycnf{'pass'} = ); + Term::ReadKey::ReadMode(0), print "\n" if $RK; + } + else { $mycnf{'pass'} = $op{'password'}; } # Use password given on command line +} + +$op{'com'} ||= 3; +$op{'c'} ||= 1; # Used in collect_reports() if --r given integer value + +$relative_live = 0; +$relative_infiles = 0; + +if(defined $op{'r'}) +{ + if($op{r}) { $relative_live = 1; } # if -r was given an integer value + else { $relative_infiles = 1; } +} + +# The report is written to a tmp file first. +# Later it will be moved to $op{'outfile'} or emailed $op{'email'} if needed. +($tmpfile_fh, $tmpfile) = tempfile() or die "Cannot open temporary file for writing: $!\n"; + +if($op{'detach'}) +{ + $SIG{'TERM'} = 'sig_handler'; + + if(fork()) + { + print "mysqlreport has forked and detached.\n"; + print "While running detached, mysqlreport writes reports to '$tmpfile'.\n"; + + exit; + } + + open(STDIN, " $tmpfile") or die "Cannot dup STDOUT: $!\n"; + open(STDERR, "> $tmpfile") or die "Cannot dup STDERR: $!\n"; +} + +select $tmpfile_fh; +$| = 1 if ($op{'detach'} || $relative_live); + +print "tmp file: $tmpfile\n" if $op{debug}; + +# Connect to MySQL +if(!$op{'infile'} && !$relative_infiles) +{ + connect_to_MySQL(); +} + +$have_innodb_vals = 1; # This might be set to 0 later in get_MySQL_version() + +if(defined $op{'r'}) +{ + if($relative_live) + { + print STDERR "mysqlreport is writing relative reports to '$tmpfile'.\n" unless $op{'detach'}; + get_MySQL_version(); + collect_reports(); + } + + if($relative_infiles) { read_relative_infiles(); } +} +else +{ + if(!$op{'infile'}) + { + get_MySQL_version(); + get_vals(); + get_vars(); + } + else + { + read_infile($op{'infile'}); + } + + get_Com_values(); + + set_myisam_vals(); + set_ib_vals() if $have_innodb_vals; + + write_report(); +} + +exit_tasks_and_cleanup(); + +exit; + +# +# Subroutines +# +sub show_help_and_exit +{ + print <<"HELP"; +mysqlreport v3.5 Apr 16 2008 +mysqlreport makes an easy-to-read report of important MySQL status values. + +Command line options (abbreviations work): + --user USER Connect to MySQL as USER + --password PASS Use PASS or prompt for MySQL user's password + --host ADDRESS Connect to MySQL at ADDRESS + --port PORT Connect to MySQL at PORT + --socket SOCKET Connect to MySQL at SOCKET + --no-mycnf Don't read ~/.my.cnf + --infile FILE Read status values from FILE instead of MySQL + --outfile FILE Write report to FILE + --email ADDRESS Email report to ADDRESS (doesn't work on Windows) + --flush-status Issue FLUSH STATUS; after getting current values + --relative X Generate relative reports. If X is an integer, + reports are live from the MySQL server X seconds apart. + If X is a list of infiles (file1 file2 etc.), + reports are generated from the infiles in the order + that they are given. + --report-count N Collect N number of live relative reports (default 1) + --detach Fork and detach from terminal (run in background) + --help Prints this + --debug Print debugging information + +Visit http://hackmysql.com/mysqlreport for more information. +HELP + + exit; +} + +sub get_user_mycnf +{ + print "get_user_mycnf\n" if $op{debug}; + + return if $WIN; + open MYCNF, "$ENV{HOME}/.my.cnf" or return; + while() + { + if(/^(.+?)\s*=\s*"?(.+?)"?\s*$/) + { + $mycnf{$1} = $2; + print "get_user_mycnf: read '$1 = $2'\n" if $op{debug}; + } + } + $mycnf{'pass'} ||= $mycnf{'password'} if exists $mycnf{'password'}; + close MYCNF; +} + +sub connect_to_MySQL +{ + print "connect_to_MySQL\n" if $op{debug}; + + my $dsn; + + if($mycnf{'socket'} && -S $mycnf{'socket'}) + { + $dsn = "DBI:mysql:mysql_socket=$mycnf{socket}"; + } + elsif($mycnf{'host'}) + { + $dsn = "DBI:mysql:host=$mycnf{host}" . ($mycnf{port} ? ";port=$mycnf{port}" : ""); + } + else + { + $dsn = "DBI:mysql:host=localhost"; + } + + print "connect_to_MySQL: DBI DSN: $dsn\n" if $op{debug}; + + $dbh = DBI->connect($dsn, $mycnf{'user'}, $mycnf{'pass'}) or die; +} + +sub collect_reports +{ + print "collect_reports\n" if $op{debug}; + + my $i; + + get_vals(); + get_vars(); + + get_Com_values(); + + %stats_past = %stats; + + set_myisam_vals(); + set_ib_vals() if $have_innodb_vals; + + print "#\n# Beginning report, 0 0:0:0\n#\n"; + + write_report(); + + for($i = 0; $i < $op{'c'}; $i++) + { + $dbh->disconnect(); + + sleep($op{'r'}); + + connect_to_MySQL(); + + print "\n#\n# Interval report " , $i + 1 , ", +", sec_to_dhms(($i + 1) * $op{'r'}), "\n#\n"; + + get_vals(); + + write_relative_report(); + } +} + +sub read_relative_infiles +{ + print "read_relative_infiles\n" if $op{debug}; + + my $slurp; # Used to check infiles for multiple sets of status values + my $n_stats; # Number of multiple sets of status values in an infile + my $infile; + my $report_n; # Report number + + $report_n = 1; + + foreach $infile (@ARGV) + { + # Read all of infile into $slurp + open INFILE, "< $infile" or warn and next; + $slurp = do { local $/; }; + close INFILE; + + $n_stats = 0; + + # Count number of status value sets + $n_stats++ while $slurp =~ /Aborted_clients/g; + + print "read_relative_infiles: found $n_stats sets of status values in file '$infile'\n" + if $op{debug}; + + if($n_stats == 1) + { + read_infile($infile); + relative_infile_report($report_n++); + } + + if($n_stats > 1) + { + my @tmpfile_fh; + my @tmpfile_name; + my $i; + my $stat_n; # Status value set number + + # Create a tmp file for each set of status values + for($i = 0; $i < $n_stats; $i++) + { + my ($fh, $name) = tempfile() + or die "read_relative_infiles: cannot open temporary file for writing: $!\n"; + + push(@tmpfile_fh, $fh); + push(@tmpfile_name, $name); + + print "read_relative_infiles: created tmp file '$name' for set $i\n" if $op{debug}; + } + + $i = 0; + $stat_n = 0; + + select $tmpfile_fh[$i]; + + # Read infile again and copy each set of status values to seperate tmp files + open INFILE, "< $infile" or warn and next; + while() + { + next if /^\+/; + next if /^$/; + + # The infile must begin with the system variable values. + # Therefore, the first occurance of Aborted_clients indicates the beginning + # of the first set of status values if no sets have occured yet ($stat_n == 0). + # In this case, the following status values are printed to the current fh, + # along with the system variable values read thus far, until Aborted_clients + # occurs again. Then begins the second and subsequent sets of status values. + + if(/Aborted_clients/) + { + print and next if $stat_n++ == 0; + select $tmpfile_fh[++$i]; + } + + print; + } + close INFILE; + + # Re-select the main tmp file into which the reports are being written. + select $tmpfile_fh; + + for($i = 0; $i < $n_stats; $i++) + { + close $tmpfile_fh[$i]; + + print "read_relative_infiles: reading set $i tmp file '$tmpfile_name[$i]'\n" + if $op{debug}; + + read_infile($tmpfile_name[$i]); + relative_infile_report($report_n++); + + if($WIN) { `del $tmpfile_name[$i]`; } + else { `rm -f $tmpfile_name[$i]`; } + + print "read_relative_infiles: deleted set $i tmp file '$tmpfile_name[$i]'\n" + if $op{debug}; + } + + } # if($n_stats > 1) + } # foreach $infile (@files) +} + +sub relative_infile_report +{ + print "relative_infile_report\n" if $op{debug}; + + my $report_n = shift; + + if($report_n == 1) + { + get_Com_values(); + + %stats_past = %stats; + + set_myisam_vals(); + set_ib_vals() if $have_innodb_vals; + + print "#\n# Beginning report, 0 0:0:0\n#\n"; + + write_report(); + } + else + { + print "\n#\n# Interval report ", $report_n - 1, ", +", + sec_to_dhms($stats{Uptime} - $stats_past{Uptime}), + "\n#\n"; + + write_relative_report(); + } +} + +sub get_vals +{ + print "get_vals\n" if $op{debug}; + + my @row; + + # Get status values + if($MySQL_version >= 50002) + { + $query = $dbh->prepare("SHOW GLOBAL STATUS;"); + } + else + { + $query = $dbh->prepare("SHOW STATUS;"); + } + $query->execute(); + while(@row = $query->fetchrow_array()) { $stats{$row[0]} = $row[1]; } + + $real_uptime = $stats{'Uptime'}; +} + +sub get_vars +{ + print "get_vars\n" if $op{debug}; + + my @row; + + # Get server system variables + $query = $dbh->prepare("SHOW VARIABLES;"); + $query->execute(); + while(@row = $query->fetchrow_array()) { $vars{$row[0]} = $row[1]; } + + # table_cache was renamed to table_open_cache in MySQL 5.1.3 + if($MySQL_version >= 50103) + { + $vars{'table_cache'} = $vars{'table_open_cache'}; + } +} + +sub read_infile +{ + print "read_infile\n" if $op{debug}; + + my $infile = shift; + + # Default required system variable values if not set in INFILE. + # As of mysqlreport v3.5 the direct output from SHOW VARIABLES; + # can be put into INFILE instead. See http://hackmysql.com/mysqlreportdoc + # for details. + $vars{'version'} = "0.0.0" if !exists $vars{'version'}; + $vars{'table_cache'} = 64 if !exists $vars{'table_cache'}; + $vars{'max_connections'} = 100 if !exists $vars{'max_connections'}; + $vars{'key_buffer_size'} = 8388600 if !exists $vars{'key_buffer_size'}; # 8M + $vars{'thread_cache_size'} = 0 if !exists $vars{'thread_cache_size'}; + $vars{'tmp_table_size'} = 0 if !exists $vars{'tmp_table_size'}; + $vars{'long_query_time'} = '?' if !exists $vars{'long_query_time'}; + $vars{'log_slow_queries'} = '?' if !exists $vars{'log_slow_queries'}; + + # One should also add: + # key_cache_block_size + # query_cache_size + # to INFILE if needed. + + open INFILE, "< $infile" or die "Cannot open INFILE '$infile': $!\n"; + + while() + { + last if !defined $_; + + next if /^\+/; # skip divider lines + next if /^$/; # skip blank lines + + next until /(Aborted_clients|back_log|=)/; + + if($1 eq 'Aborted_clients') # status values + { + print "read_infile: start stats\n" if $op{debug}; + + while($_) + { + chomp; + if(/([A-Za-z_]+)[\s\t|]+(\d+)/) + { + $stats{$1} = $2; + print "read_infile: save $1 = $2\n" if $op{debug}; + } + else { print "read_infile: ignore '$_'\n" if $op{debug}; } + + last if $1 eq 'Uptime'; # exit while() if end of status values + $_ = ; # otherwise, read next line of status values + } + } + elsif($1 eq 'back_log') # system variable values + { + print "read_infile: start vars\n" if $op{debug}; + + while($_) + { + chomp; + if(/([A-Za-z_]+)[\s\t|]+([\w\.\-]+)/) # This will exclude some vars + { # like pid_file which we don't need + $vars{$1} = $2; + print "read_infile: save $1 = $2\n" if $op{debug}; + } + else { print "read_infile: ignore '$_'\n" if $op{debug}; } + + last if $1 eq 'wait_timeout'; # exit while() if end of vars + $_ = ; # otherwise, read next line of vars + } + } + elsif($1 eq '=') # old style, manually added system variable values + { + print "read_infile: start old vars\n" if $op{debug}; + + while($_ && $_ =~ /=/) + { + chomp; + if(/^\s*(\w+)\s*=\s*([0-9.]+)(M*)\s*$/) # e.g.: key_buffer_size = 128M + { + $vars{$1} = ($3 ? $2 * 1024 * 1024 : $2); + print "read_infile: read '$_' as $1 = $vars{$1}\n" if $op{debug}; + } + else { print "read_infile: ignore '$_'\n" if $op{debug}; } + + $_ = ; # otherwise, read next line of old vars + } + + redo; + } + else + { + print "read_infile: unrecognized line: '$_'\n" if $op{debug}; + } + } + + close INFILE; + + $real_uptime = $stats{'Uptime'}; + + $vars{'table_cache'} = $vars{'table_open_cache'} if exists $vars{'table_open_cache'}; + + get_MySQL_version(); +} + +sub get_MySQL_version +{ + print "get_MySQL_version\n" if $op{debug}; + + return if $MySQL_version; + + my ($major, $minor, $patch); + + if($op{'infile'} || $relative_infiles) + { + ($major, $minor, $patch) = ($vars{'version'} =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/); + } + else + { + my @row; + + $query = $dbh->prepare("SHOW VARIABLES LIKE 'version';"); + $query->execute(); + @row = $query->fetchrow_array(); + ($major, $minor, $patch) = ($row[1] =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/); + } + + $MySQL_version = sprintf("%d%02d%02d", $major, $minor, $patch); + + # Innodb_ status values were added in 5.0.2 + if($MySQL_version < 50002) + { + $have_innodb_vals = 0; + print "get_MySQL_version: no InnoDB reports because MySQL version is older than 5.0.2\n" if $op{debug}; + } +} + +sub set_myisam_vals +{ + print "set_myisam_vals\n" if $op{debug}; + + $questions = $stats{'Questions'}; + + $key_read_ratio = sprintf "%.2f", + ($stats{'Key_read_requests'} ? + 100 - ($stats{'Key_reads'} / $stats{'Key_read_requests'}) * 100 : + 0); + + $key_write_ratio = sprintf "%.2f", + ($stats{'Key_write_requests'} ? + 100 - ($stats{'Key_writes'} / $stats{'Key_write_requests'}) * 100 : + 0); + + $key_cache_block_size = (defined $vars{'key_cache_block_size'} ? + $vars{'key_cache_block_size'} : + 1024); + + $key_buffer_used = $stats{'Key_blocks_used'} * $key_cache_block_size; + + if(defined $stats{'Key_blocks_unused'}) # MySQL 4.1.2+ + { + $key_buffer_usage = $vars{'key_buffer_size'} - + ($stats{'Key_blocks_unused'} * $key_cache_block_size); + } + else { $key_buffer_usage = -1; } + + # Data Manipulation Statements: http://dev.mysql.com/doc/refman/5.0/en/data-manipulation.html + %DMS_vals = + ( + SELECT => $stats{'Com_select'}, + INSERT => $stats{'Com_insert'} + $stats{'Com_insert_select'}, + REPLACE => $stats{'Com_replace'} + $stats{'Com_replace_select'}, + UPDATE => $stats{'Com_update'} + + (exists $stats{'Com_update_multi'} ? $stats{'Com_update_multi'} : 0), + DELETE => $stats{'Com_delete'} + + (exists $stats{'Com_delete_multi'} ? $stats{'Com_delete_multi'} : 0) + ); + + $dms = $DMS_vals{SELECT} + $DMS_vals{INSERT} + $DMS_vals{REPLACE} + $DMS_vals{UPDATE} + $DMS_vals{DELETE}; + + $slow_query_t = format_u_time($vars{long_query_time}); + +} + +sub set_ib_vals +{ + print "set_ib_vals\n" if $op{debug}; + + $ib_bp_used = ($stats{'Innodb_buffer_pool_pages_total'} - + $stats{'Innodb_buffer_pool_pages_free'}) * + $stats{'Innodb_page_size'}; + + $ib_bp_total = $stats{'Innodb_buffer_pool_pages_total'} * $stats{'Innodb_page_size'}; + + $ib_bp_read_ratio = sprintf "%.2f", + ($stats{'Innodb_buffer_pool_read_requests'} ? + 100 - ($stats{'Innodb_buffer_pool_reads'} / + $stats{'Innodb_buffer_pool_read_requests'}) * 100 : + 0); +} + +sub write_relative_report +{ + print "write_relative_report\n" if $op{debug}; + + %stats_present = %stats; + + for(keys %stats) + { + if($stats_past{$_} =~ /\d+/) + { + if($stats_present{$_} >= $stats_past{$_}) # Avoid negative values + { + $stats{$_} = $stats_present{$_} - $stats_past{$_}; + } + } + } + + # These values are either "at present" or "high water marks". + # Therefore, it is more logical to not relativize these values. + # Doing otherwise causes strange and misleading values. + $stats{'Key_blocks_used'} = $stats_present{'Key_blocks_used'}; + $stats{'Open_tables'} = $stats_present{'Open_tables'}; + $stats{'Max_used_connections'} = $stats_present{'Max_used_connections'}; + $stats{'Threads_running'} = $stats_present{'Threads_running'}; + $stats{'Threads_connected'} = $stats_present{'Threads_connected'}; + $stats{'Threads_cached'} = $stats_present{'Threads_cached'}; + $stats{'Qcache_free_blocks'} = $stats_present{'Qcache_free_blocks'}; + $stats{'Qcache_total_blocks'} = $stats_present{'Qcache_total_blocks'}; + $stats{'Qcache_free_memory'} = $stats_present{'Qcache_free_memory'}; + if($have_innodb_vals) + { + $stats{'Innodb_page_size'} = $stats_present{'Innodb_page_size'}; + $stats{'Innodb_buffer_pool_pages_data'} = $stats_present{'Innodb_buffer_pool_pages_data'}; + $stats{'Innodb_buffer_pool_pages_dirty'} = $stats_present{'Innodb_buffer_pool_pages_dirty'}; + $stats{'Innodb_buffer_pool_pages_free'} = $stats_present{'Innodb_buffer_pool_pages_free'}; + $stats{'Innodb_buffer_pool_pages_latched'} = $stats_present{'Innodb_buffer_pool_pages_latched'}; + $stats{'Innodb_buffer_pool_pages_misc'} = $stats_present{'Innodb_buffer_pool_pages_misc'}; + $stats{'Innodb_buffer_pool_pages_total'} = $stats_present{'Innodb_buffer_pool_pages_total'}; + $stats{'Innodb_data_pending_fsyncs'} = $stats_present{'Innodb_data_pending_fsyncs'}; + $stats{'Innodb_data_pending_reads'} = $stats_present{'Innodb_data_pending_reads'}; + $stats{'Innodb_data_pending_writes'} = $stats_present{'Innodb_data_pending_writes'}; + + # Innodb_row_lock_ values were added in MySQL 5.0.3 + if($MySQL_version >= 50003) + { + $stats{'Innodb_row_lock_current_waits'} = $stats_present{'Innodb_row_lock_current_waits'}; + $stats{'Innodb_row_lock_time_avg'} = $stats_present{'Innodb_row_lock_time_avg'}; + $stats{'Innodb_row_lock_time_max'} = $stats_present{'Innodb_row_lock_time_max'}; + } + } + + get_Com_values(); + + %stats_past = %stats_present; + + set_myisam_vals(); + set_ib_vals() if $have_innodb_vals; + + write_report(); +} + +sub write_report +{ + print "write_report\n" if $op{debug}; + + $~ = 'MYSQL_TIME', write; + $~ = 'KEY_BUFF_MAX', write; + if($key_buffer_usage != -1) { $~ = 'KEY_BUFF_USAGE', write } + $~ = 'KEY_RATIOS', write; + write_DTQ(); + $~ = 'SLOW_DMS', write; + write_DMS(); + write_Com(); + $~ = 'SAS', write; + write_qcache(); + $~ = 'REPORT_END', write; + $~ = 'TAB', write; + + write_InnoDB() if $have_innodb_vals; +} + +sub sec_to_dhms # Seconds to days hours:minutes:seconds +{ + my $s = shift; + my ($d, $h, $m) = (0, 0, 0); + + return '0 0:0:0' if $s <= 0; + + if($s >= 86400) + { + $d = int $s / 86400; + $s -= $d * 86400; + } + + if($s >= 3600) + { + $h = int $s / 3600; + $s -= $h * 3600; + } + + $m = int $s / 60; + $s -= $m * 60; + + return "$d $h:$m:$s"; +} + +sub make_short +{ + my ($number, $kb, $d) = @_; + my $n = 0; + my $short; + + $d ||= 2; + + if($kb) { while ($number > 1023) { $number /= 1024; $n++; }; } + else { while ($number > 999) { $number /= 1000; $n++; }; } + + $short = sprintf "%.${d}f%s", $number, ('','k','M','G','T')[$n]; + if($short =~ /^(.+)\.(00)$/) { return $1; } # 12.00 -> 12 but not 12.00k -> 12k + + return $short; +} + +# What began as a simple but great idea has become the new standard: +# long_query_time in microseconds. For MySQL 5.1.21+ and 6.0.4+ this +# is now standard. For 4.1 and 5.0 patches, the architects of this +# idea provide: http://www.mysqlperformanceblog.com/mysql-patches/ +# Relevant notes in MySQL manual: +# http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html +# http://dev.mysql.com/doc/refman/6.0/en/slow-query-log.html +# +# The format_u_time sub simply beautifies long_query_time. + +sub format_u_time # format microsecond (µ) time value +{ + # 0.000000 - 0.000999 = 0 - 999 µ + # 0.001000 - 0.999999 = 1 ms - 999.999 ms + # 1.000000 - n.nnnnnn = 1 s - n.nnnnn s + + my $t = shift; + my $f; # formatted µ time + my $u = chr(($WIN ? 230 : 181)); + + $t = 0 if $t < 0; + + if($t > 0 && $t <= 0.000999) + { + $f = ($t * 1000000) . " $u"; + } + elsif($t >= 0.001000 && $t <= 0.999999) + { + $f = ($t * 1000) . ' ms'; + } + elsif($t >= 1) + { + $f = ($t * 1) . ' s'; # * 1 to remove insignificant zeros + } + else + { + $f = 0; # $t should = 0 at this point + } + + return $f; +} + +sub perc # Percentage +{ + my($is, $of) = @_; + $is = 0 if (not defined $is); + return sprintf "%.2f", ($is * 100) / ($of ||= 1); +} + +sub t # Time average per second +{ + my $val = shift; + return 0 if !$val; + return(make_short($val / $stats{'Uptime'}, 0, 1)); +} + +sub email_report # Email given report to $op{'email'} +{ + print "email_report\n" if $op{debug}; + + return if $WIN; + + my $report = shift; + + open SENDMAIL, "|/usr/sbin/sendmail -t"; + print SENDMAIL "From: mysqlreport\n"; + print SENDMAIL "To: $op{email}\n"; + print SENDMAIL "Subject: MySQL status report on " . ($mycnf{'host'} || 'localhost') . "\n\n"; + print SENDMAIL `cat $report`; + close SENDMAIL; +} + +sub cat_report # Print given report to screen +{ + print "cat_report\n" if $op{debug}; + + my $report = shift; + my @report; + + open REPORT, "< $report"; + @report = ; + close REPORT; + print @report; +} + +sub get_Com_values +{ + print "get_Com_values\n" if $op{debug}; + + %Com_vals = (); + + # Make copy of just the Com_ values + for(keys %stats) + { + if(grep /^Com_/, $_ and $stats{$_} > 0) + { + /^Com_(.*)/; + $Com_vals{$1} = $stats{$_}; + } + } + + # Remove DMS values + delete $Com_vals{'select'}; + delete $Com_vals{'insert'}; + delete $Com_vals{'insert_select'}; + delete $Com_vals{'replace'}; + delete $Com_vals{'replace_select'}; + delete $Com_vals{'update'}; + delete $Com_vals{'update_multi'} if exists $Com_vals{'update_multi'}; + delete $Com_vals{'delete'}; + delete $Com_vals{'delete_multi'} if exists $Com_vals{'delete_multi'}; +} + +sub write_DTQ # Write DTQ report in descending order by values +{ + print "write_DTQ\n" if $op{debug}; + + $~ = 'DTQ'; + + my %DTQ; + my $first = 1; + + # Total Com values + $stat_val = 0; + for(values %Com_vals) { $stat_val += $_; } + $DTQ{'Com_'} = $stat_val; + + $DTQ{'DMS'} = $dms; + $DTQ{'QC Hits'} = $stats{'Qcache_hits'} if $stats{'Qcache_hits'} != 0; + $DTQ{'COM_QUIT'} = int (($stats{'Connections'} - 2) - ($stats{'Aborted_clients'} / 2)); + + $stat_val = 0; + for(values %DTQ) { $stat_val += $_; } + if($questions != $stat_val) + { + $DTQ{($questions > $stat_val ? '+Unknown' : '-Unknown')} = abs $questions - $stat_val; + } + + for(sort { $DTQ{$b} <=> $DTQ{$a} } keys(%DTQ)) + { + if($first) { $stat_label = '%Total:'; $first = 0; } + else { $stat_label = ''; } + + $stat_name = $_; + $stat_val = $DTQ{$_}; + write; + } +} + +sub write_DMS # Write DMS report in descending order by values +{ + print "write_DMS\n" if $op{debug}; + + $~ = 'DMS'; + + for(sort { $DMS_vals{$b} <=> $DMS_vals{$a} } keys(%DMS_vals)) + { + $stat_name = $_; + $stat_val = $DMS_vals{$_}; + write; + } +} + +sub write_Com # Write COM report in descending order by values +{ + print "write_Com\n" if $op{debug}; + + my $i = $op{'com'}; + + $~ = 'COM_1'; + + # Total Com values and write first line of COM report + $stat_label = '%Total:' unless $op{'dtq'}; + $stat_val = 0; + for(values %Com_vals) { $stat_val += $_; } + write; + + $~ = 'COM_2'; + + # Sort remaining Com values, print only the top $op{'com'} number of values + for(sort { $Com_vals{$b} <=> $Com_vals{$a} } keys(%Com_vals)) + { + $stat_name = $_; + $stat_val = $Com_vals{$_}; + write; + + last if !(--$i); + } +} + +sub write_qcache +{ + print "write_qcache\n" if $op{debug}; + + # Query cache was added in 4.0.1, but have_query_cache was added in 4.0.2, + # ergo this method is slightly more reliable + return if not exists $vars{'query_cache_size'}; + return if $vars{'query_cache_size'} == 0; + + $qc_mem_used = $vars{'query_cache_size'} - $stats{'Qcache_free_memory'}; + $qc_hi_r = sprintf "%.2f", $stats{'Qcache_hits'} / ($stats{'Qcache_inserts'} ||= 1); + $qc_ip_r = sprintf "%.2f", $stats{'Qcache_inserts'} / ($stats{'Qcache_lowmem_prunes'} ||= 1); + + $~ = 'QCACHE'; + write; +} + +sub write_InnoDB +{ + print "write_InnoDB\n" if $op{debug}; + + return if not defined $stats{'Innodb_page_size'}; + + $stats{'Innodb_buffer_pool_pages_latched'} = 0 if not defined $stats{'Innodb_buffer_pool_pages_latched'}; + + $~ = 'IB'; + write; + + # Innodb_row_lock_ values were added in MySQL 5.0.3 + if($MySQL_version >= 50003) + { + $~ = 'IB_LOCK'; + write; + } + + # Data, Pages, Rows + $~ = 'IB_DPR'; + write; +} + +sub have_op +{ + my $key = shift; + return 1 if (exists $op{$key} && $op{$key} ne ''); + return 0; +} + +sub sig_handler +{ + print "\nReceived signal at " , scalar localtime , "\n"; + exit_tasks_and_cleanup(); + exit; +} + +sub exit_tasks_and_cleanup +{ + print "exit_tasks_and_cleanup\n" if $op{debug}; + + close $tmpfile_fh; + select STDOUT unless $op{'detach'}; + + email_report($tmpfile) if $op{'email'}; + + cat_report($tmpfile) unless $op{'detach'}; + + if($op{'outfile'}) + { + if($WIN) { `move $tmpfile $op{outfile}`; } + else { `mv $tmpfile $op{outfile}`; } + } + else + { + if($WIN) { `del $tmpfile`; } + else { `rm -f $tmpfile`; } + } + + if(!$op{'infile'} && !$relative_infiles) + { + if($op{'flush-status'}) + { + $query = $dbh->prepare("FLUSH STATUS;"); + $query->execute(); + } + + $query->finish(); + $dbh->disconnect(); + } +} + +# +# Formats +# + +format MYSQL_TIME = +MySQL @<<<<<<<<<<<<<<<< uptime @<<<<<<<<<<< @>>>>>>>>>>>>>>>>>>>>>>>> +$vars{'version'}, sec_to_dhms($real_uptime), (($op{infile} || $relative_infiles) ? '' : scalar localtime) +. + +format KEY_BUFF_MAX = + +__ Key _________________________________________________________________ +Buffer used @>>>>>> of @>>>>>> %Used: @>>>>> +make_short($key_buffer_used, 1), make_short($vars{'key_buffer_size'}, 1), perc($key_buffer_used, $vars{'key_buffer_size'}) +. + +format KEY_BUFF_USAGE = + Current @>>>>>> %Usage: @>>>>> +make_short($key_buffer_usage, 1), perc($key_buffer_usage, $vars{'key_buffer_size'}) +. + +format KEY_RATIOS = +Write hit @>>>>>% +$key_write_ratio +Read hit @>>>>>% +$key_read_ratio + +__ Questions ___________________________________________________________ +Total @>>>>>>>> @>>>>>/s +make_short($questions), t($questions) +. + +format DTQ = + @<<<<<<< @>>>>>>>> @>>>>>/s @>>>>>> @>>>>> +$stat_name, make_short($stat_val), t($stat_val), $stat_label, perc($stat_val, $questions) +. + +format SLOW_DMS = +Slow @<<<<<<< @>>>>>> @>>>>>/s @>>>>> %DMS: @>>>>> Log: @>> +$slow_query_t, make_short($stats{'Slow_queries'}), t($stats{'Slow_queries'}), perc($stats{'Slow_queries'}, $questions), perc($stats{'Slow_queries'}, $dms), $vars{'log_slow_queries'} +DMS @>>>>>>>> @>>>>>/s @>>>>> +make_short($dms), t($dms), perc($dms, $questions) +. + +format DMS = + @<<<<<<< @>>>>>>>> @>>>>>/s @>>>>> @>>>>> +$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions), perc($stat_val, $dms) +. + +format COM_1 = +Com_ @>>>>>>>> @>>>>>/s @>>>>> +make_short($stat_val), t($stat_val), perc($stat_val, $questions) +. + +format COM_2 = + @<<<<<<<<<< @>>>>>> @>>>>>/s @>>>>> +$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions) +. + +format SAS = + +__ SELECT and Sort _____________________________________________________ +Scan @>>>>>> @>>>>/s %SELECT: @>>>>> +make_short($stats{'Select_scan'}), t($stats{'Select_scan'}), perc($stats{'Select_scan'}, $stats{'Com_select'}) +Range @>>>>>> @>>>>/s @>>>>> +make_short($stats{'Select_range'}), t($stats{'Select_range'}), perc($stats{'Select_range'}, $stats{'Com_select'}) +Full join @>>>>>> @>>>>/s @>>>>> +make_short($stats{'Select_full_join'}), t($stats{'Select_full_join'}), perc($stats{'Select_full_join'}, $stats{'Com_select'}) +Range check @>>>>>> @>>>>/s @>>>>> +make_short($stats{'Select_range_check'}), t($stats{'Select_range_check'}), perc($stats{'Select_range_check'}, $stats{'Com_select'}) +Full rng join @>>>>>> @>>>>/s @>>>>> +make_short($stats{'Select_full_range_join'}), t($stats{'Select_full_range_join'}), perc($stats{'Select_full_range_join'}, $stats{'Com_select'}) +Sort scan @>>>>>> @>>>>/s +make_short($stats{'Sort_scan'}), t($stats{'Sort_scan'}) +Sort range @>>>>>> @>>>>/s +make_short($stats{'Sort_range'}), t($stats{'Sort_range'}) +Sort mrg pass @>>>>>> @>>>>/s +make_short($stats{'Sort_merge_passes'}), t($stats{'Sort_merge_passes'}) +. + +format QCACHE = + +__ Query Cache _________________________________________________________ +Memory usage @>>>>>> of @>>>>>> %Used: @>>>>> +make_short($qc_mem_used, 1), make_short($vars{'query_cache_size'}, 1), perc($qc_mem_used, $vars{'query_cache_size'}) +Block Fragmnt @>>>>>% +perc($stats{'Qcache_free_blocks'}, $stats{'Qcache_total_blocks'}) +Hits @>>>>>> @>>>>/s +make_short($stats{'Qcache_hits'}), t($stats{'Qcache_hits'}) +Inserts @>>>>>> @>>>>/s +make_short($stats{'Qcache_inserts'}), t($stats{'Qcache_inserts'}) +Insrt:Prune @>>>>>>:1 @>>>>/s +make_short($qc_ip_r), t($stats{'Qcache_inserts'} - $stats{'Qcache_lowmem_prunes'}) +Hit:Insert @>>>>>>:1 +$qc_hi_r, t($qc_hi_r) +. + +# Not really the end... +format REPORT_END = + +__ Table Locks _________________________________________________________ +Waited @>>>>>>>> @>>>>>/s %Total: @>>>>> +make_short($stats{'Table_locks_waited'}), t($stats{'Table_locks_waited'}), perc($stats{'Table_locks_waited'}, $stats{'Table_locks_waited'} + $stats{'Table_locks_immediate'}); +Immediate @>>>>>>>> @>>>>>/s +make_short($stats{'Table_locks_immediate'}), t($stats{'Table_locks_immediate'}) + +__ Tables ______________________________________________________________ +Open @>>>>>>>> of @>>> %Cache: @>>>>> +$stats{'Open_tables'}, $vars{'table_cache'}, perc($stats{'Open_tables'}, $vars{'table_cache'}) +Opened @>>>>>>>> @>>>>>/s +make_short($stats{'Opened_tables'}), t($stats{'Opened_tables'}) + +__ Connections _________________________________________________________ +Max used @>>>>>>>> of @>>> %Max: @>>>>> +$stats{'Max_used_connections'}, $vars{'max_connections'}, perc($stats{'Max_used_connections'}, $vars{'max_connections'}) +Total @>>>>>>>> @>>>>>/s +make_short($stats{'Connections'}), t($stats{'Connections'}) + +__ Created Temp ________________________________________________________ +Disk table @>>>>>>>> @>>>>>/s +make_short($stats{'Created_tmp_disk_tables'}), t($stats{'Created_tmp_disk_tables'}) +Table @>>>>>>>> @>>>>>/s Size: @>>>>> +make_short($stats{'Created_tmp_tables'}), t($stats{'Created_tmp_tables'}), make_short($vars{'tmp_table_size'}, 1, 1) +File @>>>>>>>> @>>>>>/s +make_short($stats{'Created_tmp_files'}), t($stats{'Created_tmp_files'}) +. + +format TAB = + +__ Threads _____________________________________________________________ +Running @>>>>>>>> of @>>> +$stats{'Threads_running'}, $stats{'Threads_connected'} +Cached @>>>>>>>> of @>>> %Hit: @>>>>> +$stats{'Threads_cached'}, $vars{'thread_cache_size'}, make_short(100 - perc($stats{'Threads_created'}, $stats{'Connections'})) +Created @>>>>>>>> @>>>>>/s +make_short($stats{'Threads_created'}), t($stats{'Threads_created'}) +Slow @>>>>>>>> @>>>>>/s +$stats{'Slow_launch_threads'}, t($stats{'Slow_launch_threads'}) + +__ Aborted _____________________________________________________________ +Clients @>>>>>>>> @>>>>>/s +make_short($stats{'Aborted_clients'}), t($stats{'Aborted_clients'}) +Connects @>>>>>>>> @>>>>>/s +make_short($stats{'Aborted_connects'}), t($stats{'Aborted_connects'}) + +__ Bytes _______________________________________________________________ +Sent @>>>>>>>> @>>>>>/s +make_short($stats{'Bytes_sent'}), t($stats{'Bytes_sent'}) +Received @>>>>>>>> @>>>>>/s +make_short($stats{'Bytes_received'}), t($stats{'Bytes_received'}) +. + +format IB = + +__ InnoDB Buffer Pool __________________________________________________ +Usage @>>>>>> of @>>>>>> %Used: @>>>>> +make_short($ib_bp_used, 1), make_short($ib_bp_total, 1), perc($ib_bp_used, $ib_bp_total) +Read hit @>>>>>% +$ib_bp_read_ratio; +Pages + Free @>>>>>>>> %Total: @>>>>> +make_short($stats{'Innodb_buffer_pool_pages_free'}), perc($stats{'Innodb_buffer_pool_pages_free'}, $stats{'Innodb_buffer_pool_pages_total'}) + Data @>>>>>>>> @>>>>> %Drty: @>>>>> +make_short($stats{'Innodb_buffer_pool_pages_data'}), perc($stats{'Innodb_buffer_pool_pages_data'}, $stats{'Innodb_buffer_pool_pages_total'}), perc($stats{'Innodb_buffer_pool_pages_dirty'}, $stats{'Innodb_buffer_pool_pages_data'}) + Misc @>>>>>>>> @>>>>> + $stats{'Innodb_buffer_pool_pages_misc'}, perc($stats{'Innodb_buffer_pool_pages_misc'}, $stats{'Innodb_buffer_pool_pages_total'}) + Latched @>>>>>>>> @>>>>> +$stats{'Innodb_buffer_pool_pages_latched'}, perc($stats{'Innodb_buffer_pool_pages_latched'}, $stats{'Innodb_buffer_pool_pages_total'}) +Reads @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_buffer_pool_read_requests'}), t($stats{'Innodb_buffer_pool_read_requests'}) + From file @>>>>>>>> @>>>>>/s @>>>>> +make_short($stats{'Innodb_buffer_pool_reads'}), t($stats{'Innodb_buffer_pool_reads'}), perc($stats{'Innodb_buffer_pool_reads'}, $stats{'Innodb_buffer_pool_read_requests'}) + Ahead Rnd @>>>>>>>> @>>>>>/s +$stats{'Innodb_buffer_pool_read_ahead_rnd'}, t($stats{'Innodb_buffer_pool_read_ahead_rnd'}) + Ahead Sql @>>>>>>>> @>>>>>/s +$stats{'Innodb_buffer_pool_read_ahead_seq'}, t($stats{'Innodb_buffer_pool_read_ahead_seq'}) +Writes @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_buffer_pool_write_requests'}), t($stats{'Innodb_buffer_pool_write_requests'}) +Flushes @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_buffer_pool_pages_flushed'}), t($stats{'Innodb_buffer_pool_pages_flushed'}) +Wait Free @>>>>>>>> @>>>>>/s +$stats{'Innodb_buffer_pool_wait_free'}, t($stats{'Innodb_buffer_pool_wait_free'}) +. + +format IB_LOCK = + +__ InnoDB Lock _________________________________________________________ +Waits @>>>>>>>> @>>>>>/s +$stats{'Innodb_row_lock_waits'}, t($stats{'Innodb_row_lock_waits'}) +Current @>>>>>>>> +$stats{'Innodb_row_lock_current_waits'} +Time acquiring + Total @>>>>>>>> ms +$stats{'Innodb_row_lock_time'} + Average @>>>>>>>> ms +$stats{'Innodb_row_lock_time_avg'} + Max @>>>>>>>> ms +$stats{'Innodb_row_lock_time_max'} +. + +format IB_DPR = + +__ InnoDB Data, Pages, Rows ____________________________________________ +Data + Reads @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_data_reads'}), t($stats{'Innodb_data_reads'}) + Writes @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_data_writes'}), t($stats{'Innodb_data_writes'}) + fsync @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_data_fsyncs'}), t($stats{'Innodb_data_fsyncs'}) + Pending + Reads @>>>>>>>> +$stats{'Innodb_data_pending_reads'}, t($stats{'Innodb_data_pending_reads'}) + Writes @>>>>>>>> +$stats{'Innodb_data_pending_writes'}, t($stats{'Innodb_data_pending_writes'}) + fsync @>>>>>>>> +$stats{'Innodb_data_pending_fsyncs'}, t($stats{'Innodb_data_pending_fsyncs'}) + +Pages + Created @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_pages_created'}), t($stats{'Innodb_pages_created'}) + Read @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_pages_read'}), t($stats{'Innodb_pages_read'}) + Written @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_pages_written'}), t($stats{'Innodb_pages_written'}) + +Rows + Deleted @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_rows_deleted'}), t($stats{'Innodb_rows_deleted'}) + Inserted @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_rows_inserted'}), t($stats{'Innodb_rows_inserted'}) + Read @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_rows_read'}), t($stats{'Innodb_rows_read'}) + Updated @>>>>>>>> @>>>>>/s +make_short($stats{'Innodb_rows_updated'}), t($stats{'Innodb_rows_updated'}) +. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysqlreport.1 percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysqlreport.1 --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysqlreport.1 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysqlreport.1 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,180 @@ +.TH "mysqlreport" "1" "2.5 2006-09-01 (docrev 2006-05-19)" "Daniel Nichter" "MYSQL" +.SH "NAME" +.LP +mysqlreport \- Makes a friendly report of important MySQL status values +.SH "SYNTAX" +.LP +mysqlreport [\fIoptions\fP] +.SH "DESCRIPTION" +.LP +mysqlreport makes a friendly report of important MySQL status values. Actually, +it makes a friendly report of nearly every status value from SHOW STATUS. +Unlike SHOW STATUS which simply dumps over 100 values to screen in one long +list, mysqlreport interprets and formats the values and presents the basic +values and many more inferred values in a human\-readable format. Numerous +example reports are available at the mysqlreport web page at +http://hackmysql.com/mysqlreport. + +The benefit of mysqlreport is that it allows you to very quickly see a wide +array of performance indicators for your MySQL server which would otherwise +need to be calculated by hand from all the various SHOW STATUS values. For +example, the Index Read Ratio is an important value but it's not present in +SHOW STATUS; it's an inferred value (the ratio of Key_reads to +Key_read_requests). + +This documentation outlines all the command line options in mysqlreport, most +of which control which reports are printed. This document does not address +how to interpret these reports; that topic is covered in the document Guide +To Understanding mysqlreport at http://hackmysql.com/mysqlreportguide. + +.SH "OPTIONS" +Technically, command line options are in the form \-\-option, but \-option works +too. All options can be abbreviated if the abbreviation is unique. For example, +option \-\-host can be abbreviated \-\-ho but not \-\-h because \-\-h is ambiguous: it +could mean \-\-host or \-\-help. + +.LP + +.TP +\fB\-\-help\fR +Output help information and exit. + +.TP +\fB\-\-user USER\fR + +.TP +\fB\-\-password\fR +As of version 2.3 \-\-password can take the password on the +command line like "\-\-password FOO". Using \-\-password +alone without giving a password on the command line +causes mysqlreport to prompt for a password. + +.TP +\fB\-\-host ADDRESS\fR + +.TP +\fB\-\-port PORT\fR + +.TP +\fB\-\-socket SOCKET\fR + +.TP +\fB\-\-no\-mycnf\fR +\-\-no\-mycnf makes mysqlreport not read ~/.my.cnf which it does by default +otherwise. \-\-user and \-\-password always override values from ~/.my.cnf. + +.TP +\fB\-\-dtq\fR +Print Distribution of Total Queries (DTQ) report (under +Total in Questions report). Queries (or Questions) can +be divided into four main areas: DMS (see \-\-dms below), +Com_ (see \-\-com below), COM_QUIT (see COM_QUIT and +Questions at http://hackmysql.com/com_quit), and +Unknown. \-\-dtq lists the number of queries in each of +these areas in descending order. + +.TP +\fB\-\-dms\fR +Print Data Manipulation Statements (DMS) report (under +DMS in Questions report). DMS are those from the MySQL +manual section 13.2. Data Manipulation Statements. +(Currently, mysqlreport considers only SELECT, INSERT, +REPLACE, UPDATE, and DELETE.) Each DMS is listed in +descending order by count. + +.TP +\fB\-\-com N\fR +Print top N number of non\-DMS Com_ status values in +descending order (after DMS in Questions report). If N +is not given, default is 3. Such non\-DMS Com_ values +include Com_change_db, Com_show_tables, Com_rollback, +etc. + +.TP +\fB\-\-sas\fR +Print report for Select_ and Sort_ status values (after +Questions report). See MySQL Select and Sort Status +Variables at http://hackmysql.com/selectandsort. + +.TP +\fB\-\-tab\fR +Print Threads, Aborted, and Bytes status reports (after +Created temp report). As of mysqlreport v2.3 the +Threads report reports on all Threads_ status values. + +.TP +\fB\-\-qcache\fR +Print Query Cache report. +.TP +\fB\-\-all\fR +Equivalent to "\-\-dtq \-\-dms \-\-com 3 \-\-sas \-\-qcache". +(Notice \-\-tab is not invoked by \-\-all.) + +.TP +\fB\-\-infile FILE\fR +Instead of getting SHOW STATUS values from MySQL, read +values from FILE. FILE is often a copy of the output of +SHOW STATUS including formatting characters (|, +, \-). +mysqlreport expects FILE to have the format +" value number " where value is only alpha and +underscore characters (A\-Z and _) and number is a +positive integer. Anything before, between, or after +value and number is ignored. mysqlreport also needs +the following MySQL server variables: version, +table_cache, max_connections, key_buffer_size, +query_cache_size. These values can be specified in +INFILE in the format "name = value" where name is one +of the aforementioned server variables and value is a +positive integer with or without a trailing M and +possible periods (for version). For example, to specify +an 18M key_buffer_size: key_buffer_size = 18M. Or, a +256 table_cache: table_cache = 256. The M implies +Megabytes not million, so 18M means 18,874,368 not +18,000,000. If these server variables are not specified +the following defaults are used (respectively) which +may cause strange values to be reported: 0.0.0, 64, +100, 8M, 0. + +.TP +\fB\-\-outfile FILE\fR +After printing the report to screen, print the report +to FILE too. Internally, mysqlreport always writes the +report to a temp file first: /tmp/mysqlreport.PID on +*nix, c:\mysqlreport.PID on Windows (PID is the +script's process ID). Then it prints the temp file to +screen. Then if \-\-outfile is specified, the temp file +is copied to OUTFILE. After \-\-email (below), the temp +file is deleted. + +.TP +\fB\-\-email ADDRESS\fR +After printing the report to screen, email the report +to ADDRESS. This option requires sendmail in +/usr/sbin/, therefore it does not work on Windows. +/usr/sbin/sendmail can be a sym link to qmail, for +example, or any MTA that emulates sendmail's \-t +command line option and operation. The FROM: field is +"mysqlreport", SUBJECT: is "MySQL status report". + +.TP +\fB\-\-flush\-status\fR +Execute a "FLUSH STATUS;" after generating the reports. +If you do not have permissions in MySQL to do this an +error from DBD::mysql::st will be printed after the +reports. + +.SH "AUTHORS" +.LP +Daniel Nichter + +If mysqlreport breaks, send me a message from +http://hackmysql.com/feedback +with the error. + +.SH "SEE ALSO" +.LP +mytop(1) +.LP +The comprehensive Guide To Understanding mysqlreport at +http://hackmysql.com/mysqlreportguide. + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql-systemd-start percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql-systemd-start --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/mysql-systemd-start 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/mysql-systemd-start 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,68 @@ +#!/bin/bash + +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Script modified to handle the specific needs of the "wsrep" plugin +# which enables a MySQL server to act as a node in Galera Cluster. +# Modifications +# Copyright (c) 2015, 2016, Codership Oy + +# 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 + + +# Include helper functions +. /usr/share/mysql/mysql-helpers + +sanity () { + if [ ! -r /etc/mysql/my.cnf ]; then + systemd-cat -t mysql -p err \ + echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives." + exit 1 + fi + +# Make sure database and required directories exist + verify_ready + verify_database + + @DEB_INIT_APPARMOR@ +} + +pinger () { + server_up=false + for i in $(seq 1 30); do + sleep 1 + if mysqladmin ping >/dev/null 2>&1; then + server_up=true + break + fi + done + clear_recover_pos + if [ ! $server_up ]; then + systemd-cat -t mysql -p err \ + echo "MySQL server not started" + exit 1 + fi +} + +case $1 in + "pre") sanity ;; + "post") pinger ;; +esac diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/source_mysql-5.6.py percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/source_mysql-5.6.py --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/extra/source_mysql-5.6.py 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/extra/source_mysql-5.6.py 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,54 @@ +'''apport package hook for mysql-5.6 + +(c) 2009 Canonical Ltd. +Author: Mathias Gug +''' + +from __future__ import print_function, unicode_literals +import os, os.path + +from apport.hookutils import * + +def _add_my_conf_files(report, filename): + key = 'MySQLConf' + path_to_key(filename) + report[key] = "" + for line in read_file(filename).split('\n'): + try: + if 'password' in line.split('=')[0]: + line = "%s = @@APPORTREPLACED@@" % (line.split('=')[0]) + report[key] += line + '\n' + except IndexError: + continue + +def add_info(report): + attach_conffiles(report, 'mysql-server-5.6', conffiles=None) + key = 'Logs' + path_to_key('/var/log/daemon.log') + report[key] = "" + for line in read_file('/var/log/daemon.log').split('\n'): + try: + if 'mysqld' in line.split()[4]: + report[key] += line + '\n' + except IndexError: + continue + if os.path.exists('/var/log/mysql/error.log'): + key = 'Logs' + path_to_key('/var/log/mysql/error.log') + report[key] = "" + for line in read_file('/var/log/mysql/error.log').split('\n'): + report[key] += line + '\n' + attach_mac_events(report, '/usr/sbin/mysqld') + attach_file(report,'/etc/apparmor.d/usr.sbin.mysqld') + _add_my_conf_files(report, '/etc/mysql/my.cnf') + _add_my_conf_files(report, '/etc/mysql/mysql.cnf') + for d in ['/etc/mysql/conf.d', '/etc/mysql/mysql.conf.d']: + for f in os.listdir(d): + _add_my_conf_files(report, os.path.join(d, f)) + try: + report['MySQLVarLibDirListing'] = str(os.listdir('/var/lib/mysql')) + except OSError: + report['MySQLVarLibDirListing'] = str(False) + +if __name__ == '__main__': + report = {} + add_info(report) + for key in report: + print('%s: %s' % (key, report[key].split('\n', 1)[0])) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/gbp.conf percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/gbp.conf --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/gbp.conf 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,8 @@ +[DEFAULT] +# Ignore requirement to use branch name 'master' to make it easier +# for contributors to work with feature and bugfix branches +ignore-branch = True + +upstream-branch = 5.6-v25 +upstream-tree = branch +pristine-tar = False diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient18.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient18.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient18.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient18.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,20 @@ +# 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 +# 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.18* +usr/lib/*/libmysqlclient_r.so.18* +# legal +usr/share/doc/libmysqlclient18/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/libmysqlclient18/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient18.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient18.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient18.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient18.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,20 @@ +# 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 +# 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/@DEB_INSTALL_LICENSEFILE@.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 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.examples.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.examples.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.examples.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.examples.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +sql/udf_example.cc diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,30 @@ +# 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 +# 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/bin/mysql_config +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_r.a +usr/lib/*/libmysqlclient.so +usr/lib/*/libmysqlclient_r.so +usr/lib/*/libmysqlservices.a +usr/share/aclocal/mysql.m4 +usr/share/man/man1/mysql_config.1 +# legal +usr/share/doc/libmysqlclient-dev/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/libmysqlclient-dev/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,21 @@ +# 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 +# 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/@DEB_INSTALL_LICENSEFILE@.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 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.README.Maintainer.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.README.Maintainer.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/libmysqlclient-dev.README.Maintainer.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/libmysqlclient-dev.README.Maintainer.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,4 @@ +The examples directory includes files that might be needed by some +developers: +- header files not installed by default +- the example file udf_example.c diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.docs.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.docs.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.docs.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.docs.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,2 @@ +README +debian/extra/innotop/changelog.innotop diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,21 @@ +# this executable reprsent the embedded mysql server client +debian/extra/innotop/innotop usr/bin/ +debian/extra/mysqlreport usr/bin/ +usr/bin/myisam_ftdump +usr/bin/mysql +usr/bin/mysql_config_editor +usr/bin/mysql_find_rows +usr/bin/mysql_fix_extensions +usr/bin/mysql_waitpid +usr/bin/mysqlaccess +usr/bin/mysqladmin +usr/bin/mysqlbug +usr/bin/mysqlcheck +usr/bin/mysqldump +usr/bin/mysqldumpslow +usr/bin/mysqlimport +usr/bin/mysqlshow +usr/bin/mysqlslap +usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/ +usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.links.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.links.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.links.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.links.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,3 @@ +usr/bin/mysqlcheck usr/bin/mysqlanalyze +usr/bin/mysqlcheck usr/bin/mysqloptimize +usr/bin/mysqlcheck usr/bin/mysqlrepair diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,21 @@ +# 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 +# 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-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/LICENSE.mysql +mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz +mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl +# Due to static linking this cannot be avoided and hence being overridden +mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: embedded-library diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.manpages.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.manpages.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.manpages.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.manpages.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,14 @@ +debian/extra/innotop/innotop.1 +debian/extra/mysqlreport.1 +debian/tmp/usr/share/man/man1/mysqlman.1 +debian/tmp/usr/share/man/man1/myisam_ftdump.1 +debian/tmp/usr/share/man/man1/mysql.1 +debian/tmp/usr/share/man/man1/mysql_config_editor.1 +debian/tmp/usr/share/man/man1/mysqladmin.1 +debian/tmp/usr/share/man/man1/mysqlcheck.1 +debian/tmp/usr/share/man/man1/mysqldump.1 +debian/tmp/usr/share/man/man1/mysqldumpslow.1 +debian/tmp/usr/share/man/man1/mysqlimport.1 +debian/tmp/usr/share/man/man1/mysqlman.1 +debian/tmp/usr/share/man/man1/mysqlshow.1 +debian/tmp/usr/share/man/man1/mysqlslap.1 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.README.Debian.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.README.Debian.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-client-SERIES.README.Debian.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-client-SERIES.README.Debian.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,4 @@ +FAQ: + +Q: My completition is gone, why? +A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf! diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.dirs.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.dirs.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.dirs.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.dirs.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,16 @@ +# 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 +# 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 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,29 @@ +# 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 +# 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/conf.d etc/mysql/ +debian/extra/configure-symlinks usr/share/mysql-common/ +debian/extra/my.cnf.fallback etc/mysql/ + +usr/share/mysql/docs/ChangeLog +usr/share/mysql/docs/INFO_SRC +usr/share/mysql/docs/INFO_BIN +# charsets +usr/share/mysql/charsets/*.xml +usr/share/mysql/charsets/README +# legal +usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,19 @@ +# 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 +# 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-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/LICENSE.mysql +mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz +mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.maintscript.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.maintscript.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.maintscript.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.maintscript.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,2 @@ +rm_conffile /etc/mysql/conf.d/.keepme 5.6.22-1~ mysql-common +rm_conffile /etc/mysql/my.cnf 5.6.22-1~ mysql-common diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.postinst.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.postinst.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.postinst.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.postinst.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin 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# diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.postrm.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.postrm.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.postrm.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.postrm.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/bash + +# 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 +# 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 +fi + +#DEBHELPER# diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.preinst.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.preinst.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.preinst.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.preinst.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,37 @@ +#!/bin/sh +set -e + +if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then + if dpkg --compare-versions "$2" lt-nl "5.6.25-3~" ; then + + # revert fallback my.cnf symlink setup performed by mariadb-common + # from 10.0.17-1~exp2 upto 10.0.20-2 + if [ -L /etc/mysql/my.cnf ] && [ -f /etc/mysql/my.cnf.old ]; then + if [ "$(readlink /etc/mysql/my.cnf)" = "mariadb.cnf" ]; then + echo "Reverting my.cnf -> mariadb.cnf symlink setup by mariadb-common" + rm /etc/mysql/my.cnf + mv /etc/mysql/my.cnf.old /etc/mysql/my.cnf + fi + fi + + # recover from mysql-common 5.6.25-2 turning this symlinked + # mariadb.cnf into my.cnf.migrated + if [ -f /etc/mysql/my.cnf.migrated ]; then + if [ "$(md5sum /etc/mysql/my.cnf.migrated | awk '{ print $1 }')" = "4720bbc1a03252fbb9eb83b55f0b6e10" ]; then + # unmodified mariadb.cnf with the migration header prepended + # by mysql-common.postinst + echo "Removing incorrect /etc/mysql/my.cnf.migrated that was actually mariadb.cnf" + rm /etc/mysql/my.cnf.migrated + if [ -f /etc/mysql/my.cnf.old ]; then + echo "Renaming (possibly unmodified) /etc/mysql/my.cnf.old to /etc/mysql/my.cnf.migrated" + mv /etc/mysql/my.cnf.old /etc/mysql/my.cnf.migrated + else + update-alternatives --remove my.cnf /etc/mysql/my.cnf.migrated + fi + fi + fi + + fi +fi + +#DEBHELPER# diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.prerm.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.prerm.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-common-SERIES.prerm.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-common-SERIES.prerm.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +if [ "$1" = "remove" ]; then + update-alternatives --remove my.cnf /etc/mysql/my.cnf.fallback + update-alternatives --remove my.cnf /etc/mysql/my.cnf.migrated +fi + +#DEBHELPER# diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.config.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.config.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.config.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.config.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,97 @@ +#!/bin/bash + +# 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 +# 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 + +get_root_pass(){ + while :; do + PASSWD="" + db_input high mysql-@DEB_PRODUCTNAME@-server/root-pass || true + db_go + + db_get mysql-@DEB_PRODUCTNAME@-server/root-pass + if [ -z "${RET}" ]; + then + db_fset mysql-@DEB_PRODUCTNAME@-server/root-pass seen true + db_fset mysql-@DEB_PRODUCTNAME@-server/re-root-pass seen true + break + fi + PASSWD="${RET}" + + db_input high mysql-@DEB_PRODUCTNAME@-server/re-root-pass || true + db_go + + db_get mysql-@DEB_PRODUCTNAME@-server/re-root-pass + if [ "${RET}" == "${PASSWD}" ]; + then + PASSWD="" + break + fi + + db_fset mysql-@DEB_PRODUCTNAME@-server/root-pass-mismatch seen false + db_input critical mysql-@DEB_PRODUCTNAME@-server/root-pass-mismatch + db_set mysql-@DEB_PRODUCTNAME@-server/root-pass "" + db_set mysql-@DEB_PRODUCTNAME@-server/re-root-pass "" + done +} +if [ "$1" = "configure" ] && [ -z "$2" ]; +then + + set -e + + PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-server-5.7: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-@DEB_PRODUCTNAME@-server/data-dir || true + else + db_fset mysql-@DEB_PRODUCTNAME@-server/data-dir seen true + fi + + get_root_pass + + else + db_fset mysql-@DEB_PRODUCTNAME@-server/data-dir seen true + # If datadir is missing, ask for root password even with existing packages + if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ]; + then + get_root_pass + else + db_fset mysql-@DEB_PRODUCTNAME@-server/root-pass seen true + db_fset mysql-@DEB_PRODUCTNAME@-server/re-root-pass seen true + fi + fi + + set +e +fi diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.dirs.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.dirs.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.dirs.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.dirs.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,17 @@ +# 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 +# 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 +var/lib/mysql-upgrade diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.examples.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.examples.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.examples.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.examples.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,3 @@ +debian/tmp/usr/lib/mysql/plugin/daemon_example.ini +debian/tmp/usr/share/mysql/wsrep.cnf +debian/tmp/usr/share/mysql/magic diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,117 @@ +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# debian/extra/mysql-systemd-start usr/share/mysql/ +#debian/extra/mysql.cnf etc/mysql/ +# debian/extra/mysql.conf.d etc/mysql/ +# debian/extra/source_mysql-5.7.py usr/share/apport/package-hooks/ +@DEB_INSTALL_SERVER_APPARMOR@ +etc/mysql/debian-start +# binaries +usr/bin/innochecksum +usr/bin/msql2mysql +usr/bin/mysqlhotcopy +usr/bin/mysql_convert_table_format +usr/bin/myisamchk +usr/bin/myisamlog +usr/bin/myisampack +usr/bin/my_print_defaults +usr/bin/mysqld_multi +usr/scripts/mysql_install_db usr/bin/ +usr/bin/mysql_plugin +usr/bin/mysql_secure_installation +usr/bin/mysql_setpermission +usr/bin/mysql_tzinfo_to_sql +usr/bin/mysql_upgrade +usr/bin/mysqlbinlog +usr/bin/mysql_zap +usr/bin/perror +usr/bin/replace +usr/bin/resolveip +usr/bin/resolve_stack_dump usr/lib/mysql/ +usr/bin/wsrep_sst_common +usr/bin/wsrep_sst_mysqldump +usr/bin/wsrep_sst_rsync +usr/bin/wsrep_sst_xtrabackup +usr/bin/wsrep_sst_xtrabackup-v2 +# plugins +usr/lib/mysql/plugin/adt_null.so +usr/lib/mysql/plugin/auth_socket.so +usr/lib/mysql/plugin/connection_control.so +usr/lib/mysql/plugin/innodb_engine.so +usr/lib/mysql/plugin/libmemcached.so +usr/lib/mysql/plugin/mypluglib.so +usr/lib/mysql/plugin/mysql_no_login.so +usr/lib/mysql/plugin/semisync_master.so +usr/lib/mysql/plugin/semisync_slave.so +usr/lib/mysql/plugin/validate_password.so +@DEB_INSTALL_SERVER_PLUGINS@ +# server +usr/sbin/mysqld +# man pages +usr/share/man/man1/innochecksum.1 +usr/share/man/man1/comp_err.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/mysql.server.1 +usr/share/man/man1/mysql-stress-test.pl.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_tzinfo_to_sql.1 +usr/share/man/man1/mysql_upgrade.1 +usr/share/man/man1/mysqlbinlog.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 +usr/share/mysql/my-default.cnf +debian/extra/mysql.cnf etc/mysql/ +debian/extra/mysqld.cnf /etc/mysql/mysql.conf.d/ +# app armor profile +@DEB_INSTALL_SERVER_APPARMOR@ +# startup files, depending on mechanism used by distro +@DEB_FILES_STARTUP@ +# SQL files +usr/share/mysql/*.sql +# support files +usr/share/mysql/debian-start.inc.sh +# usr/share/mysql/debian_create_root_user.sql +usr/share/mysql/dictionary.txt +# usr/share/mysql/echo_stderr +usr/share/mysql/fill_help_tables.sql +usr/share/mysql/innodb_memcached_config.sql +usr/share/mysql/magic +usr/share/mysql/mysql-log-rotate +usr/share/mysql/mysql_security_commands.sql +usr/share/mysql/mysql_system_tables.sql +usr/share/mysql/mysql_system_tables_data.sql +usr/share/mysql/mysql_test_data_timezone.sql +usr/share/mysql/wsrep.cnf +usr/share/mysql/wsrep_notify +usr/share/mysql/mysql-helpers +# localized error msgs +usr/share/mysql/*/errmsg.sys +usr/share/mysql/errmsg-utf8.txt +@DEB_INSTALL_SERVER_SYSTEMD@ +# legal +usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/ +usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/README +usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_WSREP_README@ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,21 @@ +# 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 +# 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-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/LICENSE.mysql +mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz +mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl +mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: embedded-library + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.paranoid.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.paranoid.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.paranoid.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.paranoid.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,8 @@ +/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$ +/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ +/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ +mysqld\[[0-9]+\]: $ +mysqld\[[0-9]+\]: Version: .* socket: '/var/run/mysqld/mysqld.sock' port: 3306$ +mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$ +usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$ +usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.server.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.server.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.server.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.server.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,17 @@ +/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ +/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$ +/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ +/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ +mysqld\[[0-9]+\]: ?$ +mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed +mysqld\[[0-9]+\]: .*InnoDB: Started; +mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$ +mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$ +mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$ +mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$ +mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$ +mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$ +mysqld\[[0-9]+\]: Version: .* socket +mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$ +usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$ +usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.workstation.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.workstation.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.workstation.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.workstation.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,17 @@ +/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ +/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$ +/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ +/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ +mysqld\[[0-9]+\]: ?$ +mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed +mysqld\[[0-9]+\]: .*InnoDB: Started; +mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$ +mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$ +mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$ +mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$ +mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$ +mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$ +mysqld\[[0-9]+\]: Version: .* socket +mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$ +usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$ +usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.init.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.init.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.init.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.init.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,197 @@ +#!/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 and stop the mysql database server daemon +# Description: Controls the main MySQL database server daemon "mysqld" +# and its wrapper script "mysqld_safe". +### END INIT INFO +# +set -e +set -u +${DEBIAN_SCRIPT_DEBUG:+ set -v -x} + +test -x /usr/bin/mysqld_safe || exit 0 + +. /lib/lsb/init-functions + +SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) +CONF=/etc/mysql/my.cnf +MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + +# priority can be overriden and "-s" adds output to stderr +ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i" + +# Safeguard (relative paths, core dumps..) +cd / +umask 077 + +# mysqladmin likes to read /root/.my.cnf. This is usually not what I want +# as many admins e.g. only store a password without a username there and +# so break my scripts. +export HOME=/etc/mysql/ + +## Fetch a particular option from mysql's invocation. +# +# Usage: void mysqld_get_param option +mysqld_get_param() { + /usr/sbin/mysqld --print-defaults \ + | tr " " "\n" \ + | grep -- "--$1" \ + | tail -n 1 \ + | cut -d= -f2 +} + +## Do some sanity checks before even trying to start mysqld. +sanity_checks() { + # check for config file + if [ ! -r /etc/mysql/my.cnf ]; then + log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" + echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER + fi + + # check for diskspace shortage + datadir=`mysqld_get_param datadir` + if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then + log_failure_msg "$0: ERROR: The partition with $datadir is too full!" + echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER + exit 1 + fi +} + +## Checks if there is a server running and if so if it is accessible. +# +# check_alive insists on a pingable server +# check_dead also fails if there is a lost mysqld in the process list +# +# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn] +mysqld_status () { + ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) + + ps_alive=0 + pidfile=`mysqld_get_param pid-file` + if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi + + if [ "$1" = "check_alive" -a $ping_alive = 1 ] || + [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then + return 0 # EXIT_SUCCESS + else + if [ "$2" = "warn" ]; then + echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug + fi + return 1 # EXIT_FAILURE + fi +} + +# +# main() +# + +case "${1:-''}" in + 'start'|'bootstrap') + sanity_checks; + # Start daemon + if [ "$1" = "bootstrap" ]; then + log_daemon_msg "Starting first Galera Cluster node" "mysqld" + BOOTSTRAP='--wsrep-new-cluster' + else + log_daemon_msg "Starting MySQL database server" "mysqld" + BOOTSTRAP='' + fi + if mysqld_status check_alive nowarn; then + log_progress_msg "already running" + log_end_msg 0 + else + # Could be removed during boot + test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld + + # Start MySQL! + su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe $BOOTSTRAP > /dev/null 2>&1 &" + + # 6s was reported in #352070 to be too few when using ndbcluster + # 14s was reported in #736452 to be too few with large installs + for i in $(seq 1 30); do + sleep 1 + if mysqld_status check_alive nowarn ; then break; fi + log_progress_msg "." + done + if mysqld_status check_alive warn; then + log_end_msg 0 + # Now start mysqlcheck or whatever the admin wants. + output=$(/etc/mysql/debian-start) + [ -n "$output" ] && log_action_msg "$output" + else + log_end_msg 1 + log_failure_msg "Please take a look at the syslog" + fi + fi + ;; + + 'stop') + # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible + # at least for cron, we can rely on it here, too. (although we have + # to specify it explicit as e.g. sudo environments points to the normal + # users home and not /root) + log_daemon_msg "Stopping MySQL database server" "mysqld" + if ! mysqld_status check_dead nowarn; then + set +e + shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? + set -e + if [ "$r" -ne 0 ]; then + log_end_msg 1 + [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" + log_daemon_msg "Killing MySQL database server by signal" "mysqld" + killall -15 mysqld + server_down= + for i in 1 2 3 4 5 6 7 8 9 10; do + sleep 1 + if mysqld_status check_dead nowarn; then server_down=1; break; fi + done + if test -z "$server_down"; then killall -9 mysqld; fi + fi + fi + + if ! mysqld_status check_dead warn; then + log_end_msg 1 + log_failure_msg "Please stop MySQL manually and read /usr/share/doc/mysql-server-5.7/README.Debian.gz!" + exit -1 + else + log_end_msg 0 + fi + ;; + + 'restart') + set +e; $SELF stop; set -e + $SELF start + ;; + + 'reload'|'force-reload') + log_daemon_msg "Reloading MySQL database server" "mysqld" + $MYADMIN reload + log_end_msg 0 + ;; + + 'status') + if mysqld_status check_alive nowarn; then + log_action_msg "$($MYADMIN version)" + else + log_action_msg "MySQL is stopped." + exit 3 + fi + ;; + + *) + echo "Usage: $SELF start|stop|restart|reload|force-reload|status|bootstrap" + exit 1 + ;; +esac + +# Some success paths end up returning non-zero so exit 0 explicitly. See +# bug #739846. +exit 0 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.mysql-server.logrotate.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.mysql-server.logrotate.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.mysql-server.logrotate.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.mysql-server.logrotate.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,27 @@ +# - I put everything in one block and added sharedscripts, so that mysql gets +# flush-logs'd only once. +# Else the binary logs would automatically increase by n times every day. +# - The error log is obsolete, messages go to syslog now. +/var/log/mysql.log /var/log/mysql/*log { + daily + rotate 7 + missingok + create 640 mysql adm + compress + sharedscripts + postrotate + test -x /usr/bin/mysqladmin || exit 0 + # If this fails, check debian.conf! + MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then + # Really no mysqld or rather a missing debian-sys-maint user? + # If this occurs and is not a error please report a bug. + #if ps cax | grep -q mysqld; then + if killall -q -s0 -umysql mysqld; then + exit 1 + fi + else + $MYADMIN flush-logs + fi + endscript +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,39 @@ +# 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 +# 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 @DEB_PRODUCTNAMEC@ Server +After=network.target + +[Install] +WantedBy=multi-user.target + +[Service] +User=mysql +Group=mysql +Type=forking +PermissionsStartOnly=true +PIDFile=/var/run/mysqld/mysqld.pid +@DEB_SERVICE_SERVER_EXECPRE@ +ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS $MYSQLD_RECOVER_START +@DEB_SERVICE_SERVER_EXECPOST@ +TimeoutSec=600 +LimitNOFILE = 5000 +Restart=on-failure +RestartPreventExitStatus=1 +RuntimeDirectory=mysqld +RuntimeDirectoryMode=755 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.postinst.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.postinst.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.postinst.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.postinst.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,98 @@ +#!/bin/bash + +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +. /usr/share/debconf/confmodule +. /usr/share/mysql/mysql-helpers +take_upstart_job_backup () { + if [ -e "/etc/init/mysql.conf" ] && [ -d "/var/lib/mysql" ]; + then + mysql_install_db --user=mysql > /dev/null + mv /etc/init/mysql.conf /var/lib/mysql/.mysql.conf.backup + fi +} + +invoke() { + if pathfind invoke-rc.d; then + invoke-rc.d mysql + else + /etc/init.d/mysql $1 + fi +} +case "$1" in + configure) + + if [ -z "$2" ]; + then + + set -e + # If the existing config file is a proper file, we back it up + if [ -f "/etc/mysql/my.cnf" ] && [ ! -L "/etc/mysql/my.cnf" ]; then + cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak + fi + update-alternatives --force --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mysql.cnf" 200 + + verify_ready + MYSQLDATA=/var/lib/mysql + MYSQLFILES=/var/lib/mysql-files + if aa-status --enabled 2>/dev/null; then + apparmor_parser -r -T -W /etc/apparmor.d/usr.sbin.mysqld 2>/dev/null || true + fi + if [ ! "$(ls -A ${MYSQLDATA})" ] && [ -d ${MYSQLFILES} ]; + then + db_get mysql-@DEB_PRODUCTNAME@-server/root-pass && PASSWD=${RET} + db_set mysql-@DEB_PRODUCTNAME@-server/root-pass "" + db_set mysql-@DEB_PRODUCTNAME@-server/re-root-pass "" + SQL=$(mktemp -u ${MYSQLFILES}/XXXXXXXXXX) + install /dev/null -m0600 -omysql -gmysql "${SQL}" + if [ ! -z "${PASSWD}" ]; + then + PASSWD=$(printf %q "${PASSWD}") + cat << EOF > ${SQL} +USE mysql; +UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root'; +DELETE FROM user WHERE user=''; +FLUSH PRIVILEGES; +EOF + PASSWD="" + fi + mysql_install_db --user=mysql > /dev/null + run_init_sql "$SQL" + 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 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.postrm.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.postrm.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.postrm.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.postrm.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,172 @@ +#!/bin/bash + +# 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 +# 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 + MYSQLFILES=/var/lib/mysql-files + MYSQLKEYRING=/var/lib/mysql-keyring + MYSQLLOG=/var/log/mysql + MYSQLRUN=/var/run/mysqld + + server_stop + + db_input high mysql-@DEB_PRODUCTNAME@-server/remove-data-dir || true + db_go + db_get mysql-@DEB_PRODUCTNAME@-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 [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ]; + then + rm -rf ${MYSQLFILES} + fi + + if [ -d ${MYSQLKEYRING} ] || [ -L ${MYSQLKEYRING} ]; + then + rm -rf ${MYSQLKEYRING} + 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 [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ]; + then + rm -rf ${MYSQLFILES} + fi + + if getent passwd mysql >/dev/null; + then + userdel mysql + fi + fi + + set +e + ;; + + upgrade|abort-upgrade) + + ;; + + *) + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.preinst.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.preinst.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.preinst.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.preinst.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin 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 + + set +e + + fi + + ;; + + upgrade) + + set -e + + #DEBHELPER# + server_stop + + set +e + + ;; + + abort-upgrade) + + ;; + + *) + exit 1 + ;; +esac + +exit 0 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.prerm.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.prerm.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.prerm.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.prerm.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/bash + +# 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 +# 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 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.README.Debian.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.README.Debian.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.README.Debian.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.README.Debian.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,109 @@ +* MYSQL WON'T START OR STOP?: +============================= +You may never ever delete the special mysql user "debian-sys-maint". This +user together with the credentials in /etc/mysql/debian.cnf are used by the +init scripts to stop the server as they would require knowledge of the mysql +root users password else. +So in most of the times you can fix the situation by making sure that the +debian.cnf file contains the right password, e.g. by setting a new one +(remember to do a "flush privileges" then). + +* WHAT TO DO AFTER UPGRADES: +============================ +The privilege tables are automatically updated so all there is left is read +the changelogs on dev.mysql.com to see if any changes affect custom apps. + +* WHAT TO DO AFTER INSTALLATION: +================================ +The MySQL manual describes certain steps to do at this stage in a separate +chapter. They are not necessary as the Debian packages does them +automatically. + +The only thing that is left over for the admin is + - setting the passwords + - creating new users and databases + - read the rest of this text + +* DOWNGRADING TO 4.0 or 4.1: +============================ +Unsupported. Period. +But if you do and get problems or make interesting experiences, mail me, it +might help others. +Ok, if you really want, I would recommend to "mysqldump --opt" all tables, +then purge 4.1, delete /var/lib/mysql, install 4.0 and insert the dumps. Be +carefully, though, with the "mysql" table, you might not simply overwrite that +one as the password for the mysql "debian-sys-maint" user is stored in +/etc/mysql/debian.cnf and needed by /etc/init.d/ to start mysql and check if +it's alive. + +* SOME APPLICATION CAN NO LONGER CONNECT: +========================================= +This application is probably linked against libmysqlclient12 or below and +somebody has created a mysql user with new-style passwords. +The old_passwords=1 option in /etc/mysql/my.cnf might help. If not the +application that inserted the user has to be changed or the application that +tries to connect updated to libmysqlclient14 or -15. + +* NETWORKING: +============= +For security reasons, the Debian package has enabled networking only on the +loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with +"netstat -tlnp" where it is listening. If your connection is aborted +immediately see if "mysqld: all" or similar is in /etc/hosts.allow and read +hosts_access(5). + +* WHERE IS THE DOCUMENTATION?: +============================== +Unfortunately due to licensing restrictions, debian currently not able +to provide the mysql-doc package in any format. For the most up to date +documentation, please go to http://dev.mysql.com/doc. + +* PASSWORDS: +============ +It is strongly recommended to set a password for the mysql root user (which + /usr/bin/mysql -u root -D mysql -e "update user set password=password('new-password') where user='root'" + /usr/bin/mysql -u root -e "flush privileges" +If you already had a password set add "-p" before "-u" to the lines above. + + +If you are tired to type the password in every time or want to automate your +scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600 +(-rw------- username username .my.cnf) to ensure that nobody else can read +it. Every other configuration parameter can be stored there, too. You will +find an example below and more information in the MySQL manual in +/usr/share/doc/mysql-doc or www.mysql.com. + +ATTENTION: It is necessary, that a .my.cnf from root always contains a "user" +line wherever there is a "password" line, else, the Debian maintenance +scripts, that use /etc/mysql/debian.cnf, will use the username +"debian-sys-maint" but the password that is in root's .my.cnf. Also note, +that every change you make in the /root/.my.cnf will affect the mysql cron +script, too. + + # an example of $HOME/.my.cnf + [client] + user = your-mysql-username + password = enter-your-good-new-password-here + +* BIG_ROWS FOR EVEN MORE ROWS IN A TABLE: +========================================= +If you ever run out of rows in a table there is the possibility of building +the package with "-DBIG_ROWS" which, according to a MySQL employee on +packagers@lists.mysql.com should lead to a 64bit row index (I guess > 2^32 +rows) but also to an approx. 5% performance loss. + +* BerkeleyDB Storage Engine +=========================== +Support for BerkeleyDB has been removed in 5.1, and consequently both the +have-bdb and skip-bdb configuration options will cause the server to fail. +Removing the options from /etc/mysql/my.cnf will fix this problem. + +* FURTHER NOTES ON REPLICATION +=============================== +If the MySQL server is acting as a replication slave, you should not +set --tmpdir to point to a directory on a memory-based filesystem or to +a directory that is cleared when the server host restarts. A replication +slave needs some of its temporary files to survive a machine restart so +that it can replicate temporary tables or LOAD DATA INFILE operations. If +files in the temporary file directory are lost when the server restarts, +replication fails. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.templates.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.templates.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.templates.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.templates.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,88 @@ +Template: mysql-@DEB_PRODUCTNAME@-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 to enable password less login using UNIX socket based authentication. + +Template: mysql-@DEB_PRODUCTNAME@-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-@DEB_PRODUCTNAME@-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-@DEB_PRODUCTNAME@-server/remove-data-dir +Type: boolean +Default: false +_Description: Remove data directories ? + This operation will remove the data directory at '/var/lib/mysql' that stores all the databases, tables and related meta-data. + Additionally, any import or export files stored at '/var/lib/mysql-files' will be removed along with directory, as well as the contents of + /var/lib/mysql-keyring. + It is highly recommended to take data backup before removing the data directories. + +Template: mysql-@DEB_PRODUCTNAME@-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. + +Template: mysql-@DEB_PRODUCTNAME@-server/really_downgrade +Type: boolean +Default: false +_Description: Really proceed with downgrade? + A file named /var/lib/mysql/debian-*.flag exists on this system. + . + Such a file is an indication that a mysql-server package with a higher + version has been installed previously. + . + There is no guarantee that the version you're currently installing + will be able to use the current databases. + +Template: mysql-@DEB_PRODUCTNAME@-server/nis_warning +Type: note +_Description: Important note for NIS/YP users + Using MySQL under NIS/YP requires a mysql user account to be added on + the local system with: + . + adduser --system --group --home /var/lib/mysql mysql + . + You should also check the permissions and ownership of the + /var/lib/mysql directory: + . + /var/lib/mysql: drwxr-xr-x mysql mysql + +Template: mysql-@DEB_PRODUCTNAME@-server/postrm_remove_databases +Type: boolean +Default: false +_Description: Remove all MySQL databases? + The /var/lib/mysql directory which contains the MySQL databases is about + to be removed. + . + This will also erase all data in /var/lib/mysql-files as well as + /var/lib/mysql-keyring. + . + If you're removing the MySQL package in order to later install a more + recent version or if a different mysql-server package is already + using it, the data should be kept. + +Template: mysql-@DEB_PRODUCTNAME@-server/start_on_boot +Type: boolean +Default: true +_Description: Start the MySQL server on boot? + The MySQL server can be launched automatically at boot time or manually + with the '/etc/init.d/mysql start' command. + +Template: mysql-@DEB_PRODUCTNAME@-server/no_upgrade_when_using_ndb +Type: error +_Description: NDB Cluster seems to be in use + MySQL-5.7 no longer provides NDB Cluster support. Please migrate to the new + mysql-cluster-server package and remove all lines starting with "ndb" from + all config files below /etc/mysql/. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.upstart.disabled.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.upstart.disabled.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-server-SERIES.upstart.disabled.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-server-SERIES.upstart.disabled.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,63 @@ +description "MySQL 5.7 Server" +author "Mario Limonciello " + +start on runlevel [2345] +stop on starting rc RUNLEVEL=[016] + +respawn +respawn limit 2 5 + +env HOME=/etc/mysql +umask 007 + +# The default of 5 seconds is too low for mysql which needs to flush buffers +kill timeout 300 + +pre-start script + ## Fetch a particular option from mysql's invocation. + # Usage: void mysqld_get_param option + mysqld_get_param() { + /usr/sbin/mysqld --print-defaults \ + | tr " " "\n" \ + | grep -- "--$1" \ + | tail -n 1 \ + | cut -d= -f2 + } + + # priority can be overriden and "-s" adds output to stderr + ERR_LOGGER="logger -p daemon.err -t /etc/init/mysql.conf -i" + + #Sanity checks + [ -r $HOME/my.cnf ] + [ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld + /lib/init/apparmor-profile-load usr.sbin.mysqld + + # check for diskspace shortage + datadir=`mysqld_get_param datadir` + BLOCKSIZE=`LC_ALL=C df --portability $datadir/. | tail -n 1 | awk '{print $4}'` + if [ $BLOCKSIZE -le 4096 ] ; then + echo "$0: ERROR: The partition with $datadir is too full!" >&2 + echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER + exit 1 + fi +end script + +exec /usr/sbin/mysqld + +post-start script + for i in `seq 1 30` ; do + /usr/bin/mysqladmin --defaults-file="${HOME}"/debian.cnf ping && { + exec "${HOME}"/debian-start + # should not reach this line + exit 2 + } + statusnow=`status` + if echo $statusnow | grep -q 'stop/' ; then + exit 0 + elif echo $statusnow | grep -q 'respawn/' ; then + exit 1 + fi + sleep 1 + done + exit 1 +end script diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-source-SERIES.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-source-SERIES.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-source-SERIES.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-source-SERIES.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,21 @@ +# 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 +# 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/ +@DEB_INSTALL_SOURCE_XZ@ +# legal +usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-source-SERIES.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-source-SERIES.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-source-SERIES.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-source-SERIES.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,19 @@ +# 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 +# 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-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/LICENSE.mysql +mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz +mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-test-SERIES.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-test-SERIES.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-test-SERIES.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-test-SERIES.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,69 @@ +# 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 +# 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/mysql_client_test +usr/bin/mysqltest +# manpages +usr/share/man/man1/mysql_client_test.1 +usr/share/man/man1/mysql-test-run.pl.1 +usr/share/man/man1/mysqltest.1 +# plugins +usr/lib/mysql/plugin/auth.so +usr/lib/mysql/plugin/auth_test_plugin.so +usr/lib/mysql/plugin/daemon_example.ini +usr/lib/mysql/plugin/libdaemon_example.so +usr/lib/mysql/plugin/qa_auth_client.so +usr/lib/mysql/plugin/qa_auth_interface.so +usr/lib/mysql/plugin/qa_auth_server.so +usr/lib/mysql/plugin/test_udf_services.so +#usr/lib/mysql/plugin/debug/auth.so +#usr/lib/mysql/plugin/debug/auth_test_plugin.so +#usr/lib/mysql/plugin/debug/daemon_example.ini +# usr/lib/mysql/plugin/debug/ha_example.so +#usr/lib/mysql/plugin/debug/libdaemon_example.so +# usr/lib/mysql/plugin/debug/libtest_framework.so +# usr/lib/mysql/plugin/debug/libtest_services.so +# usr/lib/mysql/plugin/debug/libtest_services_threaded.so +# usr/lib/mysql/plugin/debug/libtest_session_detach.so +# usr/lib/mysql/plugin/debug/libtest_session_info.so +# usr/lib/mysql/plugin/debug/libtest_session_in_thd.so +# usr/lib/mysql/plugin/debug/libtest_sql_2_sessions.so +# usr/lib/mysql/plugin/debug/libtest_sql_all_col_types.so +# usr/lib/mysql/plugin/debug/libtest_sql_cmds_1.so +# usr/lib/mysql/plugin/debug/libtest_sql_commit.so +# usr/lib/mysql/plugin/debug/libtest_sql_complex.so +# usr/lib/mysql/plugin/debug/libtest_sql_errors.so +# usr/lib/mysql/plugin/debug/libtest_sql_lock.so +# usr/lib/mysql/plugin/debug/libtest_sql_processlist.so +# usr/lib/mysql/plugin/debug/libtest_sql_replication.so +# usr/lib/mysql/plugin/debug/libtest_sql_shutdown.so +# usr/lib/mysql/plugin/debug/libtest_sql_sqlmode.so +# usr/lib/mysql/plugin/debug/libtest_sql_stored_procedures_functions.so +# usr/lib/mysql/plugin/debug/libtest_sql_views_triggers.so +# usr/lib/mysql/plugin/debug/libtest_x_sessions_deinit.so +# usr/lib/mysql/plugin/debug/libtest_x_sessions_init.so +#usr/lib/mysql/plugin/debug/qa_auth_client.so +#usr/lib/mysql/plugin/debug/qa_auth_interface.so +#usr/lib/mysql/plugin/debug/qa_auth_server.so +# usr/lib/mysql/plugin/debug/replication_observers_example_plugin.so +# usr/lib/mysql/plugin/debug/rewrite_example.so +# usr/lib/mysql/plugin/debug/test_security_context.so +#usr/lib/mysql/plugin/debug/test_udf_services.so +# test suite +usr/lib/mysql-test/* +# legal +usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-test-SERIES.links.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-test-SERIES.links.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-test-SERIES.links.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-test-SERIES.links.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,17 @@ +# 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 +# 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 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-test-SERIES.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-test-SERIES.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-packagesource-test-SERIES.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-packagesource-test-SERIES.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,19 @@ +# 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 +# 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-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/LICENSE.mysql +mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz +mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-server.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-server.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-server.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-server.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,18 @@ +# 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 +# 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/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/mysql-server/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-server.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-server.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-server.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-server.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,19 @@ +# 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 +# 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/@DEB_INSTALL_LICENSEFILE@.gz +mysql-server: copyright-should-refer-to-common-license-file-for-lgpl diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-testsuite.install.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-testsuite.install.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-testsuite.install.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-testsuite.install.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,18 @@ +# 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 +# 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/@DEB_INSTALL_LICENSEFILE@ +usr/share/doc/mysql-testsuite/README diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-testsuite.lintian-overrides.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-testsuite.lintian-overrides.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/mysql-testsuite.lintian-overrides.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/mysql-testsuite.lintian-overrides.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,19 @@ +# 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 +# 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/@DEB_INSTALL_LICENSEFILE@.gz +mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ar.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ar.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ar.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ar.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,252 @@ +# translation of templates.po to Arabic +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Ossama M. Khayat , 2007. +msgid "" +msgstr "" +"Project-Id-Version: templates\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2007-05-01 13:04+0300\n" +"Last-Translator: Ossama M. Khayat \n" +"Language-Team: Arabic \n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=6; plural=n==1 ? 0 : n==0 ? 1 : n==2 ? 2: n%100>=3 && " +"n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" +": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" +": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" +": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" +": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" +": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" +": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "هل Ùعلاً تريد التثبيط؟" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "هناك مل٠مسمى /var/lib/mysql/debian-*.flag موجود على هذا النظام." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "" +#| "Such file is an indication that a mysql-server package with a higher " +#| "version has been installed earlier." +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"هذا المل٠دلالة على أن نسخة أحدث من حزمة mysql-server تم تثبيتها مسبقاً." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"ليست هناك أية ضمانة أن النسخة التي تقوم بتثبيتها ستكون قادرة على استخدام " +"قواعد البيانات الحالية." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "ملاحظة هامة لمستخدمي NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "" +#| "You should also check the permissions and the owner of the /var/lib/mysql " +#| "directory:" +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "عليك أيضاً أن تقوم بالتأكد من صلاحيات مالك المل٠/var/lib/mysql: " + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "إزالة جميع قواعد بيانات MySQLØŸ" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "الدليل /var/lib/mysql الذي يحتوي قواعد بيانات MySQL ستتم إزالته." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"إن كنت تقوم بإزالة حزمة MySQL كي تقوم لاحقاً بتثبيت نسخة أحدث أو إن كانت حزمة " +"mysql-server مختلÙØ© تستخدمها، Ùيجب إبقاء البيانات." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "تشغيل خادم MySQL عند الإقلاع؟" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"يمكن تشغيل خادم MySQL آلياً وقت الإقلاع أو يدوياً باستخدام الأمر '/etc/init.d/" +"mysql start'." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص بـMySQL:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"مع أنه ليس إجبارياً، ولكن من المستحسن أن تقوم بتعيين كلمة مرور خاصة بمستخدم " +"MySQL الإداري \"root\"." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "If that field is left blank, the password will not be changed." +msgid "If this field is left blank, the password will not be changed." +msgstr "إن ترك الحقل Ùارغاً، Ùلن يتم تغيير كلمة المرور." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +#, fuzzy +#| msgid "New password for the MySQL \"root\" user:" +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص بـMySQL:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "تعذر تعيين كلمة مرور للمستخدم \"root\" الخاص بـMySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"حدث خطأ أثناء تعيين كلمة المرور لمستخدم MySQL الإداري. قد يكون هذا حدث بسبب " +"أن حساب المستخدم له كلمة مرور معيّنة مسبقاً، أو بسبب مشكلة ÙÙŠ الاتصال مع خادم " +"MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "You should check the account's password after tha package installation." +msgid "You should check the account's password after the package installation." +msgstr "يجب عليك التحقق من كلمة مرور الحساب عقب تثبيت الحزمة." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"الرجاء قراءة المل٠/usr/share/doc/mysql-server-5.6/README.Debian للمزيد من " +"المعلومات." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "كي تستخدم MySQLØŒ يجب إضاÙØ© المÙدخلات التالية الخاصة بالمستخدمين والمجموعات " +#~ "إلى النظام:" + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "هل تريد دعم اتصالات MySQL من الأجهزة التي تعمل على ديبيان \"sarge\" أو " +#~ "أقدم؟" + +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "ÙÙŠ إصدارات عملاء MySQL القديمة من ديبيان، لم تكن كلمات المرور تحÙظ بشكل " +#~ "آمن. ولقد حل هذه المشكلة بعدها، غير أن العملاء (مثل PHP) المتصلين من " +#~ "أجهزة تعمل على ديبيان Sarge 3.1 لن يكونوا قادرين على الاتصال باستخدام " +#~ "الحسابات الحديثة أو الحسابات التي تم تغيير كلمة مرورها." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ca.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ca.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ca.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ca.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,227 @@ +# mysql-dfsg (debconf) translation to Catalan. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Aleix Badia i Bosch 2004 +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-4.1\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2004-01-31 19:20GMT\n" +"Last-Translator: Aleix Badia i Bosch \n" +"Language-Team: Debian L10n Catalan \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Aquest fitxer indica que anteriorment s'ha instaÅ€lat un paquet mysql-server " +"amb una versió posterior." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"No hi ha cap garantia que la versió que esteu instaÅ€lant actualment puga " +"emprar les bases de dades actuals." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "Important note for NIS/YP users!" +msgid "Important note for NIS/YP users" +msgstr "Nota important pels usuaris de NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Si empreu MySQL sota NIS/YP, heu d'afegir un compte d'usuari mysql al " +"sistema local amb:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"També hauríeu de comprovar els permisos i propietaris del directori /var/" +"lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"El directori /var/lib/mysql que conté les bases de dades de MySQL està a " +"punt deser suprimit." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Si esteu suprimint el paquet MySQL per a posteriorment instaÅ€lar una versió " +"més recent, o si un paquet mysql-server diferent ja l'està emprant, les " +"dades s'haurien de mantenir." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +#| msgid "Should MySQL start on boot?" +msgid "Start the MySQL server on boot?" +msgstr "Voleu que el MySQL s'iniciï a l'arrencada ?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"El MySQL es pot executar automàticament a l'arrencada o manualment amb " +"l'ordre «/etc/init.d/mysql start»." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Tot i que no és requerida, és molt recomanable que establiu una " +"contrasenya per a «root», l'usuari administratiu del MySQL." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"S'ha produït un error en establir la contrasenya de l'usuari administratiu " +"del MySQL. Això pot haver passat perquè el compte ja té una una " +"contrasenya, o per un problema de comunicació amb el servidor de MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"Hauríeu de comprovar la contrasenya del compte després de la instaÅ€lació " +"del paquet." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Llegiu el fitxer /usr/share/doc/mysql-server-5.1/README.Debian per a obtenir " +"més informació." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" +"Les dos contrasenyes que heu introduït no són la mateixa. Proveu-ho de nou." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "" +#~ "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the " +#~ "new " +#~ msgstr "" +#~ "El MySQL-5.1 ja no implementa el clúster NDB. Migreu al nou paquet mysql-" +#~ "cluster i suprimiu totes les línies que comencen per «ndb» de tots els " +#~ "fitxers de configuració sota /etc/mysql/." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/cs.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/cs.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/cs.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/cs.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,346 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2007-05-01 13:01+0200\n" +"Last-Translator: Miroslav Kure \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Opravdu pokraÄovat v degradaci?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "V systému existuje soubor /var/lib/mysql/debian-*.flag." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "" +#| "Such file is an indication that a mysql-server package with a higher " +#| "version has been installed earlier." +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "To znamená, že již byl nainstalován balík mysql-server s vyšší verzí." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Neexistuje žádná záruka, že momentálnÄ› instalovaná verze bude umÄ›t pracovat " +"se stávajícími databázemi." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Důležitá poznámka pro uživatele NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "" +#| "You should also check the permissions and the owner of the /var/lib/mysql " +#| "directory:" +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Také byste mÄ›li zkontrolovat vlastníka a oprávnÄ›ní adresáře /var/lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Odstranit vÅ¡echny MySQL databáze?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Adresář /var/lib/mysql, ve kterém se nachází MySQL databáze, bude odstranÄ›n." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Jestliže odstraňujete balík MySQL za úÄelem instalace novÄ›jší verze MySQL, " +"nebo pokud tato data souběžnÄ› využívá jiný balík mysql-server, mÄ›li byste " +"data ponechat." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Spustit MySQL server pÅ™i startu systému?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL se může spouÅ¡tÄ›t automaticky pÅ™i startu systému, nebo ruÄnÄ› příkazem '/" +"etc/init.d/mysql start'." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nové heslo MySQL uživatele \"root\":" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"PÅ™estože to není nezbytné, je silnÄ› doporuÄeno nastavit heslo u " +"správcovského MySQL úÄtu \"root\"." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "If that field is left blank, the password will not be changed." +msgid "If this field is left blank, the password will not be changed." +msgstr "Ponecháte-li pole prázdné, heslo se nezmÄ›ní." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +#, fuzzy +#| msgid "New password for the MySQL \"root\" user:" +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Nové heslo MySQL uživatele \"root\":" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Nelze nastavit heslo MySQL uživatele \"root\"" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"BÄ›hem nastavování hesla pro správcovského uživatele MySQL se vyskytla chyba. " +"To se mohlo stát tÅ™eba proto, protože uživatel již mÄ›l heslo nastaveno, nebo " +"protože nastal problém v komunikaci s MySQL serverem." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "You should check the account's password after tha package installation." +msgid "You should check the account's password after the package installation." +msgstr "Po instalaci balíku byste mÄ›li heslo ověřit." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Více informací naleznete v /usr/share/doc/mysql-server-5.6/README.Debian." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "Abyste mohli MySQL používat, musíte v systému založit následující " +#~ "uživatele a skupiny:" + +#~ msgid "Cannot upgrade if ISAM tables are present!" +#~ msgstr "Aktualizace nelze provést pokud jsou přítomny tabulky ISAM!" + +#~ msgid "" +#~ "Recent versions of MySQL can no longer use the old ISAM table format and " +#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by " +#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". " +#~ "The installation of mysql-server-5.6 will now abort. In case your old " +#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert " +#~ "those tables." +#~ msgstr "" +#~ "Poslední verze MySQL již nemohou používat starý formát tabulek ISAM a " +#~ "pÅ™ed aktualizací je nutné pÅ™evést tyto tabulky napÅ™. do formátu MyISAM " +#~ "pomocí \"mysql_convert_table_format\" nebo \"ALTER TABLE x ENGINE=MyISAM" +#~ "\". Instalace mysql-server-5.6 se nyní pÅ™eruší. V případÄ›, že se mezitím " +#~ "odinstaloval původní mysql-server-4.1, jednoduÅ¡e jej znovu nainstalujte a " +#~ "tabulky pÅ™eveÄte." + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "Podporovat MySQL pÅ™ipojení z poÄítaÄů používajících Debian Sarge nebo " +#~ "starší?" + +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "Způsob, jakým se dříve ukládala hesla, nebyl příliÅ¡ bezpeÄný. To se nyní " +#~ "zlepÅ¡ilo, ale nevýhodou je, že se klienti z Debianu 3.1 Sarge (napÅ™. PHP) " +#~ "nebudou moci pÅ™ipojit na nové úÄty, nebo na úÄty, u nichž se heslo " +#~ "zmÄ›nilo." + +#~ msgid "" +#~ "To use mysql you must install an equivalent user and group to the " +#~ "following and ensure yourself that /var/lib/mysql has the right " +#~ "permissions (the uid/gid may be different)." +#~ msgstr "" +#~ "Abyste mohli mysql používat, musíte do následujících souborů pÅ™idat " +#~ "ekvivalentního uživatele a skupinu a zajistit, že /var/lib/mysql má " +#~ "správná práva (uid/gid se mohou liÅ¡it)." + +#~ msgid "Remove the databases used by all MySQL versions?" +#~ msgstr "Odstranit databáze používané vÅ¡emi verzemi MySQL?" + +#~ msgid "" +#~ "If you do not provide a password no changes will be made to the account." +#~ msgstr "Nezadáte-li heslo, žádné zmÄ›ny se s úÄtem neprovedou." + +#~ msgid "" +#~ "When installation finishes, you should verify that the account is " +#~ "properly protected with a password (see README.Debian for more " +#~ "information)." +#~ msgstr "" +#~ "Po skonÄení instalace byste mÄ›li ověřit, že je úÄet chránÄ›n heslem (více " +#~ "informací naleznete v souboru README.Debian)." + +#~ msgid "Update Hints" +#~ msgstr "Poznámky k aktualizaci" + +#~ msgid "" +#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be " +#~ "corrupted! This script also enhances the privilege tables but is not " +#~ "supposed to give any user more rights that he had before," +#~ msgstr "" +#~ "Po aktualizaci jeÅ¡tÄ› musíte spustit \"mysql_upgrade\", protože jinak by " +#~ "se tabulky mohly naruÅ¡it! Tento skript také rozÅ¡iÅ™uje tabulky privilegií, " +#~ "ovÅ¡em nemÄ›l by uživatelům pÅ™idat více práv, než mÄ›li dosud." + +#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" +#~ msgstr "Také si pÅ™eÄtÄ›te http://www.mysql.com/doc/en/Upgrade.html" + +#~ msgid "" +#~ "MySQL will only install if you have a non-numeric hostname that is " +#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " +#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 " +#~ "myhostname\"." +#~ msgstr "" +#~ "MySQL se nainstaluje pouze v případÄ›, že používáte nenumerické jméno " +#~ "poÄítaÄe, které se dá pÅ™eložit pÅ™es soubor /etc/hosts. NapÅ™. když příkaz " +#~ "\"hostname\" vrátí \"diamond\", tak v /etc/hosts musí existovat obdobný " +#~ "řádek jako \"10.0.0.1 diamond\"." + +#~ msgid "" +#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account " +#~ "is used in the start/stop and cron scripts. Don't delete." +#~ msgstr "" +#~ "Bude vytvoÅ™en nový mysql uživatel \"debian-sys-maint\". Tento mysql úÄet " +#~ "se používá ve startovacích, ukonÄovacích a cronových skriptech. Nemažte " +#~ "jej." + +#~ msgid "" +#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /" +#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in " +#~ "there, never only the password!" +#~ msgstr "" +#~ "Nezapomeňte nastavit heslo pro úÄet administrátora MySQL! Používáte-li /" +#~ "root/.my.cnf, vždy zde zadejte jak řádek \"user\", tak řádek \"password" +#~ "\". Nikdy zde nezadávejte jenom heslo!" + +#~ msgid "" +#~ "Should I remove the complete /var/lib/mysql directory tree which is used " +#~ "by all MySQL versions, not necessarily only the one you are about to " +#~ "purge?" +#~ msgstr "" +#~ "Mám odstranit kompletní adresářový strom /var/lib/mysql, který se používá " +#~ "pro vÅ¡echny verze MySQL, tedy ne nutnÄ› pouze pro verzi, kterou se " +#~ "chystáte vyÄistit?" diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/da.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/da.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/da.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/da.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,222 @@ +# Danish translation mysql-5.1. +# Copyright (C) 2010 mysql-5.1 & nedenstÃ¥ende oversættere. +# This file is distributed under the same license as the mysql-5.1 package. +# Claus Hindsgaul 2005, 2006, 2007. +# Joe Hansen , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-5.1\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2010-10-07 05:26+0100\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Ønsker du virkelig at fortsætte nedgraderingen?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "Der er en fil med navnet /var/lib/mysql/debian-*.flag pÃ¥ dette system." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"SÃ¥dan en fil tyder pÃ¥, at der tidligere har været installeret en højere " +"version af mysql-server-pakken." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Det kan ikke garanteres at den version, du er ved at installere, kan benytte " +"data fra de eksisterende databaser." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Vigtig oplysning til NIS/YP-brugere" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Brug af MySQL under NIS/YP kræver at en mysql-brugerkonto tilføjes pÃ¥ det " +"lokale system med:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Du bør ogsÃ¥ tjekke rettighederne og ejerskabet af mappen /var/lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Fjern alle MySQL-databaser?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Mappen /var/lib/mysql, der indeholder MySQL-databaserne, er ved at blive " +"fjernet." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Hvis du fjerner MySQL-pakken for senere at installere en nyere version, " +"eller hvis en anden mysql-server-pakke allerede benytter den, bør dataene " +"bevares." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Start MySQL-serveren under systemopstart?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL-serveren kan enten startes op automatisk under systemopstarten, eller " +"manuelt med kommandoen '/etc/init.d/mysql start'." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Ny adgangskode for MySQL's »rootbruger«:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Selvom det ikke kræves, anbefales det kraftigt, at du sætter en adgangskode " +"for MySQL's administrationsbruger »root«." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "Hvis du lader dette felt stÃ¥ tomt, vil adgangskoden ikke blive ændret." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Gentag adgangskode for MySQL's »root-bruger«:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Kunne ikke sætte adgangskoden for MySQL's »root-bruger«" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Der opstod en fejl, da adgangskoden for MySQL's administrationsbruger blev " +"forsøgt ændret. Dette kan være sket, fordi brugeren allerede har en " +"adgangskode, eller fordi der var problemer med at kommunikere med MySQL-" +"serveren." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "Du bør tjekke kontoens adgangskode efter pakkeinstallationen." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Læs venligst filen /usr/share/doc/mysql-server-5.1/README.Debian for " +"yderligere oplysninger." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Inddatafejl for adgangskode" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" +"De to adgangskoder du indtastede var ikke de samme. Forsøg venligst igen." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "NDB-cluster ser ud til at være i brug" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +#, fuzzy +#| msgid "" +#| "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the " +#| "new mysql-cluster package and remove all lines starting with \"ndb\" from " +#| "all config files below /etc/mysql/." +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.1 tilbyder ikke længere NDB-clusterunderstøttelse. Migrer venligst " +"til den nye pakke mysql-cluster og fjern alle linjer der starter med »ndb« " +"fra alle konfigurationsfiler under /etc/mysql/." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/de.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/de.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/de.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/de.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,230 @@ +# translation of mysql-dfsg-5.6_5.6.8-1_de.po to Deutsch +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans# +# Developers do not need to manually edit POT or PO files. +# +# Alwin Meschede , 2006, 2007. +# Thomas Mueller , 2009. +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg 5.6.23-2\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2012-06-03 10:33+0200\n" +"Last-Translator: Thomas Mueller \n" +"Language-Team: german \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Möchten Sie wirklich eine ältere Version einspielen?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" +"Auf diesem System existiert eine Datei mit dem Namen /var/lib/mysql/debian-*." +"flag" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Diese Datei ist ein Hinweis darauf, dass früher ein MySQL-Server-Paket mit " +"einer höheren Version installiert war." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Es kann nicht garantiert werden, dass die gegenwärtig zu installierende " +"Version dessen Daten benutzen kann." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Wichtige Anmerkung für NIS/YP-Benutzer!" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Falls MySQL mit NIS/YP genutzt wird, ist ein »mysql«-Benutzerkonto auf dem " +"lokalen System notwendig:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Sie sollten außerdem Besitzer und Zugriffsrechte des Verzeichnisses /var/lib/" +"mysql überprüfen:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Alle MySQL-Datenbanken entfernen?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Das Verzeichnis /var/lib/mysql mit den MySQL-Datenbanken soll entfernt " +"werden." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Falls geplant ist, nur eine höhere Version von MySQL zu installieren oder " +"ein anderes mysql-server-Paket dieses bereits benutzt, sollten die Daten " +"behalten werden." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Soll der MySQL-Server automatisch beim Booten starten?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"Der MySQL-Dienst kann entweder automatisch beim Systemstart oder manuell " +"durch Eingabe des Befehls »/etc/init.d/mysql start« gestartet werden." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Neues Passwort für den MySQL »root«-Benutzer:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Obwohl es nicht zwingend erforderlich ist, wird nachdrücklich empfohlen für " +"den administrativen MySQL »root«-Benutzer ein Passwort zu setzen." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "Wenn dieses Feld freigelassen wird, wird das Passwort nicht geändert." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Wiederholen Sie das Passwort für den MySQL-»root«-Benutzer:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Konnte für den MySQL-»root«-Benutzer kein Passwort setzen" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Beim setzen des Passworts für den administrativen MySQL-Benutzer ist ein " +"Fehler aufgetreten. Dies könnte daran liegen, dass der Benutzer bereits ein " +"Passwort hat oder dass es ein Problem mit der Kommunikation mit dem MySQL-" +"Server gibt." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"Sie sollten das Passwort des administrativen Benutzers nach der " +"Paketinstallation prüfen." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Für weitere Informationen lesen Sie /usr/share/doc/mysql-server-5.6/README." +"Debian." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Passwort-Eingabefehler" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" +"Die beiden von Ihnen eingegebenen Passwörter sind nicht identisch. Bitte " +"erneut versuchen." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "NDB-Cluster scheint gerade benutzt zu werden" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6 bietet keine NDB-Clusterunterstützung mehr. Bitte migrieren Sie " +"Ihr System zum neuen »mysql-cluster-server«-Paket und entfernen Sie alle " +"Zeilen, die mit »ndb« beginnen aus allen Konfigurationsdateien im " +"Verzeichnis /etc/mysql/." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/es.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/es.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/es.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/es.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,382 @@ +# mysql-5.6 translation to spanish +# Copyright (C) 2005-2012 Software in the Public Interest, SPI Inc. +# This file is distributed under the same license as the mysql-5.6 package. +# +# Changes: +# - Initial translation +# Jesus Aneiros, 2006 +# - Updated +# Javier Fernandez-Sanguino, 2006-2012 +# - Revision +# Nacho Barrientos Arias +# Fernando Cerezal +# David Martínez Moreno +# Ricardo Mones +# Carlos Galisteo +# Javier Fernandez-Sanguino +# Fernando C. Estrada +# +# Traductores, si no conoce el formato PO, merece la pena leer la +# documentación de gettext, especialmente las secciones dedicadas a este +# formato, por ejemplo ejecutando: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Equipo de traducción al español, por favor lean antes de traducir +# los siguientes documentos: +# +# - El proyecto de traducción de Debian al español +# http://www.debian.org/intl/spanish/ +# especialmente las notas y normas de traducción en +# http://www.debian.org/intl/spanish/notas +# +# - La guía de traducción de po's de debconf: +# /usr/share/doc/po-debconf/README-trans +# o http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Si tiene dudas o consultas sobre esta traducción consulte con el último +# traductor (campo Last-Translator) y ponga en copia a la lista de +# traducción de Debian al español () +msgid "" +msgstr "" +"Project-Id-Version: mysql-5.6\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2012-06-17 09:49-0500\n" +"Last-Translator: Javier Fernández-Sanguino \n" +"Language-Team: Debian l10 Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Virtaal 0.7.1\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "¿Desea realmente continuar con la desactualización?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" +"Existe un fichero con el nombre /var/lib/mysql/debian-*.flag en este sistema." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Este fichero indica que se instaló previamente una versión superior del " +"paquete mysql-server." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"No se puede garantizar que la versión que está instalando pueda usar la base " +"de datos actual." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Nota importante para los usuarios de NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Utilizar MySQL con NIS/YP requiere que una cuenta de usuario de mysql sea " +"agregada en el sistema local como:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"También debería comprobar los permisos y el propietario del directorio: /var/" +"lib/mysql" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "¿Desea eliminar todas las bases de datos MySQL?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"El directorio /var/lib/mysql contiene bases de datos MySQL que van a " +"eliminarse." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Debería mantener los datos si tiene planificado instalar una versión de " +"MySQL más reciente o si hay un paquete «mysql-server» distinto que los está " +"utilizando." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "¿Desea que el servidor MySQL se ejecute al iniciar el sistema?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"El servidor MySQL puede iniciarse en el momento de arranque del sistema o " +"manualmente si escribe la orden «/etc/init.d/mysql start»." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nueva contraseña para el usuario «root» de MySQL:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Se recomienda que configure una contraseña para el usuario " +"«root» (administrador) de MySQL, aunque no es obligatorio." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "No se modificará la contraseña si deja el espacio en blanco." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Nueva contraseña para el usuario «root» de MySQL:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "No se pudo fijar la contraseña para el usuario «root» de MySQL" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Se produjo un error mientras intentaba fijar la contraseña para el usuario " +"administrador de MySQL. Esto puede haber sucedido porque la cuenta ya tenía " +"una contraseña o porque se produjo un error de comunicación con el servidor " +"MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"Debería comprobar la contraseña de la cuenta después de la instalación del " +"paquete." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Consulte /usr/share/doc/mysql-server-5.6/README.Debian para más información." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Se ha producido un error al introducir la contraseña" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" +"Las dos contraseñas que ha introducido son distintas. Intente de nuevo." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "NDB Cluster parece estar en uso" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6 ya no brinda soporte para NDB Cluster. Migre al nuevo paquete " +"mysql-cluster-server y elimine todas las líneas que empiecen con \"ndb\" de " +"todos los ficheros de configuración bajo /etc/mysql/." + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "Deben añadirse las siguientes entradas para usuarios y grupos en el " +#~ "sistema para poder utilizar MySQL:" + +#~ msgid "Cannot upgrade if ISAM tables are present!" +#~ msgstr "¡No se puede actualizar si ya hay tablas ISAM!" + +#~ msgid "" +#~ "Recent versions of MySQL can no longer use the old ISAM table format and " +#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by " +#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". " +#~ "The installation of mysql-server-5.6 will now abort. In case your old " +#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert " +#~ "those tables." +#~ msgstr "" +#~ "Las versiones recientes de MySQL ya no soportan el antiguo formato de " +#~ "tabla ISAM. Antes de realizar la actualización es necesario convertir sus " +#~ "tablas a por ejemplo, MyISAM, usando «mysql_convert_table_format» o " +#~ "«ALTER TABLE x ENGINE=MyISAM». Se va a interrumpir ahora la instalación " +#~ "de mysql-server-5.6. Si aún así su mysql-server-4.1 se elimina aún así, " +#~ "puede reinstalarlo para convertir ese tipo de tablas." + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "¿Soportar las conexiones MySQL establecidadas desde sistemas que ejecutan " +#~ "Debian Sarge o versiones anteriores?" + +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "No era muy segura la forma en la que se almacenaban las contraseñas en " +#~ "versiones anteriores del cliente de MySQL en Debian. Este problema se ha " +#~ "mejorado posteriormente con el inconveniente, sin embargo, de que " +#~ "clientes (por ejemplo, PHP) en sistemas que ejecutan Debian 3.1 «Sarge» " +#~ "no podrán conectarse a cuentas que son nuevas o a las que se le haya " +#~ "cambiado la contraseña." + +#~ msgid "" +#~ "To use mysql you must install an equivalent user and group to the " +#~ "following and ensure yourself that /var/lib/mysql has the right " +#~ "permissions (the uid/gid may be different)." +#~ msgstr "" +#~ "Para utilizar mysql debe instalar un usuario y grupo equivalente al " +#~ "siguiente y asegurarse de que /var/lib/mysql tiene los permisos correctos " +#~ "(los valores del «uid» y del «gid» pueden ser diferentes)." + +#~ msgid "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" +#~ msgstr "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" + +#~ msgid "/etc/group: mysql:x:101:" +#~ msgstr "/etc/group: mysql:x:101:" + +#~ msgid "/var/lib/mysql: drwxr-xr-x mysql mysql" +#~ msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql" + +#~ msgid "Remove the databases used by all MySQL versions?" +#~ msgstr "" +#~ "¿Eliminar las bases de datos utilizadas por todas las versiones de MySQL?" + +#~ msgid "" +#~ "If you do not provide a password no changes will be made to the account." +#~ msgstr "" +#~ "No se hará ningún cambio en la cuenta si no introduce una contraseña." + +#~ msgid "" +#~ "When installation finishes, you should verify that the account is " +#~ "properly protected with a password (see README.Debian for more " +#~ "information)." +#~ msgstr "" +#~ "Debería confirmar que la contraseña está correctamente protegida con una " +#~ "contraseña cuando termine la instalación (consulte el fichero README." +#~ "Debian si desea más información)." + +#~ msgid "Install Hints" +#~ msgstr "Sugerencias para la instalación" + +#~ msgid "" +#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in " +#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and " +#~ "have manually be restored." +#~ msgstr "" +#~ "Al actualizar a la versión de MySQL 3.23, la vrsión proporcionada en " +#~ "Debian Woody, se eliminan de manera accidental, los enlaces simbólicos a " +#~ "«/var/lib/mysql» o «/var/log/mysql» y tienen que restaurarse manualmente." + +#~ msgid "" +#~ "MySQL will only install if you have a non-numeric hostname that is " +#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " +#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 " +#~ "myhostname\"." +#~ msgstr "" +#~ "Sólo se instalará MySQL si tiene un nombre de equipo que no sea una " +#~ "dirección IP y pueda resolverse a través del fichero /etc/hosts. Por " +#~ "ejemplo, si la orden «hostname» devuelve «MiNombreEquipo» entonces deberá " +#~ "existir una línea «10.0.0.1 MiNombreEquipo» en dicho fichero." + +#~ msgid "" +#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account " +#~ "is used in the start/stop and cron scripts. Don't delete." +#~ msgstr "" +#~ "Se creará un nuevo usuario «debian-sys-maint». Esta cuenta de mysql se " +#~ "utilizará en los scripts de inicio y parada y en los scripts «cron». No " +#~ "la elimine." + +#~ msgid "" +#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /" +#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in " +#~ "there, never only the password!" +#~ msgstr "" +#~ "¡Por favor, recuerde crear una CONTRASEÑA para el usuario «root» de " +#~ "MySQL! ¡Si utiliza /root/.my.cnf debe escribir las líneas «user» y " +#~ "«password» en dicho fichero, no incluya sólo la contraseña!" + +#~ msgid "" +#~ "Should I remove the complete /var/lib/mysql directory tree which is used " +#~ "by all MySQL versions, not necessarily only the one you are about to " +#~ "purge?" +#~ msgstr "" +#~ "¿Debería eliminar el árbol de directorio /var/lib/mysql completo? Tenga " +#~ "en cuenta que lo utilizan todas las versiones de MySQL y no sólo la que " +#~ "está a punto de purgar." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/eu.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/eu.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/eu.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/eu.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,236 @@ +# translation of eu.po to Euskara +# Piarres BEobide , 2006. +# Piarres Beobide , 2009. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +msgid "" +msgstr "" +"Project-Id-Version: eu\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2009-07-29 11:59+0200\n" +"Last-Translator: Piarres Beobide \n" +"Language-Team: Euskara \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Benetan bertsio zaharragora itzuli nahi duzu?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "Sisteman badago /var/lib/mysql/debian-*.flag izeneko fitxategi bat." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "" +#| "Such file is an indication that a mysql-server package with a higher " +#| "version has been installed earlier." +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Fitxategi honek aurretik bertsio berriagoko mysql-zerbitzari pakete bat " +"instalatu dela adierazten du." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Ezin da ziurtatu instalatzen ari zaren bertsio honek dauden datubaseak " +"erabili ahal izango dituenik." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "" +#| "You should also check the permissions and the owner of the /var/lib/mysql " +#| "directory:" +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Honetaz gain /var/lib/mysql direktorioaren jabea eta baimenak egiaztatu " +"beharko zenituzke:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Ezabatu MySQL datubase guztiak?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "MySQL datubaseak dituen /var/lib/mysql direktorioa ezabatua izango da." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"MySQL paketea beranduago bertsio berriago bat instalatzeko kentzen ari " +"bazara, edo beste mysql-server pakete bat berau erabiltzen ari bada, datuak " +"mantendu egin beharko lirateke." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Abioan MySQL zerbitzaria abiarazi?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"Sistema abioan MySQL automatikoki abiarazi daiteke edo eskuz '/etc/init.d/" +"mysql start' eginaz." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "MySQL \"root\" erabiltzailearen pasahitz berria:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Derrigorrezkoa ez denean, oso gomendagarria da MySQL administratzaile \"root" +"\" erabiltzaileari pasahitz bat ezartzea." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "If that field is left blank, the password will not be changed." +msgid "If this field is left blank, the password will not be changed." +msgstr "Eremua hau zurian utziaz gero ez da pasahitza aldatuko." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Errepikatu MySQL \"root\" erabiltzailearen pasahitza:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Ezin da MySQL \"root\" erabiltzailearen pasahitza ezarri" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Errore bat gertatu da MySQL administratzaile kontuaren pasahitza ezartzean. " +"Hau erabiltzaileak dagoeneko pasahitz bat duelako edo MySQL " +"zerbitzariarekiko konexioan erroreak daudelako gertatu daiteke." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"Kontuaren pasahitza egiaztatu beharko zenuke paketea instalatu aurretik." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Mesedez irakurri /usr/share/doc/mysql-server-5.6/README.Debian fitxategia " +"xehetasun gehiagorako." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Pasahitz sarrera errorea" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "Idatzi dituzun bi pasahitzak ez dira berdina. Mesedez saiatu berriz." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "Dirudienez NDB Cluster-a erabilia dago" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +#, fuzzy +#| msgid "" +#| "MySQL-5.6 has orphaned NDB Cluster support. Please migrate to the new " +#| "mysql-cluster package and remove all lines starting with \"ndb\" from all " +#| "config files below /etc/mysql/." +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6-ek NDB cluster euskarri umezurtz bat behar du. Mesedez migratu " +"mysql-cluster pakete berrira eta /etc/mysql/ azpiko konfigurazio fitxategi " +"guztietan \"ndb\"-ez hasten diren lerro guztiak ezabatu." + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "MySQL erabili ahal izateko, hurrengo erabiltzaile eta taldeak gehitu " +#~ "behar dira sisteman:" diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/fr.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/fr.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/fr.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/fr.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,242 @@ +# Translation of mysql-dfsg-* debconf templates to French +# Copyright (C) 2004-2009 Debian French l10n team +# This file is distributed under the same license as the mysql-dfsg-* packages. +# +# Translators: +# Christian Perrier , 2004, 2006, 2007, 2009, 2012. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2012-05-22 08:30+0200\n" +"Last-Translator: Christian Perrier \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"debian.org>\n" +"X-Generator: Lokalize 1.2\n" +"Plural-Forms: Plural-Forms: nplurals=2; plural=n>1;\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Faut-il vraiment revenir à la version précédente ?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "Un fichier /var/lib/mysql/debian-*.flag est présent sur ce système." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Cela indique qu'une version plus récente du paquet mysql-server a été " +"précédemment installée." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "Il n'est pas garanti que cette version puisse en utiliser les données." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Note importante pour les utilisateurs NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"L'utilisation de MySQL avec NIS/YP impose l'ajout d'un compte local " +"« mysql » avec la commande :" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Vous devez également vérifier le propriétaire et les permissions du " +"répertoire /var/lib/mysql :" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Faut-il supprimer toutes les bases de données MySQL ?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Le répertoire /var/lib/mysql qui contient les bases de données de MySQL va " +"être supprimé." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Si vous prévoyez d'installer une version plus récente de MySQL ou si un " +"autre paquet mysql-server les utilise déjà, vous devriez les conserver." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Faut-il lancer MySQL au démarrage ?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL peut être lancé soit au démarrage, soit en entrant la commande « /etc/" +"init.d/mysql start »." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nouveau mot de passe du superutilisateur de MySQL :" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Il est très fortement recommandé d'établir un mot de passe pour le compte " +"d'administration de MySQL (« root »)." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "Si ce champ est laissé vide, le mot de passe ne sera pas changé." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Confirmation du mot de passe du superutilisateur de MySQL :" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "" +"Impossible de changer le mot de passe de l'utilisateur « root » de MySQL" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Une erreur s'est produite lors du changement de mot de passe du compte " +"d'administration. Un mot de passe existait peut-être déjà ou il n'a pas été " +"possible de communiquer avec le serveur MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"Vous devriez vérifier le mot de passe de ce compte après l'installation du " +"paquet." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Veuillez consulter le fichier /usr/share/doc/mysql-server-5.6/README.Debian " +"pour plus d'informations." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Erreur de saisie du mot de passe" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" +"Le mot de passe et sa confirmation ne sont pas identiques. Veuillez " +"recommencer." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "Abandon de la gestion de NDB" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"La version 5.6 de MySQL ne gère plus les grappes NDB. Vous devriez utiliser " +"le paquet mysql-cluster-server et supprimer toutes les lignes commençant par " +"« ndb » des fichiers de configuration situés dans /etc/mysql." + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "Pour pouvoir utiliser MySQL, les utilisateurs et les groupes suivants " +#~ "doivent être ajoutés au système :" + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "Gérer les connexions d'hôtes qui utilisent les versions Debian « sarge » " +#~ "ou antérieures  ?" + +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "La méthode de stockage des mots de passe n'était pas très sûre dans les " +#~ "version précédentes de ce paquet. Cette méthode a été améliorée mais les " +#~ "modifications empêchent la connexion avec de nouveaux comptes ou des " +#~ "comptes dont le mot de passe a été modifié, pour les clients (p. ex. PHP) " +#~ "depuis des hôtes qui utilisent Debian 3.1 « sarge »." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/gl.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/gl.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/gl.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/gl.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,249 @@ +# Galician translation of mysql-dfsg-5.6's debconf templates +# This file is distributed under the same license as the mysql-dfsg-5.6 package. +# Jacobo Tarrio , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2007-04-20 09:44+0200\n" +"Last-Translator: Jacobo Tarrio \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "¿Quere pasar a unha versión anterior?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "Neste sistema hai un ficheiro chamado /var/lib/mysql/debian-*.flag." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "" +#| "Such file is an indication that a mysql-server package with a higher " +#| "version has been installed earlier." +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Este ficheiro indica que antes se instalou un paquete mysql-server cunha " +"versión superior." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Non se pode garantir que a versión que está a instalar poida empregar as " +"bases de datos actuais." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Nota importante para os usuarios de NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "" +#| "You should also check the permissions and the owner of the /var/lib/mysql " +#| "directory:" +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Tamén debería comprobar os permisos e o propietario do directorio /var/lib/" +"mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "¿Eliminar tódalas bases de datos de MySQL?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Hase eliminar o directorio /var/lib/mysql, que contén as bases de datos de " +"MySQL." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Se está a eliminar o paquete MySQL para instalar despois unha versión máis " +"recente ou se xa hai un paquete mysql-server diferente a empregalo, debería " +"conservar os datos." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "¿Iniciar o servidor MySQL co ordenador?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"Pódese iniciar automaticamente o servidor MySQL ao iniciar o ordenador, ou " +"manualmente coa orde \"/etc/init.d/mysql start\"." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Novo contrasinal para o usuario \"root\" de MySQL:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Aínda que non é obrigatorio, recoméndase encarecidamente que estableza un " +"contrasinal para o usuario administrativo \"root\" de MySQL." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "If that field is left blank, the password will not be changed." +msgid "If this field is left blank, the password will not be changed." +msgstr "Se deixa o campo en branco, non se ha cambiar o contrasinal." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +#, fuzzy +#| msgid "New password for the MySQL \"root\" user:" +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Novo contrasinal para o usuario \"root\" de MySQL:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Non se puido establecer o contrasinal do usuario \"root\" de MySQL" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Houbo un erro ao establecer o contrasinal do usuario administrativo de " +"MySQL. Puido ocorrer porque o usuario xa teña un contrasinal ou debido a un " +"problema de comunicacións co servidor MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "You should check the account's password after tha package installation." +msgid "You should check the account's password after the package installation." +msgstr "Debería comprobar o contrasinal da conta trala instalación do paquete." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Consulte o ficheiro /usr/share/doc/mysql-server-5.6/README.Debian para máis " +"información." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "Para empregar MySQL deberían engadirse ao sistema as seguintes entradas " +#~ "de usuarios e grupos:" + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "¿Soportar as conexións a MySQL de máquinas que empreguen Debian \"sarge\" " +#~ "ou anterior?" + +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "Nas versións antigas dos clientes MySQL de Debian, os contrasinais non se " +#~ "armacenaban de xeito seguro. Isto mellorouse desde aquela; nembargantes, " +#~ "os clientes (tales coma PHP) das máquinas que executen Debian 3.1 Sarge " +#~ "non se han poder conectar a contas recentes ou a contas nas que se " +#~ "cambiara o contrasinal." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/it.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/it.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/it.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/it.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,223 @@ +# Italian (it) translation of debconf templates for mysql-dfsg-5.6 +# Copyright (C) 2009 Software in the Public Interest +# This file is distributed under the same license as the mysql-dfsg-5.6 package. +# Luca Monducci , 2006 - 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6 5.6.8 italian debconf templates\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2009-08-08 11:03+0200\n" +"Last-Translator: Luca Monducci \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Procedere realmente con l'abbassamento di versione?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" +"Su questo sistema esiste un file con nome /var/lib/mysql/debian-*.flag." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Quel file indica che in precedenza è stata installata una versione superiore " +"del pacchetto mysql-server." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Non è garantito che la versione che si sta installando sia in grado di usare " +"i database presenti." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Nota importante per gli utenti NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Per usare MySQL con NIS/YP è necessario aggiungere al sistema locale un " +"account utente per mysql con:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Inoltre si devono verificare i permessi e la proprietà della directory /var/" +"lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Eliminare tutti i database MySQL?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"La directory /var/lib/mysql contenente i database di MySQL sta per essere " +"eliminata." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Se si rimuove il pacchetto MySQL per poi installare una versione più recente " +"oppure se sono già in uso da un altro pacchetto mysql-server, i dati non " +"devono essere eliminati." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Lanciare il server MySQL all'avvio?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"Il server MySQL può essere lanciato automaticamente all'avvio del sistema " +"oppure manualmente con il comando «/etc/init.d/mysql start»." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nuova password per l'utente «root» di MySQL:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Sebbene non sia obbligatoria, si raccomanda d'impostare una password per " +"l'utente d'amministrazione «root» di MySQL." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "Se questo campo è lasciato vuoto, la password non viene cambiata." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Ripetere la password per l'utente «root» di MySQL:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Impossibile impostare la password per l'utente «root» di MySQL" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Si è verificato un errore durante l'impostazione della password per l'utente " +"d'amministrazione di MySQL. Questo può essere accaduto perché l'utente ha " +"già una password oppure a causa di un problema di connessione con il server " +"MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"Al termine dell'installazione si deve verificare la password dell'account." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Per maggiori informazioni si consulti il file /usr/share/doc/mysql-" +"server-5.6/README.Debian." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Errore di inserimento della password" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "Le due password inserite sono diverse. Riprovare." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "È in uso un cluster NDB" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +#, fuzzy +#| msgid "" +#| "MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the " +#| "new mysql-cluster package and remove all lines starting with \"ndb\" from " +#| "all config files below /etc/mysql/." +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6 non fornisce più il supporto per i cluster NDB. Si dovrebbe " +"migrare al nuovo pacchetto mysql-cluster e rimuovere tutte le righe che " +"iniziano per \"ndb\" da tutti i file di configurazione sotto /etc/mysql/." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ja.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ja.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ja.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ja.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,229 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6 5.6.8-1\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2009-09-01 08:25+0900\n" +"Last-Translator: Hideki Yamane (Debian-JP) \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "本当ã«ãƒ€ã‚¦ãƒ³ã‚°ãƒ¬ãƒ¼ãƒ‰ã‚’実行ã—ã¾ã™ã‹?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" +"ã“ã®ã‚·ã‚¹ãƒ†ãƒ ã«ã¯ /var/lib/mysql/debian-*.flag ã¨ã„ã†åå‰ã®ãƒ•ã‚¡ã‚¤ãƒ«ãŒå­˜åœ¨ã—ã¦" +"ã„ã¾ã™ã€‚" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"ã“ã®ãƒ•ã‚¡ã‚¤ãƒ«ãŒæ„味ã™ã‚‹ã®ã¯ã€ä»¥å‰ã«ã‚ˆã‚Šæ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® mysql-server パッ" +"ケージãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ãŸã“ã¨ã‚’示ã—ã¾ã™ã€‚" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"ã“ã®ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’ç¾åœ¨ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã—よã†ã¨ã—ã¦ã„ã‚‹ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§ä½¿ãˆã‚‹ã‹ã©ã†ã‹" +"ã¯ä¿è¨¼ã§ãã¾ã›ã‚“。" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "NIS/YP ユーザã¸ã®é‡è¦ãªæ³¨æ„" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"NIS/YP é…下㧠MySQL を使ã†ã«ã¯ãƒ­ãƒ¼ã‚«ãƒ«ã®ã‚·ã‚¹ãƒ†ãƒ ã« mysql ã®ãƒ¦ãƒ¼ã‚¶ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã‚’" +"追加ã™ã‚‹ã®ãŒå¿…è¦ã§ã™ã€‚" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "/var/lib/mysql ã®æ‰€æœ‰è€…権é™ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹å¿…è¦ã‚‚ã‚ã‚Šã¾ã™ã€‚" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "ã™ã¹ã¦ã® MySQL データベースを削除ã—ã¾ã™ã‹?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"MySQL データベースをå«ã‚“ã§ã„るディレクトリ /var/lib/mysql を削除ã—よã†ã¨ã—ã¦" +"ã„ã¾ã™ã€‚" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"後ã§ã‚ˆã‚Šæ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ã‚‚ã®ã‚’インストールã—よã†ã¨ã™ã‚‹ãŸã‚ã« MySQL パッケー" +"ジを削除ã—よã†ã¨ã—ã¦ã„ã‚‹ã€ã‚ã‚‹ã„ã¯åˆ¥ã® mysql-server パッケージを既ã«ä½¿ã£ã¦ã„" +"ã‚‹å ´åˆã€ãƒ‡ãƒ¼ã‚¿ã¯ä¿æŒã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "MySQL をシステム起動時ã«é–‹å§‹ã—ã¾ã™ã‹?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL ã®èµ·å‹•æ–¹æ³•ã«ã¤ã„ã¦ã€ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•æ™‚ã«è‡ªå‹•çš„ã«é–‹å§‹ã™ã‚‹ã‹ã€ã‚ã‚‹ã„㯠'/etc/" +"init.d/mysql start' ã¨æ‰‹ã§å…¥åŠ›ã—ã¦èµ·å‹•ã™ã‚‹ã‹ã‚’é¸ã¹ã¾ã™ã€‚" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "MySQL ã® \"root\" ユーザã«å¯¾ã™ã‚‹æ–°ã—ã„パスワード:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"強制ã§ã¯ã‚ã‚Šã¾ã›ã‚“ãŒã€MySQL を管ç†ã™ã‚‹ \"root\" ユーザã®ãƒ‘スワードを設定ã™ã‚‹" +"ã“ã¨ã‚’å¼·ããŠå‹§ã‚ã—ã¾ã™ã€‚" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "ã“ã®å€¤ã‚’空ã®ã¾ã¾ã«ã—ã¦ãŠã„ãŸå ´åˆã¯ã€ãƒ‘スワードã¯å¤‰æ›´ã•ã‚Œã¾ã›ã‚“。" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "MySQL ã® \"root\" ユーザã«å¯¾ã™ã‚‹æ–°ã—ã„パスワード:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "MySQL ã® \"root\" ユーザã®ãƒ‘スワードを設定ã§ãã¾ã›ã‚“" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"MySQL ã®ç®¡ç†è€…ユーザã«å¯¾ã—ã¦ãƒ‘スワードを設定ã—よã†ã¨ã—ãŸéš›ã€ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾" +"ã—ãŸã€‚ã“ã‚Œã¯æ—¢ã«ç®¡ç†è€…ユーザã«ãƒ‘スワードãŒè¨­å®šã•ã‚Œã¦ã„ãŸã‹ã€MySQL サーãƒã¨ã®" +"接続ã«å•é¡ŒãŒã‚ã£ãŸãŸã‚ã ã¨æ€ã‚ã‚Œã¾ã™ã€‚" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"パッケージã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«å¾Œã€ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã®ãƒ‘スワードを確èªã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"詳細㯠/usr/share/doc/mysql-server-5.6/README.Debian ã‚’å‚ç…§ã—ã¦ãã ã•ã„。" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "パスワード入力エラー" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "入力ã•ã‚ŒãŸäºŒã¤ã®ãƒ‘スワードãŒä¸€è‡´ã—ã¾ã›ã‚“。å†å…¥åŠ›ã—ã¦ãã ã•ã„。" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "NDB クラスタãŒåˆ©ç”¨ã•ã‚Œã¦ã„るよã†ã§ã™" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +#, fuzzy +#| msgid "" +#| "MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the " +#| "new mysql-cluster package and remove all lines starting with \"ndb\" from " +#| "all config files below /etc/mysql/." +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6 ã§ã¯ NDB クラスタã®ã‚µãƒãƒ¼ãƒˆã‚’æä¾›ã—ãªããªã£ã¦ã„ã¾ã™ã€‚æ–°ãŸãª mysql-" +"cluster パッケージã«ç§»è¡Œã—ã¦ã€/etc/mysql 以下ã®è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«ã™ã¹ã¦ã‹ã‚‰ã€Œndbã€" +"ã§å§‹ã¾ã‚‹è¡Œã‚’削除ã—ã¦ãã ã•ã„。" diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/nb.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/nb.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/nb.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/nb.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,297 @@ +# translation of mysql_nb.po to Norwegian BokmÃ¥l +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Bjørn Steensrud , 2007. +msgid "" +msgstr "" +"Project-Id-Version: mysql_nb\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2007-02-18 12:13+0100\n" +"Last-Translator: Bjørn Steensrud \n" +"Language-Team: Norwegian BokmÃ¥l \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.2\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "Do you really want to downgrade?" +msgid "Really proceed with downgrade?" +msgstr "Er du sikker pÃ¥ at du vil nedgradere?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "" +#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " +#| "that a mysql-server package with a higher version has been installed " +#| "before. It can not be guaranteed that this version can use its data." +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"ADVARSEL: Fila /var/lib/mysql/debian-*.flag finnes. Dette viser at en mysql-" +"server-pakke med et høyere versjonsnummer har vært installert før. Det kan " +"ikke garanteres at denne versjonen kan bruke data fra den høyere versjonen." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "Important note for NIS/YP users!" +msgid "Important note for NIS/YP users" +msgstr "Viktig merknad for NIS/YP-brukere!" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +#, fuzzy +#| msgid "" +#| "The script is about to remove the data directory /var/lib/mysql. If it is " +#| "planned to just install a higher MySQL version or if a different mysql-" +#| "server package is already using it, the data should be kept." +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Dette skriptet skal til Ã¥ fjerne data-mappa /var/lib/mysql. Denne mappa bør " +"beholdes hvis det bare skal installeres en høyere MySQL-versjon, eller hvis " +"en annen mysql-server-pakke allerede bruker den." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +#| msgid "Should MySQL start on boot?" +msgid "Start the MySQL server on boot?" +msgstr "Skal MySQL startes ved maskinoppstart?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +#| msgid "" +#| "The MySQL can start automatically on boot time or only if you manually " +#| "type '/etc/init.d/mysql start'." +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL kan startes automatisk nÃ¥r maskinen starter, eller bare hvis du " +"skriver «/etc/init.d/mysql start»." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "New password for MySQL \"root\" user:" +msgid "New password for the MySQL \"root\" user:" +msgstr "Nytt passord for MySQLs «root»-bruker:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "" +#| "It is highly recommended that you set a password for the MySQL " +#| "administrative \"root\" user." +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Det anbefales sterkt at du oppgir et passord for den administrative «root»-" +"brukeren i MySQl." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +#, fuzzy +#| msgid "New password for MySQL \"root\" user:" +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Nytt passord for MySQLs «root»-bruker:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "Unable to set password for MySQL \"root\" user" +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Klarer ikke angi passord for MySQLs «root»-bruker" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "It seems an error occurred while setting the password for the MySQL " +#| "administrative user. This may have happened because the user already has " +#| "a password, or because there was a problem communicating with the MySQL " +#| "server." +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Det ser ut til at det oppsto en feil mens det ble satt et passord for MySQLs " +"administrative bruker. Dette kan være fordi brukeren allerede har et " +"passord, eller fordi det var et kommunikasjonsproblem med MySQL-tjeneren." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "Skal MySQL-tilkoblinger støttes fra vertsmaskiner som kjører Debian " +#~ "«sarge» eller eldre?" + +#, fuzzy +#~| msgid "" +#~| "The way passwords were stored was not very secure. This has been " +#~| "improved with the drawback that clients (e.g. PHP) from hosts running " +#~| "Debian 3.1 Sarge will not be able to connect to account which are new or " +#~| "whose password have been changed. See /usr/share/doc/mysql-server-5.6/" +#~| "README.Debian." +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "Passord ble tidligere lagret pÃ¥ en lite sikker mÃ¥te. Dette er nÃ¥ " +#~ "forbedret, med den ulempen at klienter (f.eks. PHP) fra verter som kjører " +#~ "Debian 3.1 Sarge ikke vil kunne koble til en konto som er ny eller har " +#~ "fÃ¥tt endret passordet. Se /usr/share/doc/mysql-server-5.6/README.Debian." + +#~ msgid "" +#~ "To use mysql you must install an equivalent user and group to the " +#~ "following and ensure yourself that /var/lib/mysql has the right " +#~ "permissions (the uid/gid may be different)." +#~ msgstr "" +#~ "For Ã¥ bruke MySQL mÃ¥ du installere en bruker og gruppe tilsvarende den " +#~ "nedenfor og se til at /var/lib/mysql har riktige rettigheter (uid/gid kan " +#~ "være forskjellig)." + +#~ msgid "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" +#~ msgstr "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" + +#~ msgid "/etc/group: mysql:x:101:" +#~ msgstr "/etc/group: mysql:x:101:" + +#~ msgid "/var/lib/mysql: drwxr-xr-x mysql mysql" +#~ msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql" + +#~ msgid "Remove the databases used by all MySQL versions?" +#~ msgstr "Skal databasene brukt av alle MySQL-versjoner fjernes?" + +#~ msgid "" +#~ "If you do not provide a password no changes will be made to the account." +#~ msgstr "" +#~ "Hvis du ikke oppgir et passord blir det ikke gjort noen endringer med " +#~ "kontoen." + +#~ msgid "" +#~ "When installation finishes, you should verify that the account is " +#~ "properly protected with a password (see README.Debian for more " +#~ "information)." +#~ msgstr "" +#~ "NÃ¥r installasjonen er ferdig bør det sjekkes at kontoen er ordentlig " +#~ "beskyttet med et passord (mer informasjon finnes i README.Debian)." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/nl.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/nl.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/nl.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/nl.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,219 @@ +# Dutch mysql-dfsg-5.6 po-debconf translation, +# Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER +# +# Vincent Zweije , 2006. +# Eric Spreen \n" +"Language-Team: Debian l10n Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Wilt u echt een oude versie herstellen?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" +"Er bestaat een bestand genaamd /var/lib/mysql/debian-*.flag op dit systeem." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Zulk een bestand geeft aan dat er eerder een pakket mysql-server met een " +"hogere versie is geïnstalleerd." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Er is geen garantie dat de versie die u op dit moment installeert de huidige " +"databases kan gebruiken." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Belangrijke opmerking voor gebruikers van NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Het gebruik van MySQL onder NIS/YP vereist dat een MySQL gebruikersaccount " +"wordt toegevoegd aan het lokale systeem met:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"U dient ook de permissies en eigenaren van de map /var/lib/mysql te " +"controleren:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Wilt u alle MySQL-databases verwijderen?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"De map /var/lib/mysql die de MySQL-databases bevat staat op het punt om " +"verwijderd te worden." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Als u het MySQL-pakket verwijdert om later een meer recente versie te " +"installeren of als een ander mysql-server pakket het al gebruikt, zou de " +"data behouden moeten worden." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Moet MySQL starten als de computer start?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"De MySQL-server kan automatisch worden gestart bij het starten van de " +"computer of slechts wanneer u '/etc/init.d/mysql start' handmatig uitvoert." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nieuw wachtwoord voor de MySQL \"root\"-gebruiker:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Hoewel niet verplicht, wordt het sterk aangeraden een wachtwoord in te " +"stellen voor de administratieve MySQL \"root\"-gebruiker." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "" +"Als dit veld leeg wordt gelaten, zal het wachtwoord niet worden veranderd." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Herhaal het wachtwoord voor de MySQL \"root\"-gebruiker:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Kan het wachtwoord voor de MySQL \"root\"-gebruiker niet instellen" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Er is een fout opgetreden bij het instellen van het wachtwoord voor de MySQL " +"administratieve gebruiker. Dat kan komen doordat de gebruiker al een " +"wachtwoord heeft, of omdat er een probleem was bij het communiceren met de " +"MySQL-server." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"U zou het wachtwoord van het account moeten controleren nadat het pakket is " +"geïnstalleerd." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Leest u het bestand /usr/share/doc/mysql-server-5.6/README.Debian voor meer " +"informatie." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Fout bij invoer wachtwoord" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" +"De twee wachtwoorden die u hebt ingevoerd zijn niet gelijk. Probeert u het " +"opnieuw." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "De NDB-cluster lijkt in gebruik te zijn" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6 biedt niet langer ondersteuning voor NDB Cluster. Migreer naar het " +"nieuwe pakket mysql-cluster en verwijder alle regels die beginnen met \"ndb" +"\" van alle configuratiebestanden onder /etc/mysql/." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/POTFILES.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/POTFILES.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/POTFILES.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/POTFILES.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +[type: gettext/rfc822deb] mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/pt_BR.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/pt_BR.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/pt_BR.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/pt_BR.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,443 @@ +# Brazilian Portuguese (pt_BR) debconf template translation for +# Debian's mysql-dfsg source package. +# Debian-BR Project +# André Luís Lopes, , 2004 +# André Luís Lopes, , 2006 +# André Luís Lopes, , 2007 +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2007-04-21 15:59-0300\n" +"Last-Translator: André Luís Lopes \n" +"Language-Team: Debian-BR Project \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"pt_BR utf-8\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Realmente proceder com o rebaixamento de versão?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "Um arquivo de nome /var/lib/mysql/debian-*.flag existe no sistema." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "" +#| "Such file is an indication that a mysql-server package with a higher " +#| "version has been installed earlier." +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"A presença de um arquivo como este é uma indicação de que um pacote mysql-" +"server com um número de versão mais alto já foi instalado anteriormente." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Não há garantias de que a versão que você está instalando no momento " +"conseguirá utilizar as bases de dados existentes." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Aviso importante para usuários NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "" +#| "You should also check the permissions and the owner of the /var/lib/mysql " +#| "directory:" +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Você deverá também checar as permissões e o dono do diretório /var/lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Remover todas as bases de dados do MySQL?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"O diretório /var/lib/mysql, o qual contém as bases de dados do MySQL, está " +"prestes a ser removido." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Caso você esteja removendo o pacote MySQL para posteriormente instalar uma " +"versão mais recente ou, caso uma versão diferente do pacote mysql-server " +"esteja sendo utilizada, os dados deverão ser mantidos." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Iniciar o servidor MySQL junto a inicialização da máquina?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"O servidor MySQL pode ser iniciado automaticamente junto a inicialização da " +"máquina ou manualmente com o comando '/etc/init.d/mysql start'." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nova senha para o usuário \"root\" do MySQL:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Apesar de não ser mandatório, é altamente recomendado que você defina uma " +"senha para o usuário administrativo \"root\" do MySQL." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "If that field is left blank, the password will not be changed." +msgid "If this field is left blank, the password will not be changed." +msgstr "Caso este campo seja deixado em branco, a senha não sera mudada." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +#, fuzzy +#| msgid "New password for the MySQL \"root\" user:" +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Nova senha para o usuário \"root\" do MySQL:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Impossível definir senha para o usuário \"root\" do MySQL" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Um erro ocorreu durante a definição da senha para o usuário administrativo " +"do MySQL. Isso pode ter acontecido devido a esse usuário já possuir uma " +"senha definida ou devido a ocorrência de um problema de comunicação com o " +"servidor MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "You should check the account's password after tha package installation." +msgid "You should check the account's password after the package installation." +msgstr "Você deverá checar a senha dessa conta após a instalação deste pacote." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Por favor, leia o arquivo /usr/share/doc/mysql-server-5.6/README.Debian para " +"maiores informações." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "Para utilizar o MySQL, as seguintes entradas para usuários e grupos devem " +#~ "ser adicionadas ao sistema:" + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "Suportar conexões MySQL originadas de hosts executando o Debian \"sarge\" " +#~ "ou mais antigos ?" + +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "Em versões antigas dos clientes MySQL no Debian, as senhas não eram " +#~ "armazenadas de forma segura. Isto foi corrigido desde então, porém, " +#~ "clientes (como o PHP) em hosts executando o Debian 3.1 Sarge não serão " +#~ "capazes de conectar em contas recentes ou contas as quais as senhas " +#~ "tenham sido modificadas." + +#~ msgid "" +#~ "To use mysql you must install an equivalent user and group to the " +#~ "following and ensure yourself that /var/lib/mysql has the right " +#~ "permissions (the uid/gid may be different)." +#~ msgstr "" +#~ "Para utilizar o MySQL, você deve instalar um usuário e um grupo " +#~ "equivalentes ao usuário e grupo a seguir para se certificar de que o " +#~ "diretório /var/lib/mysql possua as permissões correctas (o uid/gid podem " +#~ "ser diferentes)." + +#~ msgid "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" +#~ msgstr "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" + +#~ msgid "/etc/group: mysql:x:101:" +#~ msgstr "/etc/group: mysql:x:101:" + +#~ msgid "/var/lib/mysql: drwxr-xr-x mysql mysql" +#~ msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql" + +#~ msgid "Remove the databases used by all MySQL versions?" +#~ msgstr "Remover as bases de dados utilizadas por todas as versões do MySQL?" + +#~ msgid "" +#~ "If you do not provide a password no changes will be made to the account." +#~ msgstr "" +#~ "Caso você não forneça uma senha, nenhuma mudança será feita na conta." + +#~ msgid "" +#~ "When installation finishes, you should verify that the account is " +#~ "properly protected with a password (see README.Debian for more " +#~ "information)." +#~ msgstr "" +#~ "Quando a instalação finalizar, você deverá verificar se a conta está " +#~ "apropriadamente protegida com uma senha (consulte o arquivo README.Debian " +#~ "para maiores informações)." + +#~ msgid "internal" +#~ msgstr "interno" + +#~ msgid "Only internally used." +#~ msgstr "Somente utilizado internamente." + +#, fuzzy +#~ msgid "Update Hints" +#~ msgstr "Dicas de atualização" + +#, fuzzy +#~ msgid "" +#~ "Rarely, e.g. on new major versions, the privilege system is improved. To " +#~ "make use of it mysql_fix_privilege_tables must be executed manually. The " +#~ "script is not supposed to give any user more rights that he had before," +#~ msgstr "" +#~ "Raramente, por exemplo, em novas versões maiores, o sistema de " +#~ "privilégios é melhorado. Para fazer uso disso, o script " +#~ "mysql_fix_privilege_tables deve ser executado manualmente. O script não " +#~ "atribuirá a nenhum usuário mais direitos do que os mesmos já possuíam " +#~ "anteriormente." + +#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" +#~ msgstr "Por favor, leia http://www.mysql.com/doc/en/Upgrade.html" + +#, fuzzy +#~ msgid "Install Hints" +#~ msgstr "Dicas de instalação" + +#, fuzzy +#~ msgid "" +#~ "MySQL will only install if you have a non-numeric hostname that is " +#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " +#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 " +#~ "myhostname\"." +#~ msgstr "" +#~ "O MySQL será instalado somente caso você possua um nome de host NÃO " +#~ "NUMÉRICO que possa ser resolvido através do arquivo /etc/hosts, ou seja, " +#~ "caso o comando \"hostname\" retorne \"myhostname\", uma linha como " +#~ "\"10.0.0.1 myhostname\" deverá existir no arquivo /etc/hosts." + +#~ msgid "" +#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account " +#~ "is used in the start/stop and cron scripts. Don't delete." +#~ msgstr "" +#~ "Um novo usuário MySQL de nome \"debian-sys-maint\" será criado. Essa " +#~ "conta MySQL é utilizada pelos scripts de inicialização/parada e pelos " +#~ "scripts cron. Não remova esse usuário." + +#, fuzzy +#~ msgid "" +#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /" +#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in " +#~ "there, never only the password!" +#~ msgstr "" +#~ "Por favor, lembre-se de definir uma SENHA para o usuário root do MySQL ! " +#~ "Caso você utilize um arquivo /root/.my.cnf, sempre inclua as linhas \"user" +#~ "\" e \"password\" nesse arquivo, nunca somente a senha ! Consulte o " +#~ "arquivo /usr/share/doc/mysql-server/README.Debian para mais informações." + +#~ msgid "" +#~ "Should I remove all databases below /var/lib/mysql as you are purging the " +#~ "mysql-server package?" +#~ msgstr "" +#~ "Todas as base de dados sob o diretório /var/lib/mysql devem ser removidas " +#~ "quando você remover o pacote pacote mysql-server ?" + +#~ msgid "" +#~ "Networking is disabled by default for security reasons. You can enable it " +#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf." +#~ msgstr "" +#~ "O suporte ao funcionamento em rede está desativado por padrão por " +#~ "questões de segurança. Você poderá ativá-lo comentando a opção 'skip-" +#~ "networking' no arquivo /etc/mysql/my.cnf." + +#~ msgid "security and update notice" +#~ msgstr "aviso de segurança e actualização" + +#~ msgid "" +#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-" +#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. " +#~ "remove everything including the configuration) somewhen? (default is not)" +#~ msgstr "" +#~ "Devo remover tudo abaixo de /var/lib/mysql quando fizer o purge do pacote " +#~ "mysql-server com o comando \"dpkg --purge mysql-server\" (ou seja, " +#~ "remover tudo incluíndo a configuração)? (o padrão é não remover)" + +#~ msgid "Make MySQL reachable via network?" +#~ msgstr "Fazer com que o MySQL seja acessível via rede?" + +#~ msgid "" +#~ "Should MySQL listen on a network reachable TCP port? This is not " +#~ "necessary for use on a single computer and could be a security problem." +#~ msgstr "" +#~ "O MySQL deve aguardar ligações numa porta TCP acessível via rede? Isto " +#~ "não é necessário para uso num único computador e pode ser um problema de " +#~ "segurança." + +#~ msgid "Enable chroot mode?" +#~ msgstr "Activar o modo chroot?" + +#~ msgid "" +#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so " +#~ "that users cannot modify any files outside this directory. This improves " +#~ "resistence against crackers, too, as they are not able to modify system " +#~ "files." +#~ msgstr "" +#~ "O MySQL é capaz de se prender no diretório /var/lib/mysql_jail, assim os " +#~ "utilizadores não poderão modificar ficheiros fora deste directório. Isto " +#~ "aumenta também a resistência contra crackers, pois eles não poderão " +#~ "modificar arquivos de sistema." + +#~ msgid "Please run mysql_fix_privilege_tables !" +#~ msgstr "Por favor execute mysql_fix_privilege_tables !" + +#~ msgid "" +#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs " +#~ "other than root and mysql with mysql." +#~ msgstr "" +#~ "Permissões seguras para o diretório /var/lib/mysql serão asseguradas " +#~ "substituíndo GIDs diferentes de root e mysql por mysql." + +#~ msgid "" +#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/" +#~ msgstr "" +#~ "Instruções sobre como activar o suporte de SSL estão disponíveis no " +#~ "directório /usr/share/doc/mysql-server/." + +#, fuzzy +#~ msgid "mysql_fix_privileges_tables should be executed" +#~ msgstr "mysql_fix_privileges_tables será executado" + +#, fuzzy +#~ msgid "" +#~ "The latest MySQL versions have an enhanced, more fine grained, privilege " +#~ "system. To make use of it, some new fields must be added to the tables " +#~ "in the \"mysql\" database. This will not happen automatically." +#~ msgstr "" +#~ "As últimas versões do MySQL possuem um sistema de privilégios melhorado e " +#~ "mais refinado. Para utilizá-lo, alguns novos campos devem ser adicionados " +#~ "as tabelas na base de dados \"mysql\". Isto é feito pelo script " +#~ "mysql_fix_privileges_tables durante esta actualização independente do " +#~ "servidor estar a correr ou não !" + +#~ msgid "" +#~ "This script is not supposed to give any user more rights that he had " +#~ "before, if you encounter such a case, please contact me." +#~ msgstr "" +#~ "Este script não deverá fornecer mais direitos a um utilizador além dos " +#~ "quais ele já possua anteriormente. SE encontrar um caso desses, por favor " +#~ "entre em contacto com o mantainer deste pacote Debian." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/pt.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/pt.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/pt.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/pt.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,296 @@ +# Portuguese translation for mysql-dfsg-5.6's debconf messages +# Copyright (C) 2006 Miguel Figueiredo +# This file is distributed under the same license as the mysql-dfsg-5.6 package. +# Miguel Figueiredo , 2012 +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2012-05-28 22:40+0100\n" +"Last-Translator: Miguel Figueiredo \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Deseja mesmo fazer downgrade?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" +"Existe, neste sistema, um ficheiro chamado /var/lib/mysql/debian-*.flag." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"A existência de tal ficheiro é um indicador que anteriormente foi instalado " +"um pacote mysql-server com um número de versão superior." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Não existe nenhuma garantia que a versão que está actualmente a instalar " +"seja capaz de utilizar as bases de dados actuais." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Nota importante para utilizadores de NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Utilizar MySQL com NIS/YP necessita que seja adicionada uma conta de " +"utilizador de mysql ao sistema local com:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Deve também verificar as permissões e o dono do directório /var/lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Remover todas as bases de dados MySQL?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"O directório /var/lib/mysql que contém as bases de dados MySQL está prestes " +"a ser removido." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Se está a remover o pacote MySQL de modo a posteriormente instalar uma " +"versão mais recente ou se um pacote mysql-server já está os está a utilizar, " +"os dados devem ser mantidos." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Iniciar o servidor MySQL no arranque?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"O MySQL pode ser automaticamente lançado no arranque ou manualmente através " +"do comando '/etc/init.d/mysql start'." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nova palavra-passe para o utilizador \"root\" do MySQL:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Embora não seja obrigatório, é fortemente recomendado que defina uma palavra-" +"passe para o utilizador administrativo \"root\" do MySQL." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "" +"Se este campo for deixado em branco, a palavra-passe não irá ser alterada." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Repita a palavra-passe para o utilizador \"root\" de MySQL:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "" +"Não foi possível definir a palavra-passe para o utilizador \"root\" do MySQL" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Ocorreu um erro enquanto era definida a palavra-passe para o utilizador " +"administrativo do MySQL. Isto pode ter acontecido porque a conta já tem uma " +"palavra-passe, ou porque ocorreu um problema ao comunicação com o servidor " +"MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" +"Você deve verificar a palavra-passe da conta após a instalação do pacote." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Para mais informações, por favor leia o ficheiro /usr/share/doc/mysql-" +"server-5.6/README.Debian." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Erro de entrada da palavra-passe" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" +"As duas palavras-passe que introduziu não são as mesmas. Por favor tente " +"novamente." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "NDB Cluster parece estar a ser utilizado" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6 já não disponibiliza suporte para NDB Cluster. Por favor migre " +"para o novo pacote mysql-cluster-server e remova todas as linhas que comecem " +"por \"ndb\" em todos os ficheiros de configuração em /etc/mysql/." + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "Para utilizar o MySQL, têm de ser acrescentadas as seguintes entradas " +#~ "para os utilizadores e grupos:" + +#~ msgid "Cannot upgrade if ISAM tables are present!" +#~ msgstr "Não é possível actualizar se estiverem presentes tabelas ISAM!" + +#~ msgid "" +#~ "Recent versions of MySQL can no longer use the old ISAM table format and " +#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by " +#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". " +#~ "The installation of mysql-server-5.6 will now abort. In case your old " +#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert " +#~ "those tables." +#~ msgstr "" +#~ "As versões recentes de MySQL já não podem utilizar o antigo formato de " +#~ "tabelas ISAM e é por isso necessário converter as suas tabelas pra e.g. " +#~ "MyISAM antes da actualização, utilizando \"mysql_convert_table_format\" " +#~ "ou \"ALTER TABLE x ENGINE=MyISAM\". A instalação de mysql-server-5.6 irá " +#~ "agora ser cancelada. Se o seu antigo mysql-server-4.1 for removido apenas " +#~ "reinstale para converter essas tabelas." + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "Suportar ligações MySQL de máquinas que corram Debian \"sarge\" ou mais " +#~ "antigos?" + +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "Nas versões antigas de clientes de MySQL em Debian, as palavras-passe não " +#~ "eram guardadas de forma segura. Isto foi melhorado desde aí, no entanto " +#~ "os clientes (como o PHP) de máquinas que corram Debian 3.1 Sarge não irão " +#~ "conseguir ligar-se a contas novas ou cuja palavra-passe foi alterada." + +#~ msgid "" +#~ "To use mysql you must install an equivalent user and group to the " +#~ "following and ensure yourself that /var/lib/mysql has the right " +#~ "permissions (the uid/gid may be different)." +#~ msgstr "" +#~ "Para utilizar mysql e instalar um utilizador e grupo equivalentes para o " +#~ "seguinte e assegurar-se que /var/lib/mysql têm as permissões correctas (o " +#~ "uid/gid podem ser diferentes)." + +#~ msgid "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" +#~ msgstr "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" + +#~ msgid "/etc/group: mysql:x:101:" +#~ msgstr "/etc/group: mysql:x:101:" + +#~ msgid "/var/lib/mysql: drwxr-xr-x mysql mysql" +#~ msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql" + +#~ msgid "Remove the databases used by all MySQL versions?" +#~ msgstr "Remover as bases de dados utilizadas por todas as versões de MySQL?" + +#~ msgid "" +#~ "If you do not provide a password no changes will be made to the account." +#~ msgstr "" +#~ "Se não disponibilizar uma password não serão feitas alterações nesta " +#~ "conta." + +#~ msgid "" +#~ "When installation finishes, you should verify that the account is " +#~ "properly protected with a password (see README.Debian for more " +#~ "information)." +#~ msgstr "" +#~ "Quando terminar a instalação, deve verificar se a conta está devidamente " +#~ "protegida com uma password (para mais informações veja README.Debian)." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ro.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ro.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ro.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ro.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,319 @@ +# Romanian translation of mysql-dfsg. +# Copyright (C) 2006 THE mysql-dfsg'S COPYRIGHT HOLDER +# This file is distributed under the same license as the mysql-dfsg package. +# +# Stan Ioan-Eugen , 2006. +msgid "" +msgstr "" +"Project-Id-Version: po-debconf://mysql-dfsg\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2006-12-20 21:27+0200\n" +"Last-Translator: stan ioan-eugen \n" +"Language-Team: romanian \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "Do you really want to downgrade?" +msgid "Really proceed with downgrade?" +msgstr "SunteÅ£i sigur că doriÅ£i să instalaÅ£i o versiune mai veche?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +#, fuzzy +#| msgid "" +#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " +#| "that a mysql-server package with a higher version has been installed " +#| "before. It can not be guaranteed that this version can use its data." +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"AVERTISMENT: FiÅŸierul /var/lib/mysql/debian-*.flag există. Acest lucru " +"indică faptul că anterior a fost instalată o versiune nouă a pachetului " +"mysql-server. Nu se poate garanta că versiunea instalată acum poate folosi " +"datele versiunii instalate anterior." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "Important note for NIS/YP users!" +msgid "Important note for NIS/YP users" +msgstr "Notă importantă pentru utilizatorii NIS/YP!" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +#, fuzzy +#| msgid "" +#| "The script is about to remove the data directory /var/lib/mysql. If it is " +#| "planned to just install a higher MySQL version or if a different mysql-" +#| "server package is already using it, the data should be kept." +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Scriptul urmează să ÅŸteargă directorul de date /var/lib/mysql. Dacă plănuiÅ£i " +"doar să instalaÅ£i o versiune nouă MySQL sau datele sunt folosite de către un " +"alt pachet mysql-server, atunci ar trebui păstraÅ£i datele." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +#| msgid "Should MySQL start on boot?" +msgid "Start the MySQL server on boot?" +msgstr "DoriÅ£i ca MySQL să pornească la initializarea sistemului?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +#| msgid "" +#| "The MySQL can start automatically on boot time or only if you manually " +#| "type '/etc/init.d/mysql start'." +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL poate porni automat la iniÅ£ializarea sistemului sau doar dacă rulaÅ£i " +"comanda „/etc/init.d/mysql startâ€." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "New password for MySQL \"root\" user:" +msgid "New password for the MySQL \"root\" user:" +msgstr "Noua parolă pentru utilizatorul „root†al MySQL:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +#, fuzzy +#| msgid "" +#| "It is highly recommended that you set a password for the MySQL " +#| "administrative \"root\" user." +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Este recomandat să stabiliÅ£i o parolă pentru utilizatorul administrativ " +"„root†al MySQL." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +#, fuzzy +#| msgid "New password for MySQL \"root\" user:" +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Noua parolă pentru utilizatorul „root†al MySQL:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "Unable to set password for MySQL \"root\" user" +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Nu s-a putut stabili parola pentru utilizatorul „root†al MySQL" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "It seems an error occurred while setting the password for the MySQL " +#| "administrative user. This may have happened because the user already has " +#| "a password, or because there was a problem communicating with the MySQL " +#| "server." +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Se pare că a intervenit o eroare în stabilirea parolei pentru utilizatorul " +"administrativ al MySQL. Acest lucru se poate întâmpla dacă utilizatorul are " +"deja o parolă, sau a existat o problemă în comunicarea cu serverul MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "Cannot upgrade if ISAM tables are present!" +#~ msgstr "Nu se poate face actualizarea dacă sunt prezente tabele ISAM!" + +#~ msgid "" +#~ "Recent versions of MySQL can no longer use the old ISAM table format and " +#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by " +#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". " +#~ "The installation of mysql-server-5.6 will now abort. In case your old " +#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert " +#~ "those tables." +#~ msgstr "" +#~ "Versiunile recente MySQL nu mai pot folosi vechiul format de tabele ISAM " +#~ "ÅŸieste necesar să convertiÅ£i tabelele dumneavoastră de ex. la formatul " +#~ "MyISAM înainte de a face actualizarea folosind comanda " +#~ "„mysql_convert_table_format†sau „ALTER TABLE x ENGINE=MyISAMâ€. " +#~ "Instalarea mysql-server-5.6 va eÅŸua. ÃŽn caz că ÅŸtergeÅ£iversiunea " +#~ "anterioară mysql-server-4.1 va trebui reinstalată pentru a converti " +#~ "tabelele." + +#~ msgid "" +#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" +#~ msgstr "" +#~ "SuportaÅ£i conexiuni MySQL de la staÅ£ii ce rulează sistemul Debian „sarge†" +#~ "sau mai vechi?" + +#, fuzzy +#~| msgid "" +#~| "The way passwords were stored was not very secure. This has been " +#~| "improved with the drawback that clients (e.g. PHP) from hosts running " +#~| "Debian 3.1 Sarge will not be able to connect to account which are new or " +#~| "whose password have been changed. See /usr/share/doc/mysql-server-5.6/" +#~| "README.Debian." +#~ msgid "" +#~ "In old versions of MySQL clients on Debian, passwords were not stored " +#~ "securely. This has been improved since then, however clients (such as " +#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to " +#~ "recent accounts or accounts whose password have been changed." +#~ msgstr "" +#~ "Modul în care erau păstrate parolele nu era foarte sigur. Acest lucru a " +#~ "fost îmbunătăţitcu dezajantajul că clienÅ£ii (de ex. PHP) de pe staÅ£ii ce " +#~ "rulează sistemul Debian 3.1 Sargenu se vor putea conecta la conturi noi " +#~ "sau ale căror parole au fost schimbate. CitiÅ£i /usr/share/doc/mysql-" +#~ "server-5.6/README.Debian." + +#~ msgid "" +#~ "To use mysql you must install an equivalent user and group to the " +#~ "following and ensure yourself that /var/lib/mysql has the right " +#~ "permissions (the uid/gid may be different)." +#~ msgstr "" +#~ "Pentru a folosi mysql trebuie să adăugaÅ£i un utilizator ÅŸi grup " +#~ "echivalent ÅŸi să vă asiguraÅ£i că /var/lib/mysql are permisiunile " +#~ "stabilite corect (uid/gid pot aveavalori diferite)." + +#~ msgid "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" +#~ msgstr "" +#~ "/etc/passwd:\tmysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" + +#~ msgid "/etc/group: mysql:x:101:" +#~ msgstr "/etc/group:\tmysql:x:101:" + +#~ msgid "/var/lib/mysql: drwxr-xr-x mysql mysql" +#~ msgstr "/var/lib/mysql:\tdrwxr-xr-x\tmysql\tmysql" + +#~ msgid "Remove the databases used by all MySQL versions?" +#~ msgstr "DoriÅ£i să ÅŸtergeÅ£i bazele de date folosite de toate versiune MySQL?" + +#~ msgid "" +#~ "If you do not provide a password no changes will be made to the account." +#~ msgstr "" +#~ "Dacă nu introduceÅ£i nici o parolă, nici o schimbare nu va fi luată în " +#~ "considerare." + +#~ msgid "" +#~ "When installation finishes, you should verify that the account is " +#~ "properly protected with a password (see README.Debian for more " +#~ "information)." +#~ msgstr "" +#~ "După finalizarea instalării, ar trebui să verificaÅ£i dacă contul este " +#~ "protejat cu o parolă (citiÅ£i fiÅŸierul README.Debian pentru informaÅ£ii " +#~ "suplimentare)." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ru.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ru.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/ru.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/ru.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,220 @@ +# translation of ru.po to Russian +# Russian messages: +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry'# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans# +# Developers do not need to manually edit POT or PO files. +# +# Ilgiz Kalmetev , 2003. +# Yuriy Talakan' , 2005, 2006. +# Yuriy Talakan' , 2007. +# Yuri Kozlov , 2009, 2012. +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6 5.6.8-1\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2012-05-23 21:14+0400\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.2\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "ДейÑтвительно уÑтановить более Ñтарую верÑию?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "Ð’ ÑиÑтеме найден файл /var/lib/mysql/debian-*.flag." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Это означает, что ранее уже был уÑтановлен пакет mysql-server более новой " +"верÑии." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Ðет гарантий, что верÑиÑ, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ ÑƒÑтанавливаетÑÑ ÑейчаÑ, будет ÑпоÑобна " +"работать Ñ Ð¸Ð¼ÐµÑŽÑ‰Ð¸Ð¼Ð¸ÑÑ Ð±Ð°Ð·Ð°Ð¼Ð¸ данных." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Важное замечание Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÐµÐ¹ NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"ИÑпользование MySQL в NIS/YP требует Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ ÑƒÑ‡Ñ‘Ñ‚Ð½Ð¾Ð¹ запиÑи mysql в " +"локальную ÑиÑтему Ñ:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "Также проверьте права доÑтупа и владельца каталога /var/lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Удалить вÑе базы данных MySQL?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Ð—Ð°Ð¿Ñ€Ð¾Ñ Ð½Ð° удаление каталога /var/lib/mysql, Ñодержащий базы данных MySQL." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"ЕÑли вы удалÑете пакет MySQL Ð´Ð»Ñ ÑƒÑтановки более новой верÑии MySQL, или " +"еÑÑ‚ÑŒ другие пакеты mysql-server, иÑпользующие Ñтот каталог, то данные лучше " +"Ñохранить." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "ЗапуÑкать MySQL при загрузке ÑиÑтемы?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"Сервер MySQL можно запуÑкать автоматичеÑки при загрузке ÑиÑтемы или вручную " +"по команде '/etc/init.d/mysql start'." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Ðовый пароль Ð´Ð»Ñ MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Â«root»:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Ð¥Ð¾Ñ‚Ñ Ð¸ необÑзательно, но наÑтоÑтельно рекомендуетÑÑ ÑƒÑтановить пароль Ð´Ð»Ñ " +"админиÑтративного Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ MySQL «root»." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "ЕÑли оÑтавить поле пуÑтым, то пароль изменён не будет." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Повторите ввод Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð´Ð»Ñ MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Â«root»:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Ðевозможно задать пароль MySQL пользователю «root»" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Ð’ процеÑÑе Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸Ñтративного MySQL Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð¾ÑˆÐ»Ð° " +"ошибка. Это могло произойти, еÑли у Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ ÑƒÐ¶Ðµ был задан пароль, или " +"из-за проблем ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ñервером MySQL." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "Проверьте пароль учётной запиÑи поÑле уÑтановки пакета." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "ПодробноÑти Ñм. в файле /usr/share/doc/mysql-server-5.6/README.Debian." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Ошибка ввода паролÑ" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "Два введённых Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð½Ðµ одинаковы. Повторите ввод." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "NDB Cluster уже иÑпользуетÑÑ" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.6 больше не поддерживает NDB Cluster. Переходите на новый пакет " +"mysql-cluster-server и удалите вÑе Ñтроки, начинающиеÑÑ Ñ Â«ndb», из вÑех " +"файлов наÑтройки в каталоге /etc/mysql/." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/sk.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/sk.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/sk.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/sk.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,219 @@ +# Slovak translations for mysql-5.1 package +# Slovenské preklady pre balík mysql-5.1. +# Copyright (C) 2011 THE mysql-5.1'S COPYRIGHT HOLDER +# This file is distributed under the same license as the mysql-5.1 package. +# Slavko , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-5.1 5.1.49-3\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2011-01-04 12:55+0100\n" +"Last-Translator: Slavko \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Naozaj pokraÄovaÅ¥ v znížení verzie?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "Súbor s menom /var/lib/mysql/debian-*.flag už v systéme existuje." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"Takýto súbor udáva, že už bol predtým nainÅ¡talovaný balík mysql-server s " +"vyÅ¡Å¡ou verziou." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Neexistuje žiadna záruka, že aktuálne inÅ¡talovaná verzia dokáže pracovaÅ¥ s " +"existujúcimi databázami." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Dôležitá poznámka pre používateľov NIS/YP" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"Používanie MySQL pod NIS/YP vyžaduje aby bol používateľský úÄet mysql " +"pridaný do lokálneho systému pomocou:" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Mali by ste tiež skontrolovaÅ¥ vlastníctvo a práva k adresáru /var/lib/mysql:" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "OdstrániÅ¥ vÅ¡etky databázy MySQL?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Adresár /var/lib/mysql, ktorý obsahuje databázy MySQL, bude odstránený." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Ak odstraňujete balík MySQL kvôli neskorÅ¡ej inÅ¡talácii najnovÅ¡ej verzie " +"alebo ak ich používa aj iný balík mysql-server, mali by ste údaje ponechaÅ¥." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "SpúšťaÅ¥ MySQL server pri Å¡tarte systému?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL server môže byÅ¥ automaticky spúšťaný pri Å¡tarte systému alebo manuálne " +"príkazom „/etc/init.d/mysql startâ€." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nové heslo MySQL používateľa „rootâ€:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Hoci to nie je vyslovene nutné, je silne odporúÄané nastaviÅ¥ heslo " +"správcovského MySQL úÄtu \"root\"." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "Ak toto pole ponecháte prázdne, heslo nebude zmenené." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Zopakujte heslo MySQL používateľa „root“:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Nemožno nastaviÅ¥ heslo MySQL používateľa „root“" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Pri nastavovaní hesla správcu MySQL nastala chyba. Toto môže nastaÅ¥, ak už " +"úÄet má nastavené heslo alebo kvôli problémom pri komunikácii s MySQL " +"serverom." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "Po inÅ¡talácii balíka by ste mali skontrolovaÅ¥ heslo úÄtu." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +#, fuzzy +#| msgid "" +#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " +#| "more information." +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"ÄŽalÅ¡ie podrobností nájdete v súbore /usr/share/doc/mysql-server-5.1/README." +"Debian." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Chyba pri zadávaní hesla" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "Heslá, ktoré ste zadali sa nezhodujú. Skúste prosím znova." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "Vyzerá to, že používate NDB Cluster" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +#, fuzzy +#| msgid "" +#| "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the " +#| "new mysql-cluster package and remove all lines starting with \"ndb\" from " +#| "all config files below /etc/mysql/." +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"MySQL-5.1 už nepodporuje NDB Cluster. Použite prosím nový balík mysql-" +"cluster a zo vÅ¡etkých konfiguraÄných súborov v /etc/mysql/ odstráňte vÅ¡etky " +"riadky, ktoré zaÄínajú na „ndbâ€." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/sv.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/sv.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/sv.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/sv.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,220 @@ +# Translation of mysql-5.6 debconf template to Swedish +# Copyright (C) 2009, 2012 Martin Bagge +# This file is distributed under the same license as the mysql-5.6 package. +# +# Andreas Henriksson , 2007 +# Martin Bagge , 2009, 2012 +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-5.6 5.0.21-3\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2012-05-30 00:29+0100\n" +"Last-Translator: Martin Bagge / brother \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Swedish\n" +"X-Poedit-Country: Sweden\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "Vill du verkligen genomföra nedgraderingen?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "En fil med namnet /var/lib/mysql/debian-*.flag hittades i systemet." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" +"En sÃ¥dan fil är en indikation pÃ¥ att paketet mysql-server med ett högre " +"versionsnummer har installerats tidigare." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" +"Det finns ingen garanti för att den version som du hÃ¥ller pÃ¥ att installera " +"kommer att kunna använda de aktuella databaserna." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "Viktig information för NIS/YP-användare" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" +"För att kunna använda MySQL under NIS/YP mÃ¥ste ett användarkonto för MySQL " +"läggas till i systemet." + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" +"Du bör ocksÃ¥ kontrollera rättigheterna och ägaren av katalogen /var/lib/" +"mysql." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "Ta bort alla MySQL-databaser?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" +"Katalogen /var/lib/mysql som innehÃ¥ller MySQL-databaser kommer att tas bort." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" +"Om avinstallationen av MySQL-paketet görs för att senare kunna installera en " +"nyare version eller om en annan MySQL-server redan använder filerna ska de " +"inte raderas." + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "Ska MySQL startas vid systemets uppstart?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL-servern kan startas vid systemets uppstart eller manuellt med " +"kommandot \"/etc/init.d/mysql start\"." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "Nytt lösenord för MySQLs \"root\"-användare:" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" +"Det är inte obligatoriskt men starkt rekommenderat att du sätter ett " +"lösenord för MySQLs administrativa \"root\"-användare." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "Om detta fält lämnas tom kommer lösenordet inte att ändras." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "Repetera lösenordet för MySQLs \"root\"-användare:" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "Kunde inte sätta lösenord för MySQLs \"root\"-användare" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" +"Ett fel uppstod när det skulle sättas ett lösenord för MySQLs administrativa " +"användare (\"root\"). Detta kan ha skett för att användaren redan har ett " +"lösenord satt, eller pÃ¥ grund av problem med att kommunicera med MySQL-" +"servern." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "Du bör kontrollera kontots lösenord efter installationen av paketet." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" +"Läs filen /usr/share/doc/mysql-server-5.6/README.Debian för mer information." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "Fel vid inmatning av lösenord" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "De tvÃ¥ lösenorden du angav stämde inte överrens. Prova igen." + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "NDB-kluster används inte" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" +"Stödet för NDB-kluster har tagits bort i MySQL-5.6. Migrera till det nya " +"paketet mysql-cluster-server och ta bort alla rader som inleds med \"ndb\" " +"frÃ¥n alla inställlningsfiler i /etc/mysql/." + +#~ msgid "" +#~ "To use MySQL, the following entries for users and groups should be added " +#~ "to the system:" +#~ msgstr "" +#~ "För att använda MySQL mÃ¥ste följande användare och grupper läggas till i " +#~ "systemet:" diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/templates.pot percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/templates.pot --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/templates.pot 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/templates.pot 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,187 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: mysql-wsrep-5.6\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "Important note for NIS/YP users" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "Start the MySQL server on boot?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/tr.po percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/tr.po --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/po/tr.po 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/po/tr.po 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,342 @@ +# Turkish translation of mysql-server. +# This file is distributed under the same license as the mysql-server package. +# Gürkan Aslan , 2004 +# +msgid "" +msgstr "" +"Project-Id-Version: mysql-dfsg-4.1\n" +"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n" +"POT-Creation-Date: 2014-11-23 01:05+0200\n" +"PO-Revision-Date: 2004-06-05 08:53+0300\n" +"Last-Translator: Gürkan Aslan \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "Really proceed with downgrade?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"Such a file is an indication that a mysql-server package with a higher " +"version has been installed previously." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:2001 +msgid "" +"There is no guarantee that the version you're currently installing will be " +"able to use the current databases." +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +#, fuzzy +#| msgid "Important note for NIS/YP users!" +msgid "Important note for NIS/YP users" +msgstr "NIS/YP kullanıcıları için önemli not!" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"Using MySQL under NIS/YP requires a mysql user account to be added on the " +"local system with:" +msgstr "" + +#. Type: note +#. Description +#: ../mysql-wsrep-server-5.6.templates:3001 +msgid "" +"You should also check the permissions and ownership of the /var/lib/mysql " +"directory:" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "Remove all MySQL databases?" +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"The /var/lib/mysql directory which contains the MySQL databases is about to " +"be removed." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:4001 +msgid "" +"If you're removing the MySQL package in order to later install a more recent " +"version or if a different mysql-server package is already using it, the data " +"should be kept." +msgstr "" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +#| msgid "Should MySQL start on boot?" +msgid "Start the MySQL server on boot?" +msgstr "MySQL açılış sırasında baÅŸlatılsın mı?" + +#. Type: boolean +#. Description +#: ../mysql-wsrep-server-5.6.templates:5001 +#, fuzzy +msgid "" +"The MySQL server can be launched automatically at boot time or manually with " +"the '/etc/init.d/mysql start' command." +msgstr "" +"MySQL açılış sırasında veya '/etc/init.d/mysql start' komutunu vermeniz " +"halinde elle baÅŸlatılabilir. EÄŸer açılışta otomatik olarak baÅŸlatılmasını " +"istiyorsanız burada 'evet'i seçin." + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "New password for the MySQL \"root\" user:" +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "" +"While not mandatory, it is highly recommended that you set a password for " +"the MySQL administrative \"root\" user." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:6001 +msgid "If this field is left blank, the password will not be changed." +msgstr "" + +#. Type: password +#. Description +#: ../mysql-wsrep-server-5.6.templates:7001 +msgid "Repeat password for the MySQL \"root\" user:" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "Unable to set password for the MySQL \"root\" user" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"An error occurred while setting the password for the MySQL administrative " +"user. This may have happened because the account already has a password, or " +"because of a communication problem with the MySQL server." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "You should check the account's password after the package installation." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:8001 +msgid "" +"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more " +"information." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "Password input error" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:9001 +msgid "The two passwords you entered were not the same. Please try again." +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "NDB Cluster seems to be in use" +msgstr "" + +#. Type: error +#. Description +#: ../mysql-wsrep-server-5.6.templates:10001 +msgid "" +"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new " +"mysql-cluster-server package and remove all lines starting with \"ndb\" from " +"all config files below /etc/mysql/." +msgstr "" + +#~ msgid "" +#~ "To use mysql you must install an equivalent user and group to the " +#~ "following and ensure yourself that /var/lib/mysql has the right " +#~ "permissions (the uid/gid may be different)." +#~ msgstr "" +#~ "Mysql'i kullanmak için aÅŸağıdakiyle eÅŸdeÄŸer bir kullanıcı ve grup " +#~ "tanımlamalı, ve /var/lib/mysql izinlerinin uygun ÅŸekilde ayarlandığından " +#~ "emin olmalısınız (uid/gid farklı olabilir)." + +#~ msgid "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" +#~ msgstr "" +#~ "/etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false" + +#~ msgid "/etc/group: mysql:x:101:" +#~ msgstr "/etc/group: mysql:x:101:" + +#~ msgid "/var/lib/mysql: drwxr-xr-x mysql mysql" +#~ msgstr "/var/lib/mysql: drwxr-xr-x mysql mysql" + +#, fuzzy +#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" +#~ msgstr "Lütfen http://www.mysql.com/doc/en/Upgrade.html belgesini okuyun" + +#, fuzzy +#~ msgid "" +#~ "MySQL will only install if you have a non-numeric hostname that is " +#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command " +#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 " +#~ "myhostname\"." +#~ msgstr "" +#~ "MySQL sadece /etc/hosts dosyası yoluyla çözülebilir NUMERÄ°K OLMAYAN bir " +#~ "makine adına sahipseniz kurulacaktır. ÖrneÄŸin, eÄŸer \"hostname\" komutu " +#~ "\"makinem\" ismini döndürüyorsa, bu dosya içinde \"10.0.0.1 makinem\" " +#~ "gibi bir satır olmalıdır." + +#, fuzzy +#~ msgid "" +#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account " +#~ "is used in the start/stop and cron scripts. Don't delete." +#~ msgstr "" +#~ "Yeni mysql kullanıcısı \"debian-sys-maint\" yaratılacak. Bu hesap, " +#~ "baÅŸlangıç betiklerinde ve cron içinde kullanılıyor. Bu hesabı silmeyin." + +#, fuzzy +#~ msgid "" +#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /" +#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in " +#~ "there, never only the password!" +#~ msgstr "" +#~ "Lütfen MySQL root kullanıcısı için bir PAROLA girmeyi unutmayın! EÄŸer /" +#~ "root/.my.cnf kullanıyorsanız, \"user\" ve \"password\" satırlarını her " +#~ "zaman buraya ekleyin, sadece parolayı deÄŸil! Daha fazla bilgi için /usr/" +#~ "share/doc/mysql-server/README.Debian dosyasını okuyun." + +#, fuzzy +#~ msgid "" +#~ "Should I remove all databases below /var/lib/mysql as you are purging the " +#~ "mysql-server package?" +#~ msgstr "" +#~ "mysql-server paketi kaldırıldıktan sonra bütün veritabanları silinsin mi?" + +#~ msgid "" +#~ "Networking is disabled by default for security reasons. You can enable it " +#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf." +#~ msgstr "" +#~ "AÄŸ, öntanımlı olarak güvenlik gerekçeleriyle devre dışı bırakıldı. Bu " +#~ "özelliÄŸi /etc/mysql/my.cnf dosyası içindeki \"skip-networking\" " +#~ "seçeneÄŸini kaldırarak etkinleÅŸtirebilirsiniz." + +#~ msgid "security and update notice" +#~ msgstr "güvenlik ve güncelleme duyurusu" + +#~ msgid "" +#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-" +#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. " +#~ "remove everything including the configuration) somewhen? (default is not)" +#~ msgstr "" +#~ "mysql-server paketini temizlemek için \"dpkg --purge mysql-server\" " +#~ "komutunu kullandığınızda (yani yapılandırma dahil herÅŸeyi silmek) /var/" +#~ "lib/mysql altındaki herÅŸeyi sileyim mi? (öntanımlı cevap hayır'dır)." + +#~ msgid "Please run mysql_fix_privilege_tables !" +#~ msgstr "Lütfen mysql_fix_privilege_tables komutunu çalıştırın!" + +#~ msgid "" +#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs " +#~ "other than root and mysql with mysql." +#~ msgstr "" +#~ "/var/lib/mysql'in izinlerinin güvenli olmasını saÄŸlamak amacıyla, buna " +#~ "ait GID'leri root ve mysql'den farklı olacak ÅŸekilde deÄŸiÅŸtireceÄŸim." + +#~ msgid "" +#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/" +#~ msgstr "" +#~ "SSL desteÄŸini nasıl etkinleÅŸtirebileceÄŸinize iliÅŸkin talimatlar /usr/" +#~ "share/doc/mysql-server/ içinde." + +#~ msgid "mysql_fix_privileges_tables will be executed" +#~ msgstr "mysql_fix_privileges_tables çalıştırılacak" + +#~ msgid "" +#~ "The latest MySQL versions have an enhanced, more fine grained, privilege " +#~ "system. To make use of it, some new fields must be added to the tables " +#~ "in the \"mysql\" database. This is done by the " +#~ "mysql_fix_privilege_tables script during this upgrade regardless of if " +#~ "the server is currently running or not!" +#~ msgstr "" +#~ "En son MySQL sürümleri zenginleÅŸtirilmiÅŸ, daha ayrıntılandırılmış bir " +#~ "ayrıcalık (privilege) sistemine sahiptir. Yeni sistemi kullanmak için, " +#~ "\"mysql\" veritabanındaki tablolara bazı yeni alanlar eklenmelidir. Bu " +#~ "iÅŸlem, sunucunun çalışıp çalışmamasına baÄŸlı olmaksızın " +#~ "mysql_fix_privilege_tables betiÄŸi tarafından bu yükseltme sırasında " +#~ "yapılır." + +#~ msgid "" +#~ "This script is not supposed to give any user more rights that he had " +#~ "before, if you encounter such a case, please contact me." +#~ msgstr "" +#~ "Bu betiÄŸin hiç bir kullanıcıya öncekinden daha fazla hak kazandırmadığı " +#~ "varsayılıyor. EÄŸer bunun aksinde bir durumla karşılaşırsanız, lütfen " +#~ "benimle baÄŸlantıya geçin." + +#~ msgid "Make MySQL reachable via network?" +#~ msgstr "MySQL network üzerinden ulaşılabilir olsun mu?" + +#~ msgid "" +#~ "Should MySQL listen on a network reachable TCP port? This is not " +#~ "necessary for use on a single computer and could be a security problem." +#~ msgstr "" +#~ "MySQL aÄŸ üzerinde ulaşılabilen bir TCP portunu dinlesin mi? Tek olan bir " +#~ "bilgisayar için bu ayar gerekli deÄŸildir ve bir güvenlik sorunu " +#~ "oluÅŸturabilir." + +#~ msgid "Enable chroot mode?" +#~ msgstr "chroot kipi etkinleÅŸtirilsin mi?" + +#~ msgid "" +#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so " +#~ "that users cannot modify any files outside this directory. This improves " +#~ "resistence against crackers, too, as they are not able to modify system " +#~ "files." +#~ msgstr "" +#~ "MySQL kendini /var/lib/mysql_jail dizinine hapsederek kullanıcıların bu " +#~ "dizin dışındaki hiç bir dosyayı deÄŸiÅŸtirmemesini saÄŸlayabilir. Bu " +#~ "düzenleme, sistem dosyalarını deÄŸiÅŸtirmelerini engelleyeceÄŸinden, " +#~ "cracker'lara karşı dayanıklılığı arttırır." diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/README percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/README --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/README 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/README 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,16 @@ +# 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 + +To override debian platform codename, specify DEB_CODENAME when building with cmake diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/README.Maintainer percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/README.Maintainer --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/README.Maintainer 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/README.Maintainer 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,44 @@ +# 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 + +TODO: Why /bin/bash for some files and /bin/sh for others (this is also the case in native packaging, so might be a reason) +TODO: Related to above: Should be POSIX compliant +TODO: Maybe refactor CMakeLists.txt to remove redundancy +TODO: Clean up install exception list so --list-missing can be changed to --fail-missing + +### WSREP stuff +TODO: Find a more efficient way to configure just "packaging/deb-in/" +TODO: Can we unite systemd files (service definition, pre- and post-scriptlets, maybe more) across platforms? + In RedHat etc, we have "scripts/systemd/mysqld.service.in" which is working. + Can we use that to replace "packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in" ? +TODO: Check whether it was safe to drop "debian/additions/debian-start*", recover from old sources if not. +TODO: Check everything, especially the pre/post-install/rm scripts, + and decide whether to follow Debian or Oracle or to create a mix. +TODO: Clean "packaging/deb-in/CMakeLists.txt" for systemd, SysV init, Upstart, and the mix (Debian!). +TODO: Introduce "WITH_SYSV" as a build option, so that we can build packages with both SysV and Systemd + startup support, as fits Debian (which delivers both). +TODO: Decide about Upstart, either implement support for it or remove the references. +TODO; Check package naming on Debian/Ubuntu: + We now have platform as part of version in the file name (separator '~') + because a dash '-' would start a revision which Debian tools don't affect in a "native" package. + +### Other stuff +Package cut: Comments in RPM spec files say "lz4_decompress" and "zlib_decompress" were added to client RPMs. + That's wrong, they are in the server RPMs. Similar for DEB. They are meant for "mysqlpump" result files + (if compressed), and that tool is in the client packages (both RPM and DEB). + Also, placement differs: RPMs have them in "/usr/bin/", DEBs in "/usr/lib/mysql/" and a patch for MTR + so that they will be found. + Proposal 1: Make comments come true, move them into client packages. + Proposal 2: Put them in "/usr/bin/", delete the patch. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/rules.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/rules.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/rules.in 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/rules.in 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,181 @@ +#!/usr/bin/make -f + +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +ifneq (,$(findstring SYSTEMD,@DEB_STARTUP@)) +CMAKE_SYSTEMD_OPTIONS := -DWITH_SYSTEMD=1 -DSYSTEMD_SERVICE_NAME="@DEB_SYSTEMD_SERVICE_NAME@" +endif + +%: + dh $@ + +export DH_VERBOSE=1 +export CFLAGS= +export CXXFLAGS= + +override_dh_auto_configure: + @echo "RULES.$@" + cmake . \ + -DBUILD_CONFIG=mysql_release \ + $(CMAKE_SYSTEMD_OPTIONS) \ + -DWITH_WSREP=1 \ + -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp \ + -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_SUPPORTFILESDIR=share/mysql \ + -DSYSCONFDIR=/etc/mysql \ + -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \ + -DWITH_SSL=bundled \ + -DWITH_INNODB_MEMCACHED=1 \ + -DWITH_MECAB=system \ + -DWITH_NUMA=ON \ + -DCOMPILATION_COMMENT="MySQL @DEB_PRODUCTNAMEC@ Server (@DEB_LICENSENAME@)" \ + -DINSTALL_LAYOUT=DEB \ + -DDEB_PRODUCT=@DEB_PRODUCT@ \ + @DEB_CMAKE_EXTRAS@ + touch $@ + +override_dh_auto_build: + @echo "RULES.$@" + $(MAKE) -j8 VERBOSE=1 + touch $@ + +override_dh_auto_test: + @echo "RULES.$@" + touch $@ + +override_dh_auto_install: + + @echo "RULES.$@" + # complete install first + $(MAKE) install DESTDIR=debian/tmp + # remove all redundant files + 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 -m 0644 support-files/wsrep.cnf debian/tmp/usr/share/mysql + # SysV init stuff, or Systemd files ? On Debian 8, we need both! +#ifneq (,$(findstring SYSV,@DEB_STARTUP@)) + install -D -m 0755 support-files/mysql.server debian/tmp/etc/init.d/mysql +#endif +#ifneq (,$(findstring SYSTEMD,@DEB_STARTUP@)) +# install -m 0755 scripts/mysqld_bootstrap debian/tmp/usr/bin/ +#endif + # This seems to be the only safe place to fix permissions issues + # not handled by dh_fixperms. + # install -m 0755 debian/additions/echo_stderr debian/tmp/usr/share/mysql/ + mkdir -p debian/tmp/etc/mysql + install -m 0755 debian/extra/debian-start debian/tmp/etc/mysql/ + install -m 0755 debian/extra/debian-start.inc.sh debian/tmp/usr/share/mysql/ + install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug + #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 helper functions for maintainer scripts + install -m 0644 debian/extra/mysql-helpers debian/tmp/usr/share/mysql/ + # add apparmor profile + @DEB_RULES_INSTALL_APPARMOR@ + # add systemd script + #@DEB_RULES_INSTALL_SYSTEMD@ + # 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-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ + 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-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ + install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@ + 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-testsuite + install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@ + install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@ + @DEB_NDB_RULES_DOCDIRS@ + # add @DEB_INSTALL_LICENSEFILE@ file to each package + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-server/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-client/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/libmysqlclient18/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/libmysqlclient-dev/@DEB_INSTALL_LICENSEFILE@ + # install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/libmysqld-dev/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-testsuite/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@ + @DEB_NDB_RULES_LICENSE@ + # 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-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/README + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README-wsrep debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ + 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-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/README + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/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-testsuite/README + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/README + install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/README + @DEB_NDB_RULES_README@ + touch $@ + + +override_dh_installlogrotate-arch: + dh_installlogrotate --name mysql-server + +ifneq (,$(findstring SYSTEMD,@DEB_STARTUP@)) +#use upstream init to bypass systemd for 5.6.36 release +INSTALLINITOPTS="" +else +INSTALLINITOPTS="--onlyscripts" +endif + +override_dh_installinit: + @echo "RULES.$@" + @DEB_RULES_APPARMOR_LOAD@ + @DEB_RULES_SYSTEMD_ENABLE@ + + dh_installinit $(INSTALLINITOPTS) -pmysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ --name=mysql -- defaults 19 21 + @DEB_RULES_SYSTEMD_START@ + touch $@ + +override_dh_install: + dh_install --list-missing \ + -Xusr/bin/i_mysql_client_test \ + -Xusr/share/mysql/mysql.server \ + -Xusr/share/mysql/@DEB_INSTALL_LICENSEFILE@ \ + -Xusr/share/mysql/README \ + -Xusr/share/mysql/docs/mysql.info \ + -Xusr/share/mysql/docs/INSTALL-BINARY \ + -Xusr/share/man/man1/mysqlman.1 +ifneq (,@DEB_RULES_APPARMOR_LOAD@) + # non-empty command = apparmor is handled + dh_apparmor -pmysql-server@DEB_PRODUCTSERIES@ --profile-name=usr.sbin.mysqld +endif diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/source/format percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/source/format --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/source/format 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/source/format 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/source/include-binaries percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/source/include-binaries --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/source/include-binaries 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/source/include-binaries 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,70 @@ +# 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 +# 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 +# debian/extra/server-binary +# debian/extra/embedded-server +# obscured filenames for debug plugins +debian/extra/adt_null-plugin +debian/extra/auth-plugin +debian/extra/auth_socket-plugin +debian/extra/auth_test_plugin-plugin +debian/extra/group_replication-plugin +debian/extra/ha_example-plugin +debian/extra/innodb_engine-plugin +debian/extra/keyring_file-plugin +debian/extra/keyring_udf-plugin +debian/extra/libdaemon_example-plugin +debian/extra/libmemcached-plugin +debian/extra/libpluginmecab-plugin +debian/extra/libtest_framework-plugin +debian/extra/libtest_services-plugin +debian/extra/libtest_services_threaded-plugin +debian/extra/libtest_session_detach-plugin +debian/extra/libtest_session_info-plugin +debian/extra/libtest_session_in_thd-plugin +debian/extra/libtest_sql_2_sessions-plugin +debian/extra/libtest_sql_all_col_types-plugin +debian/extra/libtest_sql_cmds_1-plugin +debian/extra/libtest_sql_commit-plugin +debian/extra/libtest_sql_complex-plugin +debian/extra/libtest_sql_errors-plugin +debian/extra/libtest_sql_lock-plugin +debian/extra/libtest_sql_processlist-plugin +debian/extra/libtest_sql_replication-plugin +debian/extra/libtest_sql_shutdown-plugin +debian/extra/libtest_sql_sqlmode-plugin +debian/extra/libtest_sql_stored_procedures_functions-plugin +debian/extra/libtest_sql_views_triggers-plugin +debian/extra/libtest_x_sessions_deinit-plugin +debian/extra/libtest_x_sessions_init-plugin +debian/extra/locking_service-plugin +debian/extra/mypluglib-plugin +debian/extra/mysql_no_login-plugin +debian/extra/mysqlx-plugin +debian/extra/qa_auth_client-plugin +debian/extra/qa_auth_interface-plugin +debian/extra/qa_auth_server-plugin +debian/extra/replication_observers_example_plugin-plugin +debian/extra/rewriter-plugin +debian/extra/rewrite_example-plugin +debian/extra/semisync_master-plugin +debian/extra/semisync_slave-plugin +debian/extra/test_security_context-plugin +debian/extra/test_udf_services-plugin +debian/extra/validate_password-plugin +debian/extra/version_token-plugin +debian/extra/connection_control-plugin +@DEB_INCLUDE_BINARIES_EXTRA@ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/source/lintian-overrides percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/source/lintian-overrides --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/source/lintian-overrides 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,18 @@ +# 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 +# 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 + +# We provide our own versioning scheme so this warning is overridden +mysql-@DEB_PRODUCTNAME@ source: changelog-should-mention-nmu +mysql-@DEB_PRODUCTNAME@ source: source-nmu-has-incorrect-version-number diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/watch percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/watch --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-in/watch 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-in/watch 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,2 @@ +version=3 +https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@//mysql-([\d.]+).tar.gz diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-jessie/source/include-binaries percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-jessie/source/include-binaries --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-jessie/source/include-binaries 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-jessie/source/include-binaries 2017-10-19 04:25:29.000000000 +0000 @@ -32,3 +32,4 @@ debian/extra/semisync_slave-plugin debian/extra/test_udf_services-plugin debian/extra/validate_password-plugin +debian/extra/connection_control-plugin diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-precise/source/include-binaries percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-precise/source/include-binaries --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-precise/source/include-binaries 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-precise/source/include-binaries 2017-10-19 04:25:29.000000000 +0000 @@ -32,3 +32,4 @@ debian/extra/semisync_slave-plugin debian/extra/test_udf_services-plugin debian/extra/validate_password-plugin +debian/extra/connection_control-plugin diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-trusty/source/include-binaries percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-trusty/source/include-binaries --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-trusty/source/include-binaries 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-trusty/source/include-binaries 2017-10-19 04:25:29.000000000 +0000 @@ -32,3 +32,4 @@ debian/extra/semisync_slave-plugin debian/extra/test_udf_services-plugin debian/extra/validate_password-plugin +debian/extra/connection_control-plugin diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-wheezy/source/include-binaries percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-wheezy/source/include-binaries --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/deb-wheezy/source/include-binaries 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/deb-wheezy/source/include-binaries 2017-10-19 04:25:29.000000000 +0000 @@ -32,3 +32,4 @@ debian/extra/semisync_slave-plugin debian/extra/test_udf_services-plugin debian/extra/validate_password-plugin +debian/extra/connection_control-plugin diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-docker/mysql.spec.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-docker/mysql.spec.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-docker/mysql.spec.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-docker/mysql.spec.in 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -179,7 +179,7 @@ rm -f %{buildroot}%{_bindir}/$f done -for f in innochecksum myisamchk myisam_ftdump myisamlog myisampack mysqladmin \ +for f in innochecksum myisamchk myisam_ftdump myisamlog myisampack \ mysqlbinlog mysqlcheck mysql_client_test mysql_config_editor \ mysqld_multi mysqld_safe mysqldumpslow mysql_embedded mysqlimport \ mysql_plugin mysql_secure_installation mysqlshow mysqlslap mysqltest \ @@ -197,6 +197,10 @@ # No need for these scripts rm -f %{buildroot}%{_datadir}/mysql/{mysql.server,mysqld_multi.server,mysql-log-rotate,binary-configure} +# Remove files pages we explicitly do not want to package +rm -rf %{buildroot}%{_infodir}/mysql.info* +rm -f %{buildroot}%{_datadir}/mysql/win_install_firewall.sql + %check %if 0%{?runselftest} pushd release @@ -230,6 +234,7 @@ %dir %{_sysconfdir}/my.cnf.d %attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_bindir}/mysql +%attr(755, root, root) %{_bindir}/mysqladmin %attr(755, root, root) %{_bindir}/mysqldump %attr(755, root, root) %{_bindir}/mysql_config %attr(755, root, root) %{_bindir}/mysql_install_db @@ -239,6 +244,7 @@ %dir %{_libdir}/mysql/plugin %attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so %attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so %attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so %attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so @@ -282,11 +288,24 @@ %attr(644, root, root) %{_datadir}/mysql/dictionary.txt %attr(644, root, root) %{_datadir}/mysql/innodb_memcached_config.sql %attr(644, root, root) %{_datadir}/mysql/magic + +%if 0%{?commercial} +%attr(755, root, root) %{_libdir}/mysql/plugin/audit_log.so +%attr(755, root, root) %{_libdir}/mysql/plugin/authentication_pam.so +%attr(755, root, root) %{_libdir}/mysql/plugin/thread_pool.so +%attr(755, root, root) %{_libdir}/mysql/plugin/openssl_udf.so +%attr(755, root, root) %{_libdir}/mysql/plugin/firewall.so +%attr(644, root, root) %{_datadir}/mysql/linux_install_firewall.sql +%endif + %dir %attr(750, mysql, mysql) /var/lib/mysql %dir %attr(755, mysql, mysql) /var/run/mysqld %dir %attr(750, mysql, mysql) /var/lib/mysql-files %changelog +* Tue Sep 13 2016 Balasubramanian Kandasamy - 5.6.34-1 +- Add connection_control.so to server subpackage + * Mon Mar 14 2016 Georgi Kodinov - 5.6.31-1 - Add test_udf_services.so plugin diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysql_config.sh percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysql_config.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysql_config.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysql_config.sh 2017-10-19 04:25:29.000000000 +0000 @@ -2,22 +2,30 @@ # # Wrapper script for mysql_config to support multilib # -# Only works on OEL6/RHEL6 and similar # -# This command respects setarch +# This command respects setarch, works on OL6/RHEL6 and later bits=$(rpm --eval %__isa_bits) case $bits in - 32|64) status=known ;; - *) status=unknown ;; + 32|64) ;; + *) bits=unknown ;; esac -if [ "$status" = "unknown" ] ; then - echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits" - exit 1 +# Try mapping by uname if rpm command failed +if [ "$bits" = "unknown" ] ; then + arch=$(uname -m) + case $arch in + x86_64|ppc64|ppc64le|aarch64|s390x|sparc64) bits=64 ;; + i386|i486|i586|i686|pentium3|pentium4|athlon|ppc|s390|sparc) bits=32 ;; + *) bits=unknown ;; + esac fi +if [ "$bits" == "unknown" ] ; then + echo "$0: error: failed to determine isa bits on your arch." + exit 1 +fi if [ -x /usr/bin/mysql_config-$bits ] ; then /usr/bin/mysql_config-$bits "$@" @@ -25,4 +33,3 @@ echo "$0: error: needed binary: /usr/bin/mysql_config-$bits is missing. Please check your MySQL installation." exit 1 fi - diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysqld.service percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysqld.service --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysqld.service 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysqld.service 2017-10-19 04:25:29.000000000 +0000 @@ -34,7 +34,7 @@ ExecStartPre=/usr/bin/mysql-systemd-start pre # Start main service -ExecStart=/usr/bin/mysqld_safe +ExecStart=/usr/bin/mysqld_safe --basedir=/usr # Don't signal startup success before a ping works ExecStartPost=/usr/bin/mysql-systemd-start post diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysql.spec.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysql.spec.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysql.spec.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysql.spec.in 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -122,6 +122,7 @@ Requires: mysql-community-common%{?_isa} = %{version}-%{release} %endif Obsoletes: mariadb-server +Obsoletes: mariadb-server-utils Obsoletes: mariadb-galera-server Obsoletes: mariadb-server-galera Obsoletes: community-mysql-server < %{version}-%{release} @@ -547,6 +548,7 @@ %dir %{_libdir}/mysql/plugin %attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so %attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so %attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so %attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so @@ -557,6 +559,7 @@ %dir %{_libdir}/mysql/plugin/debug %attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/connection_control.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so @@ -722,6 +725,9 @@ %attr(755, root, root) %{_libdir}/mysql/libmysqld.so %changelog +* Mon Oct 31 2016 Balasubramanian Kandasamy - 5.6.35-1 +- Add connection_control.so to server subpackage + * Mon Sep 26 2016 Balasubramanian Kandasamy - 5.6.34-1 - Include mysql-files directory diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysql-systemd-start percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysql-systemd-start --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-fedora/mysql-systemd-start 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-fedora/mysql-systemd-start 2017-10-19 04:25:29.000000000 +0000 @@ -22,7 +22,9 @@ datadir=$(get_option mysqld datadir "/var/lib/mysql") # Restore log, dir, perms and SELinux contexts - [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then + install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + fi log=/var/log/mysqld.log [ -e $log ] || touch $log chmod 0640 $log diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql_config.sh percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql_config.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql_config.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql_config.sh 2017-10-19 04:25:29.000000000 +0000 @@ -5,10 +5,10 @@ # # This command respects setarch, works on OL6/RHEL6 and later -isa_bits=$(rpm --eval %__isa_bits) +bits=$(rpm --eval %__isa_bits) case $bits in - 32|64) bits=$isa_bits ;; + 32|64) ;; *) bits=unknown ;; esac @@ -16,8 +16,8 @@ if [ "$bits" = "unknown" ] ; then arch=$(uname -m) case $arch in - x86_64|ppc64) bits=64 ;; - i386|i486|i586|i686|pentium3|pentium4|athlon|ppc) bits=32 ;; + x86_64|ppc64|ppc64le|aarch64|s390x|sparc64) bits=64 ;; + i386|i486|i586|i686|pentium3|pentium4|athlon|ppc|s390|sparc) bits=32 ;; *) bits=unknown ;; esac fi @@ -33,4 +33,3 @@ echo "$0: error: needed binary: /usr/bin/mysql_config-$bits is missing. Please check your MySQL installation." exit 1 fi - diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysqld.service percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysqld.service --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysqld.service 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysqld.service 2017-10-19 04:25:29.000000000 +0000 @@ -34,7 +34,7 @@ ExecStartPre=/usr/bin/mysql-systemd-start pre # Start main service -ExecStart=/usr/bin/mysqld_safe +ExecStart=/usr/bin/mysqld_safe --basedir=/usr # Don't signal startup success before a ping works ExecStartPost=/usr/bin/mysql-systemd-start post diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql.init percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql.init --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql.init 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql.init 2017-10-19 04:25:29.000000000 +0000 @@ -23,31 +23,37 @@ STARTTIMEOUT=120 STOPTIMEOUT=60 +# Set in /etc/sysconfig/mysqld, will be passed to mysqld_safe +MYSQLD_OPTS= + [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog lockfile=/var/lock/subsys/$prog -# extract value of a MySQL option from config files -# Usage: get_mysql_option SECTION VARNAME DEFAULT -# result is returned in $result +# Extract value of a MySQL option from config files +# Usage: get_mysql_option OPTION DEFAULT SECTION1 SECTION2 SECTIONN +# Result is returned in $result # We use my_print_defaults which prints all options from multiple files, # with the more specific ones later; hence take the last match. -get_mysql_option(){ - result=$(/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1) - if [ -z "$result" ]; then - # not found, use default - result="$3" - fi +get_mysql_option () { + option=$1 + default=$2 + shift 2 + result=$(/usr/bin/my_print_defaults "$@" | sed -n "s/^--${option}=//p" | tail -n 1) + if [ -z "$result" ]; then + # not found, use default + result="${default}" + fi } -get_mysql_option mysqld datadir "/var/lib/mysql" +get_mysql_option datadir "/var/lib/mysql" mysqld datadir="$result" -get_mysql_option mysqld socket "$datadir/mysql.sock" +get_mysql_option socket "$datadir/mysql.sock" mysqld socketfile="$result" -get_mysql_option mysqld_safe log-error "/var/log/mysqld.log" +get_mysql_option log-error "/var/log/mysqld.log" mysqld mysqld_safe errlogfile="$result" -get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid" +get_mysql_option pid-file "/var/run/mysqld/mysqld.pid" mysqld mysqld_safe mypidfile="$result" case $socketfile in @@ -70,18 +76,19 @@ ret=0 else # prepare for start - touch "$errlogfile" - chown mysql:mysql "$errlogfile" - chmod 0640 "$errlogfile" + if [ ! -e "$errlogfile" -a ! -h "$errlogfile" -a "x$(dirname "$errlogfile")" = "x/var/log" ]; then + install /dev/null -m0640 -omysql -gmysql "$errlogfile" + fi [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" if [ ! -d "$datadir/mysql" ] ; then # First, make sure $datadir is there with correct permissions - if [ ! -e "$datadir" -a ! -h "$datadir" ] - then - mkdir -p "$datadir" || exit 1 + if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then + install -d -m0755 -omysql -gmysql "$datadir" || exit 1 + fi + if [ ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then + chown mysql:mysql "$datadir" + chmod 0755 "$datadir" fi - chown mysql:mysql "$datadir" - chmod 0755 "$datadir" if [ -x /sbin/restorecon ]; then /sbin/restorecon "$datadir" for dir in /var/lib/mysql-files ; do @@ -94,13 +101,14 @@ # Now create the database action $"Initializing MySQL database: " /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql ret=$? - chown -R mysql:mysql "$datadir" if [ $ret -ne 0 ] ; then return $ret fi fi - chown mysql:mysql "$datadir" - chmod 0755 "$datadir" + if [ ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then + chown mysql:mysql "$datadir" + chmod 0755 "$datadir" + fi # Pass all the options determined above, to ensure consistent behavior. # In many cases mysqld_safe would arrive at the same conclusions anyway # but we need to be sure. (An exception is that we don't force the @@ -108,7 +116,7 @@ # and some users might prefer to configure logging to syslog.) # Note: set --basedir to prevent probes that might trigger SELinux # alarms, per bug #547485 - $exec --datadir="$datadir" --socket="$socketfile" \ + $exec $MYSQLD_OPTS --datadir="$datadir" --socket="$socketfile" \ --pid-file="$mypidfile" \ --basedir=/usr --user=mysql >/dev/null & safe_pid=$! diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql.spec.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql.spec.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql.spec.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql.spec.in 2017-10-19 04:25:29.000000000 +0000 @@ -747,6 +747,7 @@ %dir %{_libdir}/mysql/plugin %attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so %attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so %attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so %attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so @@ -757,6 +758,7 @@ %dir %{_libdir}/mysql/plugin/debug %attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/connection_control.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so @@ -954,6 +956,9 @@ %endif %changelog +* Mon Oct 31 2016 Balasubramanian Kandasamy - 5.6.35-1 +- Add connection_control.so to server subpackage + * Mon Sep 26 2016 Balasubramanian Kandasamy - 5.6.34-1 - Include mysql-files directory diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql-systemd-start percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql-systemd-start --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-oel/mysql-systemd-start 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-oel/mysql-systemd-start 2017-10-19 04:25:29.000000000 +0000 @@ -22,7 +22,9 @@ datadir=$(get_option mysqld datadir "/var/lib/mysql") # Restore log, dir, perms and SELinux contexts - [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then + install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + fi log=/var/log/mysqld.log [ -e $log ] || touch $log chmod 0640 $log diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysqld.service percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysqld.service --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysqld.service 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysqld.service 2017-10-19 04:25:29.000000000 +0000 @@ -34,7 +34,7 @@ ExecStartPre=/usr/bin/mysql-systemd-start pre # Start main service -ExecStart=/usr/bin/mysqld_safe +ExecStart=/usr/bin/mysqld_safe --basedir=/usr # Don't signal startup success before a ping works ExecStartPost=/usr/bin/mysql-systemd-start post diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysql.init percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysql.init --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysql.init 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysql.init 2017-10-19 04:25:29.000000000 +0000 @@ -54,34 +54,35 @@ lockfile=/var/lock/subsys/mysql get_option () { - local section=$1 - local option=$2 - local default=$3 - ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n 1) - [ -z $ret ] && ret=$default + local option=$1 + local default=$2 + shift 2 + ret=$(/usr/bin/my_print_defaults "$@" | sed -n "s/^--${option}=//p" | tail -n 1) + [ -z $ret ] && ret=${default} echo $ret } -datadir=$(get_option mysqld datadir "/var/lib/mysql") -socket=$(get_option mysqld socket "$datadir/mysql.sock") -pidfile=$(get_option mysqld_safe pid-file "/var/run/mysql/mysqld.pid") -logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log") +datadir=$(get_option datadir "/var/lib/mysql" mysqld) +socket=$(get_option socket "$datadir/mysql.sock" mysqld) +pidfile=$(get_option pid-file "/var/run/mysql/mysqld.pid" mysqld mysqld_safe) install_db () { # Note: something different than datadir=/var/lib/mysql requires # SELinux policy changes (in enforcing mode) - datadir=$(get_option mysqld datadir "/var/lib/mysql") - logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log") + datadir=$(get_option datadir "/var/lib/mysql" mysqld) + logfile=$(get_option log-error "/var/log/mysql/mysqld.log" mysqld mysqld_safe) # Restore log, dir, perms and SELinux contexts - [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || return 1 + if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then + install -d -m 0755 -omysql -gmysql "$datadir" || return 1 + fi - [ -e $logfile ] || touch $logfile || return 1 - chmod 0640 $logfile - chown mysql:mysql $logfile || return 1 + if [ ! -e "$logfile" -a ! -h "$logfile" -a "x$(dirname "$logfile")" = "x/var/log/mysql" ]; then + install /dev/null -omysql -gmysql "$logfile" || return 1 + fi if [ -x /usr/sbin/restorecon ]; then /usr/sbin/restorecon "$datadir" - /usr/sbin/restorecon $logfile + /usr/sbin/restorecon "$logfile" fi # If special mysql dir is in place, skip db install diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysql.spec.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysql.spec.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysql.spec.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysql.spec.in 2017-10-19 04:25:29.000000000 +0000 @@ -623,6 +623,7 @@ %dir %{_libdir}/mysql/plugin %attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so %attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so %attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so %attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so @@ -633,6 +634,7 @@ %dir %{_libdir}/mysql/plugin/debug %attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/connection_control.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so @@ -824,6 +826,9 @@ %attr(755, root, root) %{_libdir}/mysql/libmysqld.so %changelog +* Mon Oct 31 2016 Balasubramanian Kandasamy - 5.6.35-1 +- Add connection_control.so to server subpackage + * Mon Sep 26 2016 Balasubramanian Kandasamy - 5.6.34-1 - Include mysql-files directory diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysql-systemd-start percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysql-systemd-start --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/rpm-sles/mysql-systemd-start 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/rpm-sles/mysql-systemd-start 2017-10-19 04:25:29.000000000 +0000 @@ -13,7 +13,9 @@ datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1) # Restore log, dir, perms and SELinux contexts - [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then + install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + fi log=/var/log/mysql/mysqld.log [ -e $log ] || touch $log chmod 0640 $log diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/WiX/create_msi.cmake.in percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/WiX/create_msi.cmake.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/WiX/create_msi.cmake.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/WiX/create_msi.cmake.in 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,6 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +SET(LINK_STATIC_RUNTIME_LIBRARIES "@LINK_STATIC_RUNTIME_LIBRARIES@") SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@") @@ -217,22 +218,37 @@ OUTPUT_STRIP_TRAILING_WHITESPACE) ENDMACRO() -SET(INC_VAR 0) +# Make sure that WIX identifier created from a path matches all the rules: +# - it is shorter than 72 characters +# - doesn't contain reserver characters ('+', '-' and '/') +# ID_SET contains a global list of all identifiers which are too long. +# Every time we use an identifier which is too long we use its index in +# ID_SET to shorten the name. +SET_PROPERTY(GLOBAL PROPERTY ID_SET) MACRO(MAKE_WIX_IDENTIFIER str varname) STRING(REPLACE "/" "." ${varname} "${str}") + STRING(REPLACE "+" "p" ${varname} "${str}") + STRING(REPLACE "-" "m" ${varname} "${str}") STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}") STRING(LENGTH "${${varname}}" len) + # FIXME: the prefix length has to be controlled better # Identifier should be smaller than 72 character - # We have to cut down the length to 70 chars, since we add 2 char prefix + # We have to cut down the length to 40 chars, since we add prefixes # pretty often - IF(len GREATER 70) - STRING(SUBSTRING "${${varname}}" 0 67 shortstr) - MATH(EXPR INC_VAR ${INC_VAR}+1) - SET(${varname} "${shortstr}${INC_VAR}") + IF(len GREATER 40) + STRING(SUBSTRING "${${varname}}" 0 37 shortstr) + GET_PROPERTY(LOCAL_LIST GLOBAL PROPERTY ID_SET) + LIST(FIND LOCAL_LIST "${${varname}}" STRING_ID) + IF(${STRING_ID} EQUAL -1) + LIST(APPEND LOCAL_LIST "${${varname}}") + SET_PROPERTY(GLOBAL PROPERTY ID_SET "${LOCAL_LIST}") + LIST(LENGTH LOCAL_LIST STRING_ID) + MATH(EXPR STRING_ID "${STRING_ID}-1" ) + ENDIF() + SET(${varname} "${shortstr}${STRING_ID}") ENDIF() ENDMACRO() - FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root) FILE(RELATIVE_PATH dir_rel ${topdir} ${dir}) IF(dir_rel) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/WiX/custom_ui.wxs percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/WiX/custom_ui.wxs --- percona-xtradb-cluster-5.6-5.6.34-26.19/packaging/WiX/custom_ui.wxs 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/packaging/WiX/custom_ui.wxs 2017-10-19 04:25:29.000000000 +0000 @@ -2,7 +2,7 @@ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/audit_log/audit_log.c percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/audit_log/audit_log.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/audit_log/audit_log.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/audit_log/audit_log.c 2017-10-19 04:25:29.000000000 +0000 @@ -217,6 +217,7 @@ { '&', 5, "&" }, { '\r', 5, " " }, { '\n', 5, " " }, + { '\t', 5, " " }, { '"', 6, """ }, { 0, 0, NULL } }; @@ -233,6 +234,10 @@ { '"', 2, "\\\"" }, { '\r', 2, "\\r" }, { '\n', 2, "\\n" }, + { '/', 2, "\\/" }, + { '\b', 2, "\\b" }, + { '\f', 2, "\\f" }, + { '\t', 2, "\\t" }, { 0, 0, NULL } }; @@ -805,15 +810,61 @@ logger_init_mutexes(); + audit_log_filter_init(); + + if (audit_log_exclude_accounts != NULL && audit_log_include_accounts != NULL) + { + fprintf(stderr, "Both 'audit_log_exclude_accounts' and " + "'audit_log_include_accounts' are not NULL\n"); + goto validation_error; + } + + if (audit_log_exclude_commands != NULL && audit_log_include_commands != NULL) + { + fprintf(stderr, "Both 'audit_log_exclude_commands' and " + "'audit_log_include_commands' are not NULL\n"); + goto validation_error; + } + + if (audit_log_exclude_accounts != NULL) + { + audit_log_exclude_accounts= my_strdup(audit_log_exclude_accounts, + MYF(MY_FAE)); + audit_log_set_exclude_accounts(audit_log_exclude_accounts); + } + if (audit_log_include_accounts != NULL) + { + audit_log_include_accounts= my_strdup(audit_log_include_accounts, + MYF(MY_FAE)); + audit_log_set_exclude_accounts(audit_log_include_accounts); + } + if (audit_log_exclude_commands != NULL) + { + audit_log_exclude_commands= my_strdup(audit_log_exclude_commands, + MYF(MY_FAE)); + audit_log_set_exclude_commands(audit_log_exclude_commands); + } + if (audit_log_include_commands != NULL) + { + audit_log_include_commands= my_strdup(audit_log_include_commands, + MYF(MY_FAE)); + audit_log_set_include_commands(audit_log_include_commands); + } + if (init_new_log_file()) return(1); if (audit_log_audit_record(buf, sizeof(buf), "Audit", time(NULL), &len)) audit_log_write(buf, len); - audit_log_filter_init(); + return 0; - return(0); +validation_error: + + audit_log_exclude_accounts= audit_log_include_accounts= NULL; + audit_log_exclude_commands= audit_log_include_commands= NULL; + + return 1; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/audit_log/filter.c percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/audit_log/filter.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/audit_log/filter.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/audit_log/filter.c 2017-10-19 04:25:29.000000000 +0000 @@ -306,6 +306,9 @@ account_init(&acc, user, user_length, host, host_length); + if (acc.length == 0) + return FALSE; + mysql_rwlock_rdlock(&LOCK_account_list); res= my_hash_search(&include_accounts, @@ -326,6 +329,9 @@ account_init(&acc, user, user_length, host, host_length); + if (acc.length == 0) + return FALSE; + mysql_rwlock_rdlock(&LOCK_account_list); res= my_hash_search(&exclude_accounts, @@ -360,17 +366,15 @@ */ my_bool audit_log_check_command_included(const char *name, size_t length) { - command cmd; my_bool res; - command_init(&cmd, name, length); + if (length == 0) + return FALSE; mysql_rwlock_rdlock(&LOCK_command_list); - - res= my_hash_search(&include_commands, - (const uchar*) cmd.name, cmd.length) != NULL; - + res= my_hash_search(&include_commands, (const uchar*) name, length) != NULL; mysql_rwlock_unlock(&LOCK_command_list); + return res; } @@ -379,15 +383,14 @@ */ my_bool audit_log_check_command_excluded(const char *name, size_t length) { - command cmd; my_bool res; - command_init(&cmd, name, length); + if (length == 0) + return FALSE; mysql_rwlock_rdlock(&LOCK_command_list); - - res= my_hash_search(&exclude_commands, - (const uchar*) cmd.name, cmd.length) != NULL; + res= my_hash_search(&exclude_commands, (const uchar*) name, length) != NULL; mysql_rwlock_unlock(&LOCK_command_list); + return res; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,22 @@ +# 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(connection_control + connection_control_coordinator.cc + connection_control.cc + security_context_wrapper.cc + connection_delay.cc + MODULE_ONLY) + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control.cc percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control.cc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control.cc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,480 @@ +/* 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 /* mysql_event_connection */ +#include "mysql_version.h" +#include +#include +#include + +#include "connection_control.h" +#include "connection_delay_api.h" /* connection_delay apis */ +#include "connection_control_coordinator.h" /* g_connection_event_coordinator */ + +namespace connection_control +{ + class Connection_control_error_handler : public Error_handler + { + public: + Connection_control_error_handler(MYSQL_PLUGIN plugin_info) + : m_plugin_info(plugin_info) + {} + + void handle_error(const char * error_message) + { + my_plugin_log_message(&m_plugin_info, + MY_ERROR_LEVEL, + error_message); + } + private: + MYSQL_PLUGIN m_plugin_info; + }; +} + +using connection_control::Connection_event_coordinator; +using connection_control::Connection_event_coordinator_services; +using connection_control::Connection_control_statistics; +using connection_control::Connection_control_variables; +using connection_control::Error_handler; +using connection_control::Connection_control_error_handler; + +typedef unsigned int mysql_event_class_t; + +Connection_control_statistics g_statistics; +Connection_control_variables g_variables; + +Connection_event_coordinator *g_connection_event_coordinator= 0; +MYSQL_PLUGIN connection_control_plugin_info= 0; + + +/** + event_notify() implementation for connection_control + + For connection event, notify Connection_event_coordinator + which in turn will notify subscribers. + + @param [in] thd Handle to THD + @param [in] event_class Event class. + We are interested in MYSQL_AUDIT_CONNECTION_CLASS. + @param [in] event mysql_event_connection handle +*/ + +static void +connection_control_notify(MYSQL_THD thd, + mysql_event_class_t event_class, + const void *event) +{ + DBUG_ENTER("connection_control_notify"); + try + { + if (event_class == MYSQL_AUDIT_CONNECTION_CLASS) + { + const struct mysql_event_connection *connection_event= + (const struct mysql_event_connection *) event; + Connection_control_error_handler error_handler(connection_control_plugin_info); + /** Notify event coordinator */ + g_connection_event_coordinator->notify_event(thd, &error_handler, + connection_event); + } + } + catch (...) + { + /* Happily ignore any bad behavior */ + } + + DBUG_VOID_RETURN; +} + + +/** + Plugin initialization function + + @param [in] plugin_info MYSQL_PLUGIN information + + @returns initialization status + @retval 0 Success + @retval 1 Failure +*/ + +static int +connection_control_init(MYSQL_PLUGIN plugin_info) +{ + connection_control_plugin_info= plugin_info; + Connection_control_error_handler error_handler(connection_control_plugin_info); + g_connection_event_coordinator= new Connection_event_coordinator(); + if (!g_connection_event_coordinator) + { + error_handler.handle_error("Failed to initialize Connection_event_coordinator"); + return 1; + } + + if (init_connection_delay_event((Connection_event_coordinator_services *) + g_connection_event_coordinator, + &error_handler)) + { + delete g_connection_event_coordinator; + return 1; + } + return 0; +} + + +/** + Plugin deinitialization + + @param arg Unused + + @returns success +*/ + +static int +connection_control_deinit(void *arg MY_ATTRIBUTE((unused))) +{ + delete g_connection_event_coordinator; + g_connection_event_coordinator= 0; + connection_control::deinit_connection_delay_event(); + connection_control_plugin_info= 0; + return 0; +} + + +/** Connection_control plugin descriptor */ +static struct st_mysql_audit connection_control_descriptor= +{ + MYSQL_AUDIT_INTERFACE_VERSION, /* interface version */ + NULL, /* release_thd() */ + connection_control_notify, /* event_notify() */ + {(ulong)MYSQL_AUDIT_CONNECTION_CLASSMASK} /* class mask */ +}; + + +/** + check() function for connection_control_failed_connections_threshold + + Check whether new value is within valid bounds or not. + + @param thd Not used. + @param var Not used. + @param save Not used. + @param value New value for the option. + + @returns whether new value is within valid bounds or not. + @retval 0 Value is ok + @retval 1 Value is not within valid bounds +*/ + +static int +check_failed_connections_threshold(MYSQL_THD thd MY_ATTRIBUTE((unused)), + struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)), + void *save MY_ATTRIBUTE((unused)), + struct st_mysql_value *value) +{ + longlong new_value; + if (value->val_int(value, &new_value)) + return 1; /* NULL value */ + + if (new_value >= connection_control::MIN_THRESHOLD && + new_value <= connection_control::MAX_THRESHOLD) + { + *(reinterpret_cast(save))= new_value; + return 0; + } + + return 1; +} + + +/** + update() function for connection_control_failed_connections_threshold + + Updates g_connection_event_coordinator with new value. + Also notifies observers about the update. + + @param thd Not used. + @param var Not used. + @param var_ptr Variable information + @param save New value for connection_control_failed_connections_threshold +*/ + +static void +update_failed_connections_threshold(MYSQL_THD thd MY_ATTRIBUTE((unused)), + struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)), + void *var_ptr, const void *save) +{ + /* + This won't result in overflow because we have already checked that this is + within valid bounds. + */ + longlong new_value= *(reinterpret_cast(save)); + g_variables.failed_connections_threshold= (int64)new_value; + Connection_control_error_handler error_handler(connection_control_plugin_info); + g_connection_event_coordinator->notify_sys_var(&error_handler, + OPT_FAILED_CONNECTIONS_THRESHOLD, + &new_value); + return; +} + + +/** Declaration of connection_control_failed_connections_threshold */ +static MYSQL_SYSVAR_LONGLONG( + failed_connections_threshold, + g_variables.failed_connections_threshold, + PLUGIN_VAR_RQCMDARG, + "Failed connection threshold to trigger delay. Default is 3.", + check_failed_connections_threshold, + update_failed_connections_threshold, + connection_control::DEFAULT_THRESHOLD, + connection_control::MIN_THRESHOLD, + connection_control::MAX_THRESHOLD, + 1 +); + + +/** + check() function for connection_control_min_connection_delay + + Check whether new value is within valid bounds or not. + + @param thd Not used. + @param var Not used. + @param save Not used. + @param value New value for the option. + + @returns whether new value is within valid bounds or not. + @retval 0 Value is ok + @retval 1 Value is not within valid bounds +*/ + +static int +check_min_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)), + struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)), + void *save MY_ATTRIBUTE((unused)), + struct st_mysql_value *value) +{ + long long new_value; + int64 existing_value= g_variables.max_connection_delay; + if (value->val_int(value, &new_value)) + return 1; /* NULL value */ + + if (new_value >= connection_control::MIN_DELAY && + new_value <= connection_control::MAX_DELAY && + new_value <= existing_value) + { + *(reinterpret_cast(save))= new_value; + return 0; + } + return 1; +} + + +/** + update() function for connection_control_min_connection_delay + + Updates g_connection_event_coordinator with new value. + Also notifies observers about the update. + + @param thd Not used. + @param var Not used. + @param var_ptr Variable information + @param save New value for connection_control_min_connection_delay +*/ + +static void +update_min_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)), + struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)), + void *var_ptr, const void *save) +{ + longlong new_value= *(reinterpret_cast(save)); + g_variables.min_connection_delay= (int64)new_value; + Connection_control_error_handler error_handler(connection_control_plugin_info); + g_connection_event_coordinator->notify_sys_var(&error_handler, + OPT_MIN_CONNECTION_DELAY, + &new_value); + return; +} + + +/** Declaration of connection_control_max_connection_delay */ +static MYSQL_SYSVAR_LONGLONG( + min_connection_delay, + g_variables.min_connection_delay, + PLUGIN_VAR_RQCMDARG, + "Maximum delay to be introduced. Default is 1000.", + check_min_connection_delay, + update_min_connection_delay, + connection_control::DEFAULT_MIN_DELAY, + connection_control::MIN_DELAY, + connection_control::MAX_DELAY, + 1 +); + + +/** + check() function for connection_control_max_connection_delay + + Check whether new value is within valid bounds or not. + + @param thd Not used. + @param var Not used. + @param save Not used. + @param value New value for the option. + + @returns whether new value is within valid bounds or not. + @retval 0 Value is ok + @retval 1 Value is not within valid bounds +*/ + +static int +check_max_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)), + struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)), + void *save MY_ATTRIBUTE((unused)), + struct st_mysql_value *value) +{ + long long new_value; + int64 existing_value= my_atomic_load64(&g_variables.min_connection_delay); + if (value->val_int(value, &new_value)) + return 1; /* NULL value */ + + if (new_value >= connection_control::MIN_DELAY && + new_value <= connection_control::MAX_DELAY && + new_value >= existing_value) + { + *(reinterpret_cast(save))= new_value; + return 0; + } + return 1; +} + + +/** + update() function for connection_control_max_connection_delay + + Updates g_connection_event_coordinator with new value. + Also notifies observers about the update. + + @param thd Not used. + @param var Not used. + @param var_ptr Variable information + @param save New value for connection_control_max_connection_delay +*/ + +static void +update_max_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)), + struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)), + void *var_ptr, const void *save) +{ + longlong new_value= *(reinterpret_cast(save)); + my_atomic_store64(&g_variables.max_connection_delay, (int64)new_value); + Connection_control_error_handler error_handler(connection_control_plugin_info); + g_connection_event_coordinator->notify_sys_var(&error_handler, + OPT_MAX_CONNECTION_DELAY, + &new_value); + return; +} + + +/** Declaration of connection_control_max_connection_delay */ +static MYSQL_SYSVAR_LONGLONG( + max_connection_delay, + g_variables.max_connection_delay, + PLUGIN_VAR_RQCMDARG, + "Maximum delay to be introduced. Default is 2147483647.", + check_max_connection_delay, + update_max_connection_delay, + connection_control::DEFAULT_MAX_DELAY, + connection_control::MIN_DELAY, + connection_control::MAX_DELAY, + 1 +); + + +/** Array of system variables. Used in plugin declaration. */ +struct st_mysql_sys_var * +connection_control_system_variables[OPT_LAST + 1]= +{ + MYSQL_SYSVAR(failed_connections_threshold), + MYSQL_SYSVAR(min_connection_delay), + MYSQL_SYSVAR(max_connection_delay), + NULL +}; + + +/** + Function to display value for status variable : Connection_control_delay_generated + + @param thd MYSQL_THD handle. Unused. + @param var Status variable structure + @param buff Value buffer. + + @returns Always returns success. +*/ + +static int show_delay_generated(MYSQL_THD, + struct st_mysql_show_var *var, + char *buff) +{ + var->type= SHOW_LONGLONG; + var->value= buff; + longlong *value= reinterpret_cast(buff); + int64 current_val= my_atomic_load64(&g_statistics.stats_array[STAT_CONNECTION_DELAY_TRIGGERED]); + *value= static_cast(current_val); + return 0; +} + + +/** Array of status variables. Used in plugin declaration. */ +struct st_mysql_show_var +connection_control_status_variables[STAT_LAST + 1]={ + { + "Connection_control_delay_generated", + (char *)&show_delay_generated, + SHOW_FUNC + }, + {0, 0, enum_mysql_show_type(0)} +}; + + +mysql_declare_plugin(audit_log) +{ + MYSQL_AUDIT_PLUGIN, /* plugin type */ + &connection_control_descriptor, /* type specific descriptor */ + "CONNECTION_CONTROL", /* plugin name */ + "Oracle Inc", /* author */ + "Connection event processing", /* description */ + PLUGIN_LICENSE_GPL , /* license */ + connection_control_init, /* plugin initializer */ + connection_control_deinit, /* plugin deinitializer */ + 0x0100, /* version */ + connection_control_status_variables, /* status variables */ + connection_control_system_variables, /* system variables */ + NULL, /* reserverd */ + 0 /* flags */ +}, +{ + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &connection_control_failed_attempts_view, + "CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS", + "Oracle Inc", + "I_S table providing a view into failed attempts statistics", + PLUGIN_LICENSE_GPL, + connection_control_failed_attempts_view_init, + NULL, + 0x0100, + NULL, + NULL, + NULL, + 0 +} +mysql_declare_plugin_end; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_coordinator.cc percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_coordinator.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_coordinator.cc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_coordinator.cc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,280 @@ +/* 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 +#include +#include + +#include "connection_control_coordinator.h" +#include "connection_control.h" + +namespace connection_control +{ + /** + Reset Connection_event_coordinator information + */ + + void + Connection_event_coordinator::reset() + { + m_subscribers.clear(); + for (uint i= (uint)STAT_CONNECTION_DELAY_TRIGGERED; + i < (uint)STAT_LAST; ++i) + m_status_vars_subscription[i]= 0; + } + + + /** + Register an event subscriber. + + A subscriber can provide following preferences: + 1. Set of events for which subscriber is interested + 2. Set of variables for which subscriber would like to receive update + 3. Set of stats for which subscriber would like to send update + + @param [in] subscriber Handle to Connection_event_observers + @param [in] events Event mask supplied by subscriber + @param [in] sys_vars opt_connection_control vector + @param [in] status_vars stats_connection_control vector + + @returns subscription status + @retval false Subscription successful + @retval true Failure in subscription for given combination of prefernece. + Most probably, other subscriber has already subscribed for + status var update. + */ + + bool + Connection_event_coordinator::register_event_subscriber( + Connection_event_observer **subscriber, + std::vector *sys_vars, + std::vector *status_vars) + { + DBUG_ENTER("Connection_event_coordinator::register_event_subscriber"); + bool error= false; + std::vector::iterator sys_vars_it; + std::vector::iterator status_vars_it; + + DBUG_ASSERT(subscriber != 0); + + if (status_vars) + { + for (status_vars_it= status_vars->begin(); + status_vars_it != status_vars->end(); + ++status_vars_it) + { + if (*status_vars_it >= STAT_LAST || + m_status_vars_subscription[*status_vars_it] != 0) + { + /* + Either an invalid status variable is specified or + someone has already subscribed for status variable + */ + error= true; + break; + } + } + } + + if (!error && sys_vars) + { + for (sys_vars_it= sys_vars->begin(); + sys_vars_it != sys_vars->end(); + ++sys_vars_it) + { + if (*sys_vars_it >= OPT_LAST) + error= true; + break; + } + } + + if (!error) + { + /* + Create Connection_event_subscriber object and + initialize it with required details. + */ + Connection_event_subscriber subscriber_info; + subscriber_info.m_subscriber= *subscriber; + + /* Reset the list first */ + for (uint i= (uint)OPT_FAILED_CONNECTIONS_THRESHOLD; + i < (uint)OPT_LAST; + ++i) + subscriber_info.m_sys_vars[i]= false; + + /* Now set the bits which are requested by subscriber */ + for (sys_vars_it= sys_vars->begin(); + sys_vars_it != sys_vars->end(); + ++sys_vars_it) + subscriber_info.m_sys_vars[*sys_vars_it]= true; + + /* Insert new entry in m_subscribers */ + try + { + m_subscribers.push_back(subscriber_info); + } + catch (...) + { + /* Something went wrong. Mostly likely OOM. */ + error= true; + } + + /* + Update m_status_vars_subscription only if subscriber information + has been inserted in m_subscribers successfully. + */ + if (!error) + { + for (status_vars_it= status_vars->begin(); + status_vars_it != status_vars->end(); + ++status_vars_it) + m_status_vars_subscription[*status_vars_it]= *subscriber; + } + } + DBUG_RETURN(error); + } + + + /** + Handle connection event. + When a notification from server is received, perform following: + 1. Iterate through list of subscribers + - If a subscriber has shown interest in received event, + call notify() for the subscriber + 2. Interate through list of status variables + - If subscriber has show interest in any status variable, + call notify_status_var() for the subscriber + - If subscriber suggests an action on status variable, + perform the action + + Note : If we receive error from a subscriber, we log it and move on. + + @param [in] thd THD handle + @param [in] error_handler Error handler class + @param [in] connection_event Event information + */ + + void + Connection_event_coordinator::notify_event( + MYSQL_THD thd, + Error_handler *error_handler, + const mysql_event_connection *connection_event) + { + DBUG_ENTER("Connection_event_coordinator::notify_event"); + std::vector::iterator it= m_subscribers.begin(); + + while (it != m_subscribers.end()) + { + Connection_event_subscriber event_subscriber= *it; + (void)event_subscriber.m_subscriber->notify_event(thd, this, + connection_event, + error_handler); + + ++it; + } + + DBUG_VOID_RETURN; + } + + + /** + Process change in sys_var value + + Iterate through all subscribers + - If a subscriber has shown interest in getting notification for given + system variable, call notify_sys_var. + + Note : If we receive error from a subscriber, we log it and move on. + + @param [in] error_hanlder Error handler class + @param [in] opt_connection_control Variable information + @param [in] new_value New value for variable + */ + + void + Connection_event_coordinator::notify_sys_var(Error_handler *error_handler, + opt_connection_control variable, + void *new_value) + { + DBUG_ENTER("Connection_event_coordinator::notify_sys_var"); + std::vector::iterator it= m_subscribers.begin(); + + while (it != m_subscribers.end()) + { + Connection_event_subscriber event_subscriber= *it; + if (event_subscriber.m_sys_vars[variable]) + { + (void) event_subscriber.m_subscriber->notify_sys_var(this, + variable, + new_value, + error_handler); + } + ++it; + } + + DBUG_VOID_RETURN; + } + + + /** + Update a status variable + + @param [in] observer Requestor + @param [in] status_var Status variable to be updated + @param [in] action Operation to be performed on status variable + + @returns status of the operation + @retval false Success + @retval true Error in processing + */ + + bool + Connection_event_coordinator::notify_status_var(Connection_event_observer **observer, + stats_connection_control status_var, + status_var_action action) + { + DBUG_ENTER("Connection_event_coordinator::notify_status_var"); + bool error= false; + + if (m_status_vars_subscription[status_var] == *observer) + { + if (status_var < STAT_LAST) + { + switch (action) + { + case ACTION_INC: + { + my_atomic_add64(&g_statistics.stats_array[status_var], 1); + break; + } + case ACTION_RESET: + { + my_atomic_store64(&g_statistics.stats_array[status_var], 0); + break; + } + default: + { + error= true; + DBUG_ASSERT(FALSE); + break; + } + } + } + } + + DBUG_RETURN(error); + } +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_coordinator.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_coordinator.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_coordinator.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_coordinator.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,73 @@ +/* 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 */ + +#ifndef CONNECTION_CONTROL_COORDINATOR_H +#define CONNECTION_CONTROL_COORDINATOR_H + +#include "connection_control_interfaces.h" /* Connection_event_coordinator_services */ +#include "connection_control_memory.h" /* Connection_control_alloc */ + +namespace connection_control +{ + /** + Connection event coordinator. + This class will keep list of subscribers for different subevents + and notify them based on their preference. + */ + + class Connection_event_coordinator : public Connection_event_coordinator_services, + public Connection_control_alloc + { + public: + Connection_event_coordinator() + { + reset(); + } + ~Connection_event_coordinator() + { + reset(); + } + + /* Functions to receive notification from server */ + void notify_event(MYSQL_THD thd, + Error_handler * error_handler, + const mysql_event_connection *connection_event); + void notify_sys_var(Error_handler * error_handler, + opt_connection_control variable, + void *new_value); + + /* Services provided to observers */ + bool register_event_subscriber(Connection_event_observer **subscriber, + std::vector *sys_vars, + std::vector *status_vars); + + bool notify_status_var(Connection_event_observer **observer, + stats_connection_control status_var, + status_var_action action); + + private: + void reset(); + class Connection_event_subscriber + { + public: + Connection_event_observer * m_subscriber; + bool m_sys_vars[OPT_LAST]; + }; + + std::vector m_subscribers; + Connection_event_observer *m_status_vars_subscription[STAT_LAST]; + }; +} +#endif // !CONNECTION_CONTROL_COORDINATOR_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_data.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_data.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_data.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_data.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,68 @@ +/* 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 */ + +#ifndef CONNECTION_CONTROL_DATA_H +#define CONNECTION_CONTROL_DATA_H + +#include + +/** + Enum for system variables : Must be in sync with + members of Connection_control_variables. +*/ +typedef enum opt_connection_control +{ + OPT_FAILED_CONNECTIONS_THRESHOLD= 0, + OPT_MIN_CONNECTION_DELAY, + OPT_MAX_CONNECTION_DELAY, + OPT_LAST /* Must be last */ +}opt_connection_control; + +/** + Enum for status variables : Must be in sync with + memebers of Connection_control_statistics. +*/ +typedef enum stats_connection_control +{ + STAT_CONNECTION_DELAY_TRIGGERED= 0, + STAT_LAST /* Must be last */ +}stats_connection_control; + +namespace connection_control +{ + /** Structure to maintain system variables */ + class Connection_control_variables + { + public: + /* Various global variables */ + int64 failed_connections_threshold; + int64 min_connection_delay; + int64 max_connection_delay; + }; + + /** Structure to maintain statistics */ + class Connection_control_statistics + { + public: + Connection_control_statistics() + {} + /* Various statistics to be collected */ + volatile int64 stats_array[STAT_LAST]; + }; +} + +extern connection_control::Connection_control_statistics g_statistics; +extern connection_control::Connection_control_variables g_variables; +#endif // !CONNECTION_CONTROL_DATA_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,87 @@ +/* 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 */ + +#ifndef CONNECTION_CONTROL_H +#define CONNECTION_CONTROL_H + +#include /* mysql_rwlock_t */ + +#include "connection_control_data.h" + +namespace connection_control +{ + + /** Helper class : Wrapper on READ lock */ + + class RD_lock + { + public: + explicit RD_lock(mysql_rwlock_t *lock) : m_lock(lock) + { + if (m_lock) + mysql_rwlock_rdlock(m_lock); + } + ~RD_lock() + { + if (m_lock) + mysql_rwlock_unlock(m_lock); + } + void lock() + { + mysql_rwlock_rdlock(m_lock); + } + void unlock() + { + mysql_rwlock_unlock(m_lock); + } + private: + mysql_rwlock_t *m_lock; + + RD_lock(const RD_lock&); /* Not copyable. */ + void operator=(const RD_lock&); /* Not assignable. */ + }; + + + /** Helper class : Wrapper on write lock */ + + class WR_lock + { + public: + explicit WR_lock(mysql_rwlock_t *lock) : m_lock(lock) + { + if (m_lock) + mysql_rwlock_wrlock(m_lock); + } + ~WR_lock() + { + if (m_lock) + mysql_rwlock_unlock(m_lock); + } + void lock() + { + mysql_rwlock_wrlock(m_lock); + } + void unlock() + { + mysql_rwlock_unlock(m_lock); + } + private: + mysql_rwlock_t *m_lock; + + WR_lock(const WR_lock&); /* Not copyable. */ + void operator=(const WR_lock&); /* Not assignable. */ + }; +} +#endif /* !CONNECTION_CONTROL_H */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_interfaces.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_interfaces.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_interfaces.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_interfaces.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,103 @@ +/* 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 */ + +#ifndef CONNECTION_CONTROL_INTERFACES_H +#define CONNECTION_CONTROL_INTERFACES_H + +#include /* mysql_event_connection */ + +#include "connection_control_data.h" /* Variables and Status */ + +#include /* std::vector */ +#include /* std::string */ + +namespace connection_control +{ + /* Typedefs for convenience */ + typedef std::string Sql_string; + + /* Forward declarations */ + class Connection_event_coordinator_services; + + class Error_handler + { + public: + virtual void handle_error(const char * error_message)= 0; + virtual ~Error_handler() {} + }; + + /** + Interface for recording connection events + */ + + class Connection_event_records + { + public: + virtual bool create_or_update_entry(const Sql_string &s)= 0; + virtual bool remove_entry(const Sql_string &s)= 0; + virtual bool match_entry(const Sql_string &s, void *value)= 0; + virtual void reset_all()= 0; + virtual ~Connection_event_records() + { /* Emptiness! */ } + }; + + + /** + Interface for defining action on connection events + */ + class Connection_event_observer + { + public: + virtual bool notify_event(MYSQL_THD thd, + Connection_event_coordinator_services *coordinator, + const mysql_event_connection *connection_event, + Error_handler *error_handler)= 0; + virtual bool notify_sys_var(Connection_event_coordinator_services *coordinator, + opt_connection_control variable, + void *new_value, + Error_handler *error_handler)= 0; + virtual ~Connection_event_observer() + { /* Nothing to see here! */ } + }; + + + /* Status variable action enum */ + typedef enum status_var_action + { + ACTION_NONE=0, + ACTION_INC, + ACTION_RESET, + ACTION_LAST /* Must be at the end */ + }status_var_action; + + + /** + Interface to provide service to observers + */ + + class Connection_event_coordinator_services + { + public: + virtual bool notify_status_var(Connection_event_observer **observer, + stats_connection_control status_var, + status_var_action action)= 0; + virtual bool register_event_subscriber(Connection_event_observer **subscriber, + std::vector *sys_vars, + std::vector *status_vars)= 0; + virtual ~Connection_event_coordinator_services() + { /* go away */ } + }; +} +#endif // !CONNECTION_CONTROL_INTERFACES_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_memory.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_memory.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_control_memory.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_control_memory.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,55 @@ +/* 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 */ + +#ifndef CONNECTION_CONTROL_MEMORY_H +#define CONNECTION_CONTROL_MEMORY_H + +#include +#include +#include +#include + +namespace connection_control +{ + template + T Connection_control_malloc(size_t size) + { + void *allocated_memory= my_malloc(size, MYF(MY_WME)); + return allocated_memory ? reinterpret_cast(allocated_memory) : NULL; + } + + class Connection_control_alloc + { + public: + static void *operator new(size_t size) throw () + { + return Connection_control_malloc(size); + } + static void *operator new[](size_t size) throw () + { + return Connection_control_malloc(size); + } + static void operator delete(void* ptr, std::size_t sz) + { + my_free(ptr); + } + static void operator delete[](void* ptr, std::size_t sz) + { + my_free(ptr); + } + }; +} + +#endif //CONNECTION_CONTROL_MEMORY_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_delay_api.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_delay_api.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_delay_api.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_delay_api.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,49 @@ +/* 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 */ + +#ifndef CONNECTION_DELAY_API_H +#define CONNECTION_DELAY_API_H + +/* Structures/Functions requried for information schema table */ + +extern struct st_mysql_information_schema connection_control_failed_attempts_view; +int connection_control_failed_attempts_view_init(void *ptr); + +namespace connection_control +{ + + /* constants/variables defined in connection_delay.cc */ + + extern int64 DEFAULT_THRESHOLD; + extern int64 MIN_THRESHOLD; + extern int64 DISABLE_THRESHOLD; + extern int64 MAX_THRESHOLD; + + extern int64 DEFAULT_MAX_DELAY; + extern int64 DEFAULT_MIN_DELAY; + extern int64 MIN_DELAY; + extern int64 MAX_DELAY; + + /** Functions being used by connection_control.cc */ + + class Connection_event_coordinator_services; + class Error_handler; + + bool init_connection_delay_event(Connection_event_coordinator_services *coordinator, + Error_handler *error_handler); + void deinit_connection_delay_event(); + +} +#endif // !CONNECTION_DELAY_API_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_delay.cc percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_delay.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_delay.cc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_delay.cc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,1007 @@ +/* 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 */ + +#define MYSQL_SERVER "We need security context" +#include /* my_charset_bin */ +#include /* THD, Security context */ +#include +#include + +#include "connection_delay.h" +#include "connection_control.h" +#include "security_context_wrapper.h" + + + +/* Forward declaration */ +bool schema_table_store_record(THD *thd, TABLE *table); + +struct st_mysql_information_schema + connection_control_failed_attempts_view={MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION}; + +/** Fields of information_schema.connection_control_failed_attempts */ +static ST_FIELD_INFO failed_attempts_view_fields[]= +{ + {"USERHOST", USERNAME_LENGTH + MAX_HOSTNAME + 5, MYSQL_TYPE_STRING, 0, MY_I_S_UNSIGNED, 0, 0}, + {"FAILED_ATTEMPTS", 16, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, 0, 0}, + {0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0} +}; + + +namespace connection_control +{ + + /** constants/variables declared in connection_delay_interfaces.h */ + + int64 DEFAULT_THRESHOLD= 3; + int64 MIN_THRESHOLD= 0; + int64 DISABLE_THRESHOLD= 0; + int64 MAX_THRESHOLD= INT_MAX32; + + int64 DEFAULT_MAX_DELAY= INT_MAX32; + int64 DEFAULT_MIN_DELAY= 1000; + int64 MIN_DELAY= 1000; + int64 MAX_DELAY= INT_MAX32; + + /** variables used by connection_delay.cc */ + static mysql_rwlock_t connection_event_delay_lock; + +#ifdef HAVE_PSI_INTERFACE + static PSI_rwlock_key key_connection_event_delay_lock; + static PSI_rwlock_info all_rwlocks[]= + { + {&key_connection_event_delay_lock, "connection_event_delay_lock", 0} + }; +#endif /* HAVE_PSI_INTERFACE */ + + static opt_connection_control opt_enums[]= + { + OPT_FAILED_CONNECTIONS_THRESHOLD, + OPT_MIN_CONNECTION_DELAY, + OPT_MAX_CONNECTION_DELAY + }; + size_t opt_enums_size= 3; + + static stats_connection_control status_vars_enums[]= + { + STAT_CONNECTION_DELAY_TRIGGERED + }; + size_t status_vars_enums_size= 1; + + static Connection_delay_action *g_max_failed_connection_handler= 0; + + Sql_string I_S_CONNECTION_CONTROL_FAILED_ATTEMPTS_USERHOST + ("information_schema.connection_control_failed_login_attempts.userhost"); + + /** + Helper function for Connection_delay_event::reset_all + + @param [in] ptr Pointer to an entry in hash + + @returns 1 to indicate that entry is a match + */ + int match_all_entries(const uchar *ptr) + { + return 1; + } + + + /** + Callback function for LF hash to get key information + + Returns a pointer to a buffer which represent a key in the hash. + The function does NOT calculate a hash. + The function is called during lf_hash_insert(). The buffer is + fed to an internal calc_hash() which use the defined charset to + calculate a hash from the key buffer (in most cases a murmur) + + @param [in] el Pointer to an element in the hash + @param [out] length The length of the key belonging to the element + + @returns Pointer to key buffer + */ + + uchar *connection_delay_event_hash_key(const uchar *el, size_t *length, my_bool huh) + { + const Connection_event_record * const *entry; + const Connection_event_record *entry_info; + entry= reinterpret_cast(el); + DBUG_ASSERT(entry != NULL); + entry_info= *entry; + *length= entry_info->get_length(); + return (const_cast(entry_info->get_userhost())); + } + + + /** + Constructor for Connection_delay_event + + Initialize LF hash. + */ + + Connection_delay_event::Connection_delay_event() + { + lf_hash_init(&m_entries, sizeof(Connection_event_record**), LF_HASH_UNIQUE, + 0, /* key offset */ + 0, /* key length not used */ + connection_delay_event_hash_key, + &my_charset_bin); + } + + + /** + Creates or updates an entry in hash + + @param [in] s User information in '' format + + @returns status of insertion/update + @retval false Insertion/Update successful + @retval true Failed to insert/update an entry + */ + + bool + Connection_delay_event::create_or_update_entry(const Sql_string &s) + { + Connection_event_record **searched_entry= NULL; + Connection_event_record *searched_entry_info= NULL; + Connection_event_record *new_entry= NULL; + int insert_status; + DBUG_ENTER("Connection_delay_event::create_or_update_entry"); + + LF_PINS *pins= lf_hash_get_pins(&m_entries); + if (unlikely(pins == NULL)) + DBUG_RETURN(true); + + searched_entry= reinterpret_cast + (lf_hash_search(&m_entries, pins, s.c_str(), s.length())); + + if (searched_entry && (searched_entry != MY_ERRPTR)) + { + /* We found an entry, so increment the count */ + searched_entry_info= *searched_entry; + DBUG_ASSERT(searched_entry_info != NULL); + searched_entry_info->inc_count(); + lf_hash_search_unpin(pins); + lf_hash_put_pins(pins); + DBUG_RETURN(false); + } + else + { + /* No entry found, so try to add new entry */ + lf_hash_search_unpin(pins); + new_entry= new Connection_event_record(s); + + insert_status= lf_hash_insert(&m_entries, pins, &new_entry); + + if (likely(insert_status == 0)) + { + lf_hash_put_pins(pins); + DBUG_RETURN(false); + } + else + { + /* + OOM. We are likely in bigger trouble than just + failing to insert an entry in hash. + */ + lf_hash_put_pins(pins); + delete new_entry; + new_entry= NULL; + DBUG_RETURN(true); + } + } + } + + + /** + Resets count stored against given user entry + + @param [in] s User information in '' format + + @returns status of reset operation + @retval false Reset successful + @retval true Failed to find given entry + */ + + bool + Connection_delay_event::remove_entry(const Sql_string &s) + { + Connection_event_record **searched_entry= NULL; + Connection_event_record *searched_entry_info= NULL; + DBUG_ENTER("Connection_delay_event::reset_entry"); + + LF_PINS *pins= lf_hash_get_pins(&m_entries); + + searched_entry= reinterpret_cast + (lf_hash_search(&m_entries, pins, s.c_str(), s.length())); + + if (searched_entry && searched_entry != MY_ERRPTR) + { + searched_entry_info= *searched_entry; + DBUG_ASSERT(searched_entry_info != NULL); + int rc= lf_hash_delete(&m_entries, pins, s.c_str(), s.length()); + lf_hash_search_unpin(pins); + lf_hash_put_pins(pins); + if (rc == 0) + { + /* free memory upon successful deletion */ + delete searched_entry_info; + } + DBUG_RETURN(rc != 0); + } + else + { + /* No entry found. */ + lf_hash_search_unpin(pins); + lf_hash_put_pins(pins); + DBUG_RETURN(true); + } + } + + + /** + Retrieve stored value for given user entry + + @param [in] s User information in '' format + @param value [out] Buffer to hold value stored against given user + + @returns whether given entry is present in hash or not + @retval false Entry found. Corresponding value is copied in value buffer. + @retval true No matching entry found. value buffer should not be used. + */ + + bool + Connection_delay_event::match_entry(const Sql_string &s, void *value) + { + Connection_event_record **searched_entry= NULL; + Connection_event_record *searched_entry_info= NULL; + int64 count= DISABLE_THRESHOLD; + bool error= true; + DBUG_ENTER("Connection_delay_event::match_entry"); + + LF_PINS *pins= lf_hash_get_pins(&m_entries); + + searched_entry= reinterpret_cast + (lf_hash_search(&m_entries, pins, s.c_str(), s.length())); + + if (searched_entry && searched_entry != MY_ERRPTR) + { + searched_entry_info= *searched_entry; + count= searched_entry_info->get_count(); + error= false; + } + + lf_hash_search_unpin(pins); + lf_hash_put_pins(pins); + *(reinterpret_cast(value))= count; + + DBUG_RETURN(error); + } + + + /** + Delete all entries from hash and free memory + + @returns Reset was successful or not + @retval true All entries removed. + @retval false Failed to remove some entries + */ + + void + Connection_delay_event::reset_all() + { + Connection_event_record **searched_entry= NULL; + DBUG_ENTER("Connection_delay_event::reset_all"); + LF_PINS *pins= lf_hash_get_pins(&m_entries); + + do + { + /* match anything */ + searched_entry= reinterpret_cast + (lf_hash_random_match(&m_entries, pins, match_all_entries, 0)); + + if (searched_entry != NULL && searched_entry != MY_ERRPTR + && (*searched_entry) + && !lf_hash_delete(&m_entries, pins, + (*searched_entry)->get_userhost(), + (*searched_entry)->get_length())) + { + delete (*searched_entry); + *searched_entry= NULL; + } + else + { + /* Failed to delete didn't remove any pins */ + lf_hash_search_unpin(pins); + } + } while (searched_entry != 0); + + lf_hash_put_pins(pins); + DBUG_VOID_RETURN; + } + + + /** This works because connction_delay_IS_table is protected by wrlock */ + static TABLE * connection_delay_IS_table; + void set_connection_delay_IS_table(TABLE *t) + { + connection_delay_IS_table= t; + } + + + /** + Function to populate information_schema view. + + @param [in] ptr Entry from LF hash + + @returns status of row insertion + @retval 0 Success + @retval 1 Error + */ + + int connection_delay_IS_table_writer(const uchar *ptr) + { + /* Always return "no match" so that we go through all entries */ + THD *thd= current_thd; + const Connection_event_record * const * entry; + const Connection_event_record *entry_info; + entry= reinterpret_cast(ptr); + entry_info= *entry; + connection_delay_IS_table->field[0]->store((char *)entry_info->get_userhost(), + entry_info->get_length(), + system_charset_info); + connection_delay_IS_table->field[1]->store(entry_info->get_count(), true); + if (schema_table_store_record(thd, connection_delay_IS_table)) + return 1; + /* Always return "no match" so that we go over all entries in the hash */ + return 0; + } + + + /** + Function to dump LF hash data to IS table. + + @param [in] thd THD handle + @param [in] tables Handle to + information_schema.connection_control_failed_attempts + */ + + void + Connection_delay_event::fill_IS_table(THD *thd, + TABLE_LIST *tables) + { + DBUG_ENTER("Connection_delay_event::fill_IS_table"); + TABLE *table= tables->table; + set_connection_delay_IS_table(table); + LF_PINS *pins= lf_hash_get_pins(&m_entries); + void *key= 0; + + do + { + key= lf_hash_random_match(&m_entries, + pins, + /* Functor: match anything and store the fields */ + connection_delay_IS_table_writer, + 0); + /* Always unpin after lf_hash_random_match() */ + lf_hash_search_unpin(pins); + } while (key != 0); + + lf_hash_put_pins(pins); + DBUG_VOID_RETURN; + } + + + /** + Connection_delay_action Constructor. + + @param [in] threshold Defines a threshold after which wait is triggered + @param [in] min_delay Lower cap on wait + @param [in] max_delay Upper cap on wait + @param [in] sys_vars System variables + @param [in] sys_vars_size Size of sys_vars array + @param [in] status_vars Status variables + @param [in] status_vars_size Size of status_vars array + @param [in] lock RW lock handle + */ + + Connection_delay_action::Connection_delay_action(int64 threshold, + int64 min_delay, + int64 max_delay, + opt_connection_control *sys_vars, + size_t sys_vars_size, + stats_connection_control *status_vars, + size_t status_vars_size, + mysql_rwlock_t *lock) + : m_threshold(threshold), + m_min_delay(min_delay), + m_max_delay(max_delay), + m_lock(lock) + { + if (sys_vars_size) + { + for (uint i=0; i < sys_vars_size; ++i) + m_sys_vars.push_back(sys_vars[i]); + } + + if (status_vars_size) + { + for (uint i=0; i < status_vars_size; ++i) + m_stats_vars.push_back(status_vars[i]); + } + } + + + /** + Create hash key of the format ''@''. + Policy: + 1. Use proxy_user information if available. Else if, + 2. Use priv_user/priv_host if either of them is not empty. Else, + 3. Use user/host + + @param [in] thd THD pointer for getting security context + @param [out] s Hash key is stored here + */ + + void + Connection_delay_action::make_hash_key(MYSQL_THD thd, Sql_string &s) + { + /* Our key for hash will be of format : ''@'' */ + + /* If proxy_user is set then use it directly for lookup */ + Security_context_wrapper sctx_wrapper(thd); + const char * proxy_user= sctx_wrapper.get_proxy_user(); + if (proxy_user && *proxy_user) + { + s.append(proxy_user); + } /* else if priv_user and/or priv_host is set, then use them */ + else + { + const char * priv_user= sctx_wrapper.get_priv_user(); + const char * priv_host= sctx_wrapper.get_priv_host(); + if ((priv_user && *priv_user) || (priv_host && *priv_host)) + { + s.append("'"); + + if (*priv_user) + s.append(priv_user); + + s.append("'@'"); + + if (*priv_host) + s.append(priv_host); + + s.append("'"); + } + else + { + const char *user= sctx_wrapper.get_user(); + const char *host= sctx_wrapper.get_host(); + const char *ip= sctx_wrapper.get_ip(); + + s.append("'"); + + if (user && *user) + s.append(user); + + s.append("'@'"); + + if (host && *host) + s.append(host); + else if (ip && *ip) + s.append(ip); + + s.append("'"); + } + } + } + + + /** + Wait till the wait_time expires or thread is killed + + @param [in] thd Handle to MYSQL_THD object + @param [in] wait_time Maximum time to wait + */ + + void + Connection_delay_action::conditional_wait(MYSQL_THD thd, + ulonglong wait_time) + { + DBUG_ENTER("Connection_delay_action::conditional_wait"); + + /** mysql_cond_timedwait requires wait time in timespec format */ + struct timespec abstime; + /** Since we get wait_time in milliseconds, convert it to nanoseconds */ + set_timespec_nsec(abstime, wait_time * 1000000ULL); + + /** PSI_stage_info for thd_enter_cond/thd_exit_cond */ + PSI_stage_info old_stage; + PSI_stage_info stage_waiting_in_connection_control_plugin= + {0, "Waiting in connection_control plugin", 0}; + + /** Initialize mutex required for mysql_cond_timedwait */ + mysql_mutex_t connection_delay_mutex; +#ifdef HAVE_PSI_INTERFACE + const char * category= "conn_delay"; + PSI_mutex_key key_connection_delay_mutex; + PSI_mutex_info connection_delay_mutex_info[]= + { + {&key_connection_delay_mutex, "connection_delay_mutex", PSI_FLAG_GLOBAL} + }; + int count_mutex= array_elements(connection_delay_mutex_info); + PSI_server->register_mutex(category, connection_delay_mutex_info, count_mutex); +#endif /* HAVE_PSI_INTERFACE */ + mysql_mutex_init(key_connection_delay_mutex, &connection_delay_mutex, + MY_MUTEX_INIT_FAST); + + /* Initialize condition to wait for */ + mysql_cond_t connection_delay_wait_condition; +#ifdef HAVE_PSI_INTERFACE + PSI_cond_key key_connection_delay_wait; + PSI_cond_info connection_delay_wait_info[]= + { + {&key_connection_delay_wait, "connection_delay_wait_condition", 0} + }; + int count_cond= array_elements(connection_delay_wait_info); + PSI_server->register_cond(category, connection_delay_wait_info, count_cond); +#endif /* HAVE_PSI_INTERFACE */ + mysql_cond_init(key_connection_delay_wait, &connection_delay_wait_condition, NULL); + + /** Register wait condition with THD */ + mysql_mutex_lock(&connection_delay_mutex); + thd_enter_cond(thd, &connection_delay_wait_condition, &connection_delay_mutex, + &stage_waiting_in_connection_control_plugin, &old_stage, + __func__, __FILE__, __LINE__); + + /* + At this point, thread is essentially going to sleep till + timeout. If admin issues KILL statement for this THD, + there is no point keeping this thread in sleep mode only + to wake up to be terminated. Hence, in case of KILL, + we will return control to server without worring about + wait_time. + */ + mysql_cond_timedwait(&connection_delay_wait_condition, &connection_delay_mutex, &abstime); + + /* Finish waiting and deregister wait condition */ + thd_exit_cond(thd, &stage_waiting_in_connection_control_plugin, + __func__, __FILE__, __LINE__); + + /* Cleanup */ + mysql_mutex_destroy(&connection_delay_mutex); + mysql_cond_destroy(&connection_delay_wait_condition); + DBUG_VOID_RETURN; + } + + + /** + @brief Handle a connection event and if requried, + wait for random amount of time before returning. + + We only care about CONNECT and CHANGE_USER sub events. + + @param [in] thd THD pointer + @param [in] coordinator Connection_event_coordinator + @param [in] connection_event Connection event to be handled + @param [in] error_handler Error handler object + + @returns status of connection event handling + @retval false Successfully handled an event. + @retval true Something went wrong. + error_buffer may contain details. + */ + + bool + Connection_delay_action::notify_event(MYSQL_THD thd, + Connection_event_coordinator_services *coordinator, + const mysql_event_connection *connection_event, + Error_handler *error_handler) + { + DBUG_ENTER("Connection_delay_action::notify"); + bool error= false; + unsigned int subclass= connection_event->event_subclass; + Connection_event_observer *self= this; + + if (subclass != MYSQL_AUDIT_CONNECTION_CONNECT && + subclass != MYSQL_AUDIT_CONNECTION_CHANGE_USER) + DBUG_RETURN(error); + + RD_lock rd_lock(m_lock); + + int64 threshold= this->get_threshold(); + + /* If feature was disabled, return */ + if (threshold <= DISABLE_THRESHOLD) + DBUG_RETURN(error); + + int64 current_count= 0; + bool user_present= false; + Sql_string userhost; + + make_hash_key(thd, userhost); + + DBUG_PRINT("info", ("Connection control : Connection event lookup for: %s", + userhost.c_str())); + + /* Cache current failure count */ + user_present= + m_userhost_hash.match_entry(userhost, (void *)¤t_count) ? false : true; + + if (current_count >= threshold || current_count < 0) + { + /* + If threshold is crosed, regardless of connection success + or failure, wait for (current_count + 1) - threshold seconds + Note that current_count is not yet updated in hash. So we + have to consider current connection as well - Hence the usage + of current_count + 1. + */ + ulonglong wait_time= get_wait_time((current_count + 1) - threshold); + + if ((error= coordinator->notify_status_var( + &self, STAT_CONNECTION_DELAY_TRIGGERED, ACTION_INC))) + { + error_handler->handle_error("Failed to update connection delay triggered stats"); + } + /* + Invoking sleep while holding read lock on Connection_delay_action + would block access to cache data through IS table. + */ + rd_lock.unlock(); + conditional_wait(thd, wait_time); + rd_lock.lock(); + } + + if (connection_event->status) + { + /* + Connection failure. + Add new entry to hash or increment failed connection count + for an existing entry + */ + if (m_userhost_hash.create_or_update_entry(userhost)) + { + char error_buffer[512]; + memset(error_buffer, 0, sizeof(error_buffer)); + my_snprintf(error_buffer, sizeof(error_buffer)-1, + "Failed to update connection delay hash for account : %s", + userhost.c_str()); + error_handler->handle_error(error_buffer); + error= true; + } + } + else + { + /* + Successful connection. + delete entry for given account from the hash + */ + if (user_present && m_userhost_hash.remove_entry(userhost)) + { + char error_buffer[512]; + memset(error_buffer, 0, sizeof(error_buffer)); + my_snprintf(error_buffer, sizeof(error_buffer) - 1, + "Failed to delete connection delay hash entry for acount : %s." + " It might have been deleted already.", + userhost.c_str()); + error_handler->handle_error(error_buffer); + error= true; + } + } + + DBUG_RETURN(error); + } + + + /** + Notification of a change in system variable value + + @param [in] coordinator Handle to coordinator + @param [in] variable Enum of variable + @param [in] new_value New value for variable + @param [out] error_buffer Buffer to log error message if any + @param [in] error_buffer_size Size of error buffer + + @returns processing status + @retval false Change in variable value processed successfully + @retval true Error processing new value. + error_buffer may contain more details. + */ + + bool + Connection_delay_action::notify_sys_var(Connection_event_coordinator_services *coordinator, + opt_connection_control variable, + void *new_value, + Error_handler * error_handler) + { + DBUG_ENTER("Connection_delay_action::notify_sys_var"); + bool error= true; + Connection_event_observer *self= this; + + WR_lock wr_lock(m_lock); + + switch (variable) + { + case OPT_FAILED_CONNECTIONS_THRESHOLD: + { + int64 new_threshold= *(static_cast(new_value)); + DBUG_ASSERT(new_threshold >= DISABLE_THRESHOLD); + set_threshold(new_threshold); + + if ((error= coordinator->notify_status_var(&self, + STAT_CONNECTION_DELAY_TRIGGERED, + ACTION_RESET))) + { + error_handler->handle_error("Failed to reset connection delay triggered stats"); + } + break; + } + case OPT_MIN_CONNECTION_DELAY: + case OPT_MAX_CONNECTION_DELAY: + { + int64 new_delay= *(static_cast(new_value)); + if ((error= set_delay(new_delay, + (variable == OPT_MIN_CONNECTION_DELAY)))) + { + char error_buffer[512]; + memset(error_buffer, 0, sizeof(error_buffer)); + my_snprintf(error_buffer, sizeof(error_buffer) - 1, + "Could not set %s delay for connection delay.", + (variable == OPT_MIN_CONNECTION_DELAY) ? "min" : "max"); + error_handler->handle_error(error_buffer); + } + break; + } + default: + /* Should never reach here. */ + DBUG_ASSERT(FALSE); + error_handler->handle_error("Unexpected option type for connection delay."); + }; + DBUG_RETURN(error); + } + + + /** + Subscribe with coordinator for connection events + + @param [in] coordinator Handle to Connection_event_coordinator_services + for registration + */ + void + Connection_delay_action::init(Connection_event_coordinator_services *coordinator) + { + DBUG_ENTER("Connection_delay_action::init"); + DBUG_ASSERT(coordinator); + bool retval; + Connection_event_observer *subscriber= this; + WR_lock wr_lock(m_lock); + retval= coordinator->register_event_subscriber(&subscriber, + &m_sys_vars, + &m_stats_vars); + DBUG_ASSERT(!retval); + if (retval) + retval= false; /* Make compiler happy */ + DBUG_VOID_RETURN; + } + + + /** + Clear data from Connection_delay_action + */ + + void + Connection_delay_action::deinit() + { + mysql_rwlock_wrlock(m_lock); + m_userhost_hash.reset_all(); + m_sys_vars.clear(); + m_stats_vars.clear(); + m_threshold= DISABLE_THRESHOLD; + mysql_rwlock_unlock(m_lock); + m_lock= 0; + } + + + + /** + Get user information from "where userhost = " + + @param [in] cond Equality condition structure + @param [out] eq_arg Sql_string handle to store user information + @param [in] field_name userhost field + + @returns whether a value was found or not + @retval false Found a value. Check eq_arg + @retval true Error. + */ + + static + bool get_equal_condition_argument(Item *cond, Sql_string *eq_arg, + const Sql_string &field_name) + { + if (cond != 0 && cond->type() == Item::FUNC_ITEM) + { + Item_func *func= static_cast(cond); + if (func != NULL && func->functype() == Item_func::EQ_FUNC) + { + Item_func_eq* eq_func= static_cast(func); + if (eq_func->arguments()[0]->type() == Item::FIELD_ITEM && + my_strcasecmp(system_charset_info, + eq_func->arguments()[0]->full_name(), + field_name.c_str()) == 0) + { + char buff[1024]; + String *res; + String filter(buff, sizeof(buff), system_charset_info); + if (eq_func->arguments()[1] != NULL && + (res= eq_func->arguments()[1]->val_str(&filter))) + { + eq_arg->append(res->c_ptr_safe(), res->length()); + return false; + } + } + } + } + return true; + } + + + /** + Function to fill information_schema.connection_control_failed_attempts. + + Handles query with equality condition. + For full scan, calls Connection_delay_event::fill_IS_table() + + Permission : SUPER_ACL is required. + + @param [in] thd THD handle. + @param [in] tables Handle to + information_schema.connection_control_failed_attempts. + @param [in] cond Condition if any. + */ + + void + Connection_delay_action::fill_IS_table(THD *thd, + TABLE_LIST *tables, + Item *cond) + { + DBUG_ENTER("Connection_delay_action::fill_IS_table"); + Security_context_wrapper sctx_wrapper(thd); + if (!sctx_wrapper.is_super_user()) + DBUG_VOID_RETURN; + WR_lock wr_lock(m_lock); + Sql_string eq_arg; + if (cond != 0 && + !get_equal_condition_argument(cond, + &eq_arg, + I_S_CONNECTION_CONTROL_FAILED_ATTEMPTS_USERHOST)) + { + int64 current_count= 0; + if (m_userhost_hash.match_entry(eq_arg, (void *)¤t_count)) + { + /* There are no matches given the condition */ + DBUG_VOID_RETURN; + } + else + { + /* There is exactly one matching userhost entry */ + TABLE *table= tables->table; + table->field[0]->store(eq_arg.c_str(), eq_arg.length(), + system_charset_info); + table->field[1]->store(current_count, true); + schema_table_store_record(thd, table); + } + } + else + m_userhost_hash.fill_IS_table(thd, tables); + + DBUG_VOID_RETURN; + } + + + /** + Initializes required objects for handling connection events. + + @param [in] coordinator Connection_event_coordinator_services handle. + */ + + bool init_connection_delay_event(Connection_event_coordinator_services *coordinator, + Error_handler *error_handler) + { + /* + 1. Initialize lock(s) + */ +#ifdef HAVE_PSI_INTERFACE + const char *category= "conn_control"; + int count= array_elements(all_rwlocks); + mysql_rwlock_register(category, all_rwlocks, count); +#endif /* HAVE_PSI_INTERFACE */ + mysql_rwlock_init(key_connection_event_delay_lock, + &connection_event_delay_lock); + g_max_failed_connection_handler= new Connection_delay_action(g_variables.failed_connections_threshold, + g_variables.min_connection_delay, + g_variables.max_connection_delay, + opt_enums, opt_enums_size, + status_vars_enums, status_vars_enums_size, + &connection_event_delay_lock); + if (!g_max_failed_connection_handler) + { + error_handler->handle_error("Failed to initialization Connection_delay_action"); + return true; + } + g_max_failed_connection_handler->init(coordinator); + + return false; + } + + + /** + Deinitializes objects and frees associated memory. + */ + + void deinit_connection_delay_event() + { + if (g_max_failed_connection_handler) + delete g_max_failed_connection_handler; + g_max_failed_connection_handler= 0; + mysql_rwlock_destroy(&connection_event_delay_lock); + return; + } +} + + +/** + Function to fill information_schema.connection_control_failed_attempts. + + @param [in] thd THD handle. + @param [in] tables Handle to + information_schema.connection_control_failed_attempts. + @param [in] cond Condition if any. + + @returns Always returns FALSE. +*/ + +int fill_failed_attempts_view(THD *thd, + TABLE_LIST *tables, + Item *cond) +{ + if (connection_control::g_max_failed_connection_handler) + connection_control::g_max_failed_connection_handler->fill_IS_table(thd, tables, cond); + return FALSE; +} + + +/** + View init function + + @param [in] ptr Handle to + information_schema.connection_control_failed_attempts. + + @returns Always returns 0. +*/ + +int connection_control_failed_attempts_view_init(void *ptr) +{ + ST_SCHEMA_TABLE *schema_table= (ST_SCHEMA_TABLE *)ptr; + + schema_table->fields_info= failed_attempts_view_fields; + schema_table->fill_table= fill_failed_attempts_view; + schema_table->idx_field1= 0; + schema_table->idx_field2= 1; + return 0; +} + + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_delay.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_delay.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/connection_delay.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/connection_delay.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,292 @@ +/* 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 */ + +#ifndef CONNECTION_DELAY_H +#define CONNECTION_DELAY_H + +#include /* LF Hash */ +#include +#include /* my_atomic_* */ +#include /* USERNAME_LENGTH */ +#include "table.h" /* TABLE_LIST */ + +#include "connection_control_interfaces.h" /* Observer interface */ +#include "connection_delay_api.h" /* Constants */ +#include "connection_control_data.h" /* variables and status */ +#include "connection_control_memory.h" /* Connection_control_alloc */ + +namespace connection_control +{ + /** + Class to store failed attempts information for a given user. + */ + + class Connection_event_record : public Connection_control_alloc + { + public: + + /** + Constructor for Connection_event_record. Always initializes failed login count to 1. + */ + Connection_event_record(const Sql_string &s) + : m_count(1) + { + memset((void *)m_userhost, 0, sizeof(m_userhost)); + memcpy((void *)m_userhost, s.c_str(), s.length()); + m_length= s.length(); + m_count= 1; + } + + /** + Retrives failed login count for given user entry + + @returns Failed login count + */ + int64 get_count() const + { + int64 result= my_atomic_load64((volatile int64*)&m_count); + return result; + } + + /** Increment failed login count for given user entry by 1 */ + void inc_count() + { + my_atomic_add64((volatile int64*)&m_count, 1); + } + + /** Reset failed login count for given user entry */ + void reset_count() + { + my_atomic_store64(&m_count, 0); + } + + /** Get user information */ + uchar * get_userhost() const + { + return const_cast (m_userhost); + } + + /** Get length information */ + size_t get_length() const + { + return m_length; + } + + /** Destructor */ + ~Connection_event_record() + { + m_count= DISABLE_THRESHOLD; + } + + private: + /* ''@'' */ + uchar m_userhost[1 + USERNAME_LENGTH + 3 + HOSTNAME_LENGTH + 1 + 1]; + /* Length of m_userhost */ + size_t m_length; + /* connection event count */ + volatile int64 m_count; + }; + + + /** + Hash for a connection event. + Stores information in Connection_event_record object for each user. + */ + + class Connection_delay_event : public Connection_event_records + { + public: + + /** Constructor. Also initializes the hash */ + Connection_delay_event(); + + /** Destructor. Removes all entries from hash before destroying hash */ + ~Connection_delay_event() + { + reset_all(); + lf_hash_destroy(&m_entries); + } + + void fill_IS_table(THD *thd, TABLE_LIST *tables); + + /* Overridden function */ + bool create_or_update_entry(const Sql_string &s); + bool remove_entry(const Sql_string &s); + bool match_entry(const Sql_string &s, void * value); + void reset_all(); + + private: + /** Hash for storing Connection_event_record per user */ + LF_HASH m_entries; + }; + + + /** + Connection event action to enforce max failed login constraint + */ + + class Connection_delay_action : public Connection_event_observer, + public Connection_control_alloc + { + public: + + Connection_delay_action(int64 threshold, + int64 min_delay, + int64 max_delay, + opt_connection_control *sys_vars, + size_t sys_vars_size, + stats_connection_control *status_vars, + size_t status_vars_size, + mysql_rwlock_t *lock); + + /** Destructor */ + ~Connection_delay_action() + { + deinit(); + m_lock= 0; + } + + void init(Connection_event_coordinator_services *coordinator); + + /** + Set threshold value. + + @param threshold [in] New threshold value + + @returns whether threshold value was changed successfully or not + @retval true Success + @retval false Failure. Invalid threshold value specified. + */ + + void set_threshold(int64 threshold) + { + my_atomic_store64(&m_threshold, threshold); + /* Clear the hash */ + m_userhost_hash.reset_all(); + } + + /** Get threshold value */ + int64 get_threshold() + { + int64 result= my_atomic_load64(&m_threshold); + return result; + } + + /** + Set min/max delay + + @param new_value [in] New m_min_delay/m_max_delay value + @param min [in] true for m_min_delay. false otherwise. + + @returns whether m_min_delay/m_max_delay value was changed successfully or not + @retval false Success + @retval true Failure. Invalid value specified. + */ + + bool set_delay(int64 new_value, bool min) + { + int64 current_max= get_max_delay(); + int64 current_min= get_min_delay(); + + if (new_value < MIN_DELAY) + return true; + + if ((min && new_value > current_max) || + (!min && new_value < current_min)) + return true; + + else + min ? my_atomic_store64(&m_min_delay, new_value) : + my_atomic_store64(&m_max_delay, new_value); + return false; + } + + /** Get max value */ + int64 get_max_delay() + { + int64 result= my_atomic_load64(&m_max_delay); + return result; + } + + /** Get min value */ + int64 get_min_delay() + { + int64 result= my_atomic_load64(&m_min_delay); + return result; + } + + void fill_IS_table(THD *thd, + TABLE_LIST *tables, + Item *cond); + + /** Overridden functions */ + bool notify_event(MYSQL_THD thd, + Connection_event_coordinator_services *coordinator, + const mysql_event_connection *connection_event, + Error_handler *error_handler); + bool notify_sys_var(Connection_event_coordinator_services *coordinator, + opt_connection_control variable, + void *new_value, + Error_handler *error_handler); + + private: + void deinit(); + void make_hash_key(MYSQL_THD thd, Sql_string &s); + /** + Generates wait time + + @param count [in] Proposed delay + + @returns wait time + */ + + inline ulonglong get_wait_time(int64 count) + { + int64 max_delay= get_max_delay(); + int64 min_delay= get_min_delay(); + int64 count_mili= count*1000; + + /* + if count < 0 (can happen in edge cases + we return max_delay. + Otherwise, following equation will be used: + wait_time = MIN(MIN(count, min_delay), + max_delay) + */ + return (static_cast((count_mili >= MIN_DELAY && count_mili < max_delay) ? + (count_mili < min_delay ? min_delay : count_mili) : + max_delay)); + } + void conditional_wait(THD *thd, + ulonglong wait_time); + + private: + /** Threshold value which triggers wait */ + volatile int64 m_threshold; + /** Lower cap on delay to be generated */ + volatile int64 m_min_delay; + /** Upper cap on delay to be generated */ + volatile int64 m_max_delay; + /** System variables */ + std::vector m_sys_vars; + /** Status variables */ + std::vector m_stats_vars; + /** Hash to store failed attempts for each user entry */ + Connection_delay_event m_userhost_hash; + /** RW lock */ + mysql_rwlock_t *m_lock; + }; +} +#endif /* !CONNECTION_DELAY_H */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/security_context_wrapper.cc percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/security_context_wrapper.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/security_context_wrapper.cc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/security_context_wrapper.cc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,219 @@ +/* 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 */ + +#define MYSQL_SERVER "We need security context" + +#include /* THD, Security context */ +#include /* SUPER_ACL */ + +#include "security_context_wrapper.h" + +namespace connection_control +{ + /** + Security_context_wrapper constructor. + + @param [in] thd Handle to THD + + Get security context from thd. + */ + Security_context_wrapper::Security_context_wrapper(MYSQL_THD thd) + { + m_valid= thd->security_ctx ? true : false; + m_thd= thd; + } + + + /** + Get value for given property from security context + + @param [in] property Property to be checked + @param [out] value Value of the property + + @returns status of property check + @retval true Error fetching property value + @retval false value contains valid value for given property + */ + + bool + Security_context_wrapper::get_property(const char *property, LEX_CSTRING *value) + { + value->length=0; + value->str= 0; + + if (!m_valid || !property) + return true; + else + { + if (!strcmp(property, "priv_user")) + { + if (m_thd->security_ctx->priv_user) + { + value->str= m_thd->security_ctx->priv_user; + value->length= strlen(value->str); + } + } + else if (!strcmp(property, "priv_host")) + { + if (m_thd->security_ctx->priv_host) + { + value->str= m_thd->security_ctx->priv_host; + value->length= strlen(value->str); + } + } + else if (!strcmp(property, "user")) + { + if (m_thd->security_ctx->user) + { + value->str= m_thd->security_ctx->user; + value->length= strlen(value->str); + } + } + else if (!strcmp(property, "proxy_user")) + { + if (m_thd->security_ctx->proxy_user) + { + value->str= m_thd->security_ctx->proxy_user; + value->length= strlen(value->str); + } + } + else if (!strcmp(property, "host")) + { + if (m_thd->security_ctx->get_host()->length()) + { + value->str= m_thd->security_ctx->get_host()->c_ptr(); + value->length= strlen(value->str); + } + } + else if (!strcmp(property, "ip")) + { + if (m_thd->security_ctx->get_ip()->length()) + { + value->str= m_thd->security_ctx->get_ip()->c_ptr(); + value->length= strlen(value->str); + } + } + else + { + return true; + } + } + return false; + } + + + /** Get proxy user information from security context */ + + const char * + Security_context_wrapper::get_proxy_user() + { + LEX_CSTRING proxy_user; + if (get_property("proxy_user", &proxy_user)) + return 0; + return proxy_user.str; + } + + + /** Get priv user information from security context */ + + const char * + Security_context_wrapper::get_priv_user() + { + LEX_CSTRING priv_user; + if (get_property("priv_user", &priv_user)) + return 0; + return priv_user.str; + } + + + /** Get priv host information from security context */ + + const char * + Security_context_wrapper::get_priv_host() + { + LEX_CSTRING priv_host; + if (get_property("priv_host", &priv_host)) + return 0; + return priv_host.str; + } + + + /** Get connected user information from security context */ + + const char * + Security_context_wrapper::get_user() + { + LEX_CSTRING user; + if (get_property("user", &user)) + return 0; + return user.str; + } + + + /** Get connected host information from security context */ + + const char * + Security_context_wrapper::get_host() + { + /* + We can't use thd->security_ctx->priv_host_name() + because it returns "%" if hostname is empty. + However, thd->security_ctx->proxy_user won't have + "%" if hostname was empty. + + To be consistent, we will always use + 'user'@'host'/''@'host'/''@'' type of representation. + */ + LEX_CSTRING host; + if (get_property("host", &host)) + return 0; + return host.str; + } + + + /** Get connected ip information from security context */ + + const char * + Security_context_wrapper::get_ip() + { + LEX_CSTRING ip; + if (get_property("ip", &ip)) + return 0; + return ip.str; + } + + + /** Check if valid security context exists for give THD or not */ + + bool + Security_context_wrapper::security_context_exists() + { + return m_valid; + } + + + /** Check whether user has requried privilege or not */ + + bool + Security_context_wrapper::is_super_user() + { + if (!m_valid) + return false; + + bool has_super= ((m_thd->security_ctx->master_access & SUPER_ACL) == SUPER_ACL); + + return has_super; + } +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/security_context_wrapper.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/security_context_wrapper.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/connection_control/security_context_wrapper.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/connection_control/security_context_wrapper.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,44 @@ +/* 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 */ + +#ifndef HAVE_SECURITY_CONTEXT_WRAPPER_H +#define HAVE_SECURITY_CONTEXT_WRAPPER_H + +#include + +namespace connection_control +{ + class Security_context_wrapper + { + public: + Security_context_wrapper(MYSQL_THD thd); + ~Security_context_wrapper() + {} + const char * get_proxy_user(); + const char * get_priv_user(); + const char * get_priv_host(); + const char * get_user(); + const char * get_host(); + const char * get_ip(); + bool security_context_exists(); + bool is_super_user(); + + private: + bool get_property(const char *property, LEX_CSTRING *value); + MYSQL_THD m_thd; + bool m_valid; + }; +} +#endif // !HAVE_SECURITY_CONTEXT_WRAPPER_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/HandlerSocket-Plugin-for-MySQL/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/HandlerSocket-Plugin-for-MySQL/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/HandlerSocket-Plugin-for-MySQL/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/HandlerSocket-Plugin-for-MySQL/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,7 @@ IF(CMAKE_CXX_FLAGS) STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) ENDIF() +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98") ADD_DEFINITIONS(-fno-rtti -fno-exceptions -fPIC -DPIC) ADD_SUBDIRECTORY(libhsclient) INCLUDE_DIRECTORIES(libhsclient) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/HandlerSocket-Plugin-for-MySQL/.gitignore percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/HandlerSocket-Plugin-for-MySQL/.gitignore --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/HandlerSocket-Plugin-for-MySQL/.gitignore 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/HandlerSocket-Plugin-for-MySQL/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -configure -Makefile.in -Makefile -.deps -*.lo -*.o -INSTALL -m4 -stamp-h1 -libtool -ltmain.sh -missing -install-sh -autom4te.cache -config.h* -config.status -config.guess -config.sub -config.log -depcomp -TAGS -aclocal.m4 -.libs -ltmain.sh -*.la -handlersocket/Makefile.plain -handlersocket/*.spec -libhsclient/*.spec -client/hstest -client/hsclient -perl-Net-HandlerSocket/*.spec -regtest/*/*.log -regtest/*/*.log2 -regtest/*/DONE -dist/* -ar-lib diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/innodb_memcached/daemon_memcached/.gitignore percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/innodb_memcached/daemon_memcached/.gitignore --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/innodb_memcached/daemon_memcached/.gitignore 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/innodb_memcached/daemon_memcached/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -# Keep the entries sorted to reduce the risk for a merge conflict -*.[ao] -*.exe -*.gcda -*.gcno -*.gcov -*.l[ao] -*.tcov -*.pyc -*~ -.deps -/.libs/ -/INSTALL -/aclocal.m4 -/autom4te.cache -/breakdancer_testsuite.c -/config.h -/config.h.in -/config.log -/config.status -/config/Doxyfile -/config/Doxyfile-api -/config/compile -/config/config.guess -/config/config.sub -/config/depcomp -/config/install-sh -/config/ltmain.sh -/config/missing -/configure -/doc/doxy -/doc/doxy-api -/doc/engine-interface.txt -/doc/protocol-binary-range.txt -/doc/protocol-binary.txt -/engine_testapp -/libtool -/m4/version.m4 -/mcstat -/memcached -/memcached-*.tar.gz -/memcached-debug -/memcached-debug.profile -/memcached.spec -/memcached_dtrace.h -/mkinstalldirs -/sizes -/stamp-h1 -/t/binary-sasl.t -/testapp -/timedrun -/version.num -Makefile -Makefile.in -TAGS -cscope.out -tags diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/innodb_memcached/innodb_memcache/.gitignore percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/innodb_memcached/innodb_memcache/.gitignore --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/innodb_memcached/innodb_memcache/.gitignore 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/innodb_memcached/innodb_memcache/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -*.build -xcode/ndbmemcache.xcodeproj/jdd.perspectivev3 -xcode/ndbmemcache.xcodeproj/jdd.mode1v3 -xcode/ndbmemcache.xcodeproj/*.mode1v3 -xcode/ndbmemcache.xcodeproj/*.pbxuser -.DS_Store -Makefile.in -junkbin -aclocal.m4 -compile -configure -depcomp -install-sh -ltmain.sh -missing -autom4te.cache/ -config.guess -config.h.in -config.sub -Makefile -config.h -config.log -config.status -libtool -src/.deps/ -src/Makefile -stamp-h1 -unit/.deps/ -unit/test_workqueue -unit/Makefile -unit/casbits_test -unit/ndbapi_interp_test -unit/test_interp -.libs -.deps -*.la -*.lo - diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c 2017-10-19 04:25:29.000000000 +0000 @@ -375,7 +375,7 @@ /* binlog is running, make the thread attach to conn_data->thd for binlog committing */ - if (thd) { + if (thd && conn_data->thd) { handler_thd_attach( conn_data->thd, NULL); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/query_response_time/tests/mtr/basic.result percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/query_response_time/tests/mtr/basic.result --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/query_response_time/tests/mtr/basic.result 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/query_response_time/tests/mtr/basic.result 2017-10-19 04:25:29.000000000 +0000 @@ -1,3 +1,4 @@ +SET GLOBAL query_response_time_flush='ON'; SHOW VARIABLES WHERE VARIABLE_NAME LIKE 'query_response_time%' AND VARIABLE_NAME!='query_response_time_exec_time_debug'; Variable_name Value query_response_time_flush OFF diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/query_response_time/tests/mtr/basic.test percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/query_response_time/tests/mtr/basic.test --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/query_response_time/tests/mtr/basic.test 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/query_response_time/tests/mtr/basic.test 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,7 @@ --source include/have_query_response_time_plugin.inc + +SET GLOBAL query_response_time_flush='ON'; + SHOW VARIABLES WHERE VARIABLE_NAME LIKE 'query_response_time%' AND VARIABLE_NAME!='query_response_time_exec_time_debug'; SHOW CREATE TABLE INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; --query_vertical SELECT PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE, PLUGIN_AUTHOR, PLUGIN_DESCRIPTION, PLUGIN_LICENSE FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'query_response_time%'; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/semisync/semisync_master.cc percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/semisync/semisync_master.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/semisync/semisync_master.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/semisync/semisync_master.cc 2017-10-19 04:25:29.000000000 +0000 @@ -670,6 +670,7 @@ TranxNode* entry= NULL; mysql_cond_t* thd_cond= NULL; + bool is_semi_sync_trans= true; if (active_tranxs_ != NULL && trx_wait_binlog_name) { entry= @@ -733,6 +734,25 @@ break; } } + /* + When code reaches here an Entry object may not be present in the + following scenario. + + Semi sync was not enabled when transaction entered into ordered_commit + process. During flush stage, semi sync was not enabled and there was no + 'Entry' object created for the transaction being committed and at a + later stage it was enabled. In this case trx_wait_binlog_name and + trx_wait_binlog_pos are set but the 'Entry' object is not present. Hence + dump thread will not wait for reply from slave and it will not update + reply_file_name. In such case the committing transaction should not wait + for an ack from slave and it should be considered as an async + transaction. + */ + if (!entry) + { + is_semi_sync_trans= false; + goto l_end; + } /* Let us update the info about the minimum binlog position of waiting * threads. @@ -833,7 +853,7 @@ l_end: /* Update the status counter. */ - if (is_on()) + if (is_on() && is_semi_sync_trans) rpl_semi_sync_master_yes_transactions++; else rpl_semi_sync_master_no_transactions++; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/tokudb-backup-plugin/backup/backup.h percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/tokudb-backup-plugin/backup/backup.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/tokudb-backup-plugin/backup/backup.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/tokudb-backup-plugin/backup/backup.h 2017-10-19 04:25:29.000000000 +0000 @@ -19,10 +19,23 @@ // When it returns 0, the file is copied. Otherwise, the file copy is skipped. typedef int (*backup_exclude_copy_fun_t)(const char *source_file,void *extra); -int tokubackup_create_backup(const char *source_dirs[], const char *dest_dirs[], int dir_count, - backup_poll_fun_t poll_fun, void *poll_extra, - backup_error_fun_t error_fun, void *error_extra, - backup_exclude_copy_fun_t check_fun, void *exclude_copy_extra) +typedef void (*backup_before_stop_capt_fun_t)(void *extra); +typedef void (*backup_after_stop_capt_fun_t)(void *extra); + + +int tokubackup_create_backup(const char *source_dirs[], + const char *dest_dirs[], + int dir_count, + backup_poll_fun_t poll_fun, + void *poll_extra, + backup_error_fun_t error_fun, + void *error_extra, + backup_exclude_copy_fun_t check_fun, + void *exclude_copy_extra, + backup_before_stop_capt_fun_t bsc_fun, + void *bsc_extra, + backup_after_stop_capt_fun_t asc_fun, + void *asc_extra) throw() __attribute__((visibility("default"))); // Effect: Backup the directories in source_dirs into correspnding dest_dirs. // Periodically call poll_fun. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/tokudb-backup-plugin/tokudb_backup.cc percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/tokudb-backup-plugin/tokudb_backup.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/plugin/tokudb-backup-plugin/tokudb_backup.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/plugin/tokudb-backup-plugin/tokudb_backup.cc 2017-10-19 04:25:29.000000000 +0000 @@ -3,6 +3,7 @@ #ident "Copyright (c) 2014 Tokutek Inc. All rights reserved." #define MYSQL_SERVER +#define HAVE_REPLICATION #include #include #include @@ -19,6 +20,88 @@ #include // check_global_access #include "backup/backup.h" #include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +template +class BasicLockableClassWrapper +{ + T &m_lockable; + void (T::*m_lock)(void); + void (T::*m_unlock)(void); +public: + BasicLockableClassWrapper(T &a_lockable, + void (T::*a_lock)(void), + void (T::*a_unlock)(void)) : + m_lockable(a_lockable), + m_lock(a_lock), + m_unlock(a_unlock) {} + + void lock() { + ((m_lockable).*(m_lock))(); + } + + void unlock() { + ((m_lockable).*(m_unlock))(); + } +}; + +class BasicLockableMysqlMutextT { + mysql_mutex_t &m_mutex; + public: + BasicLockableMysqlMutextT(mysql_mutex_t &mutex) : m_mutex(mutex) {} + void lock() { mysql_mutex_lock(&m_mutex); } + void unlock() {mysql_mutex_unlock(&m_mutex); } +}; + +template +class scoped_lock_wrapper +{ + BasicLockableWrapper m_lockable; +public: + scoped_lock_wrapper(const BasicLockableWrapper &lockable) : + m_lockable(lockable) { + m_lockable.lock(); + } + ~scoped_lock_wrapper() { + m_lockable.unlock(); + } +private: + scoped_lock_wrapper( + const scoped_lock_wrapper &); + scoped_lock_wrapper& operator=( + scoped_lock_wrapper &); +}; + +typedef BasicLockableClassWrapper Checkable_rwlock_lockable; + +struct tokudb_backup_master_info { + std::string host; + std::string user; + uint32_t port; + std::string master_log_file; + std::string relay_log_file; + uint64_t exec_master_log_pos; + std::string executed_gtid_set; + std::string channel_name; +}; + +struct tokudb_backup_master_state { + std::string file_name; + my_off_t position; + std::string executed_gtid_set; + ulong gtid_mode; +}; #ifdef TOKUDB_BACKUP_PLUGIN_VERSION #define stringify2(x) #x @@ -28,8 +111,18 @@ #define TOKUDB_BACKUP_PLUGIN_VERSION_STRING NULL #endif +/* innodb_use_native_aio option */ +extern my_bool srv_use_native_aio; + static char *tokudb_backup_plugin_version; +static const char* master_info_file_name = "tokubackup_slave_info"; +static const char* master_state_file_name = "tokubackup_binlog_info"; + +static char tokudb_backup_safe_slave = FALSE; +static ulonglong tokudb_backup_safe_slave_timeout = 0; +static bool sql_thread_started = false; + static MYSQL_SYSVAR_STR(plugin_version, tokudb_backup_plugin_version, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, "version of the tokudb backup plugin", @@ -42,19 +135,15 @@ "version of the tokutek backup library", NULL, NULL, NULL); -static MYSQL_THDVAR_ULONG(last_error, +static MYSQL_THDVAR_INT(last_error, PLUGIN_VAR_THDLOCAL, "error from the last backup. 0 is success", - NULL, NULL, 0, 0, ~0ULL, 1); - -static void tokudb_backup_update_last_error_str(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, const void* save); + NULL, NULL, 0, 0, 0, 1); static MYSQL_THDVAR_STR(last_error_string, - PLUGIN_VAR_THDLOCAL, + PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC, "error string from the last backup", - NULL, tokudb_backup_update_last_error_str, NULL); + NULL, NULL, NULL); static MYSQL_THDVAR_STR(exclude, PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC, @@ -91,10 +180,25 @@ "allowed prefix of the destination directory", NULL, NULL, NULL); +static MYSQL_SYSVAR_BOOL(safe_slave, tokudb_backup_safe_slave, + PLUGIN_VAR_OPCMDARG, "Wait until there is no temporary slave tables.", + NULL, + NULL, + 0); + +static MYSQL_SYSVAR_ULONGLONG(safe_slave_timeout, + tokudb_backup_safe_slave_timeout, + PLUGIN_VAR_OPCMDARG, + "The maximum amount of seconds to wait for slave temp tables disappear " + "0 - don't wait", + NULL, NULL, 0, 0, ULONGLONG_MAX, 0); + static struct st_mysql_sys_var *tokudb_backup_system_variables[] = { MYSQL_SYSVAR(plugin_version), MYSQL_SYSVAR(version), MYSQL_SYSVAR(allowed_prefix), + MYSQL_SYSVAR(safe_slave), + MYSQL_SYSVAR(safe_slave_timeout), MYSQL_SYSVAR(throttle), MYSQL_SYSVAR(dir), MYSQL_SYSVAR(last_error), @@ -146,15 +250,11 @@ return 0; } -static void tokudb_backup_set_error(THD *thd, int error, const char *error_string) { - THDVAR(thd, last_error) = error; - char *old_error_string = THDVAR(thd, last_error_string); - if (error_string) - THDVAR(thd, last_error_string) = my_strdup(error_string, MYF(MY_FAE)); - else - THDVAR(thd, last_error_string) = NULL; - if (old_error_string) - my_free(old_error_string); +static void tokudb_backup_set_error(THD *thd, + int error, + const char *error_string) { + THDVAR_SET(thd, last_error, &error); + THDVAR_SET(thd, last_error_string, error_string); } static void tokudb_backup_set_error_string(THD *thd, int error, const char *error_fmt, const char *s1, const char *s2, const char *s3) { @@ -166,13 +266,6 @@ my_free(error_string); } -static void tokudb_backup_update_last_error_str(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, const void* save) { - tokudb_backup_set_error(thd, THDVAR(thd, last_error), ((LEX_STRING*)save)->str); - *((char**)var_ptr) = THDVAR(thd, last_error_string); -} - struct tokudb_backup_error_extra { THD *_thd; }; @@ -188,6 +281,304 @@ } } +static bool tokudb_backup_check_slave_sql_thread_running(THD *thd) { + scoped_lock_wrapper + with_LOCK_active_mi_locked( + BasicLockableMysqlMutextT(&LOCK_active_mi)); + + Master_info *mi = active_mi; + + if (!mi || !mi->inited || !mi->host || !mi->host[0]) + return false; + + scoped_lock_wrapper + with_mi_data_locked_1(BasicLockableMysqlMutextT( + mi->data_lock)); + scoped_lock_wrapper + with_mi_data_locked_2(BasicLockableMysqlMutextT( + mi->rli->data_lock)); + scoped_lock_wrapper + with_mi_data_locked_3(BasicLockableMysqlMutextT( + mi->err_lock)); + scoped_lock_wrapper + with_mi_data_locked_4(BasicLockableMysqlMutextT( + mi->rli->err_lock)); + + return mi->rli->slave_running; +} + +static bool tokudb_backup_stop_slave_sql_thread(THD *thd) { + bool stop_slave_result; + bool result; + + if (!active_mi) + return true; + + thd->lex->slave_thd_opt = SLAVE_SQL; + + { + scoped_lock_wrapper + with_LOCK_active_mi_locked( + BasicLockableMysqlMutextT(&LOCK_active_mi)); + + Master_info *mi = active_mi; + + if (!mi || !mi->inited || !mi->host || !mi->host[0]) + return true; + + stop_slave_result = stop_slave(thd, mi, 0); + } + + result = !stop_slave_result && + !tokudb_backup_check_slave_sql_thread_running(thd); + + if (!result) + sql_print_error("TokuDB Hotbackup: Can't stop slave sql thread\n"); + + return result; +} + +static bool tokudb_backup_start_slave_sql_thread(THD *thd) { + bool start_slave_result; + bool result; + + if (!active_mi) + return true; + + thd->lex->slave_thd_opt = SLAVE_SQL; + thd->lex->slave_connection.user = NULL; + thd->lex->slave_connection.password = NULL; + + { + scoped_lock_wrapper + with_LOCK_active_mi_locked( + BasicLockableMysqlMutextT(&LOCK_active_mi)); + + Master_info *mi = active_mi; + + if (!mi || !mi->inited || !mi->host || !mi->host[0]) + return true; + + start_slave_result = start_slave(thd, mi, 0); + } + + result = !start_slave_result && + tokudb_backup_check_slave_sql_thread_running(thd); + + if (!result) + sql_print_error("TokuDB Hotbackup: can't start slave sql thread"); + + return result; +} + +static bool tokudb_backup_wait_for_safe_slave(THD *thd, uint timeout) { + static const uint sleep_time = 3000000; + size_t n_attemts = tokudb_backup_safe_slave_timeout ? + (1000000 * tokudb_backup_safe_slave_timeout / sleep_time) : 1; + + DEBUG_SYNC(thd, "tokudb_backup_wait_for_safe_slave_entered"); + if (!active_mi) { + sql_thread_started = false; + return false; + } + + sql_thread_started = tokudb_backup_check_slave_sql_thread_running(thd); + + if (sql_thread_started && !tokudb_backup_stop_slave_sql_thread(thd)) + return false; + + while(slave_open_temp_tables && n_attemts--) { + DEBUG_SYNC(thd, "tokudb_backup_wait_for_temp_tables_loop_begin"); + if (!tokudb_backup_start_slave_sql_thread(thd)) + return false; + DEBUG_SYNC(thd, "tokudb_backup_wait_for_temp_tables_loop_slave_started"); + my_sleep(sleep_time); + if (!tokudb_backup_stop_slave_sql_thread(thd)) + return false; + DEBUG_SYNC(thd, "tokudb_backup_wait_for_temp_tables_loop_end"); + } + + if (!n_attemts && + slave_open_temp_tables) { + + (sql_thread_started && + !tokudb_backup_check_slave_sql_thread_running(thd) && + !tokudb_backup_start_slave_sql_thread(thd)); + + return false; + } + + return true; +} + +static my_bool +tokudb_backup_flush_log_plugin_callback(THD *, + plugin_ref plugin, + void *) { + + const char *name = plugin_name(plugin)->str; + handlerton *hton= plugin_data(plugin, handlerton *); + + if (!strcmp(name, "TokuDB") && + hton->state == SHOW_OPTION_YES && hton->flush_logs && + !hton->flush_logs(hton)) + return TRUE; + + return FALSE; +} + +static void tokudb_backup_before_stop_capt_fun(void *arg) { + THD *thd = static_cast(arg); + if (tokudb_backup_safe_slave) { + if (!tokudb_backup_wait_for_safe_slave( + thd,tokudb_backup_safe_slave_timeout)) { + sql_print_error("TokuDB Hotbackup: safe slave option error"); + return; + } + } + (void)lock_binlog_for_backup(thd); + if (!plugin_foreach(NULL, + tokudb_backup_flush_log_plugin_callback, + MYSQL_STORAGE_ENGINE_PLUGIN, + 0)) + tokudb_backup_set_error_string(thd, EINVAL, "Can't flush TokuDB log", + NULL, NULL, NULL); +} + +std::string tokudb_backup_get_executed_gtids_set() { + char* sql_gtid_set_buffer = NULL; + std::string result; + { + scoped_lock_wrapper + with_global_sid_lock_wrlock( + Checkable_rwlock_lockable(*global_sid_lock, + &Checkable_rwlock::wrlock, + &Checkable_rwlock::unlock)); + + const Gtid_set *sql_gtid_set= gtid_state->get_logged_gtids(); + (void)sql_gtid_set->to_string(&sql_gtid_set_buffer); + } + result.assign(sql_gtid_set_buffer); + my_free(sql_gtid_set_buffer); + result.erase(std::remove(result.begin(), result.end(),'\n'), result.end()); + return result; +}; + +static void tokudb_backup_get_master_infos( + THD *thd, + std::vector *master_info_channels) { + tokudb_backup_master_info tbmi; + + if (!active_mi) + return; + + { + scoped_lock_wrapper + with_LOCK_active_mi_locked( + BasicLockableMysqlMutextT(&LOCK_active_mi)); + + Master_info *mi = active_mi; + + if (!mi || !mi->inited || !mi->host || !mi->host[0]) + return; + + std::string executed_gtid_set = tokudb_backup_get_executed_gtids_set(); + + { + scoped_lock_wrapper + with_mi_data_locked_1(BasicLockableMysqlMutextT( + mi->data_lock)); + scoped_lock_wrapper + with_mi_data_locked_2(BasicLockableMysqlMutextT( + mi->rli->data_lock)); + scoped_lock_wrapper + with_mi_data_locked_3(BasicLockableMysqlMutextT( + mi->err_lock)); + scoped_lock_wrapper + with_mi_data_locked_4(BasicLockableMysqlMutextT( + mi->rli->err_lock)); + + tbmi.host.assign(mi->host); + tbmi.user.assign(mi->get_user()); + tbmi.port = mi->port; + tbmi.master_log_file.assign(mi->get_master_log_name()); + tbmi.relay_log_file.assign(mi->rli->get_group_relay_log_name() + + dirname_length(mi->rli->get_group_relay_log_name())); + tbmi.exec_master_log_pos = mi->rli->get_group_master_log_pos(); + tbmi.executed_gtid_set.assign(executed_gtid_set); + } + } + + master_info_channels->push_back(tbmi); +} + +void tokudb_backup_get_master_state( + tokudb_backup_master_state *master_state) { + + if (!mysql_bin_log.is_open()) + return; + + LOG_INFO li; + mysql_bin_log.get_current_log(&li); + + master_state->file_name = + (li.log_file_name + dirname_length(li.log_file_name)); + master_state->position = li.pos; + master_state->executed_gtid_set = tokudb_backup_get_executed_gtids_set(); + master_state->gtid_mode = gtid_mode; + + return; +} + +struct tokudb_backup_after_stop_capt_extra { + THD *thd; + std::vector *master_info_channels; + tokudb_backup_master_state *master_state; +}; + +static void tokudb_backup_after_stop_capt_fun(void *arg) { + tokudb_backup_after_stop_capt_extra *extra = + static_cast(arg); + THD *thd = extra->thd; + std::vector *master_info_channels = + extra->master_info_channels; + tokudb_backup_master_state *master_state = extra->master_state; + if (tokudb_backup_safe_slave && + sql_thread_started && + tokudb_backup_check_slave_sql_thread_running(thd)) { + + tokudb_backup_set_error_string(thd, + EINVAL, + "Slave sql stread is not stopped", + NULL, NULL, NULL); + sql_print_error("TokuDB Hotbackup: " + "master and slave info can't be saved " + "because slave sql thread can't be stopped\n"); + + goto exit; + } + + tokudb_backup_get_master_infos(thd, master_info_channels); + tokudb_backup_get_master_state(master_state); + + if (tokudb_backup_safe_slave && sql_thread_started) { + if (!tokudb_backup_start_slave_sql_thread(thd)) { + tokudb_backup_set_error_string(thd, + EINVAL, + "Slave sql stread is not started", + NULL, NULL, NULL); + sql_print_error("TokuDB Hotbackup: " + "slave sql thread can't be started\n"); + goto exit; + } + } + +exit: + if (thd->backup_binlog_lock.is_acquired()) { + thd->backup_binlog_lock.release(thd); + } +} + static char *tokudb_backup_realpath_with_slash(const char *a) { char *result = NULL; char *apath = realpath(a, NULL); @@ -541,9 +932,127 @@ destination_dirs() {}; }; +int tokudb_backup_save_master_infos( + THD *thd, + const char *dest_dir, + const std::vector &master_info_channels) { + + int error = 0; + std::string mi_full_file_name(dest_dir); + mi_full_file_name.append("/"); + mi_full_file_name.append(master_info_file_name); + + int fd = open(mi_full_file_name.c_str(), + O_WRONLY|O_CREAT, + S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); + if (fd < 0) { + error = errno; + tokudb_backup_set_error_string( + thd, error, "Can't open master info file %s\n", + mi_full_file_name.c_str(), NULL, NULL); + return error; + } + + for (std::vector::const_iterator i = + master_info_channels.begin(), end = master_info_channels.end(); + i != end; + ++i) { + + std::stringstream out; + out << "host: " << i->host << ", " + << "user: " << i->user << ", " + << "port: " << i->port << ", " + << "master log file: " << i->master_log_file << ", " + << "relay log file: " << i->relay_log_file << ", " + << "exec master log pos: " << i->exec_master_log_pos << ", " + << "executed gtid set: " << i->executed_gtid_set << ", " + << "channel name: " << i->channel_name << std::endl; + const std::string &out_str = out.str(); + if (write(fd, out_str.c_str(), out_str.length()) < + (int)out_str.length()) + { + error = EINVAL; + tokudb_backup_set_error_string( + thd, error, "Master info was not written fully", + NULL, NULL, NULL); + break; + } + } + + if (close(fd) < 0) { + error = errno; + tokudb_backup_set_error_string( + thd, error, "Can't close master info file %s\n", + mi_full_file_name.c_str(), NULL, NULL); + } + + return error; +} + +int tokudb_backup_save_master_state( + THD *thd, + const char *dest_dir, + const tokudb_backup_master_state &master_state) { + + int error = 0; + std::string ms_full_file_name(dest_dir); + ms_full_file_name.append("/"); + ms_full_file_name.append(master_state_file_name); + + int fd = open(ms_full_file_name.c_str(), + O_WRONLY|O_CREAT, + S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); + if (fd < 0) { + error = errno; + tokudb_backup_set_error_string( + thd, error, "Can't open master state file %s\n", + ms_full_file_name.c_str(), NULL, NULL); + return error; + } + + std::stringstream out; + out << "filename: " << master_state.file_name << ", " + << "position: " << master_state.position << ", " + << "gtid_mode: " + << gtid_mode_names[master_state.gtid_mode] << ", " + << "GTID of last change: " << master_state.executed_gtid_set + << std::endl; + + const std::string &out_str = out.str(); + if (write(fd, out_str.c_str(), out_str.length()) < + (int)out_str.length()) + { + error = EINVAL; + tokudb_backup_set_error_string( + thd, error, "Master state was not written fully", + NULL, NULL, NULL); + } + + if (close(fd) < 0) { + error = errno; + tokudb_backup_set_error_string( + thd, error, "Can't close master state file %s\n", + ms_full_file_name.c_str(), NULL, NULL); + } + + return error; + +} + static void tokudb_backup_run(THD *thd, const char *dest_dir) { int error = 0; + if (srv_use_native_aio) { + error = EINVAL; + tokudb_backup_set_error_string(thd, + error, + "tokudb hot backup is disabled when " + "innodb_use_native_aio is enabled", + NULL, + NULL, + NULL); + return; + } // check that the dest dir is a child of the tokudb_backup_allowed_prefix if (tokudb_backup_allowed_prefix) { if (!tokudb_backup_is_child_of(dest_dir, tokudb_backup_allowed_prefix)) { @@ -619,18 +1128,46 @@ // set the throttle tokubackup_throttle_backup(THDVAR(thd, throttle)); + std::vector master_info_channels; + tokudb_backup_master_state master_state; + // do the backup tokudb_backup_progress_extra progress_extra = { thd, NULL }; tokudb_backup_error_extra error_extra = { thd }; tokudb_backup_exclude_copy_extra exclude_copy_extra = { thd, exclude_string, &exclude_re }; - error = tokubackup_create_backup(source_dirs, dest_dirs, count, - tokudb_backup_progress_fun, &progress_extra, - tokudb_backup_error_fun, &error_extra, - tokudb_backup_exclude_copy_fun, &exclude_copy_extra); + tokudb_backup_after_stop_capt_extra asce = {thd, + &master_info_channels, + &master_state}; + error = tokubackup_create_backup(source_dirs, + dest_dirs, + count, + tokudb_backup_progress_fun, + &progress_extra, + tokudb_backup_error_fun, + &error_extra, + tokudb_backup_exclude_copy_fun, + &exclude_copy_extra, + tokudb_backup_before_stop_capt_fun, + thd, + tokudb_backup_after_stop_capt_fun, + &asce); if (exclude_string) regfree(&exclude_re); + if (!master_info_channels.empty() && + (error = tokudb_backup_save_master_infos(thd, + dest_dir, + master_info_channels))) + goto exit; + + if (!master_state.file_name.empty() && + (error = tokudb_backup_save_master_state(thd, + dest_dir, + master_state))) + goto exit; + +exit: // cleanup thd_proc_info(thd, "tokudb backup done"); // must be a static string my_free(progress_extra._the_string); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/PS_REFRESH_VERSION percona-xtradb-cluster-5.6-5.6.37-26.21/PS_REFRESH_VERSION --- percona-xtradb-cluster-5.6-5.6.34-26.19/PS_REFRESH_VERSION 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/PS_REFRESH_VERSION 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1 @@ +c96c4272bf900dc6657e8882cdc4fe02f70f52de diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/regex/regcomp.c percona-xtradb-cluster-5.6-5.6.37-26.21/regex/regcomp.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/regex/regcomp.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/regex/regcomp.c 2017-10-19 04:25:29.000000000 +0000 @@ -551,6 +551,8 @@ assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); assert(OP(p->strip[p->pend[i]]) == ORPAREN); (void) dupl(p, p->pbegin[i]+1, p->pend[i]); + if (p->error != 0) + break; /* purecov: inspected */ EMIT(O_BACK, i); } else SETERROR(MY_REG_ESUBREG); @@ -1031,6 +1033,8 @@ AHEAD(THERE()); /* ...so fix it */ ASTERN(O_CH, THERETHERE()); copy = dupl(p, start+1, finish+1); + if (p->error != 0) + return; /* purecov: inspected */ assert(copy == finish+4); repeat(p, copy, 1, to-1); break; @@ -1040,10 +1044,14 @@ break; case REP(N, N): /* as xx{m-1,n-1} */ copy = dupl(p, start, finish); + if (p->error != 0) + return; repeat(p, copy, from-1, to-1); break; case REP(N, INF): /* as xx{n-1,INF} */ copy = dupl(p, start, finish); + if (p->error != 0) + return; /* purecov: inspected */ repeat(p, copy, from-1, to); break; default: /* "can't happen" */ @@ -1366,6 +1374,9 @@ if (len == 0) return(ret); enlarge(p, p->ssize + len); /* this many unexpected additions */ + if (p->error != 0) + return(p->error); + assert(p->ssize >= p->slen + len); (void) memcpy((char *)(p->strip + p->slen), (char *)(p->strip + start), (size_t)len*sizeof(sop)); @@ -1438,7 +1449,7 @@ } } { - int length=(HERE()-pos-1)*sizeof(sop); + size_t length=(HERE()-pos-1)*sizeof(sop); bmove_upp((uchar *) &p->strip[pos+1]+length, (uchar *) &p->strip[pos]+length, length); @@ -1482,6 +1493,15 @@ if (p->ssize >= size) return; + DBUG_EXECUTE_IF("bug24449090_simulate_oom", + { + free(p->strip); + p->strip= NULL; + p->ssize= 0; + SETERROR(MY_REG_ESPACE); + return; + }); + sp = (sop *)realloc(p->strip, size*sizeof(sop)); if (sp == NULL) { SETERROR(MY_REG_ESPACE); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -124,8 +124,20 @@ STRING(REPLACE "-grecord-gcc-switches" "" CXXFLAGS "${CXXFLAGS}") STRING(REPLACE "-pipe" "" CXXFLAGS "${CXXFLAGS}") +IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + SET (PERL_PATH "/usr/local/bin/perl") +ELSE() + SET (PERL_PATH "/usr/bin/perl") +ENDIF() + IF(UNIX) - # FIND_PROC and CHECK_PID are used by mysqld_safe + # SHELL_PATH, FIND_PROC, CHECK_PID are used by mysqld_safe +IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") + SET (SHELL_PATH "/bin/bash") +ELSE() + SET (SHELL_PATH "/bin/sh") +ENDIF() + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET (FIND_PROC "ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null") diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/dheadgen.pl percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/dheadgen.pl --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/dheadgen.pl 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/dheadgen.pl 2017-10-19 04:25:29.000000000 +0000 @@ -1,10 +1,4 @@ -#!/usr/bin/perl -w - -# -# Copyright (c) 2008, 2009 Sun Microsystems, Inc. -# Use is subject to license terms. -# - +# Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/fill_help_tables.sql percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/fill_help_tables.sql --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/fill_help_tables.sql 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/fill_help_tables.sql 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,5 @@ --- Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. --- Use is subject to license terms --- +-- Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. +-- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. @@ -12,13 +11,15 @@ -- -- 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. --- DO NOT EDIT THIS FILE. It is generated automatically. +-- DO NOT EDIT THIS FILE. It is generated automatically by the MySQL docs +-- team. If you require changes to the format of this file, contact the +-- docs team. --- File generation date: 2013-05-12 +-- File generation date: 2017-06-02 -- MySQL series: 5.6 --- Document repository revision: 35152 +-- Document repository revision: 52424 -- To use this file, load its contents into the mysql database. For example, -- with the mysql client program, process the file like this, where @@ -26,2162 +27,2512 @@ -- mysql -u root -p mysql < file_name -set names 'utf8'; +SET NAMES 'utf8'; + +TRUNCATE TABLE help_topic; +TRUNCATE TABLE help_category; +TRUNCATE TABLE help_keyword; +TRUNCATE TABLE help_relation; + +START TRANSACTION; + +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (1,'Geographic',0,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (2,'Polygon properties',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (3,'Numeric Functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (4,'WKT',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (5,'Plugins',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (6,'Control flow functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (7,'MBR',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (8,'Transactions',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (9,'Help Metadata',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (10,'Account Management',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (11,'Point properties',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (12,'Encryption Functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (13,'LineString properties',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (14,'Miscellaneous Functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (15,'Logical operators',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (16,'Functions and Modifiers for Use with GROUP BY',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (17,'Information Functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (18,'Storage Engines',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (19,'Bit Functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (20,'Comparison operators',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (21,'Table Maintenance',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (22,'User-Defined Functions',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (23,'Data Types',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (24,'Compound Statements',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (25,'Geometry constructors',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (26,'GeometryCollection properties',1,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (27,'Administration',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (28,'Data Manipulation',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (29,'Utility',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (30,'Language Structure',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (31,'Geometry relations',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (32,'Date and Time Functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (33,'WKB',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (34,'Procedures',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (35,'Geographic Features',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (36,'Contents',0,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (37,'Geometry properties',35,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (38,'String Functions',39,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (39,'Functions',36,''); +INSERT INTO help_category (help_category_id,name,parent_category_id,url) VALUES (40,'Data Definition',36,''); -delete from help_topic; -delete from help_category; -delete from help_keyword; -delete from help_relation; +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (0,28,'JOIN','MySQL supports the following JOIN syntax for the table_references part\nof SELECT statements and multiple-table DELETE and UPDATE statements:\n\ntable_references:\n escaped_table_reference [, escaped_table_reference] ...\n\nescaped_table_reference:\n table_reference\n | { OJ table_reference }\n\ntable_reference:\n table_factor\n | join_table\n\ntable_factor:\n tbl_name [PARTITION (partition_names)]\n [[AS] alias] [index_hint_list]\n | table_subquery [AS] alias\n | ( table_references )\n\njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n ON conditional_expr\n | USING (column_list)\n\nindex_hint_list:\n index_hint [, index_hint] ...\n\nindex_hint:\n USE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nA table reference (when it refers to a partitioned table) may contain a\nPARTITION option, including a comma-separated list of partitions,\nsubpartitions, or both. This option follows the name of the table and\nprecedes any alias declaration. The effect of this option is that rows\nare selected only from the listed partitions or subpartitions. Any\npartitions or subpartitions not named in the list are ignored. For more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\nThe syntax of table_factor is extended in MySQL in comparison with\nstandard SQL. The standard accepts only table_reference, not a list of\nthem inside a pair of parentheses.\n\nThis is a conservative extension if each comma in a list of\ntable_reference items is considered as equivalent to an inner join. For\nexample:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a = t1.a AND t3.b = t1.b AND t4.c = t1.c)\n\nIn MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents\n(they can replace each other). In standard SQL, they are not\nequivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used\notherwise.\n\nIn general, parentheses can be ignored in join expressions containing\nonly inner join operations. MySQL also supports nested joins. See\nhttp://dev.mysql.com/doc/refman/5.6/en/nested-join-optimization.html.\n\nIndex hints can be specified to affect how the MySQL optimizer makes\nuse of indexes. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/index-hints.html. The\noptimizer_switch system variable is another way to influence optimizer\nuse of indexes. See\nhttp://dev.mysql.com/doc/refman/5.6/en/switchable-optimizations.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/join.html\n\n','SELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n','http://dev.mysql.com/doc/refman/5.6/en/join.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (1,38,'HEX','Syntax:\nHEX(str), HEX(N)\n\nFor a string argument str, HEX() returns a hexadecimal string\nrepresentation of str where each byte of each character in str is\nconverted to two hexadecimal digits. (Multibyte characters therefore\nbecome more than two digits.) The inverse of this operation is\nperformed by the UNHEX() function.\n\nFor a numeric argument N, HEX() returns a hexadecimal string\nrepresentation of the value of N treated as a longlong (BIGINT) number.\nThis is equivalent to CONV(N,10,16). The inverse of this operation is\nperformed by CONV(HEX(N),16,10).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT X\'616263\', HEX(\'abc\'), UNHEX(HEX(\'abc\'));\n -> \'abc\', 616263, \'abc\'\nmysql> SELECT HEX(255), CONV(HEX(255),16,10);\n -> \'FF\', 255\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (2,31,'CONTAINS','Contains(g1, g2)\n\nMBRContains() and Contains() are synonyms. For more information, see\nthe description of MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (3,37,'SRID','SRID(g)\n\nST_SRID() and SRID() are synonyms. For more information, see the\ndescription of ST_SRID().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (4,27,'SHOW CONTRIBUTORS','Syntax:\nSHOW CONTRIBUTORS\n\nThe SHOW CONTRIBUTORS statement displays information about the people\nwho contribute to MySQL source or to causes that we support. For each\ncontributor, it displays Name, Location, and Comment values.\n\nThis statement is removed as of MySQL 5.6.8.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-contributors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-contributors.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (5,16,'VARIANCE','Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. This is an extension\nto standard SQL. The standard SQL function VAR_POP() can be used\ninstead.\n\nIf there are no matching rows, VARIANCE() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (6,40,'DROP SERVER','Syntax:\nDROP SERVER [ IF EXISTS ] server_name\n\nDrops the server definition for the server named server_name. The\ncorresponding row in the mysql.servers table is deleted. This statement\nrequires the SUPER privilege.\n\nDropping a server for a table does not affect any FEDERATED tables that\nused this connection information when they were created. See [HELP\nCREATE SERVER].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-server.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-server.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (7,27,'SHOW AUTHORS','Syntax:\nSHOW AUTHORS\n\nThe SHOW AUTHORS statement displays information about the people who\nwork on MySQL. For each author, it displays Name, Location, and Comment\nvalues.\n\nThis statement is removed as of MySQL 5.6.8.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-authors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-authors.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (8,26,'ST_GEOMETRYN','ST_GeometryN(gc, N)\n\nReturns the N-th geometry in the GeometryCollection value gc.\nGeometries are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1));\n+-------------------------------------------------+\n| ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1)) |\n+-------------------------------------------------+\n| POINT(1 1) |\n+-------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (9,33,'ST_GEOMCOLLFROMWKB','ST_GeomCollFromWKB(wkb[, srid]), ST_GeometryCollectionFromWKB(wkb[,\nsrid])\n\nConstructs a GeometryCollection value using its WKB representation and\nSRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (10,38,'CONCAT','Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are nonbinary strings, the\nresult is a nonbinary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent nonbinary string form.\n\nCONCAT() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CONCAT(\'My\', \'S\', \'QL\');\n -> \'MySQL\'\nmysql> SELECT CONCAT(\'My\', NULL, \'QL\');\n -> NULL\nmysql> SELECT CONCAT(14.3);\n -> \'14.3\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (11,35,'GEOMETRY HIERARCHY','Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n collection classes named MultiPoint, MultiLineString, and\n MultiPolygon for modeling geometries corresponding to collections of\n Points, LineStrings, and Polygons, respectively. MultiCurve and\n MultiSurface are introduced as abstract superclasses that generalize\n the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnoninstantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometry-class-hierarchy.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-geometry-class-hierarchy.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (12,38,'CHAR FUNCTION','Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(X\'65\')), CHARSET(CHAR(X\'65\' USING utf8));\n+----------------------+---------------------------------+\n| CHARSET(CHAR(X\'65\')) | CHARSET(CHAR(X\'65\' USING utf8)) |\n+----------------------+---------------------------------+\n| binary | utf8 |\n+----------------------+---------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CHAR(77,121,83,81,\'76\');\n -> \'MySQL\'\nmysql> SELECT CHAR(77,77.3,\'77.3\');\n -> \'MMM\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (13,7,'ASYMMETRIC_DECRYPT','Syntax:\nASYMMETRIC_DECRYPT(algorithm, crypt_str, key_str)\n\nDecrypts an encrypted string using the given algorithm and key string,\nand returns the resulting cleartext as a binary string. If decryption\nfails, the result is NULL.\n\nkey_str must be a valid key string in PEM format. For successful\ndecryption, it must be the public or private key string corresponding\nto the private or public key string used with ASYMMETRIC_ENCRYPT() to\nproduce the encrypted string. algorithm indicates the encryption\nalgorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nFor a usage example, see the description of ASYMMETRIC_ENCRYPT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (14,27,'SHOW CREATE TRIGGER','Syntax:\nSHOW CREATE TRIGGER trigger_name\n\nThis statement shows the CREATE TRIGGER statement that creates the\nnamed trigger. This statement requires the TRIGGER privilege for the\ntable associated with the trigger.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-trigger.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (15,27,'SHOW CREATE PROCEDURE','Syntax:\nSHOW CREATE PROCEDURE proc_name\n\nThis statement is a MySQL extension. It returns the exact string that\ncan be used to re-create the named stored procedure. A similar\nstatement, SHOW CREATE FUNCTION, displays information about stored\nfunctions (see [HELP SHOW CREATE FUNCTION]).\n\nTo use either statement, you must be the user named in the routine\nDEFINER clause or have SELECT access to the mysql.proc table. If you do\nnot have privileges for the routine itself, the value displayed for the\nCreate Procedure or Create Function field will be NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-procedure.html\n\n','mysql> SHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n Procedure: simpleproc\n sql_mode:\n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nmysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode:\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS CHAR(50)\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (16,24,'OPEN','Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/open.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/open.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (17,31,'ST_INTERSECTS','ST_Intersects(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (18,38,'LOWER','Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT LOWER(\'QUADRATICALLY\');\n -> \'quadratically\'\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings\n(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert\nthe string to a nonbinary string:\n\nmysql> SET @str = BINARY \'New York\';\nmysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+-------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+-------------+-----------------------------------+\n| New York | new york |\n+-------------+-----------------------------------+\n\nFor collations of Unicode character sets, LOWER() and UPPER() work\naccording to the Unicode Collation Algorithm (UCA) version in the\ncollation name, if there is one, and UCA 4.0.0 if no version is\nspecified. For example, utf8_unicode_520_ci works according to UCA\n5.2.0, whereas utf8_unicode_ci works according to UCA 4.0.0. See\nhttp://dev.mysql.com/doc/refman/5.6/en/charset-unicode-sets.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (19,40,'CREATE TRIGGER','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n TRIGGER trigger_name\n trigger_time trigger_event\n ON tbl_name FOR EACH ROW\n trigger_body\n\ntrigger_time: { BEFORE | AFTER }\n\ntrigger_event: { INSERT | UPDATE | DELETE }\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. The trigger becomes associated\nwith the table named tbl_name, which must refer to a permanent table.\nYou cannot associate a trigger with a TEMPORARY table or a view.\n\nTrigger names exist in the schema namespace, meaning that all triggers\nmust have unique names within a schema. Triggers in different schemas\ncan have the same name.\n\nThis section describes CREATE TRIGGER syntax. For additional\ndiscussion, see\nhttp://dev.mysql.com/doc/refman/5.6/en/trigger-syntax.html.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated\nwith the trigger. The statement might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section. If\nbinary logging is enabled, CREATE TRIGGER might require the SUPER\nprivilege, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nThe DEFINER clause determines the security context to be used when\nchecking access privileges at trigger activation time, as described\nlater in this section.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after each row to be\nmodified.\n\ntrigger_event indicates the kind of operation that activates the\ntrigger. These trigger_event values are permitted:\n\no INSERT: The trigger activates whenever a new row is inserted into the\n table; for example, through INSERT, LOAD DATA, and REPLACE\n statements.\n\no UPDATE: The trigger activates whenever a row is modified; for\n example, through UPDATE statements.\n\no DELETE: The trigger activates whenever a row is deleted from the\n table; for example, through DELETE and REPLACE statements. DROP TABLE\n and TRUNCATE TABLE statements on the table do not activate this\n trigger, because they do not use DELETE. Dropping a partition does\n not activate DELETE triggers, either.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (20,32,'MONTH','Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 1 to 12 for January to\nDecember, or 0 for dates such as \'0000-00-00\' or \'2008-00-00\' that have\na zero month part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MONTH(\'2008-02-03\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (21,7,'ASYMMETRIC_ENCRYPT','Syntax:\nASYMMETRIC_ENCRYPT(algorithm, str, key_str)\n\nEncrypts a string using the given algorithm and key string, and returns\nthe resulting ciphertext as a binary string. If encryption fails, the\nresult is NULL.\n\nThe str length cannot be greater than the key_str length − 11, in\nbytes\n\nkey_str must be a valid key string in PEM format. algorithm indicates\nthe encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\'\n\nTo encrypt a string, pass a private or public key string to\nASYMMETRIC_ENCRYPT(). To recover the original unencrypted string, pass\nthe encrypted string to ASYMMETRIC_DECRYPT(), along with the public or\nprivate key string correponding to the private or public key string\nused for encryption.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','-- Generate private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'RSA\', 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'RSA\', @priv);\n\n-- Encrypt using private key, decrypt using public key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @priv);\nSET @cleartext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @pub);\n\n-- Encrypt using public key, decrypt using private key\nSET @ciphertext = ASYMMETRIC_ENCRYPT(\'RSA\', \'The quick brown fox\', @pub);\nSET @cleartext = ASYMMETRIC_DECRYPT(\'RSA\', @ciphertext, @priv);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (22,27,'SHOW TRIGGERS','Syntax:\nSHOW TRIGGERS\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a\ndatabase (the default database unless a FROM clause is given). This\nstatement returns results only for databases and tables for which you\nhave the TRIGGER privilege. The LIKE clause, if present, indicates\nwhich table names to match (not trigger names) and causes the statement\nto display triggers for those tables. The WHERE clause can be given to\nselect rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nFor the trigger ins_sum as defined in\nhttp://dev.mysql.com/doc/refman/5.6/en/triggers.html, the output of\nthis statement is as shown here:\n\nmysql> SHOW TRIGGERS LIKE \'acc%\'\\G\n*************************** 1. row ***************************\n Trigger: ins_sum\n Event: INSERT\n Table: account\n Statement: SET @sum = @sum + NEW.amount\n Timing: BEFORE\n Created: NULL\n sql_mode: NO_ENGINE_SUBSTITUTION\n Definer: me@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-triggers.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-triggers.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (23,13,'ISCLOSED','IsClosed(ls)\n\nST_IsClosed() and IsClosed() are synonyms. For more information, see\nthe description of ST_IsClosed().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (24,38,'REGEXP','Syntax:\nexpr REGEXP pat, expr RLIKE pat\n\nPerforms a pattern match of a string expression expr against a pattern\npat. The pattern can be an extended regular expression, the syntax for\nwhich is discussed later in this section. Returns 1 if expr matches\npat; otherwise it returns 0. If either expr or pat is NULL, the result\nis NULL. RLIKE is a synonym for REGEXP, provided for mSQL\ncompatibility.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\n*Note*:\n\nBecause MySQL uses the C escape syntax in strings (for example, \\n to\nrepresent the newline character), you must double any \\ that you use in\nyour REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/regexp.html\n\n','mysql> SELECT \'Michael!\' REGEXP \'.*\';\n -> 1\nmysql> SELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n -> 1\nmysql> SELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n -> 1 0\nmysql> SELECT \'a\' REGEXP \'^[a-d]\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/regexp.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (25,13,'ST_POINTN','ST_PointN(ls, N)\n\nReturns the N-th Point in the Linestring value ls. Points are numbered\nbeginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_PointN(ST_GeomFromText(@ls),2));\n+----------------------------------------------+\n| ST_AsText(ST_PointN(ST_GeomFromText(@ls),2)) |\n+----------------------------------------------+\n| POINT(2 2) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (26,24,'IF STATEMENT','Syntax:\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF\n\nThe IF statement for stored programs implements a basic conditional\nconstruct.\n\n*Note*:\n\nThere is also an IF() function, which differs from the IF statement\ndescribed here. See\nhttp://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html. The\nIF statement can have THEN, ELSE, and ELSEIF clauses, and it is\nterminated with END IF.\n\nIf the search_condition evaluates to true, the corresponding THEN or\nELSEIF clause statement_list executes. If no search_condition matches,\nthe ELSE clause statement_list executes.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/if.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/if.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (27,12,'VALIDATE_PASSWORD_STRENGTH','Syntax:\nVALIDATE_PASSWORD_STRENGTH(str)\n\nGiven an argument representing a cleartext password, this function\nreturns an integer to indicate how strong the password is. The return\nvalue ranges from 0 (weak) to 100 (strong).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (28,31,'WITHIN','Within(g1, g2)\n\nMBRWithin() and Within() are synonyms. For more information, see the\ndescription of MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (29,27,'SHOW PLUGINS','Syntax:\nSHOW PLUGINS\n\nSHOW PLUGINS displays information about server plugins. Plugin\ninformation is also available in the INFORMATION_SCHEMA.PLUGINS table.\nSee http://dev.mysql.com/doc/refman/5.6/en/plugins-table.html.\n\nExample of SHOW PLUGINS output:\n\nmysql> SHOW PLUGINS\\G\n*************************** 1. row ***************************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 2. row ***************************\n Name: CSV\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 3. row ***************************\n Name: MEMORY\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 4. row ***************************\n Name: MyISAM\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n...\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-plugins.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-plugins.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (30,8,'PREPARE','Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a SQL statement and assigns it a name,\nstmt_name, by which to refer to the statement later. The prepared\nstatement is executed with EXECUTE and released with DEALLOCATE\nPREPARE. For examples, see\nhttp://dev.mysql.com/doc/refman/5.6/en/sql-syntax-prepared-statements.h\ntml.\n\nStatement names are not case sensitive. preparable_stmt is either a\nstring literal or a user variable that contains the text of the SQL\nstatement. The text must represent a single statement, not multiple\nstatements. Within the statement, ? characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query\nlater when you execute it. The ? characters should not be enclosed\nwithin quotation marks, even if you intend to bind them to string\nvalues. Parameter markers can be used only where data values should\nappear, not for SQL keywords, identifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nThe scope of a prepared statement is the session within which it is\ncreated, which as several implications:\n\no A prepared statement created in one session is not available to other\n sessions.\n\no When a session ends, whether normally or abnormally, its prepared\n statements no longer exist. If auto-reconnect is enabled, the client\n is not notified that the connection was lost. For this reason,\n clients may wish to disable auto-reconnect. See\n http://dev.mysql.com/doc/refman/5.6/en/auto-reconnect.html.\n\no A prepared statement created within a stored program continues to\n exist after the program finishes executing and can be executed\n outside the program later.\n\no A statement prepared in stored program context cannot refer to stored\n procedure or function parameters or local variables because they go\n out of scope when the program ends and would be unavailable were the\n statement to be executed later outside the program. As a workaround,\n refer instead to user-defined variables, which also have session\n scope; see\n http://dev.mysql.com/doc/refman/5.6/en/user-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/prepare.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (31,8,'LOCK','Syntax:\nLOCK TABLES\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n\nlock_type:\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n\nUNLOCK TABLES\n\nMySQL enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to\nprevent other sessions from modifying tables during periods when a\nsession requires exclusive access to them. A session can acquire or\nrelease locks only for itself. One session cannot acquire locks for\nanother session or release locks held by another session.\n\nLocks may be used to emulate transactions or to get more speed when\nupdating tables. This is explained in more detail later in this\nsection.\n\nLOCK TABLES explicitly acquires table locks for the current client\nsession. Table locks can be acquired for base tables or views. You must\nhave the LOCK TABLES privilege, and the SELECT privilege for each\nobject to be locked.\n\nFor view locking, LOCK TABLES adds all base tables used in the view to\nthe set of tables to be locked and locks them automatically. If you\nlock a table explicitly with LOCK TABLES, any tables used in triggers\nare also locked implicitly, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/lock-tables-and-triggers.html.\n\nUNLOCK TABLES explicitly releases any table locks held by the current\nsession. LOCK TABLES implicitly releases any table locks held by the\ncurrent session before acquiring new locks.\n\nAnother use for UNLOCK TABLES is to release the global read lock\nacquired with the FLUSH TABLES WITH READ LOCK statement, which enables\nyou to lock all tables in all databases. See [HELP FLUSH]. (This is a\nvery convenient way to get backups if you have a file system such as\nVeritas that can take snapshots in time.)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/lock-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/lock-tables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (32,27,'SHOW BINARY LOGS','Syntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [HELP PURGE BINARY LOGS], that shows\nhow to determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-binary-logs.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-binary-logs.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (33,25,'POLYGON','Polygon(ls1, ls2, ...)\n\nConstructs a Polygon value from a number of LineString or WKB\nLineString arguments. If any argument does not represent a LinearRing\n(that is, not a closed and simple LineString), the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (34,32,'MINUTE','Syntax:\nMINUTE(time)\n\nReturns the minute for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MINUTE(\'2008-02-03 10:05:03\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (35,38,'MID','Syntax:\nMID(str,pos,len)\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (36,17,'CONNECTION_ID','Syntax:\nCONNECTION_ID()\n\nReturns the connection ID (thread ID) for the connection. Every\nconnection has an ID that is unique among the set of currently\nconnected clients.\n\nThe value returned by CONNECTION_ID() is the same type of value as\ndisplayed in the ID column of the INFORMATION_SCHEMA.PROCESSLIST table,\nthe Id column of SHOW PROCESSLIST output, and the PROCESSLIST_ID column\nof the Performance Schema threads table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT CONNECTION_ID();\n -> 23786\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (37,28,'DELETE','Syntax:\nDELETE is a DML statement that removes rows from a table.\n\nSingle-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name\n [PARTITION (partition_name,...)]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nThe DELETE statement deletes rows from tbl_name and returns the number\nof deleted rows. To check the number of deleted rows, call the\nROW_COUNT() function described in\nhttp://dev.mysql.com/doc/refman/5.6/en/information-functions.html.\n\nMain Clauses\n\nThe conditions in the optional WHERE clause identify which rows to\ndelete. With no WHERE clause, all rows are deleted.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe deleted. It is specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nIf the ORDER BY clause is specified, the rows are deleted in the order\nthat is specified. The LIMIT clause places a limit on the number of\nrows that can be deleted. These clauses apply to single-table deletes,\nbut not multi-table deletes.\n\nMultiple-Table Syntax\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n\nPrivileges\n\nYou need the DELETE privilege on a table to delete rows from it. You\nneed only the SELECT privilege for any columns that are only read, such\nas those named in the WHERE clause.\n\nPerformance\n\nWhen you do not need to know the number of deleted rows, the TRUNCATE\nTABLE statement is a faster way to empty a table than a DELETE\nstatement with no WHERE clause. Unlike DELETE, TRUNCATE TABLE cannot be\nused within a transaction or if you have a lock on the table. See [HELP\nTRUNCATE TABLE] and [HELP LOCK].\n\nThe speed of delete operations may also be affected by factors\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/delete-optimization.html.\n\nTo ensure that a given DELETE statement does not take too much time,\nthe MySQL-specific LIMIT row_count clause for DELETE specifies the\nmaximum number of rows to be deleted. If the number of rows to delete\nis larger than the limit, repeat the DELETE statement until the number\nof affected rows is less than the LIMIT value.\n\nSubqueries\n\nYou cannot delete from a table and select from the same table in a\nsubquery.\n\nPartitioned Tables\n\nLOAD DATA supports explicit partition selection using the PARTITION\noption, which takes a comma-separated list of the names of one or more\npartitions or subpartitions (or both) from which to select rows to be\ndropped. Partitions not included in the list are ignored. Given a\npartitioned table t with a partition named p0, executing the statement\nDELETE FROM t PARTITION (p0) has the same effect on the table as\nexecuting ALTER TABLE t TRUNCATE PARTITION (p0); in both cases, all\nrows in partition p0 are dropped.\n\nPARTITION can be used along with a WHERE condition, in which case the\ncondition is tested only on rows in the listed partitions. For example,\nDELETE FROM t PARTITION (p0) WHERE c < 5 deletes rows only from\npartition p0 for which the condition c < 5 is true; rows in any other\npartitions are not checked and thus not affected by the DELETE.\n\nThe PARTITION option can also be used in multiple-table DELETE\nstatements. You can use up to one such option per table named in the\nFROM option.\n\nSee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html,\nfor more information and examples.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/delete.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/delete.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (38,24,'CLOSE','Syntax:\nCLOSE cursor_name\n\nThis statement closes a previously opened cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nAn error occurs if the cursor is not open.\n\nIf not closed explicitly, a cursor is closed at the end of the BEGIN\n... END block in which it was declared.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/close.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/close.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (39,38,'REPLACE FUNCTION','Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REPLACE(\'www.mysql.com\', \'w\', \'Ww\');\n -> \'WwWwWw.mysql.com\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (40,29,'USE','Syntax:\nUSE db_name\n\nThe USE db_name statement tells MySQL to use the db_name database as\nthe default (current) database for subsequent statements. The database\nremains the default until the end of the session or another USE\nstatement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable; # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable; # selects from db2.mytable\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/use.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/use.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (41,6,'CASE OPERATOR','Syntax:\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nThe first CASE syntax returns the result for the first\nvalue=compare_value comparison that is true. The second syntax returns\nthe result for the first condition that is true. If no comparison or\ncondition is true, the result after ELSE is returned, or NULL if there\nis no ELSE part.\n\n*Note*:\n\nThe syntax of the CASE expression described here differs slightly from\nthat of the SQL CASE statement described in [HELP CASE statement], for\nuse inside stored programs. The CASE statement cannot have an ELSE NULL\nclause, and it is terminated with END CASE instead of END.\n\nThe return type of a CASE expression result is the aggregated type of\nall result values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT CASE 1 WHEN 1 THEN \'one\'\n -> WHEN 2 THEN \'two\' ELSE \'more\' END;\n -> \'one\'\nmysql> SELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n -> \'true\'\nmysql> SELECT CASE BINARY \'B\'\n -> WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (42,27,'SHOW MASTER STATUS','Syntax:\nSHOW MASTER STATUS\n\nThis statement provides status information about the binary log files\nof the master. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nExample:\n\nmysql> SHOW MASTER STATUS\\G\n*************************** 1. row ***************************\n File: master-bin.000002\n Position: 1307\n Binlog_Do_DB: test\n Binlog_Ignore_DB: manual, mysql\nExecuted_Gtid_Set: 3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-master-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-master-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (43,32,'TO_SECONDS','Syntax:\nTO_SECONDS(expr)\n\nGiven a date or datetime expr, returns a the number of seconds since\nthe year 0. If expr is not a valid date or datetime value, returns\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TO_SECONDS(950501);\n -> 62966505600\nmysql> SELECT TO_SECONDS(\'2009-11-29\');\n -> 63426672000\nmysql> SELECT TO_SECONDS(\'2009-11-29 13:43:32\');\n -> 63426721412\nmysql> SELECT TO_SECONDS( NOW() );\n -> 63426721458\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (44,32,'TIMESTAMPDIFF','Syntax:\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nReturns datetime_expr2 − datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be\na date and the other a datetime; a date value is treated as a datetime\nhaving the time part \'00:00:00\' where necessary. The unit for the\nresult (an integer) is given by the unit argument. The legal values for\nunit are the same as those listed in the description of the\nTIMESTAMPADD() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n -> 3\nmysql> SELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n -> -1\nmysql> SELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n -> 128885\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (45,35,'SPATIAL','For MyISAM tables, MySQL can create spatial indexes using syntax\nsimilar to that for creating regular indexes, but using the SPATIAL\nkeyword. Columns in spatial indexes must be declared NOT NULL. The\nfollowing examples demonstrate how to create spatial indexes:\n\no With CREATE TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g)) ENGINE=MyISAM;\n\no With ALTER TABLE:\n\nALTER TABLE geom ADD SPATIAL INDEX(g);\n\no With CREATE INDEX:\n\nCREATE SPATIAL INDEX sp_index ON geom (g);\n\nSPATIAL INDEX creates an R-tree index. For storage engines that support\nnonspatial indexing of spatial columns, the engine creates a B-tree\nindex. A B-tree index on spatial values is useful for exact-value\nlookups, but not for range scans.\n\nFor more information on indexing spatial columns, see [HELP CREATE\nINDEX].\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\no With ALTER TABLE:\n\nALTER TABLE geom DROP INDEX g;\n\no With DROP INDEX:\n\nDROP INDEX sp_index ON geom;\n\nExample: Suppose that a table geom contains more than 32,000\ngeometries, which are stored in the column g of type GEOMETRY. The\ntable also has an AUTO_INCREMENT column fid for storing object ID\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-indexes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-indexes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (46,38,'REVERSE','Syntax:\nREVERSE(str)\n\nReturns the string str with the order of the characters reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REVERSE(\'abc\');\n -> \'cba\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (47,20,'ISNULL','Syntax:\nISNULL(expr)\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT ISNULL(1+1);\n -> 0\nmysql> SELECT ISNULL(1/0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (48,13,'ST_STARTPOINT','ST_StartPoint(ls)\n\nReturns the Point that is the start point of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_StartPoint(ST_GeomFromText(@ls)));\n+------------------------------------------------+\n| ST_AsText(ST_StartPoint(ST_GeomFromText(@ls))) |\n+------------------------------------------------+\n| POINT(1 1) |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (49,23,'BINARY','BINARY(M)\n\nThe BINARY type is similar to the CHAR type, but stores binary byte\nstrings rather than nonbinary character strings. M represents the\ncolumn length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (50,23,'BLOB DATA TYPE','A BLOB is a binary large object that can hold a variable amount of\ndata. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.\nThese differ only in the maximum length of the values they can hold.\nThe four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These\ncorrespond to the four BLOB types and have the same maximum lengths and\nstorage requirements. See\nhttp://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/blob.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/blob.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (51,17,'CURRENT_USER','Syntax:\nCURRENT_USER, CURRENT_USER()\n\nReturns the user name and host name combination for the MySQL account\nthat the server used to authenticate the current client. This account\ndetermines your access privileges. The return value is a string in the\nutf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\nmysql> SELECT * FROM mysql.user;\nERROR 1044: Access denied for user \'\'@\'localhost\' to\ndatabase \'mysql\'\nmysql> SELECT CURRENT_USER();\n -> \'@localhost\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (52,20,'<=','Syntax:\n<=\n\nLess than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 0.1 <= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (53,27,'SHOW PROFILES','Syntax:\nSHOW PROFILES\n\nThe SHOW PROFILES statement, together with SHOW PROFILE, displays\nprofiling information that indicates resource usage for statements\nexecuted during the course of the current session. For more\ninformation, see [HELP SHOW PROFILE].\n\n*Note*:\n\nThese statements are deprecated as of MySQL 5.6.7 and will be removed\nin a future MySQL release. Use the Performance Schema instead; see\nhttp://dev.mysql.com/doc/refman/5.6/en/performance-schema.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-profiles.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-profiles.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (54,28,'UPDATE','Syntax:\nUPDATE is a DML statement that modifies rows in a table.\n\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n\nFor the single-table syntax, the UPDATE statement updates columns of\nexisting rows in the named table with new values. The SET clause\nindicates which columns to modify and the values they should be given.\nEach value can be given as an expression, or the keyword DEFAULT to set\na column explicitly to its default value. The WHERE clause, if given,\nspecifies the conditions that identify which rows to update. With no\nWHERE clause, all rows are updated. If the ORDER BY clause is\nspecified, the rows are updated in the order that is specified. The\nLIMIT clause places a limit on the number of rows that can be updated.\n\nFor the multiple-table syntax, UPDATE updates rows in each table named\nin table_references that satisfy the conditions. Each matching row is\nupdated once, even if it matches the conditions multiple times. For\nmultiple-table syntax, ORDER BY and LIMIT cannot be used.\n\nFor partitioned tables, both the single-single and multiple-table forms\nof this statement support the use of a PARTITION option as part of a\ntable reference. This option takes a list of one or more partitions or\nsubpartitions (or both). Only the partitions (or subpartitions) listed\nare checked for matches, and a row that is not in any of these\npartitions or subpartitions is not updated, whether it satisfies the\nwhere_condition or not.\n\n*Note*:\n\nUnlike the case when using PARTITION with an INSERT or REPLACE\nstatement, an otherwise valid UPDATE ... PARTITION statement is\nconsidered successful even if no rows in the listed partitions (or\nsubpartitions) match the where_condition.\n\nSee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html,\nfor more information and examples.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe updated. For expression syntax, see\nhttp://dev.mysql.com/doc/refman/5.6/en/expressions.html.\n\ntable_references and where_condition are specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE\nthat are actually updated. You need only the SELECT privilege for any\ncolumns that are read but not modified.\n\nThe UPDATE statement supports the following modifiers:\n\no With the LOW_PRIORITY modifier, execution of the UPDATE is delayed\n until no other clients are reading from the table. This affects only\n storage engines that use only table-level locking (such as MyISAM,\n MEMORY, and MERGE).\n\no With the IGNORE modifier, the update statement does not abort even if\n errors occur during the update. Rows for which duplicate-key\n conflicts occur on a unique key value are not updated. Rows updated\n to values that would cause data conversion errors are updated to the\n closest valid values instead.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/update.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/update.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (55,24,'CASE STATEMENT','Syntax:\nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct.\n\n*Note*:\n\nThere is also a CASE expression, which differs from the CASE statement\ndescribed here. See\nhttp://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated\nwith END CASE instead of END.\n\nFor the first syntax, case_value is an expression. This value is\ncompared to the when_value expression in each WHEN clause until one of\nthem is equal. When an equal when_value is found, the corresponding\nTHEN clause statement_list executes. If no when_value is equal, the\nELSE clause statement_list executes, if there is one.\n\nThis syntax cannot be used to test for equality with NULL because NULL\n= NULL is false. See\nhttp://dev.mysql.com/doc/refman/5.6/en/working-with-null.html.\n\nFor the second syntax, each WHEN clause search_condition expression is\nevaluated until one is true, at which point its corresponding THEN\nclause statement_list executes. If no search_condition is equal, the\nELSE clause statement_list executes, if there is one.\n\nIf no when_value or search_condition matches the value tested and the\nCASE statement contains no ELSE clause, a Case not found for CASE\nstatement error results.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nTo handle situations where no value is matched by any WHEN clause, use\nan ELSE containing an empty BEGIN ... END block, as shown in this\nexample. (The indentation used here in the ELSE clause is for purposes\nof clarity only, and is not otherwise significant.)\n\nDELIMITER |\n\nCREATE PROCEDURE p()\n BEGIN\n DECLARE v INT DEFAULT 1;\n\n CASE v\n WHEN 2 THEN SELECT v;\n WHEN 3 THEN SELECT 0;\n ELSE\n BEGIN\n END;\n END CASE;\n END;\n |\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/case.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/case.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (56,8,'EXECUTE STATEMENT','Syntax:\nEXECUTE stmt_name\n [USING @var_name [, @var_name] ...]\n\nAfter preparing a statement with PREPARE, you execute it with an\nEXECUTE statement that refers to the prepared statement name. If the\nprepared statement contains any parameter markers, you must supply a\nUSING clause that lists user variables containing the values to be\nbound to the parameters. Parameter values can be supplied only by user\nvariables, and the USING clause must name exactly as many variables as\nthe number of parameter markers in the statement.\n\nYou can execute a given prepared statement multiple times, passing\ndifferent variables to it or setting the variables to different values\nbefore each execution.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/execute.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/execute.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (57,40,'DROP INDEX','Syntax:\nDROP INDEX [ONLINE|OFFLINE] index_name ON tbl_name\n [algorithm_option | lock_option] ...\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDROP INDEX drops the index named index_name from the table tbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop the index.\nSee [HELP ALTER TABLE].\n\nTo drop a primary key, the index name is always PRIMARY, which must be\nspecified as a quoted identifier because PRIMARY is a reserved word:\n\nDROP INDEX `PRIMARY` ON t;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (58,3,'ABS','Syntax:\nABS(X)\n\nReturns the absolute value of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ABS(2);\n -> 2\nmysql> SELECT ABS(-32);\n -> 32\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (59,14,'IS_IPV4','Syntax:\nIS_IPV4(expr)\n\nReturns 1 if the argument is a valid IPv4 address specified as a\nstring, 0 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4(\'10.0.5.9\'), IS_IPV4(\'10.0.5.256\');\n -> 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (60,33,'POLYFROMWKB','PolyFromWKB(wkb[, srid]), PolygonFromWKB(wkb[, srid])\n\nST_PolyFromWKB(), ST_PolygonFromWKB(), PolyFromWKB(), and\nPolygonFromWKB() are synonyms. For more information, see the\ndescription of ST_PolyFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (61,38,'NOT LIKE','Syntax:\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (62,38,'SPACE','Syntax:\nSPACE(N)\n\nReturns a string consisting of N space characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SPACE(6);\n -> \' \'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (63,16,'MAX','Syntax:\nMAX([DISTINCT] expr)\n\nReturns the maximum value of expr. MAX() may take a string argument; in\nsuch cases, it returns the maximum string value. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nIf there are no matching rows, MAX() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (64,22,'CREATE FUNCTION UDF','Syntax:\nCREATE [AGGREGATE] FUNCTION function_name RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n\nA user-defined function (UDF) is a way to extend MySQL with a new\nfunction that works like a native (built-in) MySQL function such as\nABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to\ninvoke the function. The RETURNS clause indicates the type of the\nfunction\'s return value. DECIMAL is a legal value after RETURNS, but\ncurrently DECIMAL functions return string values and should be written\nlike STRING functions.\n\nshared_library_name is the base name of the shared library file that\ncontains the code that implements the function. The file must be\nlocated in the plugin directory. This directory is given by the value\nof the plugin_dir system variable. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/udf-compiling.html.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary because CREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and\nshared library name. If you do not have this table, you should run the\nmysql_upgrade command to create it. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-upgrade.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-function-udf.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (65,23,'TIMESTAMP','TIMESTAMP[(fsp)]\n\nA timestamp. The range is \'1970-01-01 00:00:01.000000\' UTC to\n\'2038-01-19 03:14:07.999999\' UTC. TIMESTAMP values are stored as the\nnumber of seconds since the epoch (\'1970-01-01 00:00:00\' UTC). A\nTIMESTAMP cannot represent the value \'1970-01-01 00:00:00\' because that\nis equivalent to 0 seconds from the epoch and the value 0 is reserved\nfor representing \'0000-00-00 00:00:00\', the "zero" TIMESTAMP value.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nThe way the server handles TIMESTAMP definitions depends on the value\nof the explicit_defaults_for_timestamp system variable (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html).\nBy default, explicit_defaults_for_timestamp is disabled and the server\nhandles TIMESTAMP as follows:\n\nUnless specified otherwise, the first TIMESTAMP column in a table is\ndefined to be automatically set to the date and time of the most recent\nmodification if not explicitly assigned a value. This makes TIMESTAMP\nuseful for recording the timestamp of an INSERT or UPDATE operation.\nYou can also set any TIMESTAMP column to the current date and time by\nassigning it a NULL value, unless it has been defined with the NULL\nattribute to permit NULL values.\n\nAutomatic initialization and updating to the current date and time can\nbe specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE\nCURRENT_TIMESTAMP column definition clauses. By default, the first\nTIMESTAMP column has these properties, as previously noted. As of MySQL\n5.6.5, any TIMESTAMP column in a table can be defined to have these\nproperties. Before 5.6.5, at most one TIMESTAMP column per table can\nhave them, but it is possible to suppress them for the first column and\ninstead assign them to a different TIMESTAMP column. See\nhttp://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html.\n\nIf explicit_defaults_for_timestamp is enabled, there is no automatic\nassignment of the DEFAULT CURRENT_TIMESTAMP or ON UPDATE\nCURRENT_TIMESTAMP attributes to any TIMESTAMP column. They must be\nincluded explicitly in the column definition. Also, any TIMESTAMP not\nexplicitly declared as NOT NULL permits NULL values.\n\nexplicit_defaults_for_timestamp is available as of MySQL 5.6.6. Before\n5.6.6, the server handles TIMESTAMP as discussed for\nexplicit_defaults_for_timestamp disabled. Those behaviors, while they\nremain the default, are nonstandard and are deprecated as of 5.6.6. For\ndiscussion regarding upgrading to an installation with\nexplicit_defaults_for_timestamp enabled, see\nhttp://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.h\ntml.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (66,7,'CREATE_ASYMMETRIC_PUB_KEY','Syntax:\nCREATE_ASYMMETRIC_PUB_KEY(algorithm, priv_key_str)\n\nDerives a public key from the given private key using the given\nalgorithm, and returns the key as a binary string in PEM format. If key\nderivation fails, the result is NULL.\n\npriv_key_str must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nFor a usage example, see the description of\nCREATE_ASYMMETRIC_PRIV_KEY().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (67,27,'CACHE INDEX','Syntax:\nCACHE INDEX\n tbl_index_list [, tbl_index_list] ...\n [PARTITION (partition_list | ALL)]\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables. After the indexes have been\nassigned, they can be preloaded into the cache if desired with LOAD\nINDEX INTO CACHE.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table | Op | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status | OK |\n| test.t2 | assign_to_keycache | status | OK |\n| test.t3 | assign_to_keycache | status | OK |\n+---------+--------------------+----------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cache-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (68,12,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n -> 15\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (69,28,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for InnoDB and MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/handler.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (70,9,'HELP_DATE','This help information was generated from the MySQL 5.6 Reference Manual\non: 2017-06-02\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (71,40,'RENAME TABLE','Syntax:\nRENAME TABLE tbl_name TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nThis statement renames one or more tables. The rename operation is done\natomically, which means that no other session can access any of the\ntables while the rename is running.\n\nFor example, a table named old_table can be renamed to new_table as\nshown here:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/rename-table.html\n\n','RENAME TABLE old_table TO new_table;\n','http://dev.mysql.com/doc/refman/5.6/en/rename-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (72,23,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (73,3,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n -> 4\nmysql> SELECT 253 % 7;\n -> 1\nmysql> SELECT MOD(29,9);\n -> 2\nmysql> SELECT 29 MOD 9;\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (74,37,'ST_GEOMETRYTYPE','ST_GeometryType(g)\n\nReturns a binary string indicating the name of the geometry type of\nwhich the geometry instance g is a member, or NULL if the argument is\nNULL. The name corresponds to one of the instantiable Geometry\nsubclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_GeometryType(ST_GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------------+\n| ST_GeometryType(ST_GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------------+\n| POINT |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (75,29,'HELP STATEMENT','Syntax:\nHELP \'search_string\'\n\nThe HELP statement returns online information from the MySQL Reference\nmanual. Its proper operation requires that the help tables in the mysql\ndatabase be initialized with help topic information (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-side-help-support.html).\n\nThe HELP statement searches the help tables for the given search string\nand displays the result of the search. The search string is not case\nsensitive.\n\nThe search string can contain the wildcard characters % and _. These\nhave the same meaning as for pattern-matching operations performed with\nthe LIKE operator. For example, HELP \'rep%\' returns a list of topics\nthat begin with rep.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/help.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/help.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (76,38,'UCASE','Syntax:\nUCASE(str)\n\nUCASE() is a synonym for UPPER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (77,27,'SHOW BINLOG EVENTS','Syntax:\nSHOW BINLOG EVENTS\n [IN \'log_name\']\n [FROM pos]\n [LIMIT [offset,] row_count]\n\nShows the events in the binary log. If you do not specify \'log_name\',\nthe first binary log is displayed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-binlog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-binlog-events.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (78,33,'MPOLYFROMWKB','MPolyFromWKB(wkb[, srid]), MultiPolygonFromWKB(wkb[, srid])\n\nConstructs a MultiPolygon value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (79,24,'ITERATE','Syntax:\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements.\nITERATE means "start the loop again."\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/iterate.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/iterate.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (80,28,'DO','Syntax:\nDO expr [, expr] ...\n\nDO executes the expressions but does not return any results. In most\nrespects, DO is shorthand for SELECT expr, ..., but has the advantage\nthat it is slightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nExample: This SELECT statement pauses, but also produces a result set:\n\nmysql> SELECT SLEEP(5);\n+----------+\n| SLEEP(5) |\n+----------+\n| 0 |\n+----------+\n1 row in set (5.02 sec)\n\nDO, on the other hand, pauses without producing a result set.:\n\nmysql> DO SLEEP(5);\nQuery OK, 0 rows affected (4.99 sec)\n\nThis could be useful, for example in a stored function or trigger,\nwhich prohibit statements that produce result sets.\n\nDO only executes expressions. It cannot be used in all cases where\nSELECT can be used. For example, DO id FROM t1 is invalid because it\nreferences a table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/do.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/do.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (81,38,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmultibyte character counts as a single character. This means that for a\nstring containing five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (82,23,'DATE','DATE\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MySQL\ndisplays DATE values in \'YYYY-MM-DD\' format, but permits assignment of\nvalues to DATE columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (83,33,'ST_ASTEXT','ST_AsText(g), ST_AsWKT(g)\n\nConverts a value in internal geometry format to its WKT representation\nand returns the string result.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html\n\n','mysql> SET @g = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_GeomFromText(@g));\n+--------------------------------+\n| ST_AsText(ST_GeomFromText(@g)) |\n+--------------------------------+\n| LINESTRING(1 1,2 2,3 3) |\n+--------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (84,38,'EXTRACTVALUE','Syntax:\nExtractValue(xml_frag, xpath_expr)\n\nExtractValue() takes two string arguments, a fragment of XML markup\nxml_frag and an XPath expression xpath_expr (also known as a locator);\nit returns the text (CDATA) of the first text node which is a child of\nthe elements or elements matched by the XPath expression. In MySQL\n5.6.6 and earlier, the XPath expression could contain at most 127\ncharacters. This limitation was lifted in MySQL 5.6.7. (Bug #13007062,\nBug#62429)\n\nUsing this function is the equivalent of performing a match using the\nxpath_expr after appending /text(). In other words,\nExtractValue(\'Sakila\', \'/a/b\') and\nExtractValue(\'Sakila\', \'/a/b/text()\') produce the same\nresult.\n\nIf multiple matches are found, the content of the first child text node\nof each matching element is returned (in the order matched) as a\nsingle, space-delimited string.\n\nIf no matching text node is found for the expression (including the\nimplicit /text())---for whatever reason, as long as xpath_expr is\nvalid, and xml_frag consists of elements which are properly nested and\nclosed---an empty string is returned. No distinction is made between a\nmatch on an empty element and no match at all. This is by design.\n\nIf you need to determine whether no matching element was found in\nxml_frag or such an element was found but contained no child text\nnodes, you should test the result of an expression that uses the XPath\ncount() function. For example, both of these statements return an empty\nstring, as shown here:\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\n*Note*:\n\nIn MySQL 5.6.28 and MySQL 5.6.29, when ExtractValue() failed to find a\nmatch for the supplied expression, it returned NULL. This issue was\nresolved in MySQL 5.6.30. (Bug #22552615)\n\nHowever, you can determine whether there was actually a matching\nelement using the following:\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 1 |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n1 row in set (0.01 sec)\n\n*Important*:\n\nExtractValue() returns only CDATA, and does not return any tags that\nmight be contained within a matching tag, nor any of their content (see\nthe result returned as val1 in the following example).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html\n\n','mysql> SELECT\n -> ExtractValue(\'cccddd\', \'/a\') AS val1,\n -> ExtractValue(\'cccddd\', \'/a/b\') AS val2,\n -> ExtractValue(\'cccddd\', \'//b\') AS val3,\n -> ExtractValue(\'cccddd\', \'/b\') AS val4,\n -> ExtractValue(\'cccdddeee\', \'//b\') AS val5;\n\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n','http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (85,12,'OLD_PASSWORD','Syntax:\nOLD_PASSWORD(str)\n\nOLD_PASSWORD() was added when the implementation of PASSWORD() was\nchanged in MySQL 4.1 to improve security. OLD_PASSWORD() returns the\nvalue of the pre-4.1 implementation of PASSWORD() as a string, and is\nintended to permit you to reset passwords for any pre-4.1 clients that\nneed to connect to your MySQL server without locking them out. See\nhttp://dev.mysql.com/doc/refman/5.6/en/password-hashing.html.\n\nThe return value is a nonbinary string in the connection character set.\n\n*Note*:\n\nPasswords that use the pre-4.1 hashing method are less secure than\npasswords that use the native password hashing method and should be\navoided. Pre-4.1 passwords are deprecated and support for them will be\nremoved in a future MySQL release. Consequently, OLD_PASSWORD() is also\ndeprecated.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (86,38,'FORMAT','Syntax:\nFORMAT(X,D[,locale])\n\nFormats the number X to a format like \'#,###,###.##\', rounded to D\ndecimal places, and returns the result as a string. If D is 0, the\nresult has no decimal point or fractional part.\n\nThe optional third parameter enables a locale to be specified to be\nused for the result number\'s decimal point, thousands separator, and\ngrouping between separators. Permissible locale values are the same as\nthe legal values for the lc_time_names system variable (see\nhttp://dev.mysql.com/doc/refman/5.6/en/locale-support.html). If no\nlocale is specified, the default is \'en_US\'.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FORMAT(12332.123456, 4);\n -> \'12,332.1235\'\nmysql> SELECT FORMAT(12332.1,4);\n -> \'12,332.1000\'\nmysql> SELECT FORMAT(12332.2,0);\n -> \'12,332\'\nmysql> SELECT FORMAT(12332.2,2,\'de_DE\');\n -> \'12.332,20\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (87,38,'BIT_LENGTH','Syntax:\nBIT_LENGTH(str)\n\nReturns the length of the string str in bits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT BIT_LENGTH(\'text\');\n -> 32\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (88,2,'EXTERIORRING','ExteriorRing(poly)\n\nST_ExteriorRing() and ExteriorRing() are synonyms. For more\ninformation, see the description of ST_ExteriorRing().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (89,33,'GEOMFROMWKB','GeomFromWKB(wkb[, srid]), GeometryFromWKB(wkb[, srid])\n\nST_GeomFromWKB(), ST_GeometryFromWKB(), GeomFromWKB(), and\nGeometryFromWKB() are synonyms. For more information, see the\ndescription of ST_GeomFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (90,20,'BETWEEN AND','Syntax:\nexpr BETWEEN min AND max\n\nIf expr is greater than or equal to min and expr is less than or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is equivalent\nto the expression (min <= expr AND expr <= max) if all the arguments\nare of the same type. Otherwise type conversion takes place according\nto the rules described in\nhttp://dev.mysql.com/doc/refman/5.6/en/type-conversion.html, but\napplied to all the three arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1;\n -> 1, 0\nmysql> SELECT 1 BETWEEN 2 AND 3;\n -> 0\nmysql> SELECT \'b\' BETWEEN \'a\' AND \'c\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'3\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'x-3\';\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (91,25,'MULTIPOLYGON','MultiPolygon(poly1, poly2, ...)\n\nConstructs a MultiPolygon value from a set of Polygon or WKB Polygon\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (92,38,'LEFT','Syntax:\nLEFT(str,len)\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LEFT(\'foobarbar\', 5);\n -> \'fooba\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (93,13,'ST_ISCLOSED','ST_IsClosed(ls)\n\nFor a LineString value ls, ST_IsClosed() returns 1 if ls is closed\n(that is, its ST_StartPoint() and ST_EndPoint() values are the same).\n\nFor a MultiLineString value ls, ST_IsClosed() returns 1 if ls is closed\n(that is, the ST_StartPoint() and ST_EndPoint() values are the same for\neach LineString in ls).\n\nST_IsClosed() returns 0 if ls is not closed, and NULL if ls is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls1 = \'LineString(1 1,2 2,3 3,2 2)\';\nmysql> SET @ls2 = \'LineString(1 1,2 2,3 3,1 1)\';\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls1));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls1)) |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls2));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls2)) |\n+------------------------------------+\n| 1 |\n+------------------------------------+\n\nmysql> SET @ls3 = \'MultiLineString((1 1,2 2,3 3),(4 4,5 5))\';\n\nmysql> SELECT ST_IsClosed(ST_GeomFromText(@ls3));\n+------------------------------------+\n| ST_IsClosed(ST_GeomFromText(@ls3)) |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (94,27,'FLUSH QUERY CACHE','You can defragment the query cache to better utilize its memory with\nthe FLUSH QUERY CACHE statement. The statement does not remove any\nqueries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the\nquery cache. The FLUSH TABLES statement also does this.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/query-cache-status-and-maintenance.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/query-cache-status-and-maintenance.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (95,23,'SET DATA TYPE','SET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA set. A string object that can have zero or more values, each of which\nmust be chosen from the list of values \'value1\', \'value2\', ... SET\nvalues are represented internally as integers.\n\nA SET column can have a maximum of 64 distinct members. A table can\nhave no more than 255 unique element list definitions among its ENUM\nand SET columns considered as a group. For more information on this\nlimit, see http://dev.mysql.com/doc/refman/5.6/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (96,3,'RAND','Syntax:\nRAND([N])\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. To\nobtain a random integer R in the range i <= R < j, use the expression\nFLOOR(i + RAND() * (j − i)). For example, to obtain a random integer\nin the range the range 7 <= R < 12, use the following statement:\n\nSELECT FLOOR(7 + (RAND() * 5));\n\nIf an integer argument N is specified, it is used as the seed value:\n\no With a constant initializer argument, the seed is initialized once\n when the statement is prepared, prior to execution.\n\no With a nonconstant initializer argument (such as a column name), the\n seed is initialized with the value for each invocation of RAND().\n\nOne implication of this behavior is that for equal argument values,\nRAND(N) returns the same value each time, and thus produces a\nrepeatable sequence of column values. In the following example, the\nsequence of values produced by RAND(3) is the same both places it\noccurs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.61914388706828 |\n| 2 | 0.93845168309142 |\n| 3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.35877890638893 |\n| 2 | 0.28941420772058 |\n| 3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (97,38,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (98,23,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (99,38,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nELT() returns the Nth element of the list of strings: str1 if N = 1,\nstr2 if N = 2, and so on. Returns NULL if N is less than 1 or greater\nthan the number of arguments. ELT() is the complement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'ej\'\nmysql> SELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'foo\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (100,40,'ALTER VIEW','Syntax:\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW and the effect is the same as\nfor CREATE OR REPLACE VIEW. See [HELP CREATE VIEW]. This statement\nrequires the CREATE VIEW and DROP privileges for the view, and some\nprivilege for each column referred to in the SELECT statement. ALTER\nVIEW is permitted only to the definer or users with the SUPER\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (101,27,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-databases.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (102,32,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n -> 3938\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (103,38,'LOCATE','Syntax:\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nThe first syntax returns the position of the first occurrence of\nsubstring substr in string str. The second syntax returns the position\nof the first occurrence of substring substr in string str, starting at\nposition pos. Returns 0 if substr is not in str. Returns NULL if substr\nor str is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LOCATE(\'bar\', \'foobarbar\');\n -> 4\nmysql> SELECT LOCATE(\'xbar\', \'foobar\');\n -> 0\nmysql> SELECT LOCATE(\'bar\', \'foobarbar\', 5);\n -> 7\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (104,27,'SHOW EVENTS','Syntax:\nSHOW EVENTS\n [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement displays information about Event Manager events. It\nrequires the EVENT privilege for the database from which the events are\nto be shown.\n\nIn its simplest form, SHOW EVENTS lists all of the events in the\ncurrent schema:\n\nmysql> SELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n1 row in set (0.00 sec)\n\nmysql> SHOW EVENTS\\G\n*************************** 1. row ***************************\n Db: myschema\n Name: e_daily\n Definer: jon@ghidora\n Time zone: SYSTEM\n Type: RECURRING\n Execute at: NULL\n Interval value: 10\n Interval field: SECOND\n Starts: 2006-02-09 10:41:23\n Ends: NULL\n Status: ENABLED\n Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nTo see events for a specific schema, use the FROM clause. For example,\nto see events for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-events.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (105,23,'LONGTEXT','LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 − 1)\ncharacters. The effective maximum length is less if the value contains\nmultibyte characters. The effective maximum length of LONGTEXT columns\nalso depends on the configured maximum packet size in the client/server\nprotocol and available memory. Each LONGTEXT value is stored using a\n4-byte length prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (106,27,'KILL','Syntax:\nKILL [CONNECTION | QUERY] processlist_id\n\nEach connection to mysqld runs in a separate thread. You can kill a\nthread with the KILL processlist_id statement.\n\nThread processlist identifiers can be determined from the ID column of\nthe INFORMATION_SCHEMA.PROCESSLIST table, the Id column of SHOW\nPROCESSLIST output, and the PROCESSLIST_ID column of the Performance\nSchema threads table. The value for the current thread is returned by\nthe CONNECTION_ID() function.\n\nKILL permits an optional CONNECTION or QUERY modifier:\n\no KILL CONNECTION is the same as KILL with no modifier: It terminates\n the connection associated with the given processlist_id, after\n terminating any statement the connection is executing.\n\no KILL QUERY terminates the statement the connection is currently\n executing, but leaves the connection itself intact.\n\nIf you have the PROCESS privilege, you can see all threads. If you have\nthe SUPER privilege, you can kill all threads and statements.\nOtherwise, you can see and kill only your own threads and statements.\n\nYou can also use the mysqladmin processlist and mysqladmin kill\ncommands to examine and kill threads.\n\n*Note*:\n\nYou cannot use KILL with the Embedded MySQL Server library because the\nembedded server merely runs inside the threads of the host application.\nIt does not create any connection threads of its own.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/kill.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/kill.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (107,31,'DISJOINT','Disjoint(g1, g2)\n\nMBRDisjoint() and Disjoint() are synonyms. For more information, see\nthe description of MBRDisjoint().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (108,38,'LPAD','Syntax:\nLPAD(str,len,padstr)\n\nReturns the string str, left-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LPAD(\'hi\',4,\'??\');\n -> \'??hi\'\nmysql> SELECT LPAD(\'hi\',1,\'??\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (109,31,'OVERLAPS','Overlaps(g1, g2)\n\nMBROverlaps() and Overlaps() are synonyms. For more information, see\nthe description of MBROverlaps().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (110,8,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (111,7,'MBREQUAL','MBREqual(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (112,34,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n that ANALYSE() notices per column. This is used by ANALYSE() to check\n whether the optimal data type should be of type ENUM; if there are\n more than max_elements distinct values, then ENUM is not a suggested\n type.\n\no max_memory (default 8192) is the maximum amount of memory that\n ANALYSE() should allocate per column while trying to find all\n distinct values.\n\nA PROCEDURE clause is not permitted in a UNION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (113,9,'HELP_VERSION','This help information was generated from the MySQL 5.6 Reference Manual\non: 2017-06-02 (revision: 52424)\n\nThis information applies to MySQL 5.6 through 5.6.38.\n','',''); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (114,38,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (115,27,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (116,40,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n ADD DATAFILE \'file_name\'\n USE LOGFILE GROUP logfile_group\n [EXTENT_SIZE [=] extent_size]\n [INITIAL_SIZE [=] initial_size]\n [AUTOEXTEND_SIZE [=] autoextend_size]\n [MAX_SIZE [=] max_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] comment_text]\n ENGINE [=] engine_name\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for tables. One data file is\ncreated and added to the tablespace using this statement. Additional\ndata files may be added to the tablespace by using the ALTER TABLESPACE\nstatement (see [HELP ALTER TABLESPACE]). For rules covering the naming\nof tablespaces, see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and a log file group with the same name, or a tablespace and\na data file with the same name.\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see [HELP CREATE LOGFILE GROUP]). Multiple tablespaces\nmay use the same log file group for UNDO logging.\n\nThe EXTENT_SIZE sets the size, in bytes, of the extents used by any\nfiles belonging to the tablespace. The default value is 1M. The minimum\nsize is 32K, and theoretical maximum is 2G, although the practical\nmaximum size depends on a number of factors. In most cases, changing\nthe extent size does not have any measurable effect on performance, and\nthe default value is recommended for all but the most unusual\nsituations.\n\nAn extent is a unit of disk space allocation. One extent is filled with\nas much data as that extent can contain before another extent is used.\nIn theory, up to 65,535 (64K) extents may used per data file; however,\nthe recommended maximum is 32,768 (32K). The recommended maximum size\nfor a single data file is 32G---that is, 32K extents x 1 MB per extent.\nIn addition, once an extent is allocated to a given partition, it\ncannot be used to store data from a different partition; an extent\ncannot store data from more than one partition. This means, for example\nthat a tablespace having a single datafile whose INITIAL_SIZE is 256 MB\nand whose EXTENT_SIZE is 128M has just two extents, and so can be used\nto store data from at most two different disk data table partitions.\n\nYou can see how many extents remain free in a given data file by\nquerying the INFORMATION_SCHEMA.FILES table, and so derive an estimate\nfor how much space remains free in the file. For further discussion and\nexamples, see http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nThe INITIAL_SIZE parameter sets the data file\'s total size in bytes.\nOnce the file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using ALTER TABLESPACE\n... ADD DATAFILE. See [HELP ALTER TABLESPACE].\n\nINITIAL_SIZE is optional; its default value is 134217728 (128 MB).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nWhen setting EXTENT_SIZE, you may optionally follow the number with a\none-letter abbreviation for an order of magnitude, similar to those\nused in my.cnf. Generally, this is one of the letters M (for megabytes)\nor G (for gigabytes). In MySQL NDB Cluster 7.3.2 and later, these\nabbreviations are also supported when specifying INITIAL_SIZE as well.\n(Bug #13116514, Bug #16104705, Bug #62858)\n\nINITIAL_SIZE, EXTENT_SIZE, and UNDO_BUFFER_SIZE are subject to rounding\nas follows:\n\no EXTENT_SIZE and UNDO_BUFFER_SIZE are each rounded up to the nearest\n whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K.\n\n For data files, INITIAL_SIZE is subject to further rounding; the\n result just obtained is rounded up to the nearest whole multiple of\n EXTENT_SIZE (after any rounding).\n\nThe rounding just described is done explicitly, and a warning is issued\nby the MySQL Server when any such rounding is performed. The rounded\nvalues are also used by the NDB kernel for calculating\nINFORMATION_SCHEMA.FILES column values and other purposes. However, to\navoid an unexpected result, we suggest that you always use whole\nmultiples of 32K in specifying these options.\n\nAUTOEXTEND_SIZE, MAX_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but\nignored, and so currently have no effect. These options are intended\nfor future expansion.\n\nThe ENGINE parameter determines the storage engine which uses this\ntablespace, with engine_name being the name of the storage engine.\nCurrently, engine_name must be one of the values NDB or NDBCLUSTER.\n\nWhen CREATE TABLESPACE is used with ENGINE = NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+-------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+-------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n+--------------------+-------------+----------------+\n2 rows in set (0.01 sec)\n\n(See http://dev.mysql.com/doc/refman/5.6/en/files-table.html.)\n\nCREATE TABLESPACE is useful only with Disk Data storage for NDB\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (117,4,'ST_GEOMFROMTEXT','ST_GeomFromText(wkt[, srid]), ST_GeometryFromText(wkt[, srid])\n\nConstructs a geometry value of any type using its WKT representation\nand SRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (118,38,'INSERT FUNCTION','Syntax:\nINSERT(str,pos,len,newstr)\n\nReturns the string str, with the substring beginning at position pos\nand len characters long replaced by the string newstr. Returns the\noriginal string if pos is not within the length of the string. Replaces\nthe rest of the string from position pos if len is not within the\nlength of the rest of the string. Returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n -> \'QuWhattic\'\nmysql> SELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n -> \'Quadratic\'\nmysql> SELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n -> \'QuWhat\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (119,15,'XOR','Syntax:\nXOR\n\nLogical XOR. Returns NULL if either operand is NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is nonzero,\notherwise 0 is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 XOR 1;\n -> 0\nmysql> SELECT 1 XOR 0;\n -> 1\nmysql> SELECT 1 XOR NULL;\n -> NULL\nmysql> SELECT 1 XOR 1 XOR 1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (120,10,'GRANT','Syntax:\nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user [auth_option] [, user [auth_option]] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH {GRANT OPTION | resource_option} ...]\n\nGRANT PROXY ON user\n TO user [, user] ...\n [WITH GRANT OPTION]\n\nobject_type: {\n TABLE\n | FUNCTION\n | PROCEDURE\n}\n\npriv_level: {\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n}\n\nuser:\n (see http://dev.mysql.com/doc/refman/5.6/en/account-names.html)\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED BY PASSWORD \'hash_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n}\n\ntls_option: {\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n}\n\nresource_option: {\n | MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n}\n\nThe GRANT statement grants privileges to MySQL user accounts. GRANT\nalso serves to specify other account characteristics such as use of\nsecure connections and limits on access to server resources.\n\nTo use GRANT, you must have the GRANT OPTION privilege, and you must\nhave the privileges that you are granting. When the read_only system\nvariable is enabled, GRANT additionally requires the SUPER privilege.\n\nThe REVOKE statement is related to GRANT and enables administrators to\nremove account privileges. See [HELP REVOKE].\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\n\nThe host name part of the account, if omitted, defaults to \'%\'.\n\nNormally, a database administrator first uses CREATE USER to create an\naccount, then GRANT to define its privileges and characteristics. For\nexample:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\nGRANT SELECT ON db2.invoice TO \'jeffrey\'@\'localhost\';\nGRANT USAGE ON *.* TO \'jeffrey\'@\'localhost\' WITH MAX_QUERIES_PER_HOUR 90;\n\n*Note*:\n\nExamples shown here include no IDENTIFIED clause. It is assumed that\nyou establish passwords with CREATE USER at account-creation time to\navoid creating insecure accounts.\n\nIf an account named in a GRANT statement does not already exist, GRANT\nmay create it under the conditions described later in the discussion of\nthe NO_AUTO_CREATE_USER SQL mode.\n\nFrom the mysql program, GRANT responds with Query OK, 0 rows affected\nwhen executed successfully. To determine what privileges result from\nthe operation, use SHOW GRANTS. See [HELP SHOW GRANTS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/grant.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/grant.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (121,7,'MBRINTERSECTS','MBRIntersects(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 intersect.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (122,20,'IS NOT','Syntax:\nIS NOT boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (123,3,'SQRT','Syntax:\nSQRT(X)\n\nReturns the square root of a nonnegative number X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SQRT(4);\n -> 2\nmysql> SELECT SQRT(20);\n -> 4.4721359549996\nmysql> SELECT SQRT(-16);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (124,40,'CREATE INDEX','Syntax:\nCREATE [ONLINE|OFFLINE] [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name\n [index_type]\n ON tbl_name (index_col_name,...)\n [index_option]\n [algorithm_option | lock_option] ...\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nindex_type:\n USING {BTREE | HASH}\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes.\nSee [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY\nKEY; use ALTER TABLE instead. For more information about indexes, see\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (125,40,'ALTER DATABASE','Syntax:\nALTER {DATABASE | SCHEMA} [db_name]\n alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the\ndatabase directory. To use ALTER DATABASE, you need the ALTER privilege\non the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe database name can be omitted from the first syntax, in which case\nthe statement applies to the default database.\n\nNational Language Characteristics\n\nThe CHARACTER SET clause changes the default database character set.\nThe COLLATE clause changes the default database collation.\nhttp://dev.mysql.com/doc/refman/5.6/en/charset.html, discusses\ncharacter set and collation names.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See\n[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more\ninformation.\n\nIf you change the default character set or collation for a database,\nstored routines that use the database defaults must be dropped and\nrecreated so that they use the new defaults. (In a stored routine,\nvariables with character data types use the database defaults if the\ncharacter set or collation are not specified explicitly. See [HELP\nCREATE PROCEDURE].)\n\nUpgrading from Versions Older than MySQL 5.1\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause updates\nthe name of the directory associated with the database to use the\nencoding implemented in MySQL 5.1 for mapping database names to\ndatabase directory names (see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifier-mapping.html). This\nclause is for use under these conditions:\n\no It is intended when upgrading MySQL to 5.1 or later from older\n versions.\n\no It is intended to update a database directory name to the current\n encoding format if the name contains special characters that need\n encoding.\n\no The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example, if a database in MySQL 5.0 has the name a-b-c, the name\ncontains instances of the - (dash) character. In MySQL 5.0, the\ndatabase directory is also named a-b-c, which is not necessarily safe\nfor all file systems. In MySQL 5.1 and later, the same database name is\nencoded as a@002db@002dc to produce a file system-neutral directory\nname.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an\nolder version,the server displays a name such as a-b-c (which is in the\nold format) as #mysql50#a-b-c, and you must refer to the name using the\n#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to\nexplicitly tell the server to re-encode the database directory name to\nthe current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c\nwithout the special #mysql50# prefix.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (126,26,'GEOMETRYN','GeometryN(gc, N)\n\nST_GeometryN() and GeometryN() are synonyms. For more information, see\nthe description of ST_GeometryN().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (127,19,'<<','Syntax:\n<<\n\nShifts a longlong (BIGINT) number to the left.\n\nThe result is an unsigned 64-bit integer. The value is truncated to 64\nbits. In particular, if the shift count is greater or equal to the\nwidth of an unsigned 64-bit number, the result is zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 1 << 2;\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (128,27,'SHOW TABLE STATUS','Syntax:\nSHOW TABLE STATUS\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of\ninformation about each non-TEMPORARY table. You can also get this list\nusing the mysqlshow --status db_name command. The LIKE clause, if\npresent, indicates which table names to match. The WHERE clause can be\ngiven to select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-table-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-table-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (129,38,'ASCII','Syntax:\nASCII(str)\n\nReturns the numeric value of the leftmost character of the string str.\nReturns 0 if str is the empty string. Returns NULL if str is NULL.\nASCII() works for 8-bit characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ASCII(\'2\');\n -> 50\nmysql> SELECT ASCII(2);\n -> 50\nmysql> SELECT ASCII(\'dx\');\n -> 100\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (130,3,'DIV','Syntax:\nDIV\n\nInteger division. Discards from the division result any fractional part\nto the right of the decimal point.\n\nIf either operand has a noninteger type, the operands are converted to\nDECIMAL and divided using DECIMAL arithmetic before converting the\nresult to BIGINT. If the result exceeds BIGINT range, an error occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 5 DIV 2, -5 DIV 2, 5 DIV -2, -5 DIV -2;\n -> 2, -2, -2, 2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (131,27,'SHOW SLAVE STATUS','Syntax:\nSHOW SLAVE STATUS\n\nThis statement provides status information on essential parameters of\nthe slave threads. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nIf you issue this statement using the mysql client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout:\n\nmysql> SHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: localhost\n Master_User: root\n Master_Port: 13000\n Connect_Retry: 60\n Master_Log_File: master-bin.000002\n Read_Master_Log_Pos: 1307\n Relay_Log_File: slave-relay-bin.000003\n Relay_Log_Pos: 1508\n Relay_Master_Log_File: master-bin.000002\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB:\n Replicate_Ignore_DB:\n Replicate_Do_Table:\n Replicate_Ignore_Table:\n Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n Last_Errno: 0\n Last_Error:\n Skip_Counter: 0\n Exec_Master_Log_Pos: 1307\n Relay_Log_Space: 1858\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n Master_Server_Id: 1\n Master_UUID: 3e11fa47-71ca-11e1-9e33-c80aa9429562\n Master_Info_File: /var/mysqld.2/data/master.info\n SQL_Delay: 0\n SQL_Remaining_Delay: NULL\n Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it\n Master_Retry_Count: 10\n Master_Bind:\n Last_IO_Error_Timestamp:\n Last_SQL_Error_Timestamp:\n Master_SSL_Crl:\n Master_SSL_Crlpath:\n Retrieved_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Executed_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Auto_Position: 1\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (132,35,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Spatial columns\nare supported for MyISAM, InnoDB, NDB, and ARCHIVE tables. See also the\nnotes about spatial indexes under [HELP SPATIAL].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-columns.html\n\n','CREATE TABLE geom (g GEOMETRY);\n','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-columns.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (133,19,'&','Syntax:\n&\n\nBitwise AND.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 29 & 15;\n -> 13\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (134,15,'ASSIGN-EQUAL','Syntax:\n=\n\nThis operator is used to perform value assignments in two cases,\ndescribed in the next two paragraphs.\n\nWithin a SET statement, = is treated as an assignment operator that\ncauses the user variable on the left hand side of the operator to take\non the value to its right. (In other words, when used in a SET\nstatement, = is treated identically to :=.) The value on the right hand\nside may be a literal value, another variable storing a value, or any\nlegal expression that yields a scalar value, including the result of a\nquery (provided that this value is a scalar value). You can perform\nmultiple assignments in the same SET statement.\n\nIn the SET clause of an UPDATE statement, = also acts as an assignment\noperator; in this case, however, it causes the column named on the left\nhand side of the operator to assume the value given to the right,\nprovided any WHERE conditions that are part of the UPDATE are met. You\ncan make multiple assignments in the same SET clause of an UPDATE\nstatement.\n\nIn any other context, = is treated as a comparison operator.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n','http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (135,38,'CONVERT','Syntax:\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nThe CONVERT() function takes an expression of any type and produces a\nresult value of the specified type.\n\nDiscussion of CONVERT(expr, type) syntax here also applies to CAST(expr\nAS type), which is equivalent.\n\nCONVERT(... USING ...) is standard SQL syntax. The non-USING form of\nCONVERT() is ODBC syntax.\n\nCONVERT() with USING converts data between different character sets. In\nMySQL, transcoding names are the same as the corresponding character\nset names. For example, this statement converts the string \'abc\' in the\ndefault character set to the corresponding string in the utf8 character\nset:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nCONVERT() without USING and CAST() take an expression and a type value\nspecifying the result type. These type values are permitted:\n\no BINARY[(N)]\n\n Produces a string with the BINARY data type. See\n http://dev.mysql.com/doc/refman/5.6/en/binary-varbinary.html for a\n description of how this affects comparisons. If the optional length N\n is given, BINARY(N) causes the cast to use no more than N bytes of\n the argument. Values shorter than N bytes are padded with 0x00 bytes\n to a length of N.\n\no CHAR[(N)] [charset_info]\n\n Produces a string with the CHAR data type. If the optional length N\n is given, CHAR(N) causes the cast to use no more than N characters of\n the argument. No padding occurs for values shorter than N characters.\n\n With no charset_info clause, CHAR produces a string with the default\n character set. To specify the character set explicitly, these\n charset_info values are permitted:\n\n o CHARACTER SET charset_name: Produces a string with the given\n character set.\n\n o ASCII: Shorthand for CHARACTER SET latin1.\n\n o UNICODE: Shorthand for CHARACTER SET ucs2.\n\n In all cases, the string has the default collation for the character\n set.\n\no DATE\n\n Produces a DATE value.\n\no DATETIME\n\n Produces a DATETIME value.\n\no DECIMAL[(M[,D])]\n\n Produces a DECIMAL value. If the optional M and D values are given,\n they specify the maximum number of digits (the precision) and the\n number of digits following the decimal point (the scale).\n\no NCHAR[(N)]\n\n Like CHAR, but produces a string with the national character set. See\n http://dev.mysql.com/doc/refman/5.6/en/charset-national.html.\n\n Unlike CHAR, NCHAR does not permit trailing character set information\n to be specified.\n\no SIGNED [INTEGER]\n\n Produces a signed integer value.\n\no TIME\n\n Produces a TIME value.\n\no UNSIGNED [INTEGER]\n\n Produces an unsigned integer value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (136,24,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition expression is true. Thus, a REPEAT always enters the\nloop at least once. statement_list consists of one or more statements,\neach terminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/repeat.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n -> BEGIN\n -> SET @x = 0;\n -> REPEAT\n -> SET @x = @x + 1;\n -> UNTIL @x > p1 END REPEAT;\n -> END\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/repeat.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (137,23,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (138,23,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (139,38,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multibyte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 2562) ...\n\nIf the leftmost character is not a multibyte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (140,37,'ENVELOPE','Envelope(g)\n\nST_Envelope() and Envelope() are synonyms. For more information, see\nthe description of ST_Envelope().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (141,37,'ST_ISEMPTY','ST_IsEmpty(g)\n\nThis function is a placeholder that returns 0 for any valid geometry\nvalue, 1 for any invalid geometry value, or NULL if the argument is\nNULL.\n\nMySQL does not support GIS EMPTY values such as POINT EMPTY.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (142,14,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of an IPv4 network address as a\nstring, returns an integer that represents the numeric value of the\naddress in network byte order (big endian). INET_ATON() returns NULL if\nit does not understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'10.0.5.9\');\n -> 167773449\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (143,37,'ISSIMPLE','IsSimple(g)\n\nST_IsSimple() and IsSimple() are synonyms. For more information, see\nthe description of ST_IsSimple().\n\nPrior to MySQL 5.6.1, IsSimple() always returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (144,3,'- BINARY','Syntax:\n-\n\nSubtraction:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3-5;\n -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (145,32,'CURRENT_TIME','Syntax:\nCURRENT_TIME, CURRENT_TIME([fsp])\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (146,4,'WKT DEFINITION','The Well-Known Text (WKT) representation of geometry values is designed\nfor exchanging geometry data in ASCII form. The OpenGIS specification\nprovides a Backus-Naur grammar that specifies the formal production\nrules for writing WKT values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/spatial-extensions.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-data-formats.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-data-formats.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (147,11,'ST_Y','ST_Y(p)\n\nReturns the Y-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html\n\n','mysql> SELECT ST_Y(Point(56.7, 53.34));\n+--------------------------+\n| ST_Y(Point(56.7, 53.34)) |\n+--------------------------+\n| 53.34 |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (148,10,'REVOKE','Syntax:\nREVOKE\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL [PRIVILEGES], GRANT OPTION\n FROM user [, user] ...\n\nREVOKE PROXY ON user\n FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts.\n\nWhen the read_only system variable is enabled, REVOKE requires the\nSUPER privilege in addition to any other required privileges described\nin the following discussion.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nREVOKE INSERT ON *.* FROM \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nFor details on the levels at which privileges exist, the permissible\npriv_type, priv_level, and object_type values, and the syntax for\nspecifying users and passwords, see [HELP GRANT]\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege, or the UPDATE privilege for the mysql database.\n\nUser accounts from which privileges are to be revoked must exist.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/revoke.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (149,32,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (150,23,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (151,12,'RANDOM_BYTES','Syntax:\nRANDOM_BYTES(len)\n\nThis function returns a binary string of len random bytes generated\nusing the random number generator of the SSL library (OpenSSL or\nyaSSL). Permitted values of len range from 1 to 1024. For values\noutside that range, RANDOM_BYTES() generates a warning and returns\nNULL.\n\nRANDOM_BYTES() can be used to provide the initialization vector for the\nAES_DECRYPT() and AES_ENCRYPT() functions. For use in that context, len\nmust be at least 16. Larger values are permitted, but bytes in excess\nof 16 are ignored.\n\nRANDOM_BYTES() generates a random value, which makes its result\nnondeterministic. Consequently, statements that use this function are\nunsafe for statement-based replication and cannot be stored in the\nquery cache.\n\nThis function is available as of MySQL 5.6.17.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (152,38,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar \');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (153,29,'EXPLAIN','Syntax:\n{EXPLAIN | DESCRIBE | DESC}\n tbl_name [col_name | wild]\n\n{EXPLAIN | DESCRIBE | DESC}\n [explain_type]\n explainable_stmt\n\nexplain_type: {\n EXTENDED\n | PARTITIONS\n | FORMAT = format_name\n}\n\nformat_name: {\n TRADITIONAL\n | JSON\n}\n\nexplainable_stmt: {\n SELECT statement\n | DELETE statement\n | INSERT statement\n | REPLACE statement\n | UPDATE statement\n}\n\nThe DESCRIBE and EXPLAIN statements are synonyms. In practice, the\nDESCRIBE keyword is more often used to obtain information about table\nstructure, whereas EXPLAIN is used to obtain a query execution plan\n(that is, an explanation of how MySQL would execute a query).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/explain.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (154,3,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n -> 180\nmysql> SELECT DEGREES(PI() / 2);\n -> 90\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (155,3,'- UNARY','Syntax:\n-\n\nUnary minus. This operator changes the sign of the operand.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT - 2;\n -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (156,23,'VARCHAR','[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,535. The effective maximum length\nof a VARCHAR is subject to the maximum row size (65,535 bytes, which is\nshared among all columns) and the character set used. For example, utf8\ncharacters can require up to three bytes per character, so a VARCHAR\ncolumn that uses the utf8 character set can be declared to be a maximum\nof 21,844 characters. See\nhttp://dev.mysql.com/doc/refman/5.6/en/column-count-limit.html.\n\nMySQL stores VARCHAR values as a 1-byte or 2-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A\nVARCHAR column uses one length byte if values require no more than 255\nbytes, two length bytes if values may require more than 255 bytes.\n\n*Note*:\n\nMySQL follows the standard SQL specification, and does not remove\ntrailing spaces from VARCHAR values.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the\nstandard SQL way to define that a VARCHAR column should use some\npredefined character set. MySQL uses utf8 as this predefined character\nset. http://dev.mysql.com/doc/refman/5.6/en/charset-national.html.\nNVARCHAR is shorthand for NATIONAL VARCHAR.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (157,38,'UNHEX','Syntax:\n\nUNHEX(str)\n\nFor a string argument str, UNHEX(str) interprets each pair of\ncharacters in the argument as a hexadecimal number and converts it to\nthe byte represented by the number. The return value is a binary\nstring.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT UNHEX(\'4D7953514C\');\n -> \'MySQL\'\nmysql> SELECT X\'4D7953514C\';\n -> \'MySQL\'\nmysql> SELECT UNHEX(HEX(\'string\'));\n -> \'string\'\nmysql> SELECT HEX(UNHEX(\'1267\'));\n -> \'1267\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (158,40,'DROP TRIGGER','Syntax:\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nThis statement drops a trigger. The schema (database) name is optional.\nIf the schema is omitted, the trigger is dropped from the default\nschema. DROP TRIGGER requires the TRIGGER privilege for the table\nassociated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that\ndoes not exist. A NOTE is generated for a nonexistent trigger when\nusing IF EXISTS. See [HELP SHOW WARNINGS].\n\nTriggers for a table are also dropped if you drop the table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-trigger.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (159,8,'RESET MASTER','Syntax:\nRESET MASTER\n\nDeletes all binary log files listed in the index file, resets the\nbinary log index file to be empty, and creates a new binary log file.\n\nIn MySQL 5.6.5 and later, RESET MASTER also clears the values of the\ngtid_purged system variable (known as gtid_lost in MySQL 5.6.8 and\nearlier) as well as the global value of the gtid_executed (gtid_done,\nprior to MySQL 5.6.9) system variable (but not its session value); that\nis, executing this statement sets each of these values to an empty\nstring (\'\').\n\nThis statement is intended to be used only when the master is started\nfor the first time.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset-master.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset-master.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (160,3,'PI','Syntax:\nPI()\n\nReturns the value of Ï€ (pi). The default number of decimal places\ndisplayed is seven, but MySQL uses the full double-precision value\ninternally.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT PI();\n -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n -> 3.141592653589793116\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (161,3,'/','Syntax:\n/\n\nDivision:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3/5;\n -> 0.60\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (162,8,'PURGE BINARY LOGS','Syntax:\nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n\nThe binary log is a set of files that contain information about data\nmodifications made by the MySQL server. The log consists of a set of\nbinary log files, plus an index file (see\nhttp://dev.mysql.com/doc/refman/5.6/en/binary-log.html).\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed\nin the log index file prior to the specified log file name or date.\nBINARY and MASTER are synonyms. Deleted log files also are removed from\nthe list recorded in the index file, so that the given log file becomes\nthe first in the list.\n\nThis statement has no effect if the server was not started with the\n--log-bin option to enable binary logging.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/purge-binary-logs.html\n\n','PURGE BINARY LOGS TO \'mysql-bin.010\';\nPURGE BINARY LOGS BEFORE \'2008-04-02 22:46:26\';\n','http://dev.mysql.com/doc/refman/5.6/en/purge-binary-logs.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (163,16,'STDDEV_SAMP','Syntax:\nSTDDEV_SAMP(expr)\n\nReturns the sample standard deviation of expr (the square root of\nVAR_SAMP().\n\nIf there are no matching rows, STDDEV_SAMP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (164,31,'ST_TOUCHES','ST_Touches(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two\ngeometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either\nthe boundary or the interior of the other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (165,17,'SCHEMA','Syntax:\nSCHEMA()\n\nThis function is a synonym for DATABASE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (166,33,'MLINEFROMWKB','MLineFromWKB(wkb[, srid]), MultiLineStringFromWKB(wkb[, srid])\n\nConstructs a MultiLineString value using its WKB representation and\nSRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (167,27,'SHOW CREATE TABLE','Syntax:\nSHOW CREATE TABLE tbl_name\n\nShows the CREATE TABLE statement that creates the named table. To use\nthis statement, you must have some privilege for the table. This\nstatement also works with views.\nSHOW CREATE TABLE quotes table and column names according to the value\nof the sql_quote_show_create option. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-table.html\n\n','mysql> SHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n Table: t\nCreate Table: CREATE TABLE `t` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `s` char(60) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (168,28,'DUAL','You are permitted to specify DUAL as a dummy table name in situations\nwhere no tables are referenced:\n\nmysql> SELECT 1 + 1 FROM DUAL;\n -> 2\n\nDUAL is purely for the convenience of people who require that all\nSELECT statements should have FROM and possibly other clauses. MySQL\nmay ignore the clauses. MySQL does not require FROM DUAL if no tables\nare referenced.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/select.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (169,38,'INSTR','Syntax:\nINSTR(str,substr)\n\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of LOCATE(),\nexcept that the order of the arguments is reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT INSTR(\'foobarbar\', \'bar\');\n -> 4\nmysql> SELECT INSTR(\'xbar\', \'foobar\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (170,20,'>=','Syntax:\n>=\n\nGreater than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 >= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (171,3,'EXP','Syntax:\nEXP(X)\n\nReturns the value of e (the base of natural logarithms) raised to the\npower of X. The inverse of this function is LOG() (using a single\nargument only) or LN().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT EXP(2);\n -> 7.3890560989307\nmysql> SELECT EXP(-2);\n -> 0.13533528323661\nmysql> SELECT EXP(0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (172,37,'ST_ISSIMPLE','ST_IsSimple(g)\n\nReturns 1 if the geometry value g has no anomalous geometric points,\nsuch as self-intersection or self-tangency. ST_IsSimple() returns 0 if\nthe argument is not simple, and NULL if the argument is NULL.\n\nThe description of each instantiable geometric class given earlier in\nthe chapter includes the specific conditions that cause an instance of\nthat class to be classified as not simple. (See [HELP Geometry\nhierarchy].)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (173,13,'POINTN','PointN(ls, N)\n\nST_PointN() and PointN() are synonyms. For more information, see the\ndescription of ST_PointN().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (174,38,'OCT','Syntax:\nOCT(N)\n\nReturns a string representation of the octal value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT OCT(12);\n -> \'14\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (175,32,'SYSDATE','Syntax:\nSYSDATE([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the\ntime at which the statement began to execute. (Within a stored function\nor trigger, NOW() returns the time at which the function or triggering\nstatement began to execute.)\n\nmysql> SELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |\n+---------------------+----------+---------------------+\n\nmysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |\n+---------------------+----------+---------------------+\n\nIn addition, the SET TIMESTAMP statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp settings in the\nbinary log have no effect on invocations of SYSDATE().\n\nBecause SYSDATE() can return different values even within the same\nstatement, and is not affected by SET TIMESTAMP, it is nondeterministic\nand therefore unsafe for replication if statement-based binary logging\nis used. If that is a problem, you can use row-based logging.\n\nAlternatively, you can use the --sysdate-is-now option to cause\nSYSDATE() to be an alias for NOW(). This works if the option is used on\nboth the master and the slave.\n\nThe nondeterministic nature of SYSDATE() also means that indexes cannot\nbe used for evaluating expressions that refer to it.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (176,5,'UNINSTALL PLUGIN','Syntax:\nUNINSTALL PLUGIN plugin_name\n\nThis statement removes an installed server plugin. It requires the\nDELETE privilege for the mysql.plugin system table. UNINSTALL PLUGIN is\nthe complement of INSTALL PLUGIN.\n\nplugin_name must be the name of some plugin that is listed in the\nmysql.plugin table. The server executes the plugin\'s deinitialization\nfunction and removes the row for the plugin from the mysql.plugin\ntable, so that subsequent server restarts will not load and initialize\nthe plugin. UNINSTALL PLUGIN does not remove the plugin\'s shared\nlibrary file.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/uninstall-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/uninstall-plugin.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (177,33,'ASBINARY','AsBinary(g), AsWKB(g)\n\nST_AsBinary(), ST_AsWKB(), AsBinary(), and AsWKB() are synonyms. For\nmore information, see the description of ST_AsBinary().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (178,27,'SHOW TABLES','Syntax:\nSHOW [FULL] TABLES\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLES lists the non-TEMPORARY tables in a given database. You can\nalso get this list using the mysqlshow db_name command. The LIKE\nclause, if present, indicates which table names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nMatching performed by the LIKE clause is dependent on the setting of\nthe lower_case_table_names system variable.\n\nThis statement also lists any views in the database. The FULL modifier\nis supported such that SHOW FULL TABLES displays a second output\ncolumn. Values for the second column are BASE TABLE for a table and\nVIEW for a view.\n\nIf you have no privileges for a base table or view, it does not show up\nin the output from SHOW TABLES or mysqlshow db_name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-tables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (179,32,'MAKEDATE','Syntax:\nMAKEDATE(year,dayofyear)\n\nReturns a date, given year and day-of-year values. dayofyear must be\ngreater than 0 or the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n -> \'2011-01-31\', \'2011-02-01\'\nmysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n -> \'2011-12-31\', \'2014-12-31\'\nmysql> SELECT MAKEDATE(2011,0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (180,38,'BINARY OPERATOR','Syntax:\nBINARY expr\n\nThe BINARY operator converts the expression to a binary string. A\ncommon use for BINARY is to force a character string comparison to be\ndone byte by byte rather than character by character, in effect\nbecoming case sensitive. The BINARY operator also causes trailing\nspaces in comparisons to be significant.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','mysql> SELECT \'a\' = \'A\';\n -> 1\nmysql> SELECT BINARY \'a\' = \'A\';\n -> 0\nmysql> SELECT \'a\' = \'a \';\n -> 1\nmysql> SELECT BINARY \'a\' = \'a \';\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (181,7,'MBROVERLAPS','MBROverlaps(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 overlap. The term spatially overlaps is\nused if two geometries intersect and their intersection results in a\ngeometry of the same dimension but not equal to either of the given\ngeometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (182,33,'ST_LINEFROMWKB','ST_LineFromWKB(wkb[, srid]), ST_LineStringFromWKB(wkb[, srid])\n\nConstructs a LineString value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (183,7,'ASYMMETRIC_DERIVE','Syntax:\nASYMMETRIC_DERIVE(pub_key_str, priv_key_str)\n\nDerives a symmetric key using the private key of one party and the\npublic key of another, and returns the resulting key as a binary\nstring. If key derivation fails, the result is NULL.\n\npub_key_str and priv_key_str must be valid key strings in PEM format.\nThey must be created using the DH algorithm.\n\nSuppose that you have two pairs of public and private keys:\n\nSET @dhp = CREATE_DH_PARAMETERS(1024);\nSET @priv1 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub1 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv1);\nSET @priv2 = CREATE_ASYMMETRIC_PRIV_KEY(\'DH\', @dhp);\nSET @pub2 = CREATE_ASYMMETRIC_PUB_KEY(\'DH\', @priv2);\n\nSuppose further that you use the private key from one pair and the\npublic key from the other pair to create a symmetric key string. Then\nthis symmetric key identity relationship holds:\n\nASYMMETRIC_DERIVE(@pub1, @priv2) = ASYMMETRIC_DERIVE(@pub2, @priv1)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (184,28,'INSERT SELECT','Syntax:\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table\nfrom one or many tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert-select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert-select.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (185,40,'CREATE PROCEDURE','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n FUNCTION sp_name ([func_parameter[,...]])\n RETURNS type\n [characteristic ...] routine_body\n\nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n\nfunc_parameter:\n param_name type\n\ntype:\n Any valid MySQL data type\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nroutine_body:\n Valid SQL routine statement\n\nThese statements create stored routines. By default, a routine is\nassociated with the default database. To associate the routine\nexplicitly with a given database, specify the name as db_name.sp_name\nwhen you create it.\n\nThe CREATE FUNCTION statement is also used in MySQL to support UDFs\n(user-defined functions). See\nhttp://dev.mysql.com/doc/refman/5.6/en/adding-functions.html. A UDF can\nbe regarded as an external stored function. Stored functions share\ntheir namespace with UDFs. See\nhttp://dev.mysql.com/doc/refman/5.6/en/function-resolution.html, for\nthe rules describing how the server interprets references to different\nkinds of functions.\n\nTo invoke a stored procedure, use the CALL statement (see [HELP CALL]).\nTo invoke a stored function, refer to it in an expression. The function\nreturns a value during expression evaluation.\n\nCREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE\nprivilege. They might also require the SUPER privilege, depending on\nthe DEFINER value, as described later in this section. If binary\nlogging is enabled, CREATE FUNCTION might require the SUPER privilege,\nas described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nBy default, MySQL automatically grants the ALTER ROUTINE and EXECUTE\nprivileges to the routine creator. This behavior can be changed by\ndisabling the automatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be\nused when checking access privileges at routine execution time, as\ndescribed later in this section.\n\nIf the routine name is the same as the name of a built-in SQL function,\na syntax error occurs unless you use a space between the name and the\nfollowing parenthesis when defining the routine or invoking it later.\nFor this reason, avoid using the names of existing SQL functions for\nyour own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always permissible to have spaces after a stored\nroutine name, regardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present.\nIf there are no parameters, an empty parameter list of () should be\nused. Parameter names are not case sensitive.\n\nEach parameter is an IN parameter by default. To specify otherwise for\na parameter, use the keyword OUT or INOUT before the parameter name.\n\n*Note*:\n\nSpecifying a parameter as IN, OUT, or INOUT is valid only for a\nPROCEDURE. For a FUNCTION, parameters are always regarded as IN\nparameters.\n\nAn IN parameter passes a value into a procedure. The procedure might\nmodify the value, but the modification is not visible to the caller\nwhen the procedure returns. An OUT parameter passes a value from the\nprocedure back to the caller. Its initial value is NULL within the\nprocedure, and its value is visible to the caller when the procedure\nreturns. An INOUT parameter is initialized by the caller, can be\nmodified by the procedure, and any change made by the procedure is\nvisible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the\nCALL statement that invokes the procedure so that you can obtain its\nvalue when the procedure returns. If you are calling the procedure from\nwithin another stored procedure or function, you can also pass a\nroutine parameter or local routine variable as an IN or INOUT\nparameter.\n\nRoutine parameters cannot be referenced in statements prepared within\nthe routine; see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-program-restrictions.html\n.\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter:\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE simpleproc (OUT param1 INT)\n -> BEGIN\n -> SELECT COUNT(*) INTO param1 FROM t;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter ;\n\nmysql> CALL simpleproc(@a);\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @a;\n+------+\n| @a |\n+------+\n| 3 |\n+------+\n1 row in set (0.00 sec)\n\nThe example uses the mysql client delimiter command to change the\nstatement delimiter from ; to // while the procedure is being defined.\nThis enables the ; delimiter used in the procedure body to be passed\nthrough to the server rather than being interpreted by mysql itself.\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-defining.html.\n\nThe RETURNS clause may be specified only for a FUNCTION, for which it\nis mandatory. It indicates the return type of the function, and the\nfunction body must contain a RETURN value statement. If the RETURN\nstatement returns a value of a different type, the value is coerced to\nthe proper type. For example, if a function specifies an ENUM or SET\nvalue in the RETURNS clause, but the RETURN statement returns an\ninteger, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nThe following example function takes a parameter, performs an operation\nusing an SQL function, and returns the result. In this case, it is\nunnecessary to use delimiter because the function definition contains\nno internal ; statement delimiters:\n\nmysql> CREATE FUNCTION hello (s CHAR(20))\nmysql> RETURNS CHAR(50) DETERMINISTIC\n -> RETURN CONCAT(\'Hello, \',s,\'!\');\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n1 row in set (0.00 sec)\n\nParameter types and function return types can be declared to use any\nvalid data type. The COLLATE attribute can be used if preceded by the\nCHARACTER SET attribute.\n\nThe routine_body consists of a valid SQL routine statement. This can be\na simple statement such as SELECT or INSERT, or a compound statement\nwritten using BEGIN and END. Compound statements can contain\ndeclarations, loops, and other control structure statements. The syntax\nfor these statements is described in\nhttp://dev.mysql.com/doc/refman/5.6/en/sql-syntax-compound-statements.h\ntml.\n\nMySQL permits routines to contain DDL statements, such as CREATE and\nDROP. MySQL also permits stored procedures (but not stored functions)\nto contain SQL transaction statements such as COMMIT. Stored functions\nmay not contain statements that perform explicit or implicit commit or\nrollback. Support for these statements is not required by the SQL\nstandard, which states that each DBMS vendor may decide whether to\npermit them.\n\nStatements that return a result set can be used within a stored\nprocedure but not within a stored function. This prohibition includes\nSELECT statements that do not have an INTO var_list clause and other\nstatements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that\ncan be determined at function definition time to return a result set, a\nNot allowed to return a result set from a function error occurs\n(ER_SP_NO_RETSET). For statements that can be determined only at\nruntime to return a result set, a PROCEDURE %s can\'t return a result\nset in the given context error occurs (ER_SP_BADSELECT).\n\nUSE statements within stored routines are not permitted. When a routine\nis invoked, an implicit USE db_name is performed (and undone when the\nroutine terminates). The causes the routine to have the given default\ndatabase while it executes. References to objects in databases other\nthan the routine default database should be qualified with the\nappropriate database name.\n\nFor additional information about statements that are not permitted in\nstored routines, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-program-restrictions.html\n.\n\nFor information about invoking stored procedures from within programs\nwritten in a language that has a MySQL interface, see [HELP CALL].\n\nMySQL stores the sql_mode system variable setting in effect when a\nroutine is created or altered, and always executes the routine with\nthis setting in force, regardless of the current server SQL mode when\nthe routine begins executing.\n\nThe switch from the SQL mode of the invoker to that of the routine\noccurs after evaluation of arguments and assignment of the resulting\nvalues to routine parameters. If you define a routine in strict SQL\nmode but invoke it in nonstrict mode, assignment of arguments to\nroutine parameters does not take place in strict mode. If you require\nthat expressions passed to a routine be assigned in strict SQL mode,\nyou should invoke the routine with strict mode in effect.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (186,7,'SQL_THREAD_WAIT_AFTER_GTIDS','Syntax:\nSQL_THREAD_WAIT_AFTER_GTIDS(gtid_set[, timeout])\n\nSQL_THREAD_WAIT_AFTER_GTIDS() was added in MySQL 5.6.5, and replaced by\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() in MySQL 5.6.9. (Bug #14775984)\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (187,24,'GET DIAGNOSTICS','Syntax:\nGET [CURRENT] DIAGNOSTICS\n{\n statement_information_item\n [, statement_information_item] ...\n | CONDITION condition_number\n condition_information_item\n [, condition_information_item] ...\n}\n\nstatement_information_item:\n target = statement_information_item_name\n\ncondition_information_item:\n target = condition_information_item_name\n\nstatement_information_item_name:\n NUMBER\n | ROW_COUNT\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | RETURNED_SQLSTATE\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_number, target:\n (see following discussion)\n\nSQL statements produce diagnostic information that populates the\ndiagnostics area. The GET DIAGNOSTICS statement enables applications to\ninspect this information. It is available as of MySQL 5.6.4. (You can\nalso use SHOW WARNINGS or SHOW ERRORS to see conditions or errors.)\n\nNo special privileges are required to execute GET DIAGNOSTICS.\n\nThe keyword CURRENT means to retrieve information from the current\ndiagnostics area. In MySQL, it has no effect because that is the\ndefault behavior.\n\nGET DIAGNOSTICS is typically used in a handler within a stored program,\nbut it is a MySQL extension that it is permitted outside handler\ncontext to check the execution of any SQL statement. For example, if\nyou invoke the mysql client program, you can enter these statements at\nthe prompt:\n\nmysql> DROP TABLE test.no_such_table;\nERROR 1051 (42S02): Unknown table \'test.no_such_table\'\nmysql> GET DIAGNOSTICS CONDITION 1\n -> @p1 = RETURNED_SQLSTATE, @p2 = MESSAGE_TEXT;\nmysql> SELECT @p1, @p2;\n+-------+------------------------------------+\n| @p1 | @p2 |\n+-------+------------------------------------+\n| 42S02 | Unknown table \'test.no_such_table\' |\n+-------+------------------------------------+\n\nFor a description of the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html. Briefly,\nit contains two kinds of information:\n\no Statement information, such as the number of conditions that occurred\n or the affected-rows count.\n\no Condition information, such as the error code and message. If a\n statement raises multiple conditions, this part of the diagnostics\n area has a condition area for each one. If a statement raises no\n conditions, this part of the diagnostics area is empty.\n\nFor a statement that produces three conditions, the diagnostics area\ncontains statement and condition information like this:\n\nStatement information:\n row count\n ... other statement information items ...\nCondition area list:\n Condition area 1:\n error code for condition 1\n error message for condition 1\n ... other condition information items ...\n Condition area 2:\n error code for condition 2:\n error message for condition 2\n ... other condition information items ...\n Condition area 3:\n error code for condition 3\n error message for condition 3\n ... other condition information items ...\n\nGET DIAGNOSTICS can obtain either statement or condition information,\nbut not both in the same statement:\n\no To obtain statement information, retrieve the desired statement items\n into target variables. This instance of GET DIAGNOSTICS assigns the\n number of available conditions and the rows-affected count to the\n user variables @p1 and @p2:\n\nGET DIAGNOSTICS @p1 = NUMBER, @p2 = ROW_COUNT;\n\no To obtain condition information, specify the condition number and\n retrieve the desired condition items into target variables. This\n instance of GET DIAGNOSTICS assigns the SQLSTATE value and error\n message to the user variables @p3 and @p4:\n\nGET DIAGNOSTICS CONDITION 1\n @p3 = RETURNED_SQLSTATE, @p4 = MESSAGE_TEXT;\n\nThe retrieval list specifies one or more target = item_name\nassignments, separated by commas. Each assignment names a target\nvariable and either a statement_information_item_name or\ncondition_information_item_name designator, depending on whether the\nstatement retrieves statement or condition information.\n\nValid target designators for storing item information can be stored\nprocedure or function parameters, stored program local variables\ndeclared with DECLARE, or user-defined variables.\n\nValid condition_number designators can be stored procedure or function\nparameters, stored program local variables declared with DECLARE,\nuser-defined variables, system variables, or literals. A character\nliteral may include a _charset introducer. A warning occurs if the\ncondition number is not in the range from 1 to the number of condition\nareas that have information. In this case, the warning is added to the\ndiagnostics area without clearing it.\n\nWhen a condition occurs, MySQL does not populate all condition items\nrecognized by GET DIAGNOSTICS. For example:\n\nmysql> GET DIAGNOSTICS CONDITION 1\n -> @p5 = SCHEMA_NAME, @p6 = TABLE_NAME;\nmysql> SELECT @p5, @p6;\n+------+------+\n| @p5 | @p6 |\n+------+------+\n| | |\n+------+------+\n\nIn standard SQL, if there are multiple conditions, the first condition\nrelates to the SQLSTATE value returned for the previous SQL statement.\nIn MySQL, this is not guaranteed. To get the main error, you cannot do\nthis:\n\nGET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;\n\nInstead, retrieve the condition count first, then use it to specify\nwhich condition number to inspect:\n\nGET DIAGNOSTICS @cno = NUMBER;\nGET DIAGNOSTICS CONDITION @cno @errno = MYSQL_ERRNO;\n\nFor information about permissible statement and condition information\nitems, and which ones are populated when a condition occurs, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html#diagnostic\ns-area-information-items.\n\nHere is an example that uses GET DIAGNOSTICS and an exception handler\nin stored procedure context to assess the outcome of an insert\noperation. If the insert was successful, the procedure uses GET\nDIAGNOSTICS to get the rows-affected count. This shows that you can use\nGET DIAGNOSTICS multiple times to retrieve information about a\nstatement as long as the diagnostics area has not been cleared.\n\nCREATE PROCEDURE do_insert(value INT)\nBEGIN\n -- Declare variables to hold diagnostics area information\n DECLARE code CHAR(5) DEFAULT \'00000\';\n DECLARE msg TEXT;\n DECLARE rows INT;\n DECLARE result TEXT;\n -- Declare exception handler for failed insert\n DECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n BEGIN\n GET DIAGNOSTICS CONDITION 1\n code = RETURNED_SQLSTATE, msg = MESSAGE_TEXT;\n END;\n\n -- Perform the insert\n INSERT INTO t1 (int_col) VALUES(value);\n -- Check whether the insert was successful\n IF code = \'00000\' THEN\n GET DIAGNOSTICS rows = ROW_COUNT;\n SET result = CONCAT(\'insert succeeded, row count = \',rows);\n ELSE\n SET result = CONCAT(\'insert failed, error = \',code,\', message = \',msg);\n END IF;\n -- Say what happened\n SELECT result;\nEND;\n\nSuppose that t1.int_col is an integer column that is declared as NOT\nNULL. The procedure produces these results when invoked to insert\nnon-NULL and NULL values, respectively:\n\nmysql> CALL do_insert(1);\n+---------------------------------+\n| result |\n+---------------------------------+\n| insert succeeded, row count = 1 |\n+---------------------------------+\n\nmysql> CALL do_insert(NULL);\n+-------------------------------------------------------------------------+\n| result |\n+-------------------------------------------------------------------------+\n| insert failed, error = 23000, message = Column \'int_col\' cannot be null |\n+-------------------------------------------------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (188,38,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/regexp.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/regexp.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (189,24,'LEAVE','Syntax:\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the\ngiven label. If the label is for the outermost stored program block,\nLEAVE exits the program.\n\nLEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/leave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/leave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (190,20,'NOT IN','Syntax:\nexpr NOT IN (value,...)\n\nThis is the same as NOT (expr IN (value,...)).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (191,11,'X','X(p)\n\nST_X() and X() are synonyms. For more information, see the description\nof ST_X().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (192,17,'FOUND_ROWS','Syntax:\nFOUND_ROWS()\n\nA SELECT statement may include a LIMIT clause to restrict the number of\nrows the server returns to the client. In some cases, it is desirable\nto know how many rows the statement would have returned without the\nLIMIT, but without running the statement again. To obtain this row\ncount, include an SQL_CALC_FOUND_ROWS option in the SELECT statement,\nand then invoke FOUND_ROWS() afterward:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n -> WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (193,31,'CROSSES','Crosses(g1, g2)\n\nST_Crosses() and Crosses() are synonyms. For more information, see the\ndescription of ST_Crosses().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (194,26,'ST_UNION','ST_Union(g1, g2)\n\nReturns a geometry that represents the point set union of the geometry\nvalues g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = ST_GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT ST_AsText(ST_Union(@g1, @g2));\n+--------------------------------------+\n| ST_AsText(ST_Union(@g1, @g2)) |\n+--------------------------------------+\n| MULTILINESTRING((1 1,3 3),(3 1,1 3)) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (195,16,'BIT_XOR','Syntax:\nBIT_XOR(expr)\n\nReturns the bitwise XOR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_XOR() returns a neutral value (all\nbits set to 0).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (196,27,'FLUSH','Syntax:\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n flush_option [, flush_option] ...\n\nThe FLUSH statement has several variant forms that clear or reload\nvarious internal caches, flush tables, or acquire locks. To execute\nFLUSH, you must have the RELOAD privilege. Specific flush options might\nrequire additional privileges, as described later.\n\nBy default, the server writes FLUSH statements to the binary log so\nthat they replicate to replication slaves. To suppress logging, specify\nthe optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\n*Note*:\n\nFLUSH LOGS, FLUSH TABLES WITH READ LOCK (with or without a table list),\nand FLUSH TABLES tbl_name ... FOR EXPORT are not written to the binary\nlog in any case because they would cause problems if replicated to a\nslave.\n\nSending a SIGHUP signal to the server causes several flush operations\nto occur that are similar to various forms of the FLUSH statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-signal-response.html.\n\nThe FLUSH statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nThe RESET statement is similar to FLUSH. See [HELP RESET], for\ninformation about using the RESET statement with replication.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/flush.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/flush.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (197,24,'BEGIN END','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\nBEGIN ... END syntax is used for writing compound statements, which can\nappear within stored programs (stored procedures and functions,\ntriggers, and events). A compound statement can contain multiple\nstatements, enclosed by the BEGIN and END keywords. statement_list\nrepresents a list of one or more statements, each terminated by a\nsemicolon (;) statement delimiter. The statement_list itself is\noptional, so the empty compound statement (BEGIN END) is legal.\n\nBEGIN ... END blocks can be nested.\n\nUse of multiple statements requires that a client is able to send\nstatement strings containing the ; statement delimiter. In the mysql\ncommand-line client, this is handled with the delimiter command.\nChanging the ; end-of-statement delimiter (for example, to //) permit ;\nto be used in a program body. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-defining.html.\n\nA BEGIN ... END block can be labeled. See [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/begin-end.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/begin-end.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (198,27,'SHOW PROCEDURE STATUS','Syntax:\nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is a MySQL extension. It returns characteristics of a\nstored procedure, such as the database, name, type, creator, creation\nand modification dates, and character set information. A similar\nstatement, SHOW FUNCTION STATUS, displays information about stored\nfunctions (see [HELP SHOW FUNCTION STATUS]).\n\nThe LIKE clause, if present, indicates which procedure or function\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-procedure-status.html\n\n','mysql> SHOW PROCEDURE STATUS LIKE \'sp1\'\\G\n*************************** 1. row ***************************\n Db: test\n Name: sp1\n Type: PROCEDURE\n Definer: testuser@localhost\n Modified: 2004-08-03 15:29:37\n Created: 2004-08-03 15:29:37\n Security_type: DEFINER\n Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-procedure-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (199,16,'STDDEV_POP','Syntax:\nSTDDEV_POP(expr)\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent\nbut not standard SQL.\n\nIf there are no matching rows, STDDEV_POP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (200,27,'SHOW CHARACTER SET','Syntax:\nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n\nThe SHOW CHARACTER SET statement shows all available character sets.\nThe LIKE clause, if present, indicates which character set names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. For example:\n\nmysql> SHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1 | cp1252 West European | latin1_swedish_ci | 1 |\n| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |\n| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |\n| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |\n+---------+-----------------------------+-------------------+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-character-set.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (201,31,'INTERSECTS','Intersects(g1, g2)\n\nMBRIntersects() and Intersects() are synonyms. For more information,\nsee the description of MBRIntersects().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (202,24,'LOOP','Syntax:\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\nLOOP implements a simple loop construct, enabling repeated execution of\nthe statement list, which consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter. The statements\nwithin the loop are repeated until the loop is terminated. Usually,\nthis is accomplished with a LEAVE statement. Within a stored function,\nRETURN can also be used, which exits the function entirely.\n\nNeglecting to include a loop-termination statement results in an\ninfinite loop.\n\nA LOOP statement can be labeled. For the rules regarding label use, see\n[HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/loop.html\n\n','CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/loop.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (203,20,'GREATEST','Syntax:\nGREATEST(value1,value2,...)\n\nWith two or more arguments, returns the largest (maximum-valued)\nargument. The arguments are compared using the same rules as for\nLEAST().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT GREATEST(2,0);\n -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n -> 767.0\nmysql> SELECT GREATEST(\'B\',\'A\',\'C\');\n -> \'C\'\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (204,31,'ST_CONTAINS','ST_Contains(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as ST_Within().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (205,16,'BIT_AND','Syntax:\nBIT_AND(expr)\n\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_AND() returns a neutral value (all\nbits set to 1).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (206,32,'SECOND','Syntax:\nSECOND(time)\n\nReturns the second for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SECOND(\'10:05:03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (207,7,'MBRCONTAINS','MBRContains(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\ncontains the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRContains(@g1,@g2), MBRWithin(@g2,@g1);\n+----------------------+--------------------+\n| MBRContains(@g1,@g2) | MBRWithin(@g2,@g1) |\n+----------------------+--------------------+\n| 1 | 1 |\n+----------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (208,3,'COT','Syntax:\nCOT(X)\n\nReturns the cotangent of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT COT(12);\n -> -1.5726734063977\nmysql> SELECT COT(0);\n -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (209,27,'SHOW CREATE EVENT','Syntax:\nSHOW CREATE EVENT event_name\n\nThis statement displays the CREATE EVENT statement needed to re-create\na given event. It requires the EVENT privilege for the database from\nwhich the event is to be shown. For example (using the same event\ne_daily defined and then altered in [HELP SHOW EVENTS]):\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-event.html\n\n','mysql> SHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row ***************************\n Event: e_daily\n sql_mode:\n time_zone: SYSTEM\n Create Event: CREATE EVENT `e_daily`\n ON SCHEDULE EVERY 1 DAY\n STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n ON COMPLETION NOT PRESERVE\n ENABLE\n COMMENT \'Saves total number of sessions then\n clears the table each day\'\n DO BEGIN\n INSERT INTO site_activity.totals (time, total)\n SELECT CURRENT_TIMESTAMP, COUNT(*)\n FROM site_activity.sessions;\n DELETE FROM site_activity.sessions;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (210,15,'OR','Syntax:\nOR, ||\n\nLogical OR. When both operands are non-NULL, the result is 1 if any\noperand is nonzero, and 0 otherwise. With a NULL operand, the result is\n1 if the other operand is nonzero, and NULL otherwise. If both operands\nare NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 OR 1;\n -> 1\nmysql> SELECT 1 OR 0;\n -> 1\nmysql> SELECT 0 OR 0;\n -> 0\nmysql> SELECT 0 OR NULL;\n -> NULL\nmysql> SELECT 1 OR NULL;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (211,38,'LOAD_FILE','Syntax:\nLOAD_FILE(file_name)\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify\nthe full path name to the file, and you must have the FILE privilege.\nThe file must be readable by all and its size less than\nmax_allowed_packet bytes. If the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nIf the file does not exist or cannot be read because one of the\npreceding conditions is not satisfied, the function returns NULL.\n\nThe character_set_filesystem system variable controls interpretation of\nfile names that are given as literal strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> UPDATE t\n SET blob_col=LOAD_FILE(\'/tmp/picture\')\n WHERE id=1;\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (212,4,'POINTFROMTEXT','PointFromText(wkt[, srid])\n\nST_PointFromText() and PointFromText() are synonyms. For more\ninformation, see the description of ST_PointFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (213,32,'DATE_FORMAT','Syntax:\nDATE_FORMAT(date,format)\n\nFormats the date value according to the format string.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n -> \'Sunday October 2009\'\nmysql> SELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n -> \'22:23:00\'\nmysql> SELECT DATE_FORMAT(\'1900-10-04 22:23:00\',\n -> \'%D %y %a %d %m %b %j\');\n -> \'4th 00 Thu 04 10 Oct 277\'\nmysql> SELECT DATE_FORMAT(\'1997-10-04 22:23:00\',\n -> \'%H %k %I %r %T %S %w\');\n -> \'22 22 10 10:23:00 PM 22:23:00 00 6\'\nmysql> SELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n -> \'1998 52\'\nmysql> SELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n -> \'00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (214,32,'YEAR','Syntax:\nYEAR(date)\n\nReturns the year for date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT YEAR(\'1987-01-01\');\n -> 1987\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (215,20,'IS NULL','Syntax:\nIS NULL\n\nTests whether a value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n -> 0, 0, 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (216,40,'ALTER SERVER','Syntax:\nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n\nAlters the server information for server_name, adjusting any of the\noptions permitted in the CREATE SERVER statement. The corresponding\nfields in the mysql.servers table are updated accordingly. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-server.html\n\n','ALTER SERVER s OPTIONS (USER \'sally\');\n','http://dev.mysql.com/doc/refman/5.6/en/alter-server.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (217,24,'RESIGNAL','Syntax:\nRESIGNAL [condition_value]\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nRESIGNAL passes on the error condition information that is available\nduring execution of a condition handler within a compound statement\ninside a stored procedure or function, trigger, or event. RESIGNAL may\nchange some or all information before passing it on. RESIGNAL is\nrelated to SIGNAL, but instead of originating a condition as SIGNAL\ndoes, RESIGNAL relays existing condition information, possibly after\nmodifying it.\n\nRESIGNAL makes it possible to both handle an error and return the error\ninformation. Otherwise, by executing an SQL statement within the\nhandler, information that caused the handler\'s activation is destroyed.\nRESIGNAL also can make some procedures shorter if a given handler can\nhandle part of a situation, then pass the condition "up the line" to\nanother handler.\n\nNo special privileges are required to execute the RESIGNAL statement.\n\nAll forms of RESIGNAL require that the current context be a condition\nhandler. Otherwise, RESIGNAL is illegal and a RESIGNAL when handler not\nactive error occurs.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html.\n\nFor condition_value and signal_information_item, the definitions and\nrules are the same for RESIGNAL as for SIGNAL. For example, the\ncondition_value can be an SQLSTATE value, and the value can indicate\nerrors, warnings, or "not found." For additional information, see [HELP\nSIGNAL].\n\nThe RESIGNAL statement takes condition_value and SET clauses, both of\nwhich are optional. This leads to several possible uses:\n\no RESIGNAL alone:\n\nRESIGNAL;\n\no RESIGNAL with new signal information:\n\nRESIGNAL SET signal_information_item [, signal_information_item] ...;\n\no RESIGNAL with a condition value and possibly new signal information:\n\nRESIGNAL condition_value\n [SET signal_information_item [, signal_information_item] ...];\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/resignal.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/resignal.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (218,13,'ST_NUMPOINTS','ST_NumPoints(ls)\n\nReturns the number of Point objects in the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_NumPoints(ST_GeomFromText(@ls));\n+------------------------------------+\n| ST_NumPoints(ST_GeomFromText(@ls)) |\n+------------------------------------+\n| 3 |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (219,32,'TIME FUNCTION','Syntax:\nTIME(expr)\n\nExtracts the time part of the time or datetime expression expr and\nreturns it as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME(\'2003-12-31 01:02:03\');\n -> \'01:02:03\'\nmysql> SELECT TIME(\'2003-12-31 01:02:03.000123\');\n -> \'01:02:03.000123\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (220,32,'DATE_ADD','Syntax:\nDATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)\n\nThese functions perform date arithmetic. The date argument specifies\nthe starting date or datetime value. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is a string; it may start with a - for negative intervals. unit is\na keyword indicating the units in which the expression should be\ninterpreted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n -> \'2009-01-01 00:00:00\'\nmysql> SELECT INTERVAL 1 DAY + \'2008-12-31\';\n -> \'2009-01-01\'\nmysql> SELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n -> \'2004-12-31 23:59:59\'\nmysql> SELECT DATE_ADD(\'2000-12-31 23:59:59\',\n -> INTERVAL 1 SECOND);\n -> \'2001-01-01 00:00:00\'\nmysql> SELECT DATE_ADD(\'2010-12-31 23:59:59\',\n -> INTERVAL 1 DAY);\n -> \'2011-01-01 23:59:59\'\nmysql> SELECT DATE_ADD(\'2100-12-31 23:59:59\',\n -> INTERVAL \'1:1\' MINUTE_SECOND);\n -> \'2101-01-01 00:01:00\'\nmysql> SELECT DATE_SUB(\'2005-01-01 00:00:00\',\n -> INTERVAL \'1 1:1:1\' DAY_SECOND);\n -> \'2004-12-30 22:58:59\'\nmysql> SELECT DATE_ADD(\'1900-01-01 00:00:00\',\n -> INTERVAL \'-1 10\' DAY_HOUR);\n -> \'1899-12-30 14:00:00\'\nmysql> SELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n -> \'1997-12-02\'\nmysql> SELECT DATE_ADD(\'1992-12-31 23:59:59.000002\',\n -> INTERVAL \'1.999999\' SECOND_MICROSECOND);\n -> \'1993-01-01 00:00:01.000001\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (221,37,'ST_ENVELOPE','ST_Envelope(g)\n\nReturns the minimum bounding rectangle (MBR) for the geometry value g,\nor NULL if the argument is NULL. The result is returned as a Polygon\nvalue that is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,2 2)\')));\n+----------------------------------------------------------------+\n| ST_AsText(ST_Envelope(ST_GeomFromText(\'LineString(1 1,2 2)\'))) |\n+----------------------------------------------------------------+\n| POLYGON((1 1,2 1,2 2,1 2,1 1)) |\n+----------------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (222,38,'LIKE','Syntax:\nexpr LIKE pat [ESCAPE \'escape_char\']\n\nPattern matching using an SQL pattern. Returns 1 (TRUE) or 0 (FALSE).\nIf either expr or pat is NULL, the result is NULL.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','mysql> SELECT \'David!\' LIKE \'David_\';\n -> 1\nmysql> SELECT \'David!\' LIKE \'%D%v%\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (223,25,'MULTIPOINT','MultiPoint(pt1, pt2, ...)\n\nConstructs a MultiPoint value using Point or WKB Point arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (224,19,'>>','Syntax:\n>>\n\nShifts a longlong (BIGINT) number to the right.\n\nThe result is an unsigned 64-bit integer. The value is truncated to 64\nbits. In particular, if the shift count is greater or equal to the\nwidth of an unsigned 64-bit number, the result is zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 4 >> 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (225,24,'FETCH','Syntax:\nFETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ...\n\nThis statement fetches the next row for the SELECT statement associated\nwith the specified cursor (which must be open), and advances the cursor\npointer. If a row exists, the fetched columns are stored in the named\nvariables. The number of columns retrieved by the SELECT statement must\nmatch the number of output variables specified in the FETCH statement.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE\nvalue \'02000\'. To detect this condition, you can set up a handler for\nit (or for a NOT FOUND condition). For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nBe aware that another operation, such as a SELECT or another FETCH, may\nalso cause the handler to execute by raising the same condition. If it\nis necessary to distinguish which operation raised the condition, place\nthe operation within its own BEGIN ... END block so that it can be\nassociated with its own handler.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/fetch.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/fetch.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (226,30,'TRUE FALSE','The constants TRUE and FALSE evaluate to 1 and 0, respectively. The\nconstant names can be written in any lettercase.\n\nmysql> SELECT TRUE, true, FALSE, false;\n -> 1, 1, 0, 0\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/boolean-literals.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/boolean-literals.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (227,7,'MBRWITHIN','MBRWithin(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangle of g1\nis within the minimum bounding rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = ST_GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nmysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (228,17,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (229,27,'SHOW CREATE FUNCTION','Syntax:\nSHOW CREATE FUNCTION func_name\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored\nfunctions. See [HELP SHOW CREATE PROCEDURE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (230,32,'STR_TO_DATE','Syntax:\nSTR_TO_DATE(str,format)\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string\nstr and a format string format. STR_TO_DATE() returns a DATETIME value\nif the format string contains both date and time parts, or a DATE or\nTIME value if the string contains only date or time parts. If the date,\ntime, or datetime value extracted from str is illegal, STR_TO_DATE()\nreturns NULL and produces a warning.\n\nThe server scans str attempting to match format to it. The format\nstring can contain literal characters and format specifiers beginning\nwith %. Literal characters in format must match literally in str.\nFormat specifiers in format must match a date or time part in str. For\nthe specifiers that can be used in format, see the DATE_FORMAT()\nfunction description.\n\nmysql> SELECT STR_TO_DATE(\'01,5,2013\',\'%d,%m,%Y\');\n -> \'2013-05-01\'\nmysql> SELECT STR_TO_DATE(\'May 1, 2013\',\'%M %d,%Y\');\n -> \'2013-05-01\'\n\nScanning starts at the beginning of str and fails if format is found\nnot to match. Extra characters at the end of str are ignored.\n\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'a%h:%i:%s\');\n -> \'09:30:17\'\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'%h:%i:%s\');\n -> NULL\nmysql> SELECT STR_TO_DATE(\'09:30:17a\',\'%h:%i:%s\');\n -> \'09:30:17\'\n\nUnspecified date or time parts have a value of 0, so incompletely\nspecified values in str produce a result with some or all parts set to\n0:\n\nmysql> SELECT STR_TO_DATE(\'abc\',\'abc\');\n -> \'0000-00-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%m\');\n -> \'0000-09-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%s\');\n -> \'00:00:09\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (231,11,'Y','Y(p)\n\nST_Y() and Y() are synonyms. For more information, see the description\nof ST_Y().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (232,21,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [QUICK | EXTENDED]\n\nCHECKSUM TABLE reports a checksum for the contents of a table. During\nthe checksum operation, the table is locked with a read lock for InnoDB\nand MyISAM. You can use this statement to verify that the contents are\nthe same before and after a backup, rollback, or other operation that\nis intended to put the data back to a known state. This statement\nrequires the SELECT privilege for the table.\n\nThis statement is not supported for views. If you run CHECKSUM TABLE\nagainst a view, the Checksum value is always NULL, and a warning is\nreturned.\n\nPerformance Considerations\n\nBy default, the entire table is read row by row and the checksum is\ncalculated. For large tables, this could take a long time, thus you\nwould only perform this operation occasionally. This row-by-row\ncalculation is what you get with the EXTENDED clause, with InnoDB and\nall other storage engines other than MyISAM, and with MyISAM tables not\ncreated with the CHECKSUM=1 clause.\n\nFor MyISAM tables created with the CHECKSUM=1 clause, CHECKSUM TABLE or\nCHECKSUM TABLE ... QUICK returns the "live" table checksum that can be\nreturned very fast. If the table does not meet all these conditions,\nthe QUICK method returns NULL. See [HELP CREATE TABLE] for the syntax\nof the CHECKSUM clause.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a\nwarning.\n\nPrior to MySQL 5.6.4, CHECKSUM TABLE returned 0 for partitioned tables\nunless the EXTENDED option was used. (Bug #11933226, Bug #60681)\n\nThe checksum value depends on the table row format. If the row format\nchanges, the checksum also changes. For example, the change in storage\nformat for temporal types such as TIME, DATETIME, and TIMESTAMP just\ndescribed mean that, if a 5.5 table is upgraded to MySQL 5.6, the\nchecksum value may change.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/checksum-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/checksum-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (233,2,'NUMINTERIORRINGS','NumInteriorRings(poly)\n\nST_NumInteriorRings() and NumInteriorRings() are synonyms. For more\ninformation, see the description of ST_NumInteriorRings().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (234,2,'INTERIORRINGN','InteriorRingN(poly, N)\n\nST_InteriorRingN() and InteriorRingN() are synonyms. For more\ninformation, see the description of ST_InteriorRingN().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (235,32,'UTC_TIME','Syntax:\nUTC_TIME, UTC_TIME([fsp])\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIME(), UTC_TIME() + 0;\n -> \'18:07:53\', 180753.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (236,14,'IS_IPV4_COMPAT','Syntax:\nIS_IPV4_COMPAT(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-compatible IPv6 address, 0 otherwise.\nIPv4-compatible addresses have the form ::ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.5.9\'));\n -> 1\nmysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (237,40,'DROP FUNCTION','The DROP FUNCTION statement is used to drop stored functions and\nuser-defined functions (UDFs):\n\no For information about dropping stored functions, see [HELP DROP\n PROCEDURE].\n\no For information about dropping user-defined functions, see [HELP DROP\n FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (238,4,'ST_POLYFROMTEXT','ST_PolyFromText(wkt[, srid]), ST_PolygonFromText(wkt[, srid])\n\nConstructs a Polygon value using its WKT representation and SRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (239,16,'STDDEV','Syntax:\nSTDDEV(expr)\n\nReturns the population standard deviation of expr. This function is\nprovided for compatibility with Oracle. The standard SQL function\nSTDDEV_POP() can be used instead.\n\nIf there are no matching rows, STDDEV() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (240,32,'PERIOD_ADD','Syntax:\nPERIOD_ADD(P,N)\n\nAdds N months to period P (in the format YYMM or YYYYMM). Returns a\nvalue in the format YYYYMM.\n\n*Note*:\n\nThe period argument P is not a date value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_ADD(200801,2);\n -> 200803\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (241,38,'RIGHT','Syntax:\nRIGHT(str,len)\n\nReturns the rightmost len characters from the string str, or NULL if\nany argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RIGHT(\'foobarbar\', 4);\n -> \'rbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (242,40,'DROP TABLESPACE','Syntax:\nDROP TABLESPACE tablespace_name\n ENGINE [=] engine_name\n\nThis statement drops a tablespace that was previously created using\nCREATE TABLESPACE (see [HELP CREATE TABLESPACE]).\n\n*Important*:\n\nThe tablespace to be dropped must not contain any data files; in other\nwords, before you can drop a tablespace, you must first drop each of\nits data files using ALTER TABLESPACE ... DROP DATAFILE (see [HELP\nALTER TABLESPACE]).\n\nThe ENGINE clause (required) specifies the storage engine used by the\ntablespace. Currently, the only accepted values for engine_name are NDB\nand NDBCLUSTER.\n\nDROP TABLESPACE is useful only with Disk Data storage for NDB Cluster.\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-tablespace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (243,21,'CHECK TABLE','Syntax:\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {\n FOR UPGRADE\n | QUICK\n | FAST\n | MEDIUM\n | EXTENDED\n | CHANGED\n}\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nInnoDB, MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, the key\nstatistics are updated as well.\n\nBefore running CHECK TABLE on InnoDB tables, see\nhttp://dev.mysql.com/doc/refman/5.6/en/check-table.html#check-table-inn\nodb.\n\nTo check a table, you must have some privilege for it.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nCHECK TABLE is supported for partitioned tables, and you can use ALTER\nTABLE ... CHECK PARTITION to check one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/check-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/check-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (244,38,'BIN','Syntax:\nBIN(N)\n\nReturns a string representation of the binary value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT BIN(12);\n -> \'1100\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (245,25,'MULTILINESTRING','MultiLineString(ls1, ls2, ...)\n\nConstructs a MultiLineString value using LineString or WKB LineString\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (246,27,'SHOW RELAYLOG EVENTS','Syntax:\nSHOW RELAYLOG EVENTS\n [IN \'log_name\']\n [FROM pos]\n [LIMIT [offset,] row_count]\n\nShows the events in the relay log of a replication slave. If you do not\nspecify \'log_name\', the first relay log is displayed. This statement\nhas no effect on the master.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-relaylog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-relaylog-events.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (247,4,'MPOINTFROMTEXT','MPointFromText(wkt[, srid]), MultiPointFromText(wkt[, srid])\n\nConstructs a MultiPoint value using its WKT representation and SRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (248,38,'SUBSTR','Syntax:\nSUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str\nFROM pos FOR len)\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (249,23,'CHAR','[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA fixed-length string that is always right-padded with spaces to the\nspecified length when stored. M represents the column length in\ncharacters. The range of M is 0 to 255. If M is omitted, the length is\n1.\n\n*Note*:\n\nTrailing spaces are removed when CHAR values are retrieved unless the\nPAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (250,16,'COUNT DISTINCT','Syntax:\nCOUNT(DISTINCT expr,[expr...])\n\nReturns a count of the number of rows with different non-NULL expr\nvalues.\n\nIf there are no matching rows, COUNT(DISTINCT) returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT COUNT(DISTINCT results) FROM student;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (251,27,'SHOW CREATE VIEW','Syntax:\nSHOW CREATE VIEW view_name\n\nThis statement shows the CREATE VIEW statement that creates the named\nview.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (252,20,'INTERVAL','Syntax:\nINTERVAL(N,N1,N2,N3,...)\n\nReturns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All\narguments are treated as integers. It is required that N1 < N2 < N3 <\n... < Nn for this function to work correctly. This is because a binary\nsearch is used (very fast).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (253,32,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_DAYS(730669);\n -> \'2007-07-03\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (254,40,'ALTER PROCEDURE','Syntax:\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a\nstored procedure using this statement; to make such changes, you must\ndrop and re-create the procedure using DROP PROCEDURE and CREATE\nPROCEDURE.\n\nYou must have the ALTER ROUTINE privilege for the procedure. By\ndefault, that privilege is granted automatically to the procedure\ncreator. This behavior can be changed by disabling the\nautomatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (255,19,'BIT_COUNT','Syntax:\nBIT_COUNT(N)\n\nReturns the number of bits that are set in the argument N as an\nunsigned 64-bit integer, or NULL if the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n -> 4, 3\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (256,33,'ST_POINTFROMWKB','ST_PointFromWKB(wkb[, srid])\n\nConstructs a Point value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (257,31,'ST_WITHIN','ST_Within(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as ST_Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (258,3,'ACOS','Syntax:\nACOS(X)\n\nReturns the arc cosine of X, that is, the value whose cosine is X.\nReturns NULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ACOS(1);\n -> 0\nmysql> SELECT ACOS(1.0001);\n -> NULL\nmysql> SELECT ACOS(0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (259,8,'ISOLATION','Syntax:\nSET [GLOBAL | SESSION] TRANSACTION\n transaction_characteristic [, transaction_characteristic] ...\n\ntransaction_characteristic:\n ISOLATION LEVEL level\n | READ WRITE\n | READ ONLY\n\nlevel:\n REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n\nThis statement specifies transaction characteristics. It takes a list\nof one or more characteristic values separated by commas. These\ncharacteristics set the transaction isolation level or access mode. The\nisolation level is used for operations on InnoDB tables. The access\nmode may be specified as of MySQL 5.6.5 and indicates whether\ntransactions operate in read/write or read-only mode.\n\nIn addition, SET TRANSACTION can include an optional GLOBAL or SESSION\nkeyword to indicate the scope of the statement.\n\nScope of Transaction Characteristics\n\nYou can set transaction characteristics globally, for the current\nsession, or for the next transaction:\n\no With the GLOBAL keyword, the statement applies globally for all\n subsequent sessions. Existing sessions are unaffected.\n\no With the SESSION keyword, the statement applies to all subsequent\n transactions performed within the current session.\n\no Without any SESSION or GLOBAL keyword, the statement applies to the\n next (not started) transaction performed within the current session.\n Subsequent transactions revert to using the SESSION isolation level.\n\nA global change to transaction characteristics requires the SUPER\nprivilege. Any session is free to change its session characteristics\n(even in the middle of a transaction), or the characteristics for its\nnext transaction.\n\nSET TRANSACTION without GLOBAL or SESSION is not permitted while there\nis an active transaction:\n\nmysql> START TRANSACTION;\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be changed\nwhile a transaction is in progress\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option to mysqld on the command line or\nin an option file. Values of level for this option use dashes rather\nthan spaces, so the permissible values are READ-UNCOMMITTED,\nREAD-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. For example, to set\nthe default isolation level to REPEATABLE READ, use these lines in the\n[mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\n\nIt is possible to check or set the global and session transaction\nisolation levels at runtime by using the tx_isolation system variable:\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\nSET GLOBAL tx_isolation=\'REPEATABLE-READ\';\nSET SESSION tx_isolation=\'SERIALIZABLE\';\n\nSimilarly, to set the transaction access mode at server startup or at\nruntime, use the --transaction-read-only option or tx_read_only system\nvariable. By default, these are OFF (the mode is read/write) but can be\nset to ON for a default mode of read only.\n\nSetting the global or session value of tx_isolation or tx_read_only is\nequivalent to setting the isolation level or access mode with SET\nGLOBAL TRANSACTION or SET SESSION TRANSACTION.\n\nTransaction Isolation Levels\n\nFor information about transaction isolation levels, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-transaction-isolation-lev\nels.html.\n\nTransaction Access Mode\n\nAs of MySQL 5.6.5, the transaction access mode may be specified with\nSET TRANSACTION. By default, a transaction takes place in read/write\nmode, with both reads and writes permitted to tables used in the\ntransaction. This mode may be specified explicitly using an access mode\nof READ WRITE.\n\nIf the transaction access mode is set to READ ONLY, changes to tables\nare prohibited. This may enable storage engines to make performance\nimprovements that are possible when writes are not permitted.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the\nsame statement.\n\nIn read-only mode, it remains possible to change tables created with\nthe TEMPORARY keyword using DML statements. Changes made with DDL\nstatements are not permitted, just as with permanent tables.\n\nThe READ WRITE and READ ONLY access modes also may be specified for an\nindividual transaction using the START TRANSACTION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-transaction.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-transaction.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (260,3,'SIN','Syntax:\nSIN(X)\n\nReturns the sine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SIN(PI());\n -> 1.2246063538224e-16\nmysql> SELECT ROUND(SIN(PI()));\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (261,26,'ST_BUFFER','ST_Buffer(g, d)\n\nReturns a geometry that represents all points whose distance from the\ngeometry value g is less than or equal to a distance of d.\n\nST_Buffer() supports negative distances for polygons, multipolygons,\nand geometry collections containing polygons or multipolygons. For\npoint, multipoint, linestring, multilinestring, and geometry\ncollections not containing any polygons or multipolygons, ST_Buffer()\nwith a negative distance returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (262,26,'BUFFER','Buffer(g, d)\n\nST_Buffer() and Buffer() are synonyms. For more information, see the\ndescription of ST_Buffer().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (263,20,'IS','Syntax:\nIS boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n -> 1, 1, 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (264,32,'GET_FORMAT','Syntax:\nGET_FORMAT({DATE|TIME|DATETIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nReturns a format string. This function is useful in combination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n -> \'03.10.2003\'\nmysql> SELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n -> \'2003-10-31\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (265,2,'ST_CENTROID','ST_Centroid(mpoly)\n\nReturns the mathematical centroid for the MultiPolygon value mpoly as a\nPoint. The result is not guaranteed to be on the MultiPolygon.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n -> ST_GeomFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))\');\nmysql> SELECT GeometryType(@poly),ST_AsText(ST_Centroid(@poly));\n+---------------------+--------------------------------------------+\n| GeometryType(@poly) | ST_AsText(ST_Centroid(@poly)) |\n+---------------------+--------------------------------------------+\n| POLYGON | POINT(4.958333333333333 4.958333333333333) |\n+---------------------+--------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (266,23,'TINYBLOB','TINYBLOB\n\nA BLOB column with a maximum length of 255 (28 − 1) bytes. Each\nTINYBLOB value is stored using a 1-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (267,17,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (268,21,'REPAIR TABLE','Syntax:\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n\nREPAIR TABLE repairs a possibly corrupted table, for certain storage\nengines only. By default, it has the same effect as myisamchk --recover\ntbl_name. REPAIR TABLE works for MyISAM, ARCHIVE, and CSV tables. See\nhttp://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html\nhttp://dev.mysql.com/doc/refman/5.6/en/archive-storage-engine.html, and\nhttp://dev.mysql.com/doc/refman/5.6/en/csv-storage-engine.html. This\nstatement does not work with views.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nREPAIR TABLE is supported for partitioned tables. However, the USE_FRM\noption cannot be used with this statement on a partitioned table.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nYou can use ALTER TABLE ... REPAIR PARTITION to repair one or more\npartitions; for more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/repair-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/repair-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (269,18,'MERGE','The MERGE storage engine, also known as the MRG_MyISAM engine, is a\ncollection of identical MyISAM tables that can be used as one.\n"Identical" means that all tables have identical column and index\ninformation. You cannot merge MyISAM tables in which the columns are\nlisted in a different order, do not have exactly the same columns, or\nhave the indexes in different order. However, any or all of the MyISAM\ntables can be compressed with myisampack. See\nhttp://dev.mysql.com/doc/refman/5.6/en/myisampack.html. Differences in\ntable options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not\nmatter.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/merge-storage-engine.html\n\n','mysql> CREATE TABLE t1 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> CREATE TABLE t2 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> INSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\nmysql> INSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\nmysql> CREATE TABLE total (\n -> a INT NOT NULL AUTO_INCREMENT,\n -> message CHAR(20), INDEX(a))\n -> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n','http://dev.mysql.com/doc/refman/5.6/en/merge-storage-engine.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (270,31,'ST_DISTANCE','ST_Distance(g1, g2)\n\nReturns the distance between g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','mysql> SET @g1 = Point(1,1);\nmysql> SET @g2 = Point(2,2);\nmysql> SELECT ST_Distance(@g1, @g2);\n+-----------------------+\n| ST_Distance(@g1, @g2) |\n+-----------------------+\n| 1.4142135623730951 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (271,40,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...)\n [table_options]\n [partition_options]\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)]\n [table_options]\n [partition_options]\n [IGNORE | REPLACE]\n [AS] query_expression\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_tbl_name | (LIKE old_tbl_name) }\n\ncreate_definition:\n col_name column_definition\n | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n [index_option] ...\n | {INDEX|KEY} [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]\n [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name,...) reference_definition\n | CHECK (expr)\n\ncolumn_definition:\n data_type [NOT NULL | NULL] [DEFAULT default_value]\n [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]\n [COMMENT \'string\']\n [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n [STORAGE {DISK|MEMORY|DEFAULT}]\n [reference_definition]\n\ndata_type:\n BIT[(length)]\n | TINYINT[(length)] [UNSIGNED] [ZEROFILL]\n | SMALLINT[(length)] [UNSIGNED] [ZEROFILL]\n | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]\n | INT[(length)] [UNSIGNED] [ZEROFILL]\n | INTEGER[(length)] [UNSIGNED] [ZEROFILL]\n | BIGINT[(length)] [UNSIGNED] [ZEROFILL]\n | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DECIMAL[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | NUMERIC[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | DATE\n | TIME[(fsp)]\n | TIMESTAMP[(fsp)]\n | DATETIME[(fsp)]\n | YEAR\n | CHAR[(length)] [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | VARCHAR(length) [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | BINARY[(length)]\n | VARBINARY(length)\n | TINYBLOB\n | BLOB\n | MEDIUMBLOB\n | LONGBLOB\n | TINYTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | TEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | MEDIUMTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | LONGTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | ENUM(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | SET(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | spatial_type\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nreference_definition:\n REFERENCES tbl_name (index_col_name,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] value\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list)\n | RANGE{(expr) | COLUMNS(column_list)}\n | LIST{(expr) | COLUMNS(column_list)} }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\n\npartition_definition:\n PARTITION partition_name\n [VALUES\n {LESS THAN {(expr | value_list) | MAXVALUE}\n |\n IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n [(subpartition_definition [, subpartition_definition] ...)]\n\nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n\nquery_expression:\n SELECT ... (Some valid select or union statement)\n\nCREATE TABLE creates a table with the given name. You must have the\nCREATE privilege for the table.\n\nBy default, tables are created in the default database, using the\nInnoDB storage engine. An error occurs if the table exists, if there is\nno default database, or if the database does not exist.\n\nFor information about the physical representation of a table, see\nhttp://dev.mysql.com/doc/refman/5.6/en/create-table-files.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (272,32,'MICROSECOND','Syntax:\nMICROSECOND(expr)\n\nReturns the microseconds from the time or datetime expression expr as a\nnumber in the range from 0 to 999999.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MICROSECOND(\'12:00:00.123456\');\n -> 123456\nmysql> SELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n -> 10\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (273,40,'CREATE SERVER','Syntax:\nCREATE SERVER server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n\noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n\nThis statement creates the definition of a server for use with the\nFEDERATED storage engine. The CREATE SERVER statement creates a new row\nin the servers table in the mysql database. This statement requires the\nSUPER privilege.\n\nThe server_name should be a unique reference to the server. Server\ndefinitions are global within the scope of the server, it is not\npossible to qualify the server definition to a specific database.\nserver_name has a maximum length of 64 characters (names longer than 64\ncharacters are silently truncated), and is case insensitive. You may\nspecify the name as a quoted string.\n\nThe wrapper_name should be mysql, and may be quoted with single\nquotation marks. Other values for wrapper_name are not currently\nsupported.\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are\nsilently truncated to 64 characters. Numeric literals must be a number\nbetween 0 and 9999, default value is 0.\n\n*Note*:\n\nThe OWNER option is currently not applied, and has no effect on the\nownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table\nthat can later be used with the CREATE TABLE statement when creating a\nFEDERATED table. The options that you specify will be used to populate\nthe columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-server.html\n\n','CREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n','http://dev.mysql.com/doc/refman/5.6/en/create-server.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (274,33,'ST_POLYFROMWKB','ST_PolyFromWKB(wkb[, srid]), ST_PolygonFromWKB(wkb[, srid])\n\nConstructs a Polygon value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (275,32,'MAKETIME','Syntax:\nMAKETIME(hour,minute,second)\n\nReturns a time value calculated from the hour, minute, and second\narguments.\n\nAs of MySQL 5.6.4, the second argument can have a fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MAKETIME(12,15,30);\n -> \'12:15:30\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (276,32,'CURDATE','Syntax:\nCURDATE()\n\nReturns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CURDATE();\n -> \'2008-06-13\'\nmysql> SELECT CURDATE() + 0;\n -> 20080613\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (277,10,'SET PASSWORD','Syntax:\nSET PASSWORD [FOR user] = password_option\n\npassword_option: {\n PASSWORD(\'auth_string\')\n | OLD_PASSWORD(\'auth_string\')\n | \'hash_string\'\n}\n\nThe SET PASSWORD statement assigns a password to a MySQL user account,\nspecified as either a cleartext (unencrypted) or encrypted value:\n\no \'auth_string\' represents a cleartext password.\n\no \'hash_string\' represents an encrypted password.\n\nSET PASSWORD can be used with or without an explicitly named user\naccount:\n\no With a FOR user clause, the statement sets the password for the named\n account, which must exist:\n\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = password_option;\n\n In this case, you must have the UPDATE privilege for the mysql\n database.\n\no With no FOR user clause, the statement sets the password for the\n current user:\n\nSET PASSWORD = password_option;\n\n Any client who connects to the server using a nonanonymous account\n can change the password for that account. To see which account the\n server authenticated you as, invoke the CURRENT_USER() function:\n\nSELECT CURRENT_USER();\n\nWhen the read_only system variable is enabled, SET PASSWORD requires\nthe SUPER privilege in addition to any other required privileges.\n\nIf a FOR user clause is given, the account name uses the format\ndescribed in http://dev.mysql.com/doc/refman/5.6/en/account-names.html.\nThe user value should be given as \'user_name\'@\'host_name\', where\n\'user_name\' and \'host_name\' are exactly as listed in the User and Host\ncolumns of the account\'s mysql.user table row. The host name part of\nthe account name, if omitted, defaults to \'%\'. For example, to set the\npassword for an account with User and Host column values of \'bob\' and\n\'%.example.org\', write the statement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.example.org\' = PASSWORD(\'auth_string\');\n\nThe password can be specified in these ways:\n\no Using the PASSWORD() function\n\n The \'auth_string\' function argument is the cleartext (unencrypted)\n password. PASSWORD() hashes the password and returns the encrypted\n password string for storage in the mysql.user account row.\n\n The PASSWORD() function hashes the password using the hashing method\n determined by the value of the old_passwords system variable value.\n If SET PASSWORD rejects the hashed password value returned by\n PASSWORD() as not being in the correct format, it may be necessary to\n change old_passwords to change the hashing method. For example, if\n the account uses the mysql_native_password plugin, the old_passwords\n value must be 0:\n\nSET old_passwords = 0;\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\n\n If the old_passwords value differs from that required by the\n authentication plugin, the hashed password value returned by\n PASSWORD() is not acceptable for that plugin, and attempts to set the\n password produce an error. For example:\n\nmysql> SET old_passwords = 1;\nmysql> SET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\nERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number\n\n Permitted old_passwords values are described later in this section.\n\no Using the OLD_PASSWORD() function:\n\n The \'auth_string\' function argument is the cleartext (unencrypted)\n password. OLD_PASSWORD() hashes the password using pre-4.1 hashing\n and returns the encrypted password string for storage in the\n mysql.user account row. This hashing method is appropriate only for\n accounts that use the mysql_old_password authentication plugin.\n\no Using an already encrypted password string\n\n The password is specified as a string literal. It must represent the\n already encrypted password value, in the hash format required by the\n authentication method used for the account.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-password.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-password.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (278,17,'DATABASE','Syntax:\nDATABASE()\n\nReturns the default (current) database name as a string in the utf8\ncharacter set. If there is no default database, DATABASE() returns\nNULL. Within a stored routine, the default database is the database\nthat the routine is associated with, which is not necessarily the same\nas the database that is the default in the calling context.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT DATABASE();\n -> \'test\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (279,6,'IF FUNCTION','Syntax:\nIF(expr1,expr2,expr3)\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL), IF() returns expr2.\nOtherwise, it returns expr3.\n\n*Note*:\n\nThere is also an IF statement, which differs from the IF() function\ndescribed here. See [HELP IF statement].\n\nIf only one of expr2 or expr3 is explicitly NULL, the result type of\nthe IF() function is the type of the non-NULL expression.\n\nThe default return type of IF() (which may matter when it is stored\ninto a temporary table) is calculated as follows:\n\no If expr2 or expr3 produce a string, the result is a string.\n\n If expr2 and expr3 are both strings, the result is case sensitive if\n either string is case sensitive.\n\no If expr2 or expr3 produce a floating-point value, the result is a\n floating-point value.\n\no If expr2 or expr3 produce an integer, the result is an integer.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT IF(1>2,2,3);\n -> 3\nmysql> SELECT IF(1<2,\'yes\',\'no\');\n -> \'yes\'\nmysql> SELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n -> \'no\'\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (280,33,'POINTFROMWKB','PointFromWKB(wkb[, srid])\n\nST_PointFromWKB() and PointFromWKB() are synonyms. For more\ninformation, see the description of ST_PointFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (281,3,'POWER','Syntax:\nPOWER(X,Y)\n\nThis is a synonym for POW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (282,3,'ATAN','Syntax:\nATAN(X)\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(2);\n -> 1.1071487177941\nmysql> SELECT ATAN(-2);\n -> -1.1071487177941\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (283,27,'SHOW PROFILE','Syntax:\nSHOW PROFILE [type [, type] ... ]\n [FOR QUERY n]\n [LIMIT row_count [OFFSET offset]]\n\ntype:\n ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling\ninformation that indicates resource usage for statements executed\nduring the course of the current session.\n\n*Note*:\n\nThese statements are deprecated as of MySQL 5.6.7 and will be removed\nin a future MySQL release. Use the Performance Schema instead; see\nhttp://dev.mysql.com/doc/refman/5.6/en/performance-schema-query-profili\nng.html.\n\nProfiling is controlled by the profiling session variable, which has a\ndefault value of 0 (OFF). Profiling is enabled by setting profiling to\n1 or ON:\n\nmysql> SET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nserver. The size of the list is controlled by the\nprofiling_history_size session variable, which has a default value of\n15. The maximum value is 100. Setting the value to 0 has the practical\neffect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILE and SHOW PROFILES, so\nyou will find neither of those statements in the profile list.\nMalformed statements are profiled. For example, SHOW PROFILING is an\nillegal statement, and a syntax error occurs if you try to execute it,\nbut it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement.\nWithout the FOR QUERY n clause, the output pertains to the most\nrecently executed statement. If FOR QUERY n is included, SHOW PROFILE\ndisplays information for statement n. The values of n correspond to the\nQuery_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to\nrow_count rows. If LIMIT is given, OFFSET offset may be added to begin\nthe output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The\nStatus values are like the State values displayed by SHOW PROCESSLIST,\nalthough there might be some minor differences in interpretion for the\ntwo statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/thread-information.html).\n\nOptional type values may be specified to display specific additional\ntypes of information:\n\no ALL displays all information\n\no BLOCK IO displays counts for block input and output operations\n\no CONTEXT SWITCHES displays counts for voluntary and involuntary\n context switches\n\no CPU displays user and system CPU usage times\n\no IPC displays counts for messages sent and received\n\no MEMORY is not currently implemented\n\no PAGE FAULTS displays counts for major and minor page faults\n\no SOURCE displays the names of functions from the source code, together\n with the name and line number of the file in which the function\n occurs\n\no SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-profile.html\n\n','mysql> SELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> SET profiling = 1;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> DROP TABLE IF EXISTS t1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> CREATE TABLE T1 (id INT);\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SHOW PROFILES;\n+----------+----------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+----------+--------------------------+\n| 0 | 0.000088 | SET PROFILING = 1 |\n| 1 | 0.000136 | DROP TABLE IF EXISTS t1 |\n| 2 | 0.011947 | CREATE TABLE t1 (id INT) |\n+----------+----------+--------------------------+\n3 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| checking permissions | 0.000040 |\n| creating table | 0.000056 |\n| After create | 0.011363 |\n| query end | 0.000375 |\n| freeing items | 0.000089 |\n| logging slow query | 0.000019 |\n| cleaning up | 0.000005 |\n+----------------------+----------+\n7 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE FOR QUERY 1;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| query end | 0.000107 |\n| freeing items | 0.000008 |\n| logging slow query | 0.000015 |\n| cleaning up | 0.000006 |\n+--------------------+----------+\n4 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE CPU FOR QUERY 2;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| checking permissions | 0.000040 | 0.000038 | 0.000002 |\n| creating table | 0.000056 | 0.000028 | 0.000028 |\n| After create | 0.011363 | 0.000217 | 0.001571 |\n| query end | 0.000375 | 0.000013 | 0.000028 |\n| freeing items | 0.000089 | 0.000010 | 0.000014 |\n| logging slow query | 0.000019 | 0.000009 | 0.000010 |\n| cleaning up | 0.000005 | 0.000003 | 0.000002 |\n+----------------------+----------+----------+------------+\n7 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/show-profile.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (284,3,'LN','Syntax:\nLN(X)\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X.\nIf X is less than or equal to 0, then NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LN(2);\n -> 0.69314718055995\nmysql> SELECT LN(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (285,27,'SET CHARACTER SET','Syntax:\nSET {CHARACTER SET | CHARSET}\n {\'charset_name\' | DEFAULT}\n\nThis statement maps all strings sent between the server and the current\nclient with the given mapping. SET CHARACTER SET sets three session\nsystem variables: character_set_client and character_set_results are\nset to the given character set, and character_set_connection to the\nvalue of character_set_database. See\nhttp://dev.mysql.com/doc/refman/5.6/en/charset-connection.html.\n\ncharset_name may be quoted or unquoted.\n\nThe default character set mapping can be restored by using the value\nDEFAULT. The default depends on the server configuration.\n\nucs2, utf16, and utf32 cannot be used as a client character set, which\nmeans that they do not work for SET CHARACTER SET.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-character-set.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (286,24,'RETURN','Syntax:\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and\nreturns the value expr to the function caller. There must be at least\none RETURN statement in a stored function. There may be more than one\nif the function has multiple exit points.\n\nThis statement is not used in stored procedures, triggers, or events.\nThe LEAVE statement can be used to exit a stored program of those\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/return.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/return.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (287,8,'SET SQL_LOG_BIN','Syntax:\nSET sql_log_bin = {0|1}\n\nThe sql_log_bin variable controls whether logging to the binary log is\ndone. The default value is 1 (do logging). To change logging for the\ncurrent session, change the session value of this variable. The session\nuser must have the SUPER privilege to set this variable. Set this\nvariable to 0 for a session to temporarily disable binary logging while\nmaking changes to the master which you do not want to replicate to the\nslave.\n\nAs of MySQL 5.5, sql_log_bin can be set as a global or session\nvariable. Setting sql_log_bin globally is only detected when a new\nsession is started. Any sessions previously running are not impacted\nwhen setting sql_log_bin globally.\n\n*Warning*:\n\nIncorrect use of sql_log_bin with a global scope means any changes made\nin an already running session are still being recorded to the binary\nlog and therefore replicated. Exercise extreme caution using\nsql_log_bin with a global scope as the above situation could cause\nunexpected results including replication failure.\n\nIn MySQL 5.6, it is not possible to set @@session.sql_log_bin within a\ntransaction or subquery. (Bug #53437)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-sql-log-bin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-sql-log-bin.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (288,12,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str[,init_vector])\n\nThis function decrypts data using the official AES (Advanced Encryption\nStandard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nThe optional initialization vector argument, init_vector, is available\nas of MySQL 5.6.17. As of that version, statements that use\nAES_DECRYPT() are unsafe for statement-based replication and cannot be\nstored in the query cache.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (289,17,'COERCIBILITY','Syntax:\nCOERCIBILITY(str)\n\nReturns the collation coercibility value of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n -> 0\nmysql> SELECT COERCIBILITY(USER());\n -> 3\nmysql> SELECT COERCIBILITY(\'abc\');\n -> 4\nmysql> SELECT COERCIBILITY(1000);\n -> 5\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (290,23,'INT','INT[(M)] [UNSIGNED] [ZEROFILL]\n\nA normal-size integer. The signed range is -2147483648 to 2147483647.\nThe unsigned range is 0 to 4294967295.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (291,13,'GLENGTH','GLength(ls)\n\nReturns a double-precision number indicating the length of the\nLineString or MultiLineString value ls in its associated spatial\nreference. The length of a MultiLineString value is equal to the sum of\nthe lengths of its elements.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n| 2.8284271247461903 |\n+----------------------------+\n\nmysql> SET @mls = \'MultiLineString((1 1,2 2,3 3),(4 4,5 5))\';\nmysql> SELECT GLength(GeomFromText(@mls));\n+-----------------------------+\n| GLength(GeomFromText(@mls)) |\n+-----------------------------+\n| 4.242640687119286 |\n+-----------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (292,38,'MAKE_SET','Syntax:\nMAKE_SET(bits,str1,str2,...)\n\nReturns a set value (a string containing substrings separated by ,\ncharacters) consisting of the strings that have the corresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL\nvalues in str1, str2, ... are not appended to the result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n -> \'a\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n -> \'hello,world\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n -> \'hello\'\nmysql> SELECT MAKE_SET(0,\'a\',\'b\',\'c\');\n -> \'\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (293,38,'FIND_IN_SET','Syntax:\nFIND_IN_SET(str,strlist)\n\nReturns a value in the range of 1 to N if the string str is in the\nstring list strlist consisting of N substrings. A string list is a\nstring composed of substrings separated by , characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimized to use bit arithmetic. Returns\n0 if str is not in strlist or if strlist is the empty string. Returns\nNULL if either argument is NULL. This function does not work properly\nif the first argument contains a comma (,) character.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIND_IN_SET(\'b\',\'a,b,c,d\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (294,16,'MIN','Syntax:\nMIN([DISTINCT] expr)\n\nReturns the minimum value of expr. MIN() may take a string argument; in\nsuch cases, it returns the minimum string value. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the minimum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nIf there are no matching rows, MIN() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (295,28,'REPLACE','Syntax:\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n SET col_name={expr | DEFAULT}, ...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n [(col_name,...)]\n SELECT ...\n\nREPLACE works exactly like INSERT, except that if an old row in the\ntable has the same value as a new row for a PRIMARY KEY or a UNIQUE\nindex, the old row is deleted before the new row is inserted. See [HELP\nINSERT].\n\nREPLACE is a MySQL extension to the SQL standard. It either inserts, or\ndeletes and inserts. For another MySQL extension to standard SQL---that\neither inserts or updates---see\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html.\n\n*Note*:\n\nREPLACE makes sense only if a table has a PRIMARY KEY or UNIQUE index.\nOtherwise, it becomes equivalent to INSERT, because there is no index\nto be used to determine whether a new row duplicates another.\n\nValues for all columns are taken from the values specified in the\nREPLACE statement. Any missing columns are set to their default values,\njust as happens for INSERT. You cannot refer to values from the current\nrow and use them in the new row. If you use an assignment such as SET\ncol_name = col_name + 1, the reference to the column name on the right\nhand side is treated as DEFAULT(col_name), so the assignment is\nequivalent to SET col_name = DEFAULT(col_name) + 1.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for\nthe table.\n\nREPLACE supports explicit partition selection using the PARTITION\noption with a comma-separated list of names of partitions,\nsubpartitions, or both. As with INSERT, if it is not possible to insert\nthe new row into any of these partitions or subpartitions, the REPLACE\nstatement fails with the error Found a row not matching the given\npartition set. See\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html, for\nmore information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/replace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/replace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (296,32,'CURRENT_TIMESTAMP','Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP([fsp])\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (297,26,'ST_SYMDIFFERENCE','ST_SymDifference(g1, g2)\n\nReturns a geometry that represents the point set symmetric difference\nof the geometry values g1 and g2, which is defined as:\n\ng1 symdifference g2 := (g1 union g2) difference (g1 intersection g2)\n\nOr, in function call notation:\n\nST_SymDifference(g1, g2) = ST_Difference(ST_Union(g1, g2), ST_Intersection(g1, g2))\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_AsText(ST_SymDifference(@g1, @g2));\n+---------------------------------------+\n| ST_AsText(ST_SymDifference(@g1, @g2)) |\n+---------------------------------------+\n| MULTIPOINT(1 1,2 2) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (298,7,'GTID_SUBSET','Syntax:\nGTID_SUBSET(subset,set)\n\nGiven two sets of global transaction IDs subset and set, returns true\n(1) if all GTIDs in subset are also in set. Returns false (0)\notherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 1\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\')\\G\n*************************** 1. row ***************************\nGTID_SUBSET(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\'): 0\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (299,16,'VAR_SAMP','Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nIf there are no matching rows, VAR_SAMP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (300,23,'DATETIME','DATETIME[(fsp)]\n\nA date and time combination. The supported range is \'1000-01-01\n00:00:00.000000\' to \'9999-12-31 23:59:59.999999\'. MySQL displays\nDATETIME values in \'YYYY-MM-DD HH:MM:SS[.fraction]\' format, but permits\nassignment of values to DATETIME columns using either strings or\nnumbers.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nAs of MySQL 5.6.5, automatic initialization and updating to the current\ndate and time for DATETIME columns can be specified using DEFAULT and\nON UPDATE column definition clauses, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (301,23,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (302,27,'SHOW COLUMNS','Syntax:\nSHOW [FULL] {COLUMNS | FIELDS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. SHOW COLUMNS displays information only for\nthose columns for which you have some privilege.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. In other words, these two statements are equivalent:\n\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n\nThe optional FULL keyword causes the output to include the column\ncollation and comments, as well as the privileges you have for each\ncolumn.\n\nThe LIKE clause, if present, indicates which column names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nmysql> SHOW COLUMNS FROM City;\n+-------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+-------------+----------+------+-----+---------+----------------+\n| ID | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| CountryCode | char(3) | NO | MUL | | |\n| District | char(20) | NO | | | |\n| Population | int(11) | NO | | 0 | |\n+-------------+----------+------+-----+---------+----------------+\n\nThe data types may differ from what you expect them to be based on a\nCREATE TABLE statement because MySQL sometimes changes data types when\nyou create or alter a table. The conditions under which this occurs are\ndescribed in\nhttp://dev.mysql.com/doc/refman/5.6/en/silent-column-changes.html.\n\nSHOW COLUMNS displays the following values for each table column:\n\no Field\n\n The column name.\n\no Type\n\n The column data type.\n\no Collation\n\n The collation for nonbinary string columns, or NULL for other\n columns. This value is displayed only if you use the FULL keyword.\n\no Null\n\n Column nullability. The value is YES if NULL values can be stored in\n the column, NO if not.\n\no Key\n\n Whether the column is indexed:\n\n o If Key is empty, the column either is not indexed or is indexed\n only as a secondary column in a multiple-column, nonunique index.\n\n o If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n in a multiple-column PRIMARY KEY.\n\n o If Key is UNI, the column is the first column of a UNIQUE index. (A\n UNIQUE index permits multiple NULL values, but you can tell whether\n the column permits NULL by checking the Null field.)\n\n o If Key is MUL, the column is the first column of a nonunique index\n in which multiple occurrences of a given value are permitted within\n the column.\n\n If more than one of the Key values applies to a given column of a\n table, Key displays the one with the highest priority, in the order\n PRI, UNI, MUL.\n\n A UNIQUE index may be displayed as PRI if it cannot contain NULL\n values and there is no PRIMARY KEY in the table. A UNIQUE index may\n display as MUL if several columns form a composite UNIQUE index;\n although the combination of the columns is unique, each column can\n still hold multiple occurrences of a given value.\n\no Default\n\n The default value for the column. This is NULL if the column has an\n explicit default of NULL, or if the column definition includes no\n DEFAULT clause.\n\no Extra\n\n Any additional information that is available about a given column.\n The value is nonempty in these cases: auto_increment for columns that\n have the AUTO_INCREMENT attribute; on update CURRENT_TIMESTAMP for\n TIMESTAMP or DATETIME columns that have the ON UPDATE\n CURRENT_TIMESTAMP attribute.\n\no Privileges\n\n The privileges you have for the column. This value is displayed only\n if you use the FULL keyword.\n\no Comment\n\n Any comment included in the column definition. This value is\n displayed only if you use the FULL keyword.\n\nYou can also obtain information about table columns from\nINFORMATION_SCHEMA, which contains a COLUMNS table. See\nhttp://dev.mysql.com/doc/refman/5.6/en/columns-table.html.\n\nYou can list a table\'s columns with the mysqlshow db_name tbl_name\ncommand.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee http://dev.mysql.com/doc/refman/5.6/en/describe.html.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-columns.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (303,23,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (304,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (305,19,'^','Syntax:\n^\n\nBitwise XOR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (306,40,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view. If any of the views named in the argument list do not\nexist, MySQL returns an error indicating by name which nonexisting\nviews it was unable to drop, but it also drops all of the views in the\nlist that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (307,32,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() enables you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n -> 53\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (308,22,'DROP FUNCTION UDF','Syntax:\nDROP FUNCTION function_name\n\nThis statement drops the user-defined function (UDF) named\nfunction_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql\ndatabase. This is because DROP FUNCTION removes a row from the\nmysql.func system table that records the function\'s name, type, and\nshared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-function-udf.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (309,38,'UPDATEXML','Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a single portion of a given fragment of XML\nmarkup xml_target with a new XML fragment new_xml, and then returns the\nchanged XML. The portion of xml_target that is replaced matches an\nXPath expression xpath_expr supplied by the user. In MySQL 5.6.6 and\nearlier, the XPath expression could contain at most 127 characters.\nThis limitation is lifted in MySQL 5.6.7. (Bug #13007062, Bug #62429)\n\nIf no expression matching xpath_expr is found, or if multiple matches\nare found, the function returns the original xml_target XML fragment.\nAll three arguments should be strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html\n\n','mysql> SELECT\n -> UpdateXML(\'ccc\', \'/a\', \'fff\') AS val1,\n -> UpdateXML(\'ccc\', \'/b\', \'fff\') AS val2,\n -> UpdateXML(\'ccc\', \'//b\', \'fff\') AS val3,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val4,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val5\n -> \\G\n\n*************************** 1. row ***************************\nval1: fff\nval2: ccc\nval3: fff\nval4: cccfff\nval5: ccc\n','http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (310,8,'RESET SLAVE','Syntax:\nRESET SLAVE [ALL]\n\nRESET SLAVE makes the slave forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean\nstart: It clears the master info and relay log info repositories,\ndeletes all the relay log files, and starts a new relay log file. It\nalso resets to 0 the replication delay specified with the MASTER_DELAY\noption to CHANGE MASTER TO. RESET SLAVE does not change the values of\ngtid_executed or gtid_purged. To use RESET SLAVE, the slave replication\nthreads must be stopped, so on a running slave use STOP SLAVE before\nissuing RESET SLAVE.\n\n*Note*:\n\nAll relay log files are deleted, even if they have not been completely\nexecuted by the slave SQL thread. (This is a condition likely to exist\non a replication slave if you have issued a STOP SLAVE statement or if\nthe slave is highly loaded.)\n\nIn MySQL 5.6 (unlike the case in MySQL 5.1 and earlier), RESET SLAVE\ndoes not change any replication connection parameters such as master\nhost, master port, master user, or master password, which are retained\nin memory. This means that START SLAVE can be issued without requiring\na CHANGE MASTER TO statement following RESET SLAVE.\n\nConnection parameters are reset if the slave mysqld is shut down\nfollowing RESET SLAVE. In MySQL 5.6.3 and later, you can instead use\nRESET SLAVE ALL to reset these connection parameters (Bug #11809016).\n\nRESET SLAVE ALL does not clear the IGNORE_SERVER_IDS list set by CHANGE\nMASTER TO. This issue is fixed in MySQL 5.7. (Bug #18816897)\n\nIn MySQL 5.6.7 and later, RESET SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nIf the slave SQL thread was in the middle of replicating temporary\ntables when it was stopped, and RESET SLAVE is issued, these replicated\ntemporary tables are deleted on the slave.\n\n*Note*:\n\nWhen used on an NDB Cluster replication slave SQL node, RESET SLAVE\nclears the mysql.ndb_apply_status table. You should keep in mind when\nusing this statement that ndb_apply_status uses the NDB storage engine\nand so is shared by all SQL nodes attached to the slave cluster.\n\nBeginning with MySQL NDB Cluster 7.4.9, you can override this behavior\nby issuing SET GLOBAL @@ndb_clear_apply_status=OFF prior to executing\nRESET SLAVE, which keeps the slave from purging the ndb_apply_status\ntable in such cases.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset-slave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (311,32,'DAY','Syntax:\nDAY(date)\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (312,14,'UUID','Syntax:\nUUID()\n\nReturns a Universal Unique Identifier (UUID) generated according to RFC\n4122, "A Universally Unique IDentifier (UUID) URN Namespace"\n(http://www.ietf.org/rfc/rfc4122.txt).\n\nA UUID is designed as a number that is globally unique in space and\ntime. Two calls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate devices not\nconnected to each other.\n\n*Warning*:\n\nAlthough UUID() values are intended to be unique, they are not\nnecessarily unguessable or unpredictable. If unpredictability is\nrequired, UUID values should be generated some other way.\n\nUUID() returns a value that conforms to UUID version 1 as described in\nRFC 4122. The value is a 128-bit number represented as a utf8 string of\nfive hexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\nformat:\n\no The first three numbers are generated from the low, middle, and high\n parts of a timestamp. The high part also includes the UUID version\n number.\n\no The fourth number preserves temporal uniqueness in case the timestamp\n value loses monotonicity (for example, due to daylight saving time).\n\no The fifth number is an IEEE 802 node number that provides spatial\n uniqueness. A random number is substituted if the latter is not\n available (for example, because the host device has no Ethernet card,\n or it is unknown how to find the hardware address of an interface on\n the host operating system). In this case, spatial uniqueness cannot\n be guaranteed. Nevertheless, a collision should have very low\n probability.\n\n The MAC address of an interface is taken into account only on FreeBSD\n and Linux. On other operating systems, MySQL uses a randomly\n generated 48-bit number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID();\n -> \'6ccd780c-baba-1026-9564-5b8c656024db\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (313,25,'LINESTRING','LineString(pt1, pt2, ...)\n\nConstructs a LineString value from a number of Point or WKB Point\narguments. If the number of arguments is less than two, the return\nvalue is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (314,14,'SLEEP','Syntax:\nSLEEP(duration)\n\nSleeps (pauses) for the number of seconds given by the duration\nargument, then returns 0. If SLEEP() is interrupted, it returns 1. The\nduration may have a fractional part.\n\nWhen sleep returns normally (without interruption), it returns 0:\n\nmysql> SELECT SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 0 |\n+-------------+\n\nWhen SLEEP() is the only thing invoked by a query that is interrupted,\nit returns 1 and the query itself returns no error. This statement is\ninterrupted using KILL QUERY from another session:\n\nmysql> SELECT SLEEP(1000);\n+-------------+\n| SLEEP(1000) |\n+-------------+\n| 1 |\n+-------------+\n\nWhen SLEEP() is only part of a query that is interrupted, the query\nreturns an error. This statement is interrupted using KILL QUERY from\nanother session:\n\nmysql> SELECT 1 FROM t1 WHERE SLEEP(1000);\nERROR 1317 (70100): Query execution was interrupted\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (315,40,'CREATE LOGFILE GROUP','Syntax:\nCREATE LOGFILE GROUP logfile_group\n ADD UNDOFILE \'undo_file\'\n [INITIAL_SIZE [=] initial_size]\n [UNDO_BUFFER_SIZE [=] undo_buffer_size]\n [REDO_BUFFER_SIZE [=] redo_buffer_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] comment_text]\n ENGINE [=] engine_name\n\nThis statement creates a new log file group named logfile_group having\na single UNDO file named \'undo_file\'. A CREATE LOGFILE GROUP statement\nhas one and only one ADD UNDOFILE clause. For rules covering the naming\nof log file groups, see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and a log file group with the same name, or a tablespace and\na data file with the same name.\n\nIn MySQL NDB Cluster 7.3 and later, you can have only one log file\ngroup per Cluster at any given time. (See Bug #16386)\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size;\nif not specified, it defaults to 128M (128 megabytes). The optional\nUNDO_BUFFER_SIZE parameter sets the size used by the UNDO buffer for\nthe log file group; The default value for UNDO_BUFFER_SIZE is 8M (eight\nmegabytes); this value cannot exceed the amount of system memory\navailable. Both of these parameters are specified in bytes. In MySQL\nNDB Cluster 7.3.2 and later, you may optionally follow either or both\nof these with a one-letter abbreviation for an order of magnitude,\nsimilar to those used in my.cnf. Generally, this is one of the letters\nM (for megabytes) or G (for gigabytes). Prior to MySQL NDB Cluster\n7.3.2, the values for these options could only be specified using\ndigits. (Bug #13116514, Bug #16104705, Bug #62858)\n\nMemory used for UNDO_BUFFER_SIZE comes from the global pool whose size\nis determined by the value of the SharedGlobalMemory data node\nconfiguration parameter. This includes any default value implied for\nthis option by the setting of the InitialLogFileGroup data node\nconfiguration parameter.\n\nThe maximum permitted for UNDO_BUFFER_SIZE is 629145600 (600 MB).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB).\n\nThe ENGINE option determines the storage engine to be used by this log\nfile group, with engine_name being the name of the storage engine. In\nMySQL 5.6, this must be NDB (or NDBCLUSTER). If ENGINE is not set,\nMySQL tries to use the engine specified by the default_storage_engine\nserver system variable (formerly storage_engine). In any case, if the\nengine is not specified as NDB or NDBCLUSTER, the CREATE LOGFILE GROUP\nstatement appears to succeed but actually fails to create the log file\ngroup, as shown here:\n\nmysql> CREATE LOGFILE GROUP lg1\n -> ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+-------+------+------------------------------------------------------------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------------------------------------------------------------+\n| Error | 1478 | Table storage engine \'InnoDB\' does not support the create option \'TABLESPACE or LOGFILE GROUP\' |\n+-------+------+------------------------------------------------------------------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> DROP LOGFILE GROUP lg1 ENGINE = NDB; \nERROR 1529 (HY000): Failed to drop LOGFILE GROUP\n\nmysql> CREATE LOGFILE GROUP lg1\n -> ADD UNDOFILE \'undo.dat\' INITIAL_SIZE = 10M\n -> ENGINE = NDB;\nQuery OK, 0 rows affected (2.97 sec)\n\nThe fact that the CREATE LOGFILE GROUP statement does not actually\nreturn an error when a non-NDB storage engine is named, but rather\nappears to succeed, is a known issue which we hope to address in a\nfuture release of NDB Cluster.\n\nREDO_BUFFER_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but ignored,\nand so have no effect in MySQL 5.6. These options are intended for\nfuture expansion.\n\nWhen used with ENGINE [=] NDB, a log file group and associated UNDO log\nfile are created on each Cluster data node. You can verify that the\nUNDO files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, LOGFILE_GROUP_NUMBER, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE FILE_NAME = \'undo_10.dat\';\n+--------------------+----------------------+----------------+\n| LOGFILE_GROUP_NAME | LOGFILE_GROUP_NUMBER | EXTRA |\n+--------------------+----------------------+----------------+\n| lg_3 | 11 | CLUSTER_NODE=3 |\n| lg_3 | 11 | CLUSTER_NODE=4 |\n+--------------------+----------------------+----------------+\n2 rows in set (0.06 sec)\n\nCREATE LOGFILE GROUP is useful only with Disk Data storage for NDB\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-logfile-group.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (316,6,'NULLIF','Syntax:\nNULLIF(expr1,expr2)\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nThe return value has the same type as the first argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n -> NULL\nmysql> SELECT NULLIF(1,2);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (317,3,'ROUND','Syntax:\nROUND(X), ROUND(X,D)\n\nRounds the argument X to D decimal places. The rounding algorithm\ndepends on the data type of X. D defaults to 0 if not specified. D can\nbe negative to cause D digits left of the decimal point of the value X\nto become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ROUND(-1.23);\n -> -1\nmysql> SELECT ROUND(-1.58);\n -> -2\nmysql> SELECT ROUND(1.58);\n -> 2\nmysql> SELECT ROUND(1.298, 1);\n -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n -> 1\nmysql> SELECT ROUND(23.298, -1);\n -> 20\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (318,32,'TIMEDIFF','Syntax:\nTIMEDIFF(expr1,expr2)\n\nTIMEDIFF() returns expr1 − expr2 expressed as a time value. expr1 and\nexpr2 are time or date-and-time expressions, but both must be of the\nsame type.\n\nThe result returned by TIMEDIFF() is limited to the range allowed for\nTIME values. Alternatively, you can use either of the functions\nTIMESTAMPDIFF() and UNIX_TIMESTAMP(), both of which return integers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMEDIFF(\'2000:01:01 00:00:00\',\n -> \'2000:01:01 00:00:00.000001\');\n -> \'-00:00:00.000001\'\nmysql> SELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\',\n -> \'2008-12-30 01:01:01.000002\');\n -> \'46:58:57.999999\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (319,8,'STOP SLAVE','Syntax:\nSTOP SLAVE [thread_types]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege.\nRecommended best practice is to execute STOP SLAVE on the slave before\nstopping the slave server (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-shutdown.html, for more\ninformation).\n\nWhen using the row-based logging format: You should execute STOP SLAVE\nor STOP SLAVE SQL_THREAD on the slave prior to shutting down the slave\nserver if you are replicating any tables that use a nontransactional\nstorage engine (see the Note later in this section).\n\nLike START SLAVE, this statement may be used with the IO_THREAD and\nSQL_THREAD options to name the thread or threads to be stopped.\n\nIn MySQL 5.6.7 and later, STOP SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\nIn MySQL 5.6.13 and later, you can control how long STOP SLAVE waits\nbefore timing out by setting the rpl_stop_slave_timeout system\nvariable. This can be used to avoid deadlocks between STOP SLAVE and\nother slave SQL statements using different client connections to the\nslave. (Bug #16856735)\n\n*Note*:\n\nIn MySQL 5.6, STOP SLAVE waits until the current replication event\ngroup affecting one or more nontransactional tables has finished\nexecuting (if there is any such replication group), or until the user\nissues a KILL QUERY or KILL CONNECTION statement. (Bug #319, Bug\n#38205)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/stop-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/stop-slave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (320,4,'LINEFROMTEXT','LineFromText(wkt[, srid]), LineStringFromText(wkt[, srid])\n\nST_LineFromText(), ST_LineStringFromText(), LineFromText(), and\nLineStringFromText() are synonyms. For more information, see the\ndescription of ST_LineFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (321,32,'ADDTIME','Syntax:\nADDTIME(expr1,expr2)\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time\nor datetime expression, and expr2 is a time expression.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n -> \'2008-01-02 01:01:01.000001\'\nmysql> SELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'03:00:01.999997\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (322,38,'UPPER','Syntax:\nUPPER(str)\n\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT UPPER(\'Hej\');\n -> \'HEJ\'\n\nSee the description of LOWER() for information that also applies to\nUPPER(). This included information about how to perform lettercase\nconversion of binary strings (BINARY, VARBINARY, BLOB) for which these\nfunctions are ineffective, and information about case folding for\nUnicode character sets.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (323,23,'MEDIUMBLOB','MEDIUMBLOB\n\nA BLOB column with a maximum length of 16,777,215 (224 − 1) bytes.\nEach MEDIUMBLOB value is stored using a 3-byte length prefix that\nindicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (324,32,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether\nthe function is used in a string or numeric context. The value is\nexpressed in the current time zone. unix_timestamp is an internal\ntimestamp value such as is produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format\nstring, which is used the same way as listed in the entry for the\nDATE_FORMAT() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_UNIXTIME(1447430881);\n -> \'2015-11-13 10:08:01\'\nmysql> SELECT FROM_UNIXTIME(1447430881) + 0;\n -> 20151113100801\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2015 13th November 10:08:01 2015\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (325,12,'SHA2','Syntax:\nSHA2(str, hash_length)\n\nCalculates the SHA-2 family of hash functions (SHA-224, SHA-256,\nSHA-384, and SHA-512). The first argument is the cleartext string to be\nhashed. The second argument indicates the desired bit length of the\nresult, which must have a value of 224, 256, 384, 512, or 0 (which is\nequivalent to 256). If either argument is NULL or the hash length is\nnot one of the permitted values, the return value is NULL. Otherwise,\nthe function result is a hash value containing the desired number of\nbits. See the notes at the beginning of this section about storing hash\nvalues efficiently.\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT SHA2(\'abc\', 224);\n -> \'23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (326,6,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT IFNULL(1,0);\n -> 1\nmysql> SELECT IFNULL(NULL,10);\n -> 10\nmysql> SELECT IFNULL(1/0,10);\n -> 10\nmysql> SELECT IFNULL(1/0,\'yes\');\n -> \'yes\'\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (327,27,'SHOW FUNCTION CODE','Syntax:\nSHOW FUNCTION CODE func_name\n\nThis statement is similar to SHOW PROCEDURE CODE but for stored\nfunctions. See [HELP SHOW PROCEDURE CODE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-function-code.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-function-code.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (328,27,'SHOW ERRORS','Syntax:\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW COUNT(*) ERRORS\n\nSHOW ERRORS is a diagnostic statement that is similar to SHOW WARNINGS,\nexcept that it displays information only for errors, rather than for\nerrors, warnings, and notes.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You\ncan also retrieve this number from the error_count variable:\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nSHOW ERRORS and error_count apply only to errors, not warnings or\nnotes. In other respects, they are similar to SHOW WARNINGS and\nwarning_count. In particular, SHOW ERRORS cannot display information\nfor more than max_error_count messages, and error_count can exceed the\nvalue of max_error_count if the number of errors exceeds\nmax_error_count.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-errors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-errors.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (329,27,'SET NAMES','Syntax:\nSET NAMES {\'charset_name\'\n [COLLATE \'collation_name\'] | DEFAULT}\n\nThis statement sets the three session system variables\ncharacter_set_client, character_set_connection, and\ncharacter_set_results to the given character set. Setting\ncharacter_set_connection to charset_name also sets collation_connection\nto the default collation for charset_name. See\nhttp://dev.mysql.com/doc/refman/5.6/en/charset-connection.html.\n\nThe optional COLLATE clause may be used to specify a collation\nexplicitly. If given, the collation must one of the permitted\ncollations for charset_name.\n\ncharset_name and collation_name may be quoted or unquoted.\n\nThe default mapping can be restored by using a value of DEFAULT. The\ndefault depends on the server configuration.\n\nucs2, utf16, and utf32 cannot be used as a client character set, which\nmeans that they do not work for SET NAMES.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-names.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-names.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (330,20,'LEAST','Syntax:\nLEAST(value1,value2,...)\n\nWith two or more arguments, returns the smallest (minimum-valued)\nargument. The arguments are compared using the following rules:\n\no If any argument is NULL, the result is NULL. No comparison is needed.\n\no If all arguments are integer-valued, they are compared as integers.\n\no If at least one argument is double precision, they are compared as\n double-precision values. Otherwise, if at least one argument is a\n DECIMAL value, they are compared as DECIMAL values.\n\no If the arguments comprise a mix of numbers and strings, they are\n compared as numbers.\n\no If any argument is a nonbinary (character) string, the arguments are\n compared as nonbinary strings.\n\no In all other cases, the arguments are compared as binary strings.\n\nThe return type of LEAST() is the aggregated type of the comparison\nargument types.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT LEAST(2,0);\n -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n -> 3.0\nmysql> SELECT LEAST(\'B\',\'A\',\'C\');\n -> \'A\'\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (331,20,'=','=\n\nEqual:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 = 0;\n -> 0\nmysql> SELECT \'0\' = 0;\n -> 1\nmysql> SELECT \'0.0\' = 0;\n -> 1\nmysql> SELECT \'0.01\' = 0;\n -> 0\nmysql> SELECT \'.01\' = 0.01;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (332,4,'ST_GEOMCOLLFROMTEXT','ST_GeomCollFromText(wkt[, srid]), ST_GeometryCollectionFromText(wkt[,\nsrid])\n\nConstructs a GeometryCollection value using its WKT representation and\nSRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','mysql> SET @g = "MULTILINESTRING((10 10, 11 11), (9 9, 10 10))";\nmysql> SELECT ST_AsText(ST_GeomCollFromText(@g));\n+--------------------------------------------+\n| ST_AsText(ST_GeomCollFromText(@g)) |\n+--------------------------------------------+\n| MULTILINESTRING((10 10,11 11),(9 9,10 10)) |\n+--------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (333,14,'IS_IPV4_MAPPED','Syntax:\nIS_IPV4_MAPPED(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-mapped IPv6 address, 0 otherwise. IPv4-mapped\naddresses have the form ::ffff:ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.5.9\'));\n -> 0\nmysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (334,10,'CREATE USER','Syntax:\nCREATE USER\n user [auth_option] [, user [auth_option]] ...\n\nuser:\n (see )\n\nauth_option: {\n IDENTIFIED BY \'auth_string\'\n | IDENTIFIED BY PASSWORD \'hash_string\'\n | IDENTIFIED WITH auth_plugin\n | IDENTIFIED WITH auth_plugin AS \'hash_string\'\n}\n\nThe CREATE USER statement creates new MySQL accounts. An error occurs\nif you try to create an account that already exists.\n\nAn account when first created has no privileges.\n\nTo use CREATE USER, you must have the global CREATE USER privilege, or\nthe INSERT privilege for the mysql database. When the read_only system\nvariable is enabled, CREATE USER additionally requires the SUPER\nprivilege.\n\nFor each account, CREATE USER creates a new row in the mysql.user table\nwith no privileges and assigns the account an authentication plugin.\nDepending on the syntax used, CREATE USER may also assign the account a\npassword.\n\nEach user value naming an account may be followed by an optional\nauth_option value that specifies how authentication occurs for clients\nthat use the account. This part of CREATE USER syntax is shared with\nGRANT, so the description here applies to GRANT as well.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nThe server assigns an authentication plugin and password to each\naccount as follows, depending on whether the user specification clause\nincludes IDENTIFIED WITH to specify a plugin or IDENTIFIED BY to\nspecify a password:\n\no With IDENTIFIED WITH, the server assigns the specified plugin and the\n account has no password. If the optional AS \'hash_string\' clause is\n also given, the string is stored as is in the authentication_string\n column (it is assumed to be already hashed in the format required by\n the plugin).\n\no With IDENTIFIED BY, the server assigns the plugin implicitly and\n assigns the specified password.\n\no With neither IDENTIFIED WITH nor IDENTIFIED BY, the server assigns\n the plugin implicitly and the account has no password.\n\nIf the account has no password, the Password column in the account\'s\nmysql.user table row remains empty, which is insecure. To set the\npassword, use SET PASSWORD. See [HELP SET PASSWORD].\n\nFor implicit authentication plugin assignment, the server uses these\nrules:\n\no As of MySQL 5.6.6, the server assigns the default plugin to the\n account. This plugin becomes the value of the plugin column in the\n account\'s mysql.user table row. The default plugin is\n mysql_native_password unless the --default-authentication-plugin\n option is set otherwise at server startup.\n\no Before MySQL 5.6.6, the server assigns no plugin to the account. The\n plugin column in the account\'s mysql.user table row remains empty.\n\nFor client connections that use a given account, the server invokes the\nauthentication plugin assigned to the account and the client must\nprovide credentials as required by the authentication method that the\nplugin implements. If the server cannot find the plugin, either at\naccount-creation time or connect time, an error occurs.\n\nIf an account\'s mysql.user table row has a nonempty plugin column:\n\no The server authenticates client connection attempts using the named\n plugin.\n\no Changes to the account password using SET PASSWORD with PASSWORD()\n must be made with the old_passwords system variable set to the value\n required by the authentication plugin, so that PASSWORD() uses the\n appropriate password hashing method. If the plugin is\n mysql_old_password, the password can also be changed using SET\n PASSWORD with OLD_PASSWORD(), which uses pre-4.1 password hashing\n regardless of the value of old_passwords.\n\nIf an account\'s mysql.user table row has an empty plugin column:\n\no The server authenticates client connection attempts using the\n mysql_native_password or mysql_old_password authentication plugin,\n depending on the hash format of the password stored in the Password\n column.\n\no Changes to the account password using SET PASSWORD can be made with\n PASSWORD(), with old_passwords set to 0 or 1 for 4.1 or pre-4.1\n password hashing, respectively, or with OLD_PASSWORD(), which uses\n pre-4.1 password hashing regardless of the value of old_passwords.\n\nCREATE USER examples:\n\no To specify an authentication plugin for an account, use IDENTIFIED\n WITH auth_plugin. The plugin name can be a quoted string literal or\n an unquoted name. \'auth_string\' is an optional quoted string literal\n to pass to the plugin. The plugin interprets the meaning of the\n string, so its format is plugin specific and it is stored in the\n authentication_string column as given. (This value is meaningful only\n for plugins that use that column.) Consult the documentation for a\n given plugin for information about the authentication string values\n it accepts, if any.\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED WITH mysql_native_password;\n\n The server assigns the given authentication plugin to the account but\n no password. Clients must provide no password when they connect.\n However, an account with no password is insecure. To ensure that an\n account uses a specific authentication plugin and has a password with\n the corresponding hash format, specify the plugin explicitly with\n IDENTIFIED WITH, then use SET PASSWORD to set the password:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED WITH mysql_native_password;\nSET old_passwords = 0;\nSET PASSWORD FOR \'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\n\n Changes to the account password using SET PASSWORD with PASSWORD()\n must be made with the old_passwords system variable set to the value\n required by the account\'s authentication plugin, so that PASSWORD()\n uses the appropriate password hashing method. Therefore, to use the\n sha256_password or mysql_old_password plugin instead, name that\n plugin in the CREATE USER statement and set old_passwords to 2 or 1,\n respectively, before using SET PASSWORD. (Use of mysql_old_password\n is not recommended. It is deprecated and support for it will be\n removed in a future MySQL release.)\n\no To specify a password for an account at account-creation time, use\n IDENTIFIED BY with the literal cleartext password value:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\n The server assigns an authentication plugin to the account\n implicitly, as described previously, and assigns the given password.\n Clients must provide the given password when they connect.\n\n If the implicitly assigned plugin is mysql_native_password, the\n old_passwords system variable must be set to 0. Otherwise, CREATE\n USER does not hash the password in the format required by the plugin\n and an error occurs:\n\nmysql> SET old_passwords = 1;\nmysql> CREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nERROR 1827 (HY000): The password hash doesn\'t have the expected\nformat. Check if the correct password algorithm is being used with\nthe PASSWORD() function.\n\nmysql> SET old_passwords = 0;\nmysql> CREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nQuery OK, 0 rows affected (0.00 sec)\n\no To avoid specifying the cleartext password if you know its hash value\n (the value that PASSWORD() would return for the password), specify\n the hash value preceded by the keyword PASSWORD:\n\nCREATE USER \'jeffrey\'@\'localhost\'\nIDENTIFIED BY PASSWORD \'*90E462C37378CED12064BB3388827D2BA3A9B689\';\n\n The server assigns an authentication plugin to the account\n implicitly, as described previously, and assigns the given password.\n The password hash must be in the format required by the assigned\n plugin. Clients must provide the password when they connect.\n\no To enable the user to connect with no password, include no IDENTIFIED\n BY clause:\n\nCREATE USER \'jeffrey\'@\'localhost\';\n\n The server assigns an authentication plugin to the account\n implicitly, as described previously, but no password. Clients must\n provide no password when they connect. However, an account with no\n password is insecure. To avoid this, use SET PASSWORD to set the\n account password.\n\nAs mentioned previously, implicit plugin assignment depends on the\ndefault authentication plugin. Permitted values of\n--default-authentication-plugin are mysql_native_plugin and\nsha256_password, but not mysql_old_password. This means it is not\npossible to set the default plugin so as to be able to create an\naccount that uses mysql_old_password with CREATE USER ... IDENTIFIED BY\nsyntax. To create an account that uses mysql_old_password, use CREATE\nUSER ... IDENTIFIED WITH to name the plugin explicitly, then set the\npassword: CREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED WITH\nmysql_old_password; SET old_passwords = 1; SET PASSWORD FOR\n\'jeffrey\'@\'localhost\' = PASSWORD(\'mypass\');\n\nHowever, the preceding procedure is not recommended because\nmysql_old_password is deprecated.\n\nFor additional information about setting passwords and authentication\nplugins, see\nhttp://dev.mysql.com/doc/refman/5.6/en/assigning-passwords.html, and\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (335,25,'POINT','Point(x, y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (336,38,'LCASE','Syntax:\nLCASE(str)\n\nLCASE() is a synonym for LOWER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (337,7,'CREATE_DH_PARAMETERS','CREATE_DH_PARAMETERS(key_len)\n\nCreates a shared secret for generating a DH private/public key pair and\nreturns a binary string that can be passed to\nCREATE_ASYMMETRIC_PRIV_KEY(). If secret generation fails, the result is\nnull.\n\nSupported key_len values: The minimum and maximum key lengths in bits\nare 1,024 and 10,000. These key-length limits are constraints imposed\nby OpenSSL. Server administrators can impose additional limits on\nmaximum key length by setting environment variables. See\nhttp://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-usage.html\n.\n\nFor an example showing how to use the return value for generating\nsymmetric keys, see the description of ASYMMETRIC_DERIVE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','SET @dhp = CREATE_DH_PARAMETERS(1024);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (338,20,'IS NOT NULL','Syntax:\nIS NOT NULL\n\nTests whether a value is not NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (339,38,'MATCH AGAINST','Syntax:\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nMySQL has support for full-text indexing and searching:\n\no A full-text index in MySQL is an index of type FULLTEXT.\n\no Full-text indexes can be used only with InnoDB or MyISAM tables, and\n can be created only for CHAR, VARCHAR, or TEXT columns.\n\no A FULLTEXT index definition can be given in the CREATE TABLE\n statement when a table is created, or added later using ALTER TABLE\n or CREATE INDEX.\n\no For large data sets, it is much faster to load your data into a table\n that has no FULLTEXT index and then create the index after that, than\n to load data into a table that has an existing FULLTEXT index.\n\nFull-text searching is performed using MATCH() ... AGAINST syntax.\nMATCH() takes a comma-separated list that names the columns to be\nsearched. AGAINST takes a string to search for, and an optional\nmodifier that indicates what type of search to perform. The search\nstring must be a string value that is constant during query evaluation.\nThis rules out, for example, a table column because that can differ for\neach row.\n\nThere are three types of full-text searches:\n\no A natural language search interprets the search string as a phrase in\n natural human language (a phrase in free text). There are no special\n operators, with the exception of double quote (") characters. The\n stopword list applies. For more information about stopword lists, see\n http://dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html.\n\n Full-text searches are natural language searches if the IN NATURAL\n LANGUAGE MODE modifier is given or if no modifier is given. For more\n information, see\n http://dev.mysql.com/doc/refman/5.6/en/fulltext-natural-language.html\n .\n\no A boolean search interprets the search string using the rules of a\n special query language. The string contains the words to search for.\n It can also contain operators that specify requirements such that a\n word must be present or absent in matching rows, or that it should be\n weighted higher or lower than usual. Certain common words (stopwords)\n are omitted from the search index and do not match if present in the\n search string. The IN BOOLEAN MODE modifier specifies a boolean\n search. For more information, see\n http://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html.\n\no A query expansion search is a modification of a natural language\n search. The search string is used to perform a natural language\n search. Then words from the most relevant rows returned by the search\n are added to the search string and the search is done again. The\n query returns the rows from the second search. The IN NATURAL\n LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier\n specifies a query expansion search. For more information, see\n http://dev.mysql.com/doc/refman/5.6/en/fulltext-query-expansion.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html\n\n','mysql> SELECT id, body, MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE) AS score\n FROM articles WHERE MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body | score |\n+----+-------------------------------------+-----------------+\n| 4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n| 6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (340,40,'CREATE EVENT','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n EVENT\n [IF NOT EXISTS]\n event_name\n ON SCHEDULE schedule\n [ON COMPLETION [NOT] PRESERVE]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n DO event_body;\n\nschedule:\n AT timestamp [+ INTERVAL interval] ...\n | EVERY interval\n [STARTS timestamp [+ INTERVAL interval] ...]\n [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nThis statement creates and schedules a new event. The event will not\nrun unless the Event Scheduler is enabled. For information about\nchecking Event Scheduler status and enabling it if necessary, see\nhttp://dev.mysql.com/doc/refman/5.6/en/events-configuration.html.\n\nCREATE EVENT requires the EVENT privilege for the schema in which the\nevent is to be created. It might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section.\n\nThe minimum requirements for a valid CREATE EVENT statement are as\nfollows:\n\no The keywords CREATE EVENT plus an event name, which uniquely\n identifies the event in a database schema.\n\no An ON SCHEDULE clause, which determines when and how often the event\n executes.\n\no A DO clause, which contains the SQL statement to be executed by an\n event.\n\nThis is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event\nexecutes once---one hour following its creation---by running an SQL\nstatement that increments the value of the myschema.mytable table\'s\nmycol column by 1.\n\nThe event_name must be a valid MySQL identifier with a maximum length\nof 64 characters. Event names are not case sensitive, so you cannot\nhave two events named myevent and MyEvent in the same schema. In\ngeneral, the rules governing event names are the same as those for\nnames of stored routines. See\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\nAn event is associated with a schema. If no schema is indicated as part\nof event_name, the default (current) schema is assumed. To create an\nevent in a specific schema, qualify the event name with a schema using\nschema_name.event_name syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (341,7,'MBR DEFINITION','Its MBR (minimum bounding rectangle), or envelope. This is the bounding\ngeometry, formed by the minimum and maximum (X,Y) coordinates:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html\n\n','((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n','http://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (342,26,'ST_DIFFERENCE','ST_Difference(g1, g2)\n\nReturns a geometry that represents the point set difference of the\ngeometry values g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_AsText(ST_Difference(@g1, @g2));\n+------------------------------------+\n| ST_AsText(ST_Difference(@g1, @g2)) |\n+------------------------------------+\n| POINT(1 1) |\n+------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (343,25,'GEOMETRYCOLLECTION','GeometryCollection(g1, g2, ...)\n\nConstructs a GeometryCollection.\n\nIf the argument contains a nonsupported geometry, the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-mysql-specific-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (344,3,'*','Syntax:\n*\n\nMultiplication:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3*5;\n -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (345,33,'ST_ASBINARY','ST_AsBinary(g), ST_AsWKB(g)\n\nConverts a value in internal geometry format to its WKB representation\nand returns the binary result.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html\n\n','SELECT ST_AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (346,38,'TO_BASE64','Syntax:\nTO_BASE64(str)\n\nConverts the string argument to base-64 encoded form and returns the\nresult as a character string with the connection character set and\ncollation. If the argument is not a string, it is converted to a string\nbefore conversion takes place. The result is NULL if the argument is\nNULL. Base-64 encoded strings can be decoded using the FROM_BASE64()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (347,12,'DES_DECRYPT','Syntax:\nDES_DECRYPT(crypt_str[,key_str])\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs,\nthis function returns NULL.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.6/en/secure-connections.html.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte\nof the encrypted string to determine the DES key number that was used\nto encrypt the original string, and then reads the key from the DES key\nfile to decrypt the message. For this to work, the user must have the\nSUPER privilege. The key file can be specified with the --des-key-file\nserver option.\n\nIf you pass this function a key_str argument, that string is used as\nthe key for decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string,\nMySQL returns the given crypt_str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (348,2,'ST_AREA','ST_Area(poly)\n\nReturns a double-precision number indicating the area of the argument,\nas measured in its spatial reference system. For arguments of dimension\n0 or 1, the result is 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\nmysql> SELECT ST_Area(ST_GeomFromText(@poly));\n+---------------------------------+\n| ST_Area(ST_GeomFromText(@poly)) |\n+---------------------------------+\n| 4 |\n+---------------------------------+\n\nmysql> SET @mpoly =\n -> \'MultiPolygon(((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1)))\';\nmysql> SELECT ST_Area(ST_GeomFromText(@mpoly));\n+----------------------------------+\n| ST_Area(ST_GeomFromText(@mpoly)) |\n+----------------------------------+\n| 8 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (349,13,'ENDPOINT','EndPoint(ls)\n\nST_EndPoint() and EndPoint() are synonyms. For more information, see\nthe description of ST_EndPoint().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (350,16,'COUNT','Syntax:\nCOUNT(expr)\n\nReturns a count of the number of non-NULL values of expr in the rows\nretrieved by a SELECT statement. The result is a BIGINT value.\n\nIf there are no matching rows, COUNT() returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student.student_name,COUNT(*)\n -> FROM student,course\n -> WHERE student.student_id=course.student_id\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (351,28,'INSERT','Syntax:\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n SET col_name={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nINSERT inserts new rows into an existing table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based on\nexplicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed\nfurther in [HELP INSERT SELECT].\n\nWhen inserting into a partitioned table, you can control which\npartitions and subpartitions accept new rows. The PARTITION option\ntakes a comma-separated list of the names of one or more partitions or\nsubpartitions (or both) of the table. If any of the rows to be inserted\nby a given INSERT statement do not match one of the partitions listed,\nthe INSERT statement fails with the error Found a row not matching the\ngiven partition set. See\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html, for\nmore information and examples.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (352,4,'MLINEFROMTEXT','MLineFromText(wkt[, srid]), MultiLineStringFromText(wkt[, srid])\n\nConstructs a MultiLineString value using its WKT representation and\nSRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (353,33,'GEOMCOLLFROMWKB','GeomCollFromWKB(wkb[, srid]), GeometryCollectionFromWKB(wkb[, srid])\n\nST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB(),\nGeomCollFromWKB(), and GeometryCollectionFromWKB() are synonyms. For\nmore information, see the description of ST_GeomCollFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (354,23,'TINYTEXT','TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 255 (28 − 1) characters. The\neffective maximum length is less if the value contains multibyte\ncharacters. Each TINYTEXT value is stored using a 1-byte length prefix\nthat indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (355,14,'DEFAULT','Syntax:\nDEFAULT(col_name)\n\nReturns the default value for a table column. An error results if the\ncolumn has no default value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (356,21,'OPTIMIZE TABLE','Syntax:\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nReorganizes the physical storage of table data and associated index\ndata, to reduce storage space and improve I/O efficiency when accessing\nthe table. The exact changes made to each table depend on the storage\nengine used by that table. This statement does not work with views.\n\nUse OPTIMIZE TABLE in these cases, depending on the type of table:\n\no After doing substantial insert, update, or delete operations on an\n InnoDB table that has its own .ibd file because it was created with\n the innodb_file_per_table option enabled. The table and indexes are\n reorganized, and disk space can be reclaimed for use by the operating\n system.\n\no After doing substantial insert, update, or delete operations on\n columns that are part of a FULLTEXT index in an InnoDB table. Set the\n configuration option innodb_optimize_fulltext_only=1 first. To keep\n the index maintenance period to a reasonable time, set the\n innodb_ft_num_word_optimize option to specify how many words to\n update in the search index, and run a sequence of OPTIMIZE TABLE\n statements until the search index is fully updated.\n\no After deleting a large part of a MyISAM or ARCHIVE table, or making\n many changes to a MyISAM or ARCHIVE table with variable-length rows\n (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted\n rows are maintained in a linked list and subsequent INSERT operations\n reuse old row positions. You can use OPTIMIZE TABLE to reclaim the\n unused space and to defragment the data file. After extensive changes\n to a table, this statement may also improve performance of statements\n that use the table, sometimes significantly.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nOPTIMIZE TABLE is also supported for partitioned tables. For\ninformation about using this statement with partitioned tables and\ntable partitions, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/optimize-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/optimize-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (357,12,'DECODE','Syntax:\nDECODE(crypt_str,pass_str)\n\nDecrypts the encrypted string crypt_str using pass_str as the password.\ncrypt_str should be a string returned from ENCODE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (358,20,'<=>','Syntax:\n<=>\n\nNULL-safe equal. This operator performs an equality comparison like the\n= operator, but returns 1 rather than NULL if both operands are NULL,\nand 0 rather than NULL if one operand is NULL.\n\nThe <=> operator is equivalent to the standard SQL IS NOT DISTINCT FROM\noperator.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n -> 1, 1, 0\nmysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;\n -> 1, NULL, NULL\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (359,27,'RESET','Syntax:\nRESET reset_option [, reset_option] ...\n\nThe RESET statement is used to clear the state of various server\noperations. You must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement. See [HELP\nFLUSH].\n\nThe RESET statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nreset_option can be any of the following:\n\no MASTER\n\n Deletes all binary logs listed in the index file, resets the binary\n log index file to be empty, and creates a new binary log file.\n\no QUERY CACHE\n\n Removes all query results from the query cache.\n\no SLAVE\n\n Makes the slave forget its replication position in the master binary\n logs. Also resets the relay log by deleting any existing relay log\n files and beginning a new one.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (360,14,'GET_LOCK','Syntax:\nGET_LOCK(str,timeout)\n\nTries to obtain a lock with a name given by the string str, using a\ntimeout of timeout seconds. A negative timeout value means infinite\ntimeout. The lock is exclusive. While held by one session, other\nsessions cannot obtain a lock of the same name.\n\nReturns 1 if the lock was obtained successfully, 0 if the attempt timed\nout (for example, because another client has previously locked the\nname), or NULL if an error occurred (such as running out of memory or\nthe thread was killed with mysqladmin kill).\n\nA lock obtained with GET_LOCK() is released explicitly by executing\nRELEASE_LOCK() or implicitly when your session terminates (either\nnormally or abnormally).\n\nLocks obtained with GET_LOCK() are not released when transactions\ncommit or roll back.\n\n*Important*:\n\nThe behavior of GET_LOCK() changes in MySQL 5.7. In consideration of\nfuture upgrades, limit the str value to 64 characters or less and do\nnot rely on subsequent calls to GET_LOCK() releasing previous locks.\n\nGET_LOCK() can be used to implement application locks or to simulate\nrecord locks. Names are locked on a server-wide basis. If a name has\nbeen locked within one session, GET_LOCK() blocks any request by\nanother session for a lock with the same name. This enables clients\nthat agree on a given lock name to use the name to perform cooperative\nadvisory locking. But be aware that it also enables a client that is\nnot among the set of cooperating clients to lock a name, either\ninadvertently or deliberately, and thus prevent any of the cooperating\nclients from locking that name. One way to reduce the likelihood of\nthis is to use lock names that are database-specific or\napplication-specific. For example, use lock names of the form\ndb_name.str or app_name.str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT GET_LOCK(\'lock1\',10);\n -> 1\nmysql> SELECT IS_FREE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT GET_LOCK(\'lock2\',10);\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock1\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (361,23,'BIGINT','BIGINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (362,32,'CURTIME','Syntax:\nCURTIME([fsp])\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext. The value is expressed in the current time zone.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CURTIME();\n -> \'23:50:26\'\nmysql> SELECT CURTIME() + 0;\n -> 235026.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (363,37,'ST_DIMENSION','ST_Dimension(g)\n\nReturns the inherent dimension of the geometry value g, or NULL if the\nargument is NULL. The dimension can be −1, 0, 1, or 2. The meaning of\nthese values is given in\nhttp://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_Dimension(ST_GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------------+\n| ST_Dimension(ST_GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------------+\n| 1 |\n+------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (364,27,'SET','Syntax:\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n user_var_name = expr\n | param_name = expr\n | local_var_name = expr\n | [GLOBAL | SESSION]\n system_var_name = expr\n | [@@global. | @@session. | @@]\n system_var_name = expr\n\nSET ONE_SHOT system_var_name = expr\n\nSET syntax for variable assignment enables you to assign values to\ndifferent types of variables that affect the operation of the server or\nclients:\n\no System variables. See\n http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n System variables also can be set at server startup, as described in\n http://dev.mysql.com/doc/refman/5.6/en/using-system-variables.html.\n (To display system variable names and values, use the SHOW VARIABLES\n statement; see [HELP SHOW VARIABLES].)\n\no User-defined variables. See\n http://dev.mysql.com/doc/refman/5.6/en/user-variables.html.\n\no Stored procedure and function parameters, and stored program local\n variables. See\n http://dev.mysql.com/doc/refman/5.6/en/stored-program-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-variable.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (365,3,'CONV','Syntax:\nCONV(N,from_base,to_base)\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base\nto_base. Returns NULL if any argument is NULL. The argument N is\ninterpreted as an integer, but may be specified as an integer or a\nstring. The minimum base is 2 and the maximum base is 36. If from_base\nis a negative number, N is regarded as a signed number. Otherwise, N is\ntreated as unsigned. CONV() works with 64-bit precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CONV(\'a\',16,2);\n -> \'1010\'\nmysql> SELECT CONV(\'6E\',18,8);\n -> \'172\'\nmysql> SELECT CONV(-17,10,-18);\n -> \'-H\'\nmysql> SELECT CONV(10+\'10\'+\'10\'+X\'0a\',10,10);\n -> \'40\'\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (366,28,'LOAD XML','Syntax:\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE [db_name.]tbl_name\n [CHARACTER SET charset_name]\n [ROWS IDENTIFIED BY \'\']\n [IGNORE number {LINES | ROWS}]\n [(field_name_or_user_var,...)]\n [SET col_name = expr,...]\n\nThe LOAD XML statement reads data from an XML file into a table. The\nfile_name must be given as a literal string. The tagname in the\noptional ROWS IDENTIFIED BY clause must also be given as a literal\nstring, and must be surrounded by angle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML\noutput mode (that is, starting the client with the --xml option). To\nwrite data from a table to an XML file, you can invoke the mysql client\nwith the --xml and -e options from the system shell, as shown here:\n\nshell> mysql --xml -e \'SELECT * FROM mydb.mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default,\nthe element is considered to be the equivalent of a database\ntable row; this can be changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\no Column names as attributes and column values as attribute values:\n\n\n\no Column names as tags and column values as the content of these tags:\n\n\n value1\n value2\n\n\no Column names are the name attributes of tags, and values are\n the contents of these tags:\n\n\n value1\n value2\n\n\n This is the format used by other MySQL tools, such as mysqldump.\n\nAll three formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it\ncorrectly. Tags are matched based on the tag or attribute name and the\ncolumn name.\n\nPrior to MySQL 5.6.27, LOAD XML did not handle empty XML elements in\nthe form correctly. (Bug #67542, Bug #16171518)\n\nThe following clauses work essentially the same way for LOAD XML as\nthey do for LOAD DATA:\n\no LOW_PRIORITY or CONCURRENT\n\no LOCAL\n\no REPLACE or IGNORE\n\no CHARACTER SET\n\no SET\n\nSee [HELP LOAD DATA], for more information about these clauses.\n\n(field_name_or_user_var, ...) is a comma-separated list of one or more\nXML fields or user variables. The name of a user variable used for this\npurpose must match the name of a field from the XML file, prefixed with\n@. You can use field names to select only desired fields. User\nvariables can be employed to store the corresponding field values for\nsubsequent re-use.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first\nnumber rows in the XML file to be skipped. It is analogous to the LOAD\nDATA statement\'s IGNORE ... LINES clause.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-xml.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-xml.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (367,15,'ASSIGN-VALUE','Syntax:\n:=\n\nAssignment operator. Causes the user variable on the left hand side of\nthe operator to take on the value to its right. The value on the right\nhand side may be a literal value, another variable storing a value, or\nany legal expression that yields a scalar value, including the result\nof a query (provided that this value is a scalar value). You can\nperform multiple assignments in the same SET statement. You can perform\nmultiple assignments in the same statement.\n\nUnlike =, the := operator is never interpreted as a comparison\noperator. This means you can use := in any valid SQL statement (not\njust in SET statements) to assign a value to a variable.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n\nmysql> SELECT @var1:=COUNT(*) FROM t1;\n -> 4\nmysql> SELECT @var1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (368,27,'SHOW OPEN TABLES','Syntax:\nSHOW OPEN TABLES\n [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open\nin the table cache. See\nhttp://dev.mysql.com/doc/refman/5.6/en/table-cache.html. The FROM\nclause, if present, restricts the tables shown to those present in the\ndb_name database. The LIKE clause, if present, indicates which table\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-open-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-open-tables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (369,32,'EXTRACT','Syntax:\nEXTRACT(unit FROM date)\n\nThe EXTRACT() function uses the same kinds of unit specifiers as\nDATE_ADD() or DATE_SUB(), but extracts parts from the date rather than\nperforming date arithmetic.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT EXTRACT(YEAR FROM \'2009-07-02\');\n -> 2009\nmysql> SELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n -> 200907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n -> 20102\nmysql> SELECT EXTRACT(MICROSECOND\n -> FROM \'2003-01-02 10:30:00.000123\');\n -> 123\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (370,12,'ENCRYPT','Syntax:\nENCRYPT(str[,salt])\n\nEncrypts str using the Unix crypt() system call and returns a binary\nstring. The salt argument must be a string with at least two characters\nor the result will be NULL. If no salt argument is given, a random\nvalue is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT ENCRYPT(\'hello\');\n -> \'VxuFAJXVARROc\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (371,27,'SHOW STATUS','Syntax:\nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW STATUS provides server status information (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html).\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\n\nStatus variable information is also available from these sources:\n\no The GLOBAL_STATUS and SESSION_STATUS tables. See\n http://dev.mysql.com/doc/refman/5.6/en/status-table.html.\n\no The mysqladmin extended-status command. See\n http://dev.mysql.com/doc/refman/5.6/en/mysqladmin.html.\n\nFor SHOW STATUS, a LIKE clause, if present, indicates which variable\nnames to match. A WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nSHOW STATUS accepts an optional GLOBAL or SESSION variable scope\nmodifier:\n\no With a GLOBAL modifier, the statement displays the global status\n values. A global status variable may represent status for some aspect\n of the server itself (for example, Aborted_connects), or the\n aggregated status over all connections to MySQL (for example,\n Bytes_received and Bytes_sent). If a variable has no global value,\n the session value is displayed.\n\no With a SESSION modifier, the statement displays the status variable\n values for the current connection. If a variable has no session\n value, the global value is displayed. LOCAL is a synonym for SESSION.\n\no If no modifier is present, the default is SESSION.\n\nThe scope for each status variable is listed at\nhttp://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html.\n\nEach invocation of the SHOW STATUS statement uses an internal temporary\ntable and increments the global Created_tmp_tables value.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern:\n\nmysql> SHOW STATUS LIKE \'Key%\';\n+--------------------+----------+\n| Variable_name | Value |\n+--------------------+----------+\n| Key_blocks_used | 14955 |\n| Key_read_requests | 96854827 |\n| Key_reads | 162040 |\n| Key_write_requests | 7589728 |\n| Key_writes | 3813196 |\n+--------------------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (372,2,'ST_NUMINTERIORRINGS','ST_NumInteriorRings(poly)\n\nReturns the number of interior rings in the Polygon value poly.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_NumInteriorRings(ST_GeomFromText(@poly));\n+---------------------------------------------+\n| ST_NumInteriorRings(ST_GeomFromText(@poly)) |\n+---------------------------------------------+\n| 1 |\n+---------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (373,14,'INET6_ATON','Syntax:\nINET6_ATON(expr)\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary\nstring that represents the numeric value of the address in network byte\norder (big endian). Because numeric-format IPv6 addresses require more\nbytes than the largest integer type, the representation returned by\nthis function has the VARBINARY data type: VARBINARY(16) for IPv6\naddresses and VARBINARY(4) for IPv4 addresses. If the argument is not a\nvalid address, INET6_ATON() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT HEX(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'FDFE0000000000005A55CAFFFEFA9089\'\nmysql> SELECT HEX(INET6_ATON(\'10.0.5.9\'));\n -> \'0A000509\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (374,27,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster.\n\nSHOW SLAVE HOSTS should be executed on a server that acts as a\nreplication master. The statement displays information about servers\nthat are or have been connected as replication slaves, with each row of\nthe result corresponding to one slave server, as shown here:\n\nmysql> SHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+--------------------------------------+\n| Server_id | Host | Port | Master_id | Slave_UUID |\n+------------+-----------+------+-----------+--------------------------------------+\n| 192168010 | iconnect2 | 3306 | 192168011 | 14cb6624-7f93-11e0-b2c0-c80aa9429562 |\n| 1921680101 | athena | 3306 | 192168011 | 07af4990-f41f-11df-a566-7ac56fdaf645 |\n+------------+-----------+------+-----------+--------------------------------------+\n\no Server_id: The unique server ID of the slave server, as configured in\n the slave server\'s option file, or on the command line with\n --server-id=value.\n\no Host: The host name of the slave server as specified on the slave\n with the --report-host option. This can differ from the machine name\n as configured in the operating system.\n\no User: The slave server user name as, specified on the slave with the\n --report-user option. Statement output includes this column only if\n the master server is started with the --show-slave-auth-info option.\n\no Password: The slave server password as, specified on the slave with\n the --report-password option. Statement output includes this column\n only if the master server is started with the --show-slave-auth-info\n option.\n\no Port: The port on the master to which the slave server is listening,\n as specified on the slave with the --report-port option.\n\n In MySQL 5.6.5 and later, a zero in this column means that the slave\n port (--report-port) was not set. Prior to MySQL 5.6.5, 3306 was used\n as the default in such cases (Bug #13333431).\n\no Master_id: The unique server ID of the master server that the slave\n server is replicating from. This is the server ID of the server on\n which SHOW SLAVE HOSTS is executed, so this same value is listed for\n each row in the result.\n\no Slave_UUID: The globally unique ID of this slave, as generated on the\n slave and found in the slave\'s auto.cnf file.\n\n This column was added in MySQL 5.6.0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-slave-hosts.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-slave-hosts.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (375,8,'START TRANSACTION','Syntax:\nSTART TRANSACTION\n [transaction_characteristic [, transaction_characteristic] ...]\n\ntransaction_characteristic:\n WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n\nBEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\nThese statements provide control over use of transactions:\n\no START TRANSACTION or BEGIN start a new transaction.\n\no COMMIT commits the current transaction, making its changes permanent.\n\no ROLLBACK rolls back the current transaction, canceling its changes.\n\no SET autocommit disables or enables the default autocommit mode for\n the current session.\n\nBy default, MySQL runs with autocommit mode enabled. This means that as\nsoon as you execute a statement that updates (modifies) a table, MySQL\nstores the update on disk to make it permanent. The change cannot be\nrolled back.\n\nTo disable autocommit mode implicitly for a single series of\nstatements, use the START TRANSACTION statement:\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nWith START TRANSACTION, autocommit remains disabled until you end the\ntransaction with COMMIT or ROLLBACK. The autocommit mode then reverts\nto its previous state.\n\nSTART TRANSACTION permits several modifiers that control transaction\ncharacteristics. To specify multiple modifiers, separate them by\ncommas.\n\no The WITH CONSISTENT SNAPSHOT modifier starts a consistent read for\n storage engines that are capable of it. This applies only to InnoDB.\n The effect is the same as issuing a START TRANSACTION followed by a\n SELECT from any InnoDB table. See\n http://dev.mysql.com/doc/refman/5.6/en/innodb-consistent-read.html.\n The WITH CONSISTENT SNAPSHOT modifier does not change the current\n transaction isolation level, so it provides a consistent snapshot\n only if the current isolation level is one that permits a consistent\n read. The only isolation level that permits a consistent read is\n REPEATABLE READ. For all other isolation levels, the WITH CONSISTENT\n SNAPSHOT clause is ignored.\n\no The READ WRITE and READ ONLY modifiers set the transaction access\n mode. They permit or prohibit changes to tables used in the\n transaction. The READ ONLY restriction prevents the transaction from\n modifying or locking both transactional and nontransactional tables\n that are visible to other transactions; the transaction can still\n modify or lock temporary tables. These modifiers are available as of\n MySQL 5.6.5.\n\n MySQL enables extra optimizations for queries on InnoDB tables when\n the transaction is known to be read-only. Specifying READ ONLY\n ensures these optimizations are applied in cases where the read-only\n status cannot be determined automatically. See\n http://dev.mysql.com/doc/refman/5.6/en/innodb-performance-ro-txn.html\n for more information.\n\n If no access mode is specified, the default mode applies. Unless the\n default has been changed, it is read/write. It is not permitted to\n specify both READ WRITE and READ ONLY in the same statement.\n\n In read-only mode, it remains possible to change tables created with\n the TEMPORARY keyword using DML statements. Changes made with DDL\n statements are not permitted, just as with permanent tables.\n\n For additional information about transaction access mode, including\n ways to change the default mode, see [HELP ISOLATION].\n\n If the read_only system variable is enabled, explicitly starting a\n transaction with START TRANSACTION READ WRITE requires the SUPER\n privilege.\n\n*Important*:\n\nMany APIs used for writing MySQL client applications (such as JDBC)\nprovide their own methods for starting transactions that can (and\nsometimes should) be used instead of sending a START TRANSACTION\nstatement from the client. See\nhttp://dev.mysql.com/doc/refman/5.6/en/connectors-apis.html, or the\ndocumentation for your API, for more information.\n\nTo disable autocommit mode explicitly, use the following statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to\nzero, changes to transaction-safe tables (such as those for InnoDB or\nNDB) are not made permanent immediately. You must use COMMIT to store\nyour changes to disk or ROLLBACK to ignore the changes.\n\nautocommit is a session variable and must be set for each session. To\ndisable autocommit mode for each new connection, see the description of\nthe autocommit system variable at\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nBEGIN and BEGIN WORK are supported as aliases of START TRANSACTION for\ninitiating a transaction. START TRANSACTION is standard SQL syntax, is\nthe recommended way to start an ad-hoc transaction, and permits\nmodifiers that BEGIN does not.\n\nThe BEGIN statement differs from the use of the BEGIN keyword that\nstarts a BEGIN ... END compound statement. The latter does not begin a\ntransaction. See [HELP BEGIN END].\n\n*Note*:\n\nWithin all stored programs (stored procedures and functions, triggers,\nand events), the parser treats BEGIN [WORK] as the beginning of a BEGIN\n... END block. Begin a transaction in this context with START\nTRANSACTION instead.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are\nthe CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of the\ncompletion_type system variable determines the default completion\nbehavior. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the\ncurrent one ends, and the new transaction has the same isolation level\nas the just-terminated transaction. The RELEASE clause causes the\nserver to disconnect the current client session after terminating the\ncurrent transaction. Including the NO keyword suppresses CHAIN or\nRELEASE completion, which can be useful if the completion_type system\nvariable is set to cause chaining or release completion by default.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/commit.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/commit.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (376,32,'TIME_FORMAT','Syntax:\nTIME_FORMAT(time,format)\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, seconds, and\nmicroseconds. Other specifiers produce a NULL value or 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n -> \'100 100 04 04 4\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (377,40,'CREATE DATABASE','Syntax:\nCREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n [create_specification] ...\n\ncreate_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nCREATE DATABASE creates a database with the given name. To use this\nstatement, you need the CREATE privilege for the database. CREATE\nSCHEMA is a synonym for CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (378,16,'VAR_POP','Syntax:\nVAR_POP(expr)\n\nReturns the population standard variance of expr. It considers rows as\nthe whole population, not as a sample, so it has the number of rows as\nthe denominator. You can also use VARIANCE(), which is equivalent but\nis not standard SQL.\n\nIf there are no matching rows, VAR_POP() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (379,38,'CONCAT_WS','Syntax:\nCONCAT_WS(separator,str1,str2,...)\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form\nof CONCAT(). The first argument is the separator for the rest of the\narguments. The separator is added between the strings to be\nconcatenated. The separator can be a string, as can the rest of the\narguments. If the separator is NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n -> \'First name,Second name,Last Name\'\nmysql> SELECT CONCAT_WS(\',\',\'First name\',NULL,\'Last Name\');\n -> \'First name,Last Name\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (380,23,'TEXT','TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 65,535 (216 − 1) characters.\nThe effective maximum length is less if the value contains multibyte\ncharacters. Each TEXT value is stored using a 2-byte length prefix that\nindicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest TEXT type large enough to hold\nvalues M characters long.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (381,19,'~','Syntax:\n~\n\nInvert all bits.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 5 & ~1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (382,3,'ASIN','Syntax:\nASIN(X)\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ASIN(0.2);\n -> 0.20135792079033\nmysql> SELECT ASIN(\'foo\');\n\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (383,17,'ROW_COUNT','Syntax:\nROW_COUNT()\n\nROW_COUNT() returns a value as follows:\n\no DDL statements: 0. This applies to statements such as CREATE TABLE or\n DROP TABLE.\n\no DML statements other than SELECT: The number of affected rows. This\n applies to statements such as UPDATE, INSERT, or DELETE (as before),\n but now also to statements such as ALTER TABLE and LOAD DATA INFILE.\n\no SELECT: -1 if the statement returns a result set, or the number of\n rows "affected" if it does not. For example, for SELECT * FROM t1,\n ROW_COUNT() returns -1. For SELECT * FROM t1 INTO OUTFILE\n \'file_name\', ROW_COUNT() returns the number of rows written to the\n file.\n\no SIGNAL statements: 0.\n\nFor UPDATE statements, the affected-rows value by default is the number\nof rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to\nmysql_real_connect() when connecting to mysqld, the affected-rows value\nis the number of rows "found"; that is, matched by the WHERE clause.\n\nFor REPLACE statements, the affected-rows value is 2 if the new row\nreplaced an old row, because in this case, one row was inserted after\nthe duplicate was deleted.\n\nFor INSERT ... ON DUPLICATE KEY UPDATE statements, the affected-rows\nvalue per row is 1 if the row is inserted as a new row, 2 if an\nexisting row is updated, and 0 if an existing row is set to its current\nvalues. If you specify the CLIENT_FOUND_ROWS flag, the affected-rows\nvalue is 1 (not 0) if an existing row is set to its current values.\n\nThe ROW_COUNT() value is similar to the value from the\nmysql_affected_rows() C API function and the row count that the mysql\nclient displays following statement execution.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> DELETE FROM t WHERE i IN(1,2);\nQuery OK, 2 rows affected (0.00 sec)\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (384,3,'SIGN','Syntax:\nSIGN(X)\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X\nis negative, zero, or positive.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SIGN(-32);\n -> -1\nmysql> SELECT SIGN(0);\n -> 0\nmysql> SELECT SIGN(234);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (385,23,'FLOAT','FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA small (single-precision) floating-point number. Permissible values\nare -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to\n3.402823466E+38. These are the theoretical limits, based on the IEEE\nstandard. The actual range might be slightly smaller depending on your\nhardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A single-precision floating-point\nnumber is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all\ncalculations in MySQL are done with double precision. See\nhttp://dev.mysql.com/doc/refman/5.6/en/no-matching-rows.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (386,17,'CHARSET','Syntax:\nCHARSET(str)\n\nReturns the character set of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT CHARSET(\'abc\');\n -> \'latin1\'\nmysql> SELECT CHARSET(CONVERT(\'abc\' USING utf8));\n -> \'utf8\'\nmysql> SELECT CHARSET(USER());\n -> \'utf8\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (387,7,'ASYMMETRIC_VERIFY','Syntax:\nASYMMETRIC_VERIFY(algorithm, digest_str, sig_str, pub_key_str,\ndigest_type)\n\nVerifies whether the signature string matches the digest string, and\nreturns 1 or 0 to indicate whether verification succeeded or failed.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\nsig_str is the signature string. It can be generated by calling\nASYMMETRIC_SIGN().\n\npub_key_str is the public key string of the signer. It corresponds to\nthe private key passed to ASYMMETRIC_SIGN() to generate the signature\nstring and must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','-- Set the encryption algorithm and digest type\nSET @algo = \'RSA\';\nSET @dig_type = \'SHA224\';\n\n-- Create private/public key pair\nSET @priv = CREATE_ASYMMETRIC_PRIV_KEY(@algo, 1024);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(@algo, @priv);\n\n-- Generate digest from string\nSET @dig = CREATE_DIGEST(@dig_type, \'The quick brown fox\');\n\n-- Generate signature for digest and verify signature against digest\nSET @sig = ASYMMETRIC_SIGN(@algo, @dig, @priv, @dig_type);\nSET @verf = ASYMMETRIC_VERIFY(@algo, @dig, @sig, @pub, @dig_type);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (388,32,'SUBDATE','Syntax:\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE()\nis a synonym for DATE_SUB(). For information on the INTERVAL unit\nargument, see the discussion for DATE_ADD().\n\nmysql> SELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\nmysql> SELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\n\nThe second form enables the use of an integer value for days. In such\ncases, it is interpreted as the number of days to be subtracted from\nthe date or datetime expression expr.\n\nmysql> SELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n -> \'2007-12-02 12:00:00\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (389,32,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n -> 34\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (390,3,'%','Syntax:\nN % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M. For more\ninformation, see the description for the MOD() function in\nhttp://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (391,33,'ASTEXT','AsText(g), AsWKT(g)\n\nST_AsText(), ST_AsWKT(), AsText(), and AsWKT() are synonyms. For more\ninformation, see the description of ST_AsText().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-format-conversion-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (392,24,'DECLARE CONDITION','Syntax:\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n\nThe DECLARE ... CONDITION statement declares a named error condition,\nassociating a name with a condition that needs specific handling. The\nname can be referred to in a subsequent DECLARE ... HANDLER statement\n(see [HELP DECLARE HANDLER]).\n\nCondition declarations must appear before cursor or handler\ndeclarations.\n\nThe condition_value for DECLARE ... CONDITION indicates the specific\ncondition or class of conditions to associate with the condition name.\nIt can take the following forms:\n\no mysql_error_code: An integer literal indicating a MySQL error code.\n\n Do not use MySQL error code 0 because that indicates success rather\n than an error condition. For a list of MySQL error codes, see\n http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\no SQLSTATE [VALUE] sqlstate_value: A 5-character string literal\n indicating an SQLSTATE value.\n\n Do not use SQLSTATE values that begin with \'00\' because those\n indicate success rather than an error condition. For a list of\n SQLSTATE values, see\n http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\nCondition names referred to in SIGNAL or use RESIGNAL statements must\nbe associated with SQLSTATE values, not MySQL error codes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-condition.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-condition.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (393,32,'MONTHNAME','Syntax:\nMONTHNAME(date)\n\nReturns the full name of the month for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.6/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MONTHNAME(\'2008-02-03\');\n -> \'February\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (394,26,'NUMGEOMETRIES','NumGeometries(gc)\n\nST_NumGeometries() and NumGeometries() are synonyms. For more\ninformation, see the description of ST_NumGeometries().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (395,32,'TIMESTAMP FUNCTION','Syntax:\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nWith a single argument, this function returns the date or datetime\nexpression expr as a datetime value. With two arguments, it adds the\ntime expression expr2 to the date or datetime expression expr1 and\nreturns the result as a datetime value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMP(\'2003-12-31\');\n -> \'2003-12-31 00:00:00\'\nmysql> SELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'12:00:00\');\n -> \'2004-01-01 00:00:00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (396,40,'DROP DATABASE','Syntax:\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDROP DATABASE drops all tables in the database and deletes the\ndatabase. Be very careful with this statement! To use DROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is a synonym\nfor DROP DATABASE.\n\n*Important*:\n\nWhen a database is dropped, user privileges on the database are not\nautomatically dropped. See [HELP GRANT].\n\nIF EXISTS is used to prevent an error from occurring if the database\ndoes not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (397,8,'CHANGE MASTER TO','Syntax:\nCHANGE MASTER TO option [, option] ...\n\noption:\n MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_RETRY_COUNT = count\n | MASTER_DELAY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | MASTER_AUTO_POSITION = {0|1}\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | IGNORE_SERVER_IDS = (server_id_list)\n\nserver_id_list:\n [server_id [, server_id] ... ]\n\nCHANGE MASTER TO changes the parameters that the slave server uses for\nconnecting to the master server, for reading the master binary log, and\nreading the slave relay log. It also updates the contents of the master\ninfo and relay log info repositories (see\nhttp://dev.mysql.com/doc/refman/5.6/en/slave-logs.html). CHANGE MASTER\nTO requires the SUPER privilege.\n\nTo use CHANGE MASTER TO, the slave replication threads must be stopped\n(use STOP SLAVE if necessary). In MySQL 5.6.11 and later, gtid_next\nmust also be set to AUTOMATIC (Bug #16062608).\n\nOptions not specified retain their value, except as indicated in the\nfollowing discussion. Thus, in most cases, there is no need to specify\noptions that do not change. For example, if the password to connect to\nyour MySQL master has changed, issue these statements to tell the slave\nabout the new password:\n\nSTOP SLAVE; -- if replication was running\nCHANGE MASTER TO MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE; -- if you want to restart replication\n\nMASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide\ninformation to the slave about how to connect to its master:\n\no MASTER_HOST and MASTER_PORT are the host name (or IP address) of the\n master host and its TCP/IP port.\n\n *Note*:\n\n Replication cannot use Unix socket files. You must be able to connect\n to the master MySQL server using TCP/IP.\n\n If you specify the MASTER_HOST or MASTER_PORT option, the slave\n assumes that the master server is different from before (even if the\n option value is the same as its current value.) In this case, the old\n values for the master binary log file name and position are\n considered no longer applicable, so if you do not specify\n MASTER_LOG_FILE and MASTER_LOG_POS in the statement,\n MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4 are silently appended to it.\n\n Setting MASTER_HOST=\'\' (that is, setting its value explicitly to an\n empty string) is not the same as not setting MASTER_HOST at all.\n Beginning with MySQL 5.5, trying to set MASTER_HOST to an empty\n string fails with an error. Previously, setting MASTER_HOST to an\n empty string caused START SLAVE subsequently to fail. (Bug #28796)\n\n In MySQL 5.6.5 and later, values used for MASTER_HOST and other\n CHANGE MASTER TO options are checked for linefeed (\\n or 0x0A)\n characters; the presence of such characters in these values causes\n the statement to fail with ER_MASTER_INFO. (Bug #11758581, Bug\n #50801)\n\no MASTER_USER and MASTER_PASSWORD are the user name and password of the\n account to use for connecting to the master.\n\n In MySQL 5.6.4 and later, MASTER_USER cannot be made empty; setting\n MASTER_USER = \'\' or leaving it unset when setting a value for\n MASTER_PASSWORD causes an error (Bug #13427949).\n\n The password used for a MySQL Replication slave account in a CHANGE\n MASTER TO statement is limited to 32 characters in length; if the\n password is longer, the statement succeeds, but any excess characters\n are silently truncated. This is an issue specific to MySQL\n Replication, which is fixed in MySQL 5.7. (Bug #11752299, Bug #43439)\n\n The text of a running CHANGE MASTER TO statement, including values\n for MASTER_USER and MASTER_PASSWORD, can be seen in the output of a\n concurrent SHOW PROCESSLIST statement. (The complete text of a START\n SLAVE statement is also visible to SHOW PROCESSLIST.)\n\nThe MASTER_SSL_xxx options provide information about using SSL for the\nconnection. They correspond to the --ssl-xxx options described in\nhttp://dev.mysql.com/doc/refman/5.6/en/secure-connection-options.html,\nand\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-solutions-secure-con\nnections.html. These options can be changed even on slaves that are\ncompiled without SSL support. They are saved to the master info\nrepository, but are ignored if the slave does not have SSL support\nenabled. MASTER_SSL_CRL and MASTER_SSL_CRLPATH were added in MySQL\n5.6.3.\n\nMASTER_CONNECT_RETRY specifies how many seconds to wait between connect\nretries. The default is 60.\n\nMASTER_RETRY_COUNT, added in MySQL 5.6.1, limits the number of\nreconnection attempts and updates the value of the Master_Retry_Count\ncolumn in the output of SHOW SLAVE STATUS (also added in MySQL 5.6.1).\nThe default value is 24 * 3600 = 86400. MASTER_RETRY_COUNT is intended\nto replace the older --master-retry-count server option, and is now the\npreferred method for setting this limit. You are encouraged not to rely\non --master-retry-count in new applications and, when upgrading to\nMySQL 5.6.1 or later from earlier versions of MySQL, to update any\nexisting applications that rely on it, so that they use CHANGE MASTER\nTO ... MASTER_RETRY_COUNT instead.\n\nMASTER_DELAY specifies how many seconds behind the master the slave\nmust lag. An event received from the master is not executed until at\nleast interval seconds later than its execution on the master. The\ndefault is 0. An error occurs if interval is not a nonnegative integer\nin the range from 0 to 231−1. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-delayed.html. This\noption was added in MySQL 5.6.0.\n\nMASTER_BIND is for use on replication slaves having multiple network\ninterfaces, and determines which of the slave\'s network interfaces is\nchosen for connecting to the master.\n\nThe address configured with this option, if any, can be seen in the\nMaster_Bind column of the output from SHOW SLAVE STATUS. If you are\nusing slave status log tables (server started with\n--master-info-repository=TABLE), the value can also be seen as the\nMaster_bind column of the mysql.slave_master_info table.\n\nThe ability to bind a replication slave to a specific network interface\nwas added in MySQL 5.6.2. This is also supported by MySQL NDB Cluster\n7.3.1 and later.\n\nMASTER_HEARTBEAT_PERIOD sets the interval in seconds between\nreplication heartbeats. Whenever the master\'s binary log is updated\nwith an event, the waiting period for the next heartbeat is reset.\ninterval is a decimal value having the range 0 to 4294967 seconds and a\nresolution in milliseconds; the smallest nonzero value is 0.001.\nHeartbeats are sent by the master only if there are no unsent events in\nthe binary log file for a period longer than interval.\n\nIf you are logging master connection information to tables,\nMASTER_HEARTBEAT_PERIOD can be seen as the value of the Heartbeat\ncolumn of the mysql.slave_master_info table.\n\nSetting interval to 0 disables heartbeats altogether. The default value\nfor interval is equal to the value of slave_net_timeout divided by 2.\n\nSetting @@global.slave_net_timeout to a value less than that of the\ncurrent heartbeat interval results in a warning being issued. The\neffect of issuing RESET SLAVE on the heartbeat interval is to reset it\nto the default value.\n\nMASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the\nslave I/O thread should begin reading from the master the next time the\nthread starts. RELAY_LOG_FILE and RELAY_LOG_POS are the coordinates at\nwhich the slave SQL thread should begin reading from the relay log the\nnext time the thread starts. If you specify either of MASTER_LOG_FILE\nor MASTER_LOG_POS, you cannot specify RELAY_LOG_FILE or RELAY_LOG_POS.\nIn MySQL 5.6.5 and later, if you specify either of MASTER_LOG_FILE or\nMASTER_LOG_POS, you also cannot specify MASTER_AUTO_POSITION = 1\n(described later in this section). If neither of MASTER_LOG_FILE or\nMASTER_LOG_POS is specified, the slave uses the last coordinates of the\nslave SQL thread before CHANGE MASTER TO was issued. This ensures that\nthere is no discontinuity in replication, even if the slave SQL thread\nwas late compared to the slave I/O thread, when you merely want to\nchange, say, the password to use.\n\nMASTER_AUTO_POSITION was added in MySQL 5.6.5. If MASTER_AUTO_POSITION\n= 1 is used with CHANGE MASTER TO, the slave attempts to connect to the\nmaster using the GTID-based replication protocol.\n\nWhen using GTIDs, the slave tells the master which transactions it has\nalready received, executed, or both. To compute this set, it reads the\nglobal value of gtid_executed and the value of the Retrieved_gtid_set\ncolumn from SHOW SLAVE STATUS. Since the GTID of the last transmitted\ntransaction is included in Retrieved_gtid_set even if the transaction\nwas only partially transmitted, the last received GTID is subtracted\nfrom this set. Thus, the slave computes the following set:\n\nUNION(@@global.gtid_executed, Retrieved_gtid_set - last_received_GTID)\n\nThis set is sent to the master as part of the initial handshake, and\nthe master sends back all transactions that it has executed which are\nnot part of the set. If any of these transactions have been already\npurged from the master\'s binary log, the master sends the error\nER_MASTER_HAS_PURGED_REQUIRED_GTIDS to the slave, and replication does\nnot start.\n\nWhen GTID-based replication is employed, the coordinates represented by\nMASTER_LOG_FILE and MASTER_LOG_POS are not used, and global transaction\nidentifiers are used instead. Thus the use of either or both of these\noptions together with MASTER_AUTO_POSITION causes an error.\n\nBeginning with MySQL 5.6.10, you can see whether replication is running\nwith autopositioning enabled by checking the output of SHOW SLAVE\nSTATUS. (Bug #15992220)\n\ngtid_mode must also be enabled before issuing CHANGE MASTER TO ...\nMASTER_AUTO_POSITION = 1. Otherwise, the statement fails with an error.\n\nTo revert to the older file-based replication protocol after using\nGTIDs, you can issue a new CHANGE MASTER TO statement that specifies\nMASTER_AUTO_POSITION = 0, as well as at least one of MASTER_LOG_FILE or\nMASTER_LOG_POS.\n\nCHANGE MASTER TO deletes all relay log files and starts a new one,\nunless you specify RELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay\nlog files are kept; the relay_log_purge global variable is set silently\nto 0.\n\nPrior to MySQL 5.6.2, RELAY_LOG_FILE required an absolute path.\nBeginning with MySQL 5.6.2, the path can be relative, in which case it\nis assumed to be relative to the slave\'s data directory. (Bug #12190)\n\nIGNORE_SERVER_IDS takes a comma-separated list of 0 or more server IDs.\nEvents originating from the corresponding servers are ignored, with the\nexception of log rotation and deletion events, which are still recorded\nin the relay log.\n\nIn circular replication, the originating server normally acts as the\nterminator of its own events, so that they are not applied more than\nonce. Thus, this option is useful in circular replication when one of\nthe servers in the circle is removed. Suppose that you have a circular\nreplication setup with 4 servers, having server IDs 1, 2, 3, and 4, and\nserver 3 fails. When bridging the gap by starting replication from\nserver 2 to server 4, you can include IGNORE_SERVER_IDS = (3) in the\nCHANGE MASTER TO statement that you issue on server 4 to tell it to use\nserver 2 as its master instead of server 3. Doing so causes it to\nignore and not to propagate any statements that originated with the\nserver that is no longer in use.\n\nWhen a CHANGE MASTER TO statement is issued without any\nIGNORE_SERVER_IDS option, any existing list is preserved. To clear the\nlist of ignored servers, it is necessary to use the option with an\nempty list:\n\nCHANGE MASTER TO IGNORE_SERVER_IDS = ();\n\nRESET SLAVE ALL has no effect on the server ID list. This issue is\nfixed in MySQL 5.7. (Bug #18816897)\n\nIf IGNORE_SERVER_IDS contains the server\'s own ID and the server was\nstarted with the --replicate-same-server-id option enabled, an error\nresults.\n\nIn MySQL 5.6, the master info repository and the output of SHOW SLAVE\nSTATUS provide the list of servers that are currently ignored. For more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.6/en/slave-logs-status.html, and\n[HELP SHOW SLAVE STATUS].\n\nIn MySQL 5.6, invoking CHANGE MASTER TO causes the previous values for\nMASTER_HOST, MASTER_PORT, MASTER_LOG_FILE, and MASTER_LOG_POS to be\nwritten to the error log, along with other information about the\nslave\'s state prior to execution.\n\nIn MySQL 5.6.7 and later, CHANGE MASTER TO causes an implicit commit of\nan ongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nCHANGE MASTER TO is useful for setting up a slave when you have the\nsnapshot of the master and have recorded the master binary log\ncoordinates corresponding to the time of the snapshot. After loading\nthe snapshot into the slave to synchronize it with the master, you can\nrun CHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos\non the slave to specify the coordinates at which the slave should begin\nreading the master binary log.\n\nThe following example changes the master server the slave uses and\nestablishes the master binary log coordinates from which the slave\nbegins reading. This is used when you want to set up the slave to\nreplicate the master:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\n\nThe next example shows an operation that is less frequently employed.\nIt is used when the slave has relay log files that you want it to\nexecute again for some reason. To do this, the master need not be\nreachable. You need only use CHANGE MASTER TO and start the SQL thread\n(START SLAVE SQL_THREAD):\n\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (398,27,'SHOW GRANTS','Syntax:\nSHOW GRANTS [FOR user]\n\nThis statement displays the privileges that are assigned to a MySQL\nuser account, in the form of GRANT statements that must be executed to\nduplicate the privilege assignments. SHOW GRANTS requires the SELECT\nprivilege for the mysql database, except to see the privileges for the\ncurrent user.\n\nFor output that includes an IDENTIFIED BY PASSWORD clause displaying an\naccount password hash value, the SUPER privilege is required to see the\nactual hash value. Otherwise, the value displays as .\n\nTo name the account, use the same format as for the GRANT statement;\nfor example, \'jeffrey\'@\'localhost\'. If you specify only the user name\npart of the account name, a host name part of \'%\' is used. For\nadditional information about specifying account names, see [HELP\nGRANT].\n\nmysql> SHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo display the privileges granted to the account that you are using to\nconnect to the server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is\nused in DEFINER context, such as within a stored procedure that is\ndefined with SQL SECURITY DEFINER), the grants displayed are those of\nthe definer and not the invoker.\n\nSHOW GRANTS displays only the privileges granted explicitly to the\nnamed account. Other privileges that might be available to the account\nare not displayed. For example, if an anonymous account exists, the\nnamed account might be able to use its privileges, but SHOW GRANTS will\nnot display them.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-grants.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-grants.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (399,3,'CRC32','Syntax:\nCRC32(expr)\n\nComputes a cyclic redundancy check value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is\nexpected to be a string and (if possible) is treated as one if it is\nnot.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CRC32(\'MySQL\');\n -> 3259397556\nmysql> SELECT CRC32(\'mysql\');\n -> 2501908538\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (400,13,'STARTPOINT','StartPoint(ls)\n\nST_StartPoint() and StartPoint() are synonyms. For more information,\nsee the description of ST_StartPoint().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (401,4,'MPOLYFROMTEXT','MPolyFromText(wkt[, srid]), MultiPolygonFromText(wkt[, srid])\n\nConstructs a MultiPolygon value using its WKT representation and SRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (402,24,'DECLARE VARIABLE','Syntax:\nDECLARE var_name [, var_name] ... type [DEFAULT value]\n\nThis statement declares local variables within stored programs. To\nprovide a default value for a variable, include a DEFAULT clause. The\nvalue can be specified as an expression; it need not be a constant. If\nthe DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect\nto data type and overflow checking. See [HELP CREATE PROCEDURE].\n\nVariable declarations must appear before cursor or handler\ndeclarations.\n\nLocal variable names are not case sensitive. Permissible characters and\nquoting rules are the same as for other identifiers, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\nThe scope of a local variable is the BEGIN ... END block within which\nit is declared. The variable can be referred to in blocks nested within\nthe declaring block, except those blocks that declare a variable with\nthe same name.\n\nFor examples of variable declarations, see\nhttp://dev.mysql.com/doc/refman/5.6/en/local-variable-scope.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-local-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-local-variable.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (403,20,'NOT BETWEEN','Syntax:\nexpr NOT BETWEEN min AND max\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (404,32,'YEARWEEK','Syntax:\nYEARWEEK(date), YEARWEEK(date,mode)\n\nReturns year and week for a date. The year in the result may be\ndifferent from the year in the date argument for the first and the last\nweek of the year.\n\nThe mode argument works exactly like the mode argument to WEEK(). For\nthe single-argument syntax, a mode value of 0 is used. Unlike WEEK(),\nthe value of default_week_format does not influence YEARWEEK().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT YEARWEEK(\'1987-01-01\');\n -> 198652\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (405,16,'BIT_OR','Syntax:\nBIT_OR(expr)\n\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nIf there are no matching rows, BIT_OR() returns a neutral value (all\nbits set to 0).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (406,3,'LOG10','Syntax:\nLOG10(X)\n\nReturns the base-10 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG10(2);\n -> 0.30102999566398\nmysql> SELECT LOG10(100);\n -> 2\nmysql> SELECT LOG10(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (407,23,'DECIMAL','DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nA packed "exact" fixed-point number. M is the total number of digits\n(the precision) and D is the number of digits after the decimal point\n(the scale). The decimal point and (for negative numbers) the - sign\nare not counted in M. If D is 0, values have no decimal point or\nfractional part. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30. If D is omitted,\nthe default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with\na precision of 65 digits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (408,40,'CREATE FUNCTION','The CREATE FUNCTION statement is used to create stored functions and\nuser-defined functions (UDFs):\n\no For information about creating stored functions, see [HELP CREATE\n PROCEDURE].\n\no For information about creating user-defined functions, see [HELP\n CREATE FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (409,20,'<','Syntax:\n<\n\nLess than:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 < 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (410,12,'MD5','Syntax:\nMD5(str)\n\nCalculates an MD5 128-bit checksum for the string. The value is\nreturned as a string of 32 hexadecimal digits, or NULL if the argument\nwas NULL. The return value can, for example, be used as a hash key. See\nthe notes at the beginning of this section about storing hash values\nefficiently.\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT MD5(\'testing\');\n -> \'ae2b1fca515949e5d54fb22b8ed95575\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (411,32,'DAYOFMONTH','Syntax:\nDAYOFMONTH(date)\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for\ndates such as \'0000-00-00\' or \'2008-00-00\' that have a zero day part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFMONTH(\'2007-02-03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (412,32,'UNIX_TIMESTAMP','Syntax:\nUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC). As of MySQL 5.6.4, the return value is an\ninteger if no argument is given or the argument does not include a\nfractional seconds part, or DECIMAL if an argument is given that\nincludes a fractional seconds part. Before MySQL 5.6.4, the return\nvalue is an integer.\n\nIf UNIX_TIMESTAMP() is called with a date argument, it returns the\nvalue of the argument as seconds since \'1970-01-01 00:00:00\' UTC. The\ndate argument may be a DATE, DATETIME, or TIMESTAMP string, or a number\nin YYMMDD, YYMMDDHHMMSS, YYYYMMDD, or YYYYMMDDHHMMSS format. If the\nargument includes a time part, it may optionally include a fractional\nseconds part. (Before MySQL 5.6.4, any fractional seconds part is\nignored.) The server interprets date as a value in the current time\nzone and converts it to an internal value in UTC. Clients can set their\ntime zone as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/time-zone-support.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UNIX_TIMESTAMP();\n -> 1447431666\nmysql> SELECT UNIX_TIMESTAMP(\'2015-11-13 10:20:19\');\n -> 1447431619\nmysql> SELECT UNIX_TIMESTAMP(\'2015-11-13 10:20:19.012\');\n -> 1447431619.012\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (413,26,'ST_INTERSECTION','ST_Intersection(g1, g2)\n\nReturns a geometry that represents the point set intersection of the\ngeometry values g1 and g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html\n\n','mysql> SET @g1 = ST_GeomFromText(\'LineString(1 1, 3 3)\');\nmysql> SET @g2 = ST_GeomFromText(\'LineString(1 3, 3 1)\');\nmysql> SELECT ST_AsText(ST_Intersection(@g1, @g2));\n+--------------------------------------+\n| ST_AsText(ST_Intersection(@g1, @g2)) |\n+--------------------------------------+\n| POINT(2 2) |\n+--------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-operator-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (414,10,'RENAME USER','Syntax:\nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n\nThe RENAME USER statement renames existing MySQL accounts. An error\noccurs for old accounts that do not exist or new accounts that already\nexist.\n\nTo use RENAME USER, you must have the global CREATE USER privilege, or\nthe UPDATE privilege for the mysql database. When the read_only system\nvariable is enabled, RENAME USER additionally requires the SUPER\nprivilege.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nRENAME USER \'jeffrey\'@\'localhost\' TO \'jeff\'@\'127.0.0.1\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nRENAME USER causes the privileges held by the old user to be those held\nby the new user. However, RENAME USER does not automatically drop or\ninvalidate databases or objects within them that the old user created.\nThis includes stored programs or views for which the DEFINER attribute\nnames the old user. Attempts to access such objects may produce an\nerror if they execute in definer security context. (For information\nabout security context, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-security.html.)\n\nThe privilege changes take effect as indicated in\nhttp://dev.mysql.com/doc/refman/5.6/en/privilege-changes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/rename-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/rename-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (415,13,'NUMPOINTS','NumPoints(ls)\n\nST_NumPoints() and NumPoints() are synonyms. For more information, see\nthe description of ST_NumPoints().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (416,40,'ALTER LOGFILE GROUP','Syntax:\nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement adds an UNDO file named \'file_name\' to an existing log\nfile group logfile_group. An ALTER LOGFILE GROUP statement has one and\nonly one ADD UNDOFILE clause. No DROP UNDOFILE clause is currently\nsupported.\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and an undo log file with the same name, or an undo log file\nand a data file with the same name.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size\nin bytes; if not specified, the initial size defaults to 134217728 (128\nMB). Prior to MySQL NDB Cluster 7.3.2, this value was required to be\nspecified using digits; in MySQL NDB Cluster 7.3.2 and later, you may\noptionally follow size with a one-letter abbreviation for an order of\nmagnitude, similar to those used in my.cnf. Generally, this is one of\nthe letters M (megabytes) or G (gigabytes). (Bug #13116514, Bug\n#16104705, Bug #62858)\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nThe minimum allowed value for INITIAL_SIZE is 1048576 (1 MB). (Bug\n#29574)\n\n*Note*:\n\nWAIT is parsed but otherwise ignored. This keyword currently has no\neffect, and is intended for future expansion.\n\nThe ENGINE parameter (required) determines the storage engine which is\nused by this log file group, with engine_name being the name of the\nstorage engine. Currently, the only accepted values for engine_name are\n"NDBCLUSTER" and "NDB". The two values are equivalent.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-logfile-group.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (417,32,'LOCALTIMESTAMP','Syntax:\nLOCALTIMESTAMP, LOCALTIMESTAMP([fsp])\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (418,32,'ADDDATE','Syntax:\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE()\nis a synonym for DATE_ADD(). The related function SUBDATE() is a\nsynonym for DATE_SUB(). For information on the INTERVAL unit argument,\nsee the discussion for DATE_ADD().\n\nmysql> SELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\nmysql> SELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\n\nWhen invoked with the days form of the second argument, MySQL treats it\nas an integer number of days to be added to expr.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT ADDDATE(\'2008-01-02\', 31);\n -> \'2008-02-02\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (419,7,'CREATE_DIGEST','Syntax:\nCREATE_DIGEST(digest_type, str)\n\nCreates a digest from the given string using the given digest type, and\nreturns the digest as a binary string. If digest generation fails, the\nresult is NULL.\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','SET @dig = CREATE_DIGEST(\'SHA512\', The quick brown fox\');\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (420,40,'ALTER FUNCTION','Syntax:\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nfunction. More than one change may be specified in an ALTER FUNCTION\nstatement. However, you cannot change the parameters or body of a\nstored function using this statement; to make such changes, you must\ndrop and re-create the function using DROP FUNCTION and CREATE\nFUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That\nprivilege is granted automatically to the function creator.) If binary\nlogging is enabled, the ALTER FUNCTION statement might also require the\nSUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-function.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (421,14,'IS_FREE_LOCK','Syntax:\nIS_FREE_LOCK(str)\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock\nis in use, and NULL if an error occurs (such as an incorrect argument).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (422,8,'DEALLOCATE PREPARE','Syntax:\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nTo deallocate a prepared statement produced with PREPARE, use a\nDEALLOCATE PREPARE statement that refers to the prepared statement\nname. Attempting to execute a prepared statement after deallocating it\nresults in an error. If too many prepared statements are created and\nnot deallocated by either the DEALLOCATE PREPARE statement or the end\nof the session, you might encounter the upper limit enforced by the\nmax_prepared_stmt_count system variable.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/deallocate-prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/deallocate-prepare.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (423,31,'TOUCHES','Touches(g1, g2)\n\nST_Touches() and Touches() are synonyms. For more information, see the\ndescription of ST_Touches().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (424,23,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/example-auto-increment.html\n\n','CREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n);\n\nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'lax\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n','http://dev.mysql.com/doc/refman/5.6/en/example-auto-increment.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (425,12,'UNCOMPRESS','Syntax:\nUNCOMPRESS(string_to_uncompress)\n\nUncompresses a string compressed by the COMPRESS() function. If the\nargument is not a compressed value, the result is NULL. This function\nrequires MySQL to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESS(COMPRESS(\'any string\'));\n -> \'any string\'\nmysql> SELECT UNCOMPRESS(\'any string\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (426,4,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt[, srid]), GeometryCollectionFromText(wkt[, srid])\n\nST_GeomCollFromText(), ST_GeometryCollectionFromText(),\nGeomCollFromText(), and GeometryCollectionFromText() are synonyms. For\nmore information, see the description of ST_GeomCollFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (427,2,'ST_INTERIORRINGN','ST_InteriorRingN(poly, N)\n\nReturns the N-th interior ring for the Polygon value poly as a\nLineString. Rings are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1));\n+-------------------------------------------------------+\n| ST_AsText(ST_InteriorRingN(ST_GeomFromText(@poly),1)) |\n+-------------------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+-------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (428,17,'LAST_INSERT_ID','Syntax:\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nWith no argument, LAST_INSERT_ID() returns a 64-bit value representing\nthe first automatically generated value successfully inserted for an\nAUTO_INCREMENT column as a result of the most recently executed INSERT\nstatement. The value has a type of BIGINT UNSIGNED as of MySQL 5.6.9,\nBIGINT (signed) before that. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nWith an argument, LAST_INSERT_ID() returns an unsigned integer as of\nMySQL 5.6.9, a signed integer before that.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT\nvalue, you can get the value like this:\n\nmysql> SELECT LAST_INSERT_ID();\n -> 195\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table with its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain\nstable in the second statement; its value for the second and later rows\nis not affected by the earlier row insertions. (However, if you mix\nreferences to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is\nundefined.)\n\nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if the\nstatement is rolled back due to an error, the value of LAST_INSERT_ID()\nis left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()\nis not restored to that before the transaction; it remains as it was at\nthe point of the ROLLBACK.\n\nPrior to MySQL 5.6.15, this function was not replicated correctly if\nreplication filtering rules were in use. (Bug #17234370, Bug #69861)\n\nWithin the body of a stored routine (procedure or function) or a\ntrigger, the value of LAST_INSERT_ID() changes the same way as for\nstatements executed outside the body of these kinds of objects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements depends on the\nkind of routine:\n\no If a stored procedure executes statements that change the value of\n LAST_INSERT_ID(), the changed value is seen by statements that follow\n the procedure call.\n\no For stored functions and triggers that change the value, the value is\n restored when the function or trigger ends, so following statements\n will not see a changed value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (429,3,'FLOOR','Syntax:\nFLOOR(X)\n\nReturns the largest integer value not greater than X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT FLOOR(1.23), FLOOR(-1.23);\n -> 1, -2\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (430,3,'COS','Syntax:\nCOS(X)\n\nReturns the cosine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT COS(PI());\n -> -1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (431,16,'STD','Syntax:\nSTD(expr)\n\nReturns the population standard deviation of expr. This is an extension\nto standard SQL. The standard SQL function STDDEV_POP() can be used\ninstead.\n\nIf there are no matching rows, STD() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (432,32,'DATE FUNCTION','Syntax:\nDATE(expr)\n\nExtracts the date part of the date or datetime expression expr.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE(\'2003-12-31 01:02:03\');\n -> \'2003-12-31\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (433,3,'TAN','Syntax:\nTAN(X)\n\nReturns the tangent of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT TAN(PI());\n -> -1.2246063538224e-16\nmysql> SELECT TAN(PI()+1);\n -> 1.5574077246549\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (434,32,'WEEKOFYEAR','Syntax:\nWEEKOFYEAR(date)\n\nReturns the calendar week of the date as a number in the range from 1\nto 53. WEEKOFYEAR() is a compatibility function that is equivalent to\nWEEK(date,3).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKOFYEAR(\'2008-02-20\');\n -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (435,32,'SUBTIME','Syntax:\nSUBTIME(expr1,expr2)\n\nSUBTIME() returns expr1 − expr2 expressed as a value in the same\nformat as expr1. expr1 is a time or datetime expression, and expr2 is a\ntime expression.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n -> \'2007-12-30 22:58:58.999997\'\nmysql> SELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'-00:59:59.999999\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (436,3,'LOG2','Syntax:\nLOG2(X)\n\nReturns the base-2 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG2(65536);\n -> 16\nmysql> SELECT LOG2(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (437,12,'UNCOMPRESSED_LENGTH','Syntax:\nUNCOMPRESSED_LENGTH(compressed_string)\n\nReturns the length that the compressed string had before being\ncompressed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n -> 30\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (438,3,'POW','Syntax:\nPOW(X,Y)\n\nReturns the value of X raised to the power of Y.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT POW(2,2);\n -> 4\nmysql> SELECT POW(2,-2);\n -> 0.25\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (439,40,'DROP TABLE','Syntax:\nDROP [TEMPORARY] TABLE [IF EXISTS]\n tbl_name [, tbl_name] ...\n [RESTRICT | CASCADE]\n\nDROP TABLE removes one or more tables. You must have the DROP privilege\nfor each table. All table data and the table definition are removed, so\nbe careful with this statement! If any of the tables named in the\nargument list do not exist, MySQL returns an error indicating by name\nwhich nonexisting tables it was unable to drop, but it also drops all\nof the tables in the list that do exist.\n\n*Important*:\n\nWhen a table is dropped, user privileges on the table are not\nautomatically dropped. See [HELP GRANT].\n\nFor a partitioned table, DROP TABLE permanently removes the table\ndefinition, all of its partitions, and all of the data which was stored\nin those partitions. It also removes the partitioning definition (.par)\nfile associated with the dropped table.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not\nexist. A NOTE is generated for each nonexistent table when using IF\nEXISTS. See [HELP SHOW WARNINGS].\n\nIF EXISTS can be useful for dropping tables in unusual circumstances\nunder which there is an .frm file but no table managed by the storage\nengine. (For example, if an abnormal server exit occurs after removal\nof the table from the storage engine but before .frm file removal.)\n\nRESTRICT and CASCADE are permitted to make porting easier. In MySQL\n5.6, they do nothing.\n\n*Note*:\n\nDROP TABLE automatically commits the current active transaction, unless\nyou use the TEMPORARY keyword.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (440,32,'NOW','Syntax:\nNOW([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context. The value is expressed in the current time\nzone.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT NOW();\n -> \'2007-12-15 23:50:26\'\nmysql> SELECT NOW() + 0;\n -> 20071215235026.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (441,27,'SHOW ENGINES','Syntax:\nSHOW [STORAGE] ENGINES\n\nSHOW ENGINES displays status information about the server\'s storage\nengines. This is particularly useful for checking whether a storage\nengine is supported, or to see what the default engine is. This\ninformation can also be obtained from the INFORMATION_SCHEMA ENGINES\ntable. See http://dev.mysql.com/doc/refman/5.6/en/engines-table.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-engines.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-engines.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (442,4,'ST_POINTFROMTEXT','ST_PointFromText(wkt[, srid])\n\nConstructs a Point value using its WKT representation and SRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (443,13,'ST_ENDPOINT','ST_EndPoint(ls)\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT ST_AsText(ST_EndPoint(ST_GeomFromText(@ls)));\n+----------------------------------------------+\n| ST_AsText(ST_EndPoint(ST_GeomFromText(@ls))) |\n+----------------------------------------------+\n| POINT(3 3) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-linestring-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (444,14,'IS_IPV6','Syntax:\nIS_IPV6(expr)\n\nReturns 1 if the argument is a valid IPv6 address specified as a\nstring, 0 otherwise. This function does not consider IPv4 addresses to\nbe valid IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV6(\'10.0.5.9\'), IS_IPV6(\'::1\');\n -> 0, 1\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (445,23,'LONGBLOB','LONGBLOB\n\nA BLOB column with a maximum length of 4,294,967,295 or 4GB (232 − 1)\nbytes. The effective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol and\navailable memory. Each LONGBLOB value is stored using a 4-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (446,31,'ST_OVERLAPS','ST_Overlaps(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (447,23,'YEAR DATA TYPE','YEAR[(2|4)]\n\nA year in two-digit or four-digit format. The default is four-digit\nformat. YEAR(2) or YEAR(4) differ in display format, but have the same\nrange of values. In four-digit format, values display as 1901 to 2155,\nand 0000. In two-digit format, values display as 70 to 69, representing\nyears from 1970 to 2069. MySQL displays YEAR values in YYYY or YY\nformat, but permits assignment of values to YEAR columns using either\nstrings or numbers.\n\n*Note*:\n\nThe YEAR(2) data type has certain issues that you should consider\nbefore choosing to use it. As of MySQL 5.6.6, YEAR(2) is deprecated.\nYEAR(2) columns in existing tables are treated as before, but YEAR(2)\nin new or altered tables are converted to YEAR(4). For more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.6/en/migrating-to-year4.html.\n\nFor additional information about YEAR display format and interpretation\nof input values, see http://dev.mysql.com/doc/refman/5.6/en/year.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (448,16,'SUM','Syntax:\nSUM([DISTINCT] expr)\n\nReturns the sum of expr. If the return set has no rows, SUM() returns\nNULL. The DISTINCT keyword can be used to sum only the distinct values\nof expr.\n\nIf there are no matching rows, SUM() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (449,38,'REPEAT FUNCTION','Syntax:\nREPEAT(str,count)\n\nReturns a string consisting of the string str repeated count times. If\ncount is less than 1, returns an empty string. Returns NULL if str or\ncount are NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REPEAT(\'MySQL\', 3);\n -> \'MySQLMySQLMySQL\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (450,38,'SOUNDEX','Syntax:\nSOUNDEX(str)\n\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis four characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get a\nstandard soundex string. All nonalphabetic characters in str are\nignored. All international alphabetic characters outside the A-Z range\nare treated as vowels.\n\n*Important*:\n\nWhen using SOUNDEX(), you should be aware of the following limitations:\n\no This function, as currently implemented, is intended to work well\n with strings that are in the English language only. Strings in other\n languages may not produce reliable results.\n\no This function is not guaranteed to provide consistent results with\n strings that use multibyte character sets, including utf-8.\n\n We hope to remove these limitations in a future release. See Bug\n #22638 for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SOUNDEX(\'Hello\');\n -> \'H400\'\nmysql> SELECT SOUNDEX(\'Quadratically\');\n -> \'Q36324\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (451,7,'MBRTOUCHES','MBRTouches(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 touch. Two geometries spatially touch if\nthe interiors of the geometries do not intersect, but the boundary of\none of the geometries intersects either the boundary or the interior of\nthe other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (452,40,'DROP EVENT','Syntax:\nDROP EVENT [IF EXISTS] event_name\n\nThis statement drops the event named event_name. The event immediately\nceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown\nevent \'event_name\' results. You can override this and cause the\nstatement to generate a warning for nonexistent events instead using IF\nEXISTS.\n\nThis statement requires the EVENT privilege for the schema to which the\nevent to be dropped belongs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (453,23,'VARBINARY','VARBINARY(M)\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary\nbyte strings rather than nonbinary character strings. M represents the\nmaximum column length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (454,27,'LOAD INDEX','Syntax:\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n [PARTITION (partition_list | ALL)]\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key\ncache to which it has been assigned by an explicit CACHE INDEX\nstatement, or into the default key cache otherwise.\n\nLOAD INDEX INTO CACHE is used only for MyISAM tables. In MySQL 5.6, it\nis also supported for partitioned MyISAM tables; in addition, indexes\non partitioned tables can be preloaded for one, several, or all\npartitions.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of\nthe index to be preloaded.\n\nIGNORE LEAVES is also supported for partitioned MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (455,28,'UNION','Syntax:\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n\nUNION is used to combine the result from multiple SELECT statements\ninto a single result set.\n\nThe column names from the first SELECT statement are used as the column\nnames for the results returned. Selected columns listed in\ncorresponding positions of each SELECT statement should have the same\ndata type. (For example, the first column selected by the first\nstatement should have the same type as the first column selected by the\nother statements.)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/union.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/union.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (456,32,'TO_DAYS','Syntax:\nTO_DAYS(date)\n\nGiven a date date, returns a day number (the number of days since year\n0).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TO_DAYS(950501);\n -> 728779\nmysql> SELECT TO_DAYS(\'2007-10-07\');\n -> 733321\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (457,27,'SHOW INDEX','Syntax:\nSHOW {INDEX | INDEXES | KEYS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [WHERE expr]\n\nSHOW INDEX returns table index information. The format resembles that\nof the SQLStatistics call in ODBC. This statement requires some\nprivilege for any column in the table.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nThe WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nmysql> SHOW INDEX FROM City\\G\n*************************** 1. row ***************************\n Table: city\n Non_unique: 0\n Key_name: PRIMARY\n Seq_in_index: 1\n Column_name: ID\n Collation: A\n Cardinality: 4321\n Sub_part: NULL\n Packed: NULL\n Null: \n Index_type: BTREE\n Comment: \nIndex_comment: \n*************************** 2. row ***************************\n Table: city\n Non_unique: 1\n Key_name: CountryCode\n Seq_in_index: 1\n Column_name: CountryCode\n Collation: A\n Cardinality: 4321\n Sub_part: NULL\n Packed: NULL\n Null: \n Index_type: BTREE\n Comment: \nIndex_comment: \n\nSHOW INDEX returns the following fields:\n\no Table\n\n The name of the table.\n\no Non_unique\n\n 0 if the index cannot contain duplicates, 1 if it can.\n\no Key_name\n\n The name of the index. If the index is the primary key, the name is\n always PRIMARY.\n\no Seq_in_index\n\n The column sequence number in the index, starting with 1.\n\no Column_name\n\n The column name.\n\no Collation\n\n How the column is sorted in the index. This can have values A\n (ascending) or NULL (not sorted).\n\no Cardinality\n\n An estimate of the number of unique values in the index. To update\n this number, run ANALYZE TABLE or (for MyISAM tables) myisamchk -a.\n\n Cardinality is counted based on statistics stored as integers, so the\n value is not necessarily exact even for small tables. The higher the\n cardinality, the greater the chance that MySQL uses the index when\n doing joins.\n\no Sub_part\n\n The index prefix. That is, the number of indexed characters if the\n column is only partly indexed, NULL if the entire column is indexed.\n\n *Note*:\n\n Prefix limits are measured in bytes, whereas the prefix length in\n CREATE TABLE, ALTER TABLE, and CREATE INDEX statements is interpreted\n as number of characters for nonbinary string types (CHAR, VARCHAR,\n TEXT) and number of bytes for binary string types (BINARY, VARBINARY,\n BLOB). Take this into account when specifying a prefix length for a\n nonbinary string column that uses a multibyte character set.\n\n For additional information about index prefixes, see\n http://dev.mysql.com/doc/refman/5.6/en/column-indexes.html, and [HELP\n CREATE INDEX].\n\no Packed\n\n Indicates how the key is packed. NULL if it is not.\n\no Null\n\n Contains YES if the column may contain NULL values and \'\' if not.\n\no Index_type\n\n The index method used (BTREE, FULLTEXT, HASH, RTREE).\n\no Comment\n\n Information about the index not described in its own column, such as\n disabled if the index is disabled.\n\no Index_comment\n\n Any comment provided for the index with a COMMENT attribute when the\n index was created.\n\nYou can also obtain information about table indexes from\nINFORMATION_SCHEMA, which contains a STATISTICS table. See\nhttp://dev.mysql.com/doc/refman/5.6/en/statistics-table.html.\n\nYou can list a table\'s indexes with the mysqlshow -k db_name tbl_name\ncommand.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-index.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (458,27,'SHOW CREATE DATABASE','Syntax:\nSHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n\nShows the CREATE DATABASE statement that creates the named database. If\nthe SHOW statement includes an IF NOT EXISTS clause, the output too\nincludes such a clause. SHOW CREATE SCHEMA is a synonym for SHOW CREATE\nDATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-database.html\n\n','mysql> SHOW CREATE DATABASE test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n\nmysql> SHOW CREATE SCHEMA test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-database.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (459,15,'!','Syntax:\nNOT, !\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnonzero, and NOT NULL returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT NOT 10;\n -> 0\nmysql> SELECT NOT 0;\n -> 1\nmysql> SELECT NOT NULL;\n -> NULL\nmysql> SELECT ! (1+1);\n -> 0\nmysql> SELECT ! 1+1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (460,23,'DOUBLE','DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA normal-size (double-precision) floating-point number. Permissible\nvalues are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and\n2.2250738585072014E-308 to 1.7976931348623157E+308. These are the\ntheoretical limits, based on the IEEE standard. The actual range might\nbe slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A double-precision floating-point\nnumber is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (461,24,'DECLARE HANDLER','Syntax:\nDECLARE handler_action HANDLER\n FOR condition_value [, condition_value] ...\n statement\n\nhandler_action:\n CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n\nThe DECLARE ... HANDLER statement specifies a handler that deals with\none or more conditions. If one of these conditions occurs, the\nspecified statement executes. statement can be a simple statement such\nas SET var_name = value, or a compound statement written using BEGIN\nand END (see [HELP BEGIN END]).\n\nHandler declarations must appear after variable or condition\ndeclarations.\n\nThe handler_action value indicates what action the handler takes after\nexecution of the handler statement:\n\no CONTINUE: Execution of the current program continues.\n\no EXIT: Execution terminates for the BEGIN ... END compound statement\n in which the handler is declared. This is true even if the condition\n occurs in an inner block.\n\no UNDO: Not supported.\n\nThe condition_value for DECLARE ... HANDLER indicates the specific\ncondition or class of conditions that activates the handler. It can\ntake the following forms:\n\no mysql_error_code: An integer literal indicating a MySQL error code,\n such as 1051 to specify "unknown table":\n\nDECLARE CONTINUE HANDLER FOR 1051\n BEGIN\n -- body of handler\n END;\n\n Do not use MySQL error code 0 because that indicates success rather\n than an error condition. For a list of MySQL error codes, see\n http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\no SQLSTATE [VALUE] sqlstate_value: A 5-character string literal\n indicating an SQLSTATE value, such as \'42S01\' to specify "unknown\n table":\n\nDECLARE CONTINUE HANDLER FOR SQLSTATE \'42S02\'\n BEGIN\n -- body of handler\n END;\n\n Do not use SQLSTATE values that begin with \'00\' because those\n indicate success rather than an error condition. For a list of\n SQLSTATE values, see\n http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\no condition_name: A condition name previously specified with DECLARE\n ... CONDITION. A condition name can be associated with a MySQL error\n code or SQLSTATE value. See [HELP DECLARE CONDITION].\n\no SQLWARNING: Shorthand for the class of SQLSTATE values that begin\n with \'01\'.\n\nDECLARE CONTINUE HANDLER FOR SQLWARNING\n BEGIN\n -- body of handler\n END;\n\no NOT FOUND: Shorthand for the class of SQLSTATE values that begin with\n \'02\'. This is relevant within the context of cursors and is used to\n control what happens when a cursor reaches the end of a data set. If\n no more rows are available, a No Data condition occurs with SQLSTATE\n value \'02000\'. To detect this condition, you can set up a handler for\n it or for a NOT FOUND condition.\n\nDECLARE CONTINUE HANDLER FOR NOT FOUND\n BEGIN\n -- body of handler\n END;\n\n For another example, see\n http://dev.mysql.com/doc/refman/5.6/en/cursors.html. The NOT FOUND\n condition also occurs for SELECT ... INTO var_list statements that\n retrieve no rows.\n\no SQLEXCEPTION: Shorthand for the class of SQLSTATE values that do not\n begin with \'00\', \'01\', or \'02\'.\n\nDECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n BEGIN\n -- body of handler\n END;\n\nFor information about how the server chooses handlers when a condition\noccurs, see http://dev.mysql.com/doc/refman/5.6/en/handler-scope.html.\n\nIf a condition occurs for which no handler has been declared, the\naction taken depends on the condition class:\n\no For SQLEXCEPTION conditions, the stored program terminates at the\n statement that raised the condition, as if there were an EXIT\n handler. If the program was called by another stored program, the\n calling program handles the condition using the handler selection\n rules applied to its own handlers.\n\no For SQLWARNING conditions, the program continues executing, as if\n there were a CONTINUE handler.\n\no For NOT FOUND conditions, if the condition was raised normally, the\n action is CONTINUE. If it was raised by SIGNAL or RESIGNAL, the\n action is EXIT.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-handler.html\n\n','mysql> CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE handlerdemo ()\n -> BEGIN\n -> DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n -> SET @x = 1;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 2;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 3;\n -> END;\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL handlerdemo()//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n +------+\n | @x |\n +------+\n | 3 |\n +------+\n 1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/declare-handler.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (462,23,'TIME','TIME[(fsp)]\n\nA time. The range is \'-838:59:59.000000\' to \'838:59:59.000000\'. MySQL\ndisplays TIME values in \'HH:MM:SS[.fraction]\' format, but permits\nassignment of values to TIME columns using either strings or numbers.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (463,17,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (464,32,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (465,40,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege.\n\nLogically, TRUNCATE TABLE is similar to a DELETE statement that deletes\nall rows, or a sequence of DROP TABLE and CREATE TABLE statements. To\nachieve high performance, it bypasses the DML method of deleting data.\nThus, it cannot be rolled back, it does not cause ON DELETE triggers to\nfire, and it cannot be performed for InnoDB tables with parent-child\nforeign key relationships.\n\nAlthough TRUNCATE TABLE is similar to DELETE, it is classified as a DDL\nstatement rather than a DML statement. It differs from DELETE in the\nfollowing ways in MySQL 5.6:\n\no Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit, and so cannot be rolled\n back.\n\no Truncation operations cannot be performed if the session holds an\n active table lock.\n\no TRUNCATE TABLE fails for an InnoDB table or NDB table if there are\n any FOREIGN KEY constraints from other tables that reference the\n table. Foreign key constraints between columns of the same table are\n permitted.\n\no Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n be re-created as an empty table with TRUNCATE TABLE, even if the data\n or index files have become corrupted.\n\no Any AUTO_INCREMENT value is reset to its start value. This is true\n even for MyISAM and InnoDB, which normally do not reuse sequence\n values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n\no The TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (466,2,'AREA','Area(poly)\n\nST_Area() and Area() are synonyms. For more information, see the\ndescription of ST_Area().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (467,8,'START SLAVE','Syntax:\nSTART SLAVE [thread_types] [until_option] [connection_options]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type:\n IO_THREAD | SQL_THREAD\n\nuntil_option:\n UNTIL { {SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS} = gtid_set\n | MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n | RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n | SQL_AFTER_MTS_GAPS }\n\nconnection_options:\n [USER=\'user_name\'] [PASSWORD=\'user_pass\'] [DEFAULT_AUTH=\'plugin_name\'] [PLUGIN_DIR=\'plugin_dir\']\n\n\ngtid_set:\n uuid_set [, uuid_set] ...\n | \'\'\n\nuuid_set:\n uuid:interval[:interval]...\n\nuuid:\n hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\n\nh:\n [0-9,A-F]\n\ninterval:\n n[-n]\n\n (n >= 1)\n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nIn MySQL 5.6.7 and later, START SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\nMySQL 5.6.4 and later supports pluggable user-password authentication\nwith START SLAVE with the USER, PASSWORD, DEFAULT_AUTH and PLUGIN_DIR\noptions, as described in the following list:\n\no USER: User name. Cannot be set to an empty or null string, or left\n unset if PASSWORD is used.\n\no PASSWORD: Password.\n\no DEFAULT_AUTH: Name of plugin; default is MySQL native authentication.\n\no PLUGIN_DIR: Location of plugin.\n\nStarting with MySQL 5.6.4, you cannot use the SQL_THREAD option when\nspecifying any of USER, PASSWORD, DEFAULT_AUTH, or PLUGIN_DIR, unless\nthe IO_THREAD option is also provided (Bug #13083642).\n\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html,\nfor more information.\n\nIf an insecure connection is used with any these options, the server\nissues the warning Sending passwords in plain text without SSL/TLS is\nextremely insecure.\n\nStarting with MySQL 5.6.6, START SLAVE ... UNTIL supports two\nadditional options for use with global transaction identifiers (GTIDs)\n(see http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html).\nEach of these takes a set of one or more global transaction identifiers\ngtid_set as an argument (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html#\nreplication-gtids-concepts-gtid-sets, for more information).\n\nWhen no thread_type is specified, START SLAVE UNTIL SQL_BEFORE_GTIDS\ncauses the slave SQL thread to process transactions until it has\nreached the first transaction whose GTID is listed in the gtid_set.\nSTART SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to process\nall transactions until the last transaction in the gtid_set has been\nprocessed by both threads. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS causes the slave SQL thread to process all\ntransactions occurring before the first GTID in the gtid_set is\nreached, and START SLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads\nto handle all transactions, including those whose GTIDs are found in\ngtid_set, until each has encountered a transaction whose GTID is not\npart of the set. SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the\nSQL_THREAD and IO_THREAD options, although using IO_THREAD with them\ncurrently has no effect.\n\nFor example, START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56 causes the slave SQL thread\nto process all transactions originating from the master whose\nserver_uuid is 3E11FA47-71CA-11E1-9E33-C80AA9429562 until it encounters\nthe transaction having sequence number 11; it then stops without\nprocessing this transaction. In other words, all transactions up to and\nincluding the transaction with sequence number 10 are processed.\nExecuting START SLAVE SQL_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave SQL thread to obtain all transactions just mentioned\nfrom the master, including all of the transactions having the sequence\nnumbers 11 through 56, and then to stop without processing any\nadditional transactions; that is, the transaction having sequence\nnumber 56 would be the last transaction fetched by the slave SQL\nthread.\n\nPrior to MySQL 5.6.14, SQL_AFTER_GTIDS did not stop the slave once the\nindicated transaction was completed, but waited until another GTID\nevent was received (Bug #14767986).\n\n*Note*:\n\nThe SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS keywords are present in the\nMySQL 5.6.5 server; however, neither of them functioned correctly as\noptions with START SLAVE [SQL_THREAD | IO_THREAD] UNTIL in that\nversion, and are therefore supported beginning only with MySQL 5.6.6.\n(Bug#13810456)\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS is available in MySQL 5.6.6 or\nlater. This statement causes a multi-threaded slave\'s SQL threads to\nrun until no more gaps are found in the relay log, and then to stop.\nThis statement can take an SQL_THREAD option, but the effects of the\nstatement remain unchanged. It has no effect on the slave I/O thread\n(and cannot be used with the IO_THREAD option). START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS should be used before switching the slave from\nmulti-threaded mode to single-threaded mode (that is, when resetting\nslave_parallel_workers back to 0 from a positive, nonzero value) after\nslave has failed with errors in multi-threaded mode.\n\nTo change a failed multi-threaded slave to single-threaded mode, you\ncan issue the following series of statements, in the order shown:\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS;\n\nSET @@GLOBAL.slave_parallel_workers = 0;\n\nSTART SLAVE SQL_THREAD;\n\nIf you were running the failed multi-threaded slave with\nrelay_log_recovery enabled, then you must issue START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS prior to executing CHANGE MASTER TO. Otherwise the\nlatter statement fails.\n\n*Note*:\n\nIt is possible to view the entire text of a running START SLAVE ...\nstatement, including any USER or PASSWORD values used, in the output of\nSHOW PROCESSLIST. This is also true for the text of a running CHANGE\nMASTER TO statement, including any values it employs for MASTER_USER or\nMASTER_PASSWORD.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/start-slave.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (468,27,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS is a diagnostic statement that displays information about\nthe conditions (errors, warnings, and notes) resulting from executing a\nstatement in the current session. Warnings are generated for DML\nstatements such as INSERT, UPDATE, and LOAD DATA INFILE as well as DDL\nstatements such as CREATE TABLE and ALTER TABLE.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nSHOW WARNINGS is also used following EXPLAIN EXTENDED, to display the\nextra information generated by EXPLAIN when the EXTENDED keyword is\nused. See http://dev.mysql.com/doc/refman/5.6/en/explain-extended.html.\n\nSHOW WARNINGS displays information about the conditions resulting from\nthe most recent statement in the current session that generated\nmessages. It shows nothing if the most recent statement used a table\nand generated no messages. (That is, statements that use a table but\ngenerate no messages clear the message list.) Statements that do not\nuse tables and do not generate messages have no effect on the message\nlist.\n\nThe SHOW COUNT(*) WARNINGS diagnostic statement displays the total\nnumber of errors, warnings, and notes. You can also retrieve this\nnumber from the warning_count system variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nA related diagnostic statement, SHOW ERRORS, shows only error\nconditions (it excludes warnings and notes), and SHOW COUNT(*) ERRORS\nstatement displays the total number of errors. See [HELP SHOW ERRORS].\nGET DIAGNOSTICS can be used to examine information for individual\nconditions. See [HELP GET DIAGNOSTICS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (469,4,'ST_LINEFROMTEXT','ST_LineFromText(wkt[, srid]), ST_LineStringFromText(wkt[, srid])\n\nConstructs a LineString value using its WKT representation and SRID.\n\nThe result is NULL if the geometry argument is NULL or not a\nsyntactically well-formed geometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (470,10,'DROP USER','Syntax:\nDROP USER user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts and their\nprivileges. It removes privilege rows for the account from all grant\ntables. An error occurs for accounts that do not exist.\n\nTo use DROP USER, you must have the global CREATE USER privilege, or\nthe DELETE privilege for the mysql database. When the read_only system\nvariable is enabled, DROP USER additionally requires the SUPER\nprivilege.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nDROP USER \'jeffrey\'@\'localhost\';\n\nThe host name part of the account name, if omitted, defaults to \'%\'.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (471,38,'SUBSTRING','Syntax:\nSUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nThe forms without a len argument return a substring from string str\nstarting at position pos. The forms with a len argument return a\nsubstring len characters long from string str, starting at position\npos. The forms that use FROM are standard SQL syntax. It is also\npossible to use a negative value for pos. In this case, the beginning\nof the substring is pos characters from the end of the string, rather\nthan the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nFor all forms of SUBSTRING(), the position of the first character in\nthe string from which the substring is to be extracted is reckoned as\n1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SUBSTRING(\'Quadratically\',5);\n -> \'ratically\'\nmysql> SELECT SUBSTRING(\'foobarbar\' FROM 4);\n -> \'barbar\'\nmysql> SELECT SUBSTRING(\'Quadratically\',5,6);\n -> \'ratica\'\nmysql> SELECT SUBSTRING(\'Sakila\', -3);\n -> \'ila\'\nmysql> SELECT SUBSTRING(\'Sakila\', -5, 3);\n -> \'aki\'\nmysql> SELECT SUBSTRING(\'Sakila\' FROM -4 FOR 2);\n -> \'ki\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (472,37,'ISEMPTY','IsEmpty(g)\n\nST_IsEmpty() and IsEmpty() are synonyms. For more information, see the\ndescription of ST_IsEmpty().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (473,27,'SHOW FUNCTION STATUS','Syntax:\nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored\nfunctions. See [HELP SHOW PROCEDURE STATUS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-function-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-function-status.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (474,38,'LTRIM','Syntax:\nLTRIM(str)\n\nReturns the string str with leading space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LTRIM(\' barbar\');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (475,31,'ST_CROSSES','ST_Crosses(g1, g2)\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect\n\no Their intersection results in a geometry that has a dimension that is\n one less than the maximum dimension of the two given geometries\n\no Their intersection is not equal to either of the two given geometries\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (476,7,'MBRDISJOINT','MBRDisjoint(g1, g2)\n\nReturns 1 or 0 to indicate whether the minimum bounding rectangles of\nthe two geometries g1 and g2 are disjoint (do not intersect).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mysql-specific.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (477,14,'VALUES','Syntax:\nVALUES(col_name)\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column\nvalues from the INSERT portion of the statement. In other words,\nVALUES(col_name) in the UPDATE clause refers to the value of col_name\nthat would be inserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts. The VALUES()\nfunction is meaningful only in the ON DUPLICATE KEY UPDATE clause of\nINSERT statements and returns NULL otherwise. See\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (478,28,'CALL','Syntax:\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nThe CALL statement invokes a stored procedure that was defined\npreviously with CREATE PROCEDURE.\n\nStored procedures that take no arguments can be invoked without\nparentheses. That is, CALL p() and CALL p are equivalent.\n\nCALL can pass back values to its caller using parameters that are\ndeclared as OUT or INOUT parameters. When the procedure returns, a\nclient program can also obtain the number of rows affected for the\nfinal statement executed within the routine: At the SQL level, call the\nROW_COUNT() function; from the C API, call the mysql_affected_rows()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/call.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/call.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (479,12,'ENCODE','Syntax:\nENCODE(str,pass_str)\n\nEncrypt str using pass_str as the password. The result is a binary\nstring of the same length as str. To decrypt the result, use DECODE().\n\nThe ENCODE() function should no longer be used. If you still need to\nuse ENCODE(), a salt value must be used with it to reduce risk. For\nexample:\n\nENCODE(\'cleartext\', CONCAT(\'my_random_salt\',\'my_secret_password\'))\n\nA new random salt value must be used whenever a password is updated.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (480,38,'SUBSTRING_INDEX','Syntax:\nSUBSTRING_INDEX(str,delim,count)\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the\nfinal delimiter (counting from the left) is returned. If count is\nnegative, everything to the right of the final delimiter (counting from\nthe right) is returned. SUBSTRING_INDEX() performs a case-sensitive\nmatch when searching for delim.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', 2);\n -> \'www.mysql\'\nmysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', -2);\n -> \'mysql.com\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (481,11,'ST_X','ST_X(p)\n\nReturns the X-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html\n\n','mysql> SELECT ST_X(Point(56.7, 53.34));\n+--------------------------+\n| ST_X(Point(56.7, 53.34)) |\n+--------------------------+\n| 56.7 |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-point-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (482,32,'TIMESTAMPADD','Syntax:\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument,\nwhich should be one of the following values: MICROSECOND\n(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or\nYEAR.\n\nThe unit value may be specified using one of keywords as shown, or with\na prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n -> \'2003-01-02 00:01:00\'\nmysql> SELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n -> \'2003-01-09\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (483,3,'TRUNCATE','Syntax:\nTRUNCATE(X,D)\n\nReturns the number X, truncated to D decimal places. If D is 0, the\nresult has no decimal point or fractional part. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT TRUNCATE(1.223,1);\n -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n -> -1.9\nmysql> SELECT TRUNCATE(122,-2);\n -> 100\nmysql> SELECT TRUNCATE(10.28*100,0);\n -> 1028\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (484,27,'SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. This section describes\nthose following:\n\nSHOW AUTHORS\nSHOW {BINARY | MASTER} LOGS\nSHOW BINLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\nSHOW CONTRIBUTORS\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE FUNCTION func_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW MASTER STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW RELAYLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW SLAVE HOSTS\nSHOW SLAVE STATUS\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW [FULL] TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\'\npart, \'pattern\' is a string that can contain the SQL % and _ wildcard\ncharacters. The pattern is useful for restricting statement output to\nmatching values.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (485,27,'SHOW VARIABLES','Syntax:\nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW VARIABLES shows the values of MySQL system variables (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html).\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\n\nSystem variable information is also available from these sources:\n\no The GLOBAL_VARIABLES and SESSION_VARIABLES tables. See\n http://dev.mysql.com/doc/refman/5.6/en/variables-table.html.\n\no The mysqladmin variables command. See\n http://dev.mysql.com/doc/refman/5.6/en/mysqladmin.html.\n\nFor SHOW VARIABLES, a LIKE clause, if present, indicates which variable\nnames to match. A WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nSHOW VARIABLES accepts an optional GLOBAL or SESSION variable scope\nmodifier:\n\no With a GLOBAL modifier, the statement displays global system variable\n values. These are the values used to initialize the corresponding\n session variables for new connections to MySQL. If a variable has no\n global value, no value is displayed.\n\no With a SESSION modifier, the statement displays the system varaible\n values that are in effect for the current connection. If a variable\n has no session value, the global value is displayed. LOCAL is a\n synonym for SESSION.\n\no If no modifier is present, the default is SESSION.\n\nThe scope for each system variable is listed at\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nSHOW VARIABLES is subject to a version-dependent display-width limit.\nFor variables with very long values that are not completely displayed,\nuse SELECT as a workaround. For example:\n\nSELECT @@GLOBAL.innodb_data_file_path;\n\nMost system variables can be set at server startup (read-only variables\nsuch as version_comment are exceptions). Many can be changed at runtime\nwith the SET statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/using-system-variables.html, and\n[HELP SET].\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern. To obtain the row for a\nspecific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'max_join_size\';\nSHOW SESSION VARIABLES LIKE \'max_join_size\';\n\nTo get a list of variables whose name match a pattern, use the %\nwildcard character in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%size%\';\nSHOW GLOBAL VARIABLES LIKE \'%size%\';\n\nWildcard characters can be used in any position within the pattern to\nbe matched. Strictly speaking, because _ is a wildcard that matches any\nsingle character, you should escape it as \\_ to match it literally. In\npractice, this is rarely necessary.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-variables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-variables.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (486,27,'BINLOG','Syntax:\nBINLOG \'str\'\n\nBINLOG is an internal-use statement. It is generated by the mysqlbinlog\nprogram as the printable representation of certain events in binary log\nfiles. (See http://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog.html.)\nThe \'str\' value is a base 64-encoded string the that server decodes to\ndetermine the data change indicated by the corresponding event. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/binlog.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/binlog.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (487,31,'ST_DISJOINT','ST_Disjoint(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (488,3,'ATAN2','Syntax:\nATAN(Y,X), ATAN2(Y,X)\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both\narguments are used to determine the quadrant of the result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(-2,2);\n -> -0.78539816339745\nmysql> SELECT ATAN2(PI(),0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (489,15,'AND','Syntax:\nAND, &&\n\nLogical AND. Evaluates to 1 if all operands are nonzero and not NULL,\nto 0 if one or more operands are 0, otherwise NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 AND 1;\n -> 1\nmysql> SELECT 1 AND 0;\n -> 0\nmysql> SELECT 1 AND NULL;\n -> NULL\nmysql> SELECT 0 AND NULL;\n -> 0\nmysql> SELECT NULL AND 0;\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (490,32,'HOUR','Syntax:\nHOUR(time)\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much\nlarger, so HOUR can return values greater than 23.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT HOUR(\'10:05:03\');\n -> 10\nmysql> SELECT HOUR(\'272:59:59\');\n -> 272\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (491,28,'SELECT','Syntax:\nSELECT\n [ALL | DISTINCT | DISTINCTROW ]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [FROM table_references\n [PARTITION partition_list]\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position}\n [ASC | DESC], ... [WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position}\n [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n [PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n export_options\n | INTO DUMPFILE \'file_name\'\n | INTO var_name [, var_name]]\n [FOR UPDATE | LOCK IN SHARE MODE]]\n\nSELECT is used to retrieve rows selected from one or more tables, and\ncan include UNION statements and subqueries. See [HELP UNION], and\nhttp://dev.mysql.com/doc/refman/5.6/en/subqueries.html.\n\nThe most commonly used clauses of SELECT statements are these:\n\no Each select_expr indicates a column that you want to retrieve. There\n must be at least one select_expr.\n\no table_references indicates the table or tables from which to retrieve\n rows. Its syntax is described in [HELP JOIN].\n\no SELECT supports explicit partition selection using the PARTITION\n keyword with a list of partitions or subpartitions (or both)\n following the name of the table in a table_reference (see [HELP\n JOIN]). In this case, rows are selected only from the partitions\n listed, and any other partitions of the table are ignored. For more\n information and examples, see\n http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\n In MySQL 5.6.6 and later, SELECT ... PARTITION from tables using\n storage engines such as MyISAM that perform table-level locks (and\n thus partition locks) lock only the partitions or subpartitions named\n by the PARTITION option.\n\n See\n http://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locki\n ng.html, for more information.\n\no The WHERE clause, if given, indicates the condition or conditions\n that rows must satisfy to be selected. where_condition is an\n expression that evaluates to true for each row to be selected. The\n statement selects all rows if there is no WHERE clause.\n\n In the WHERE expression, you can use any of the functions and\n operators that MySQL supports, except for aggregate (summary)\n functions. See\n http://dev.mysql.com/doc/refman/5.6/en/expressions.html, and\n http://dev.mysql.com/doc/refman/5.6/en/functions.html.\n\nSELECT can also be used to retrieve rows computed without reference to\nany table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/select.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (492,16,'GROUP_CONCAT','Syntax:\nGROUP_CONCAT(expr)\n\nThis function returns a string result with the concatenated non-NULL\nvalues from a group. It returns NULL if there are no non-NULL values.\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n [ORDER BY {unsigned_integer | col_name | expr}\n [ASC | DESC] [,col_name ...]]\n [SEPARATOR str_val])\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name,\n -> GROUP_CONCAT(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (493,17,'BENCHMARK','Syntax:\nBENCHMARK(count,expr)\n\nThe BENCHMARK() function executes the expression expr repeatedly count\ntimes. It may be used to time how quickly MySQL processes the\nexpression. The result value is always 0. The intended use is from\nwithin the mysql client, which reports query execution times:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n| 0 |\n+----------------------------------------------+\n1 row in set (4.74 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (494,38,'FROM_BASE64','Syntax:\nFROM_BASE64(str)\n\nTakes a string encoded with the base-64 encoded rules used by\nTO_BASE64() and returns the decoded result as a binary string. The\nresult is NULL if the argument is NULL or not a valid base-64 string.\nSee the description of TO_BASE64() for details about the encoding and\ndecoding rules.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (495,27,'SHOW ENGINE','Syntax:\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nSHOW ENGINE displays operational information about a storage engine. It\nrequires the PROCESS privilege. The statement has these variants:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE {NDB | NDBCLUSTER} STATUS\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n\nSHOW ENGINE INNODB STATUS displays extensive information from the\nstandard InnoDB Monitor about the state of the InnoDB storage engine.\nFor information about the standard monitor and other InnoDB Monitors\nthat provide information about InnoDB processing, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-monitors.html.\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex and rw-lock statistics.\n\n*Note*:\n\nMost SHOW ENGINE INNODB MUTEX output is removed in 5.6.14. SHOW ENGINE\nINNODB MUTEX output is removed entirely in MySQL 5.7.2. InnoDB mutexes\ncan be monitored using Performance Schema tables. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/monitor-innodb-mutex-waits-perfo\nrmance-schema.html.\n\no Type\n\n Always InnoDB.\n\no Name\n\n The source file where the mutex is implemented, and the line number\n in the file where the mutex is created. The line number is specific\n to your version of MySQL.\n\no Status\n\n The mutex status. This field displays several values if WITH_DEBUG\n was defined at MySQL compilation time. If WITH_DEBUG was not defined,\n the statement displays only the os_waits value. In the latter case\n (without WITH_DEBUG), the information on which the output is based is\n insufficient to distinguish regular mutexes and mutexes that protect\n rw-locks (which permit multiple readers or a single writer).\n Consequently, the output may appear to contain multiple rows for the\n same mutex.\n\n o count indicates how many times the mutex was requested.\n\n o spin_waits indicates how many times the spinlock had to run.\n\n o spin_rounds indicates the number of spinlock rounds. (spin_rounds\n divided by spin_waits provides the average round count.)\n\n o os_waits indicates the number of operating system waits. This\n occurs when the spinlock did not work (the mutex was not locked\n during the spinlock and it was necessary to yield to the operating\n system and wait).\n\n o os_yields indicates the number of times a thread trying to lock a\n mutex gave up its timeslice and yielded to the operating system (on\n the presumption that permitting other threads to run will free the\n mutex so that it can be locked).\n\n o os_wait_times indicates the amount of time (in ms) spent in\n operating system waits. In MySQL 5.6 timing is disabled and this\n value is always 0.\n\nSHOW ENGINE INNODB MUTEX skips the mutexes and rw-locks of buffer pool\nblocks, as the amount of output can be overwhelming on systems with a\nlarge buffer pool. (There is one mutex and one rw-lock in each 16K\nbuffer pool block, and there are 65,536 blocks per gigabyte.) SHOW\nENGINE INNODB MUTEX also does not list any mutexes or rw-locks that\nhave never been waited on (os_waits=0). Thus, SHOW ENGINE INNODB MUTEX\nonly displays information about mutexes and rw-locks outside of the\nbuffer pool that have caused at least one OS-level wait.\n\nSHOW ENGINE INNODB MUTEX information can be used to diagnose system\nproblems. For example, large values of spin_waits and spin_rounds may\nindicate scalability problems.\n\nUse SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal\noperation of the Performance Schema code:\n\nmysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\\G\n...\n*************************** 3. row ***************************\n Type: performance_schema\n Name: events_waits_history.row_size\nStatus: 76\n*************************** 4. row ***************************\n Type: performance_schema\n Name: events_waits_history.row_count\nStatus: 10000\n*************************** 5. row ***************************\n Type: performance_schema\n Name: events_waits_history.memory\nStatus: 760000\n...\n*************************** 57. row ***************************\n Type: performance_schema\n Name: performance_schema.memory\nStatus: 26459600\n...\n\nThis statement is intended to help the DBA understand the effects that\ndifferent Performance Schema options have on memory requirements.\n\nName values consist of two parts, which name an internal buffer and a\nbuffer attribute, respectively. Interpret buffer names as follows:\n\no An internal buffer that is not exposed as a table is named within\n parentheses. Examples: (pfs_cond_class).row_size,\n (pfs_mutex_class).memory.\n\no An internal buffer that is exposed as a table in the\n performance_schema database is named after the table, without\n parentheses. Examples: events_waits_history.row_size,\n mutex_instances.row_count.\n\no A value that applies to the Performance Schema as a whole begins with\n performance_schema. Example: performance_schema.memory.\n\nBuffer attributes have these meanings:\n\no row_size is the size of the internal record used by the\n implementation, such as the size of a row in a table. row_size values\n cannot be changed.\n\no row_count is the number of internal records, such as the number of\n rows in a table. row_count values can be changed using Performance\n Schema configuration options.\n\no For a table, tbl_name.memory is the product of row_size and\n row_count. For the Performance Schema as a whole,\n performance_schema.memory is the sum of all the memory used (the sum\n of all other memory values).\n\nIn some cases, there is a direct relationship between a Performance\nSchema configuration parameter and a SHOW ENGINE value. For example,\nevents_waits_history_long.row_count corresponds to\nperformance_schema_events_waits_history_long_size. In other cases, the\nrelationship is more complex. For example,\nevents_waits_history.row_count corresponds to\nperformance_schema_events_waits_history_size (the number of rows per\nthread) multiplied by performance_schema_max_thread_instances ( the\nnumber of threads).\n\nSHOW ENGINE NDB STATUS If the server has the NDB storage engine\nenabled, SHOW ENGINE NDB STATUS displays cluster status information\nsuch as the number of connected data nodes, the cluster connectstring,\nand cluster binary log epochs, as well as counts of various Cluster API\nobjects created by the MySQL Server when connected to the cluster.\nSample output from this statement is shown here:\n\nmysql> SHOW ENGINE NDB STATUS;\n+------------+-----------------------+--------------------------------------------------+\n| Type | Name | Status |\n+------------+-----------------------+--------------------------------------------------+\n| ndbcluster | connection | cluster_node_id=7,\n connected_host=192.168.0.103, connected_port=1186, number_of_data_nodes=4,\n number_of_ready_data_nodes=3, connect_count=0 |\n| ndbcluster | NdbTransaction | created=6, free=0, sizeof=212 |\n| ndbcluster | NdbOperation | created=8, free=8, sizeof=660 |\n| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744 |\n| ndbcluster | NdbIndexOperation | created=0, free=0, sizeof=664 |\n| ndbcluster | NdbRecAttr | created=1285, free=1285, sizeof=60 |\n| ndbcluster | NdbApiSignal | created=16, free=16, sizeof=136 |\n| ndbcluster | NdbLabel | created=0, free=0, sizeof=196 |\n| ndbcluster | NdbBranch | created=0, free=0, sizeof=24 |\n| ndbcluster | NdbSubroutine | created=0, free=0, sizeof=68 |\n| ndbcluster | NdbCall | created=0, free=0, sizeof=16 |\n| ndbcluster | NdbBlob | created=1, free=1, sizeof=264 |\n| ndbcluster | NdbReceiver | created=4, free=0, sizeof=68 |\n| ndbcluster | binlog | latest_epoch=155467, latest_trans_epoch=148126,\n latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,\n latest_applied_binlog_epoch=0 |\n+------------+-----------------------+--------------------------------------------------+\n\nThe Status column in each of these rows provides information about the\nMySQL server\'s connection to the cluster and about the cluster binary\nlog\'s status, respectively. The Status information is in the form of\ncomma-delimited set of name/value pairs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-engine.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-engine.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (496,14,'NAME_CONST','Syntax:\nNAME_CONST(name,value)\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments\nshould be constants.\n\nmysql> SELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (497,14,'RELEASE_LOCK','Syntax:\nRELEASE_LOCK(str)\n\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not\nestablished by this thread (in which case the lock is not released),\nand NULL if the named lock did not exist. The lock does not exist if it\nwas never obtained by a call to GET_LOCK() or if it has previously been\nreleased.\n\nThe DO statement is convenient to use with RELEASE_LOCK(). See [HELP\nDO].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (498,32,'WEEKDAY','Syntax:\nWEEKDAY(date)\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =\nSunday).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKDAY(\'2008-02-03 22:23:00\');\n -> 6\nmysql> SELECT WEEKDAY(\'2007-11-06\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (499,32,'TIME_TO_SEC','Syntax:\nTIME_TO_SEC(time)\n\nReturns the time argument, converted to seconds.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_TO_SEC(\'22:23:00\');\n -> 80580\nmysql> SELECT TIME_TO_SEC(\'00:39:38\');\n -> 2378\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (500,32,'CONVERT_TZ','Syntax:\nCONVERT_TZ(dt,from_tz,to_tz)\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by\nfrom_tz to the time zone given by to_tz and returns the resulting\nvalue. Time zones are specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/time-zone-support.html. This\nfunction returns NULL if the arguments are invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'GMT\',\'MET\');\n -> \'2004-01-01 13:00:00\'\nmysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n -> \'2004-01-01 22:00:00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (501,38,'EXPORT_SET','Syntax:\nEXPORT_SET(bits,on,off[,separator[,number_of_bits]])\n\nReturns a string such that for every bit set in the value bits, you get\nan on string and for every bit not set in the value, you get an off\nstring. Bits in bits are examined from right to left (from low-order to\nhigh-order bits). Strings are added to the result from left to right,\nseparated by the separator string (the default being the comma\ncharacter ,). The number of bits examined is given by number_of_bits,\nwhich has a default of 64 if not specified. number_of_bits is silently\nclipped to 64 if larger than 64. It is treated as an unsigned integer,\nso a value of −1 is effectively the same as 64.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n -> \'Y,N,Y,N\'\nmysql> SELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n -> \'0,1,1,0,0,0,0,0,0,0\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (502,38,'CAST','Syntax:\nCAST(expr AS type)\n\nThe CAST() function takes an expression of any type and produces a\nresult value of the specified type, similar to CONVERT(). For more\ninformation, see the description of CONVERT().\n\nCAST() is standard SQL syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (503,38,'SOUNDS LIKE','Syntax:\nexpr1 SOUNDS LIKE expr2\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (504,32,'PERIOD_DIFF','Syntax:\nPERIOD_DIFF(P1,P2)\n\nReturns the number of months between periods P1 and P2. P1 and P2\nshould be in the format YYMM or YYYYMM. Note that the period arguments\nP1 and P2 are not date values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_DIFF(200802,200703);\n -> 11\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (505,16,'AVG','Syntax:\nAVG([DISTINCT] expr)\n\nReturns the average value of expr. The DISTINCT option can be used to\nreturn the average of the distinct values of expr.\n\nIf there are no matching rows, AVG() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, AVG(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (506,38,'QUOTE','Syntax:\nQUOTE(str)\n\nQuotes a string to produce a result that can be used as a properly\nescaped data value in an SQL statement. The string is returned enclosed\nby single quotation marks and with each instance of backslash (\\),\nsingle quote (\'), ASCII NUL, and Control+Z preceded by a backslash. If\nthe argument is NULL, the return value is the word "NULL" without\nenclosing single quotation marks.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT QUOTE(\'Don\\\'t!\');\n -> \'Don\\\'t!\'\nmysql> SELECT QUOTE(NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (507,20,'IN','Syntax:\nexpr IN (value,...)\n\nReturns 1 if expr is equal to any of the values in the IN list, else\nreturns 0. If all values are constants, they are evaluated according to\nthe type of expr and sorted. The search for the item then is done using\na binary search. This means IN is very quick if the IN value list\nconsists entirely of constants. Otherwise, type conversion takes place\naccording to the rules described in\nhttp://dev.mysql.com/doc/refman/5.6/en/type-conversion.html, but\napplied to all the arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 IN (0,3,5,7);\n -> 0\nmysql> SELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (508,32,'QUARTER','Syntax:\nQUARTER(date)\n\nReturns the quarter of the year for date, in the range 1 to 4.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT QUARTER(\'2008-04-01\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (509,27,'HELP COMMAND','Syntax:\nmysql> help search_string\n\nIf you provide an argument to the help command, mysql uses it as a\nsearch string to access server-side help from the contents of the MySQL\nReference Manual. The proper operation of this command requires that\nthe help tables in the mysql database be initialized with help topic\ninformation (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-side-help-support.html).\n\nIf there is no match for the search string, the search fails:\n\nmysql> help me\n\nNothing found\nPlease try to run \'help contents\' for a list of all accessible topics\n\nUse help contents to see a list of the help categories:\n\nmysql> help contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help \', where is one of the\nfollowing categories:\n Account Management\n Administration\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Language Structure\n Plugins\n Storage Engines\n Stored Routines\n Table Maintenance\n Transactions\n Triggers\n\nIf the search string matches multiple items, mysql shows a list of\nmatching topics:\n\nmysql> help logs\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following topics:\n SHOW\n SHOW BINARY LOGS\n SHOW ENGINE\n SHOW LOGS\n\nUse a topic as the search string to see the help entry for that topic:\n\nmysql> help show binary logs\nName: \'SHOW BINARY LOGS\'\nDescription:\nSyntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [purge-binary-logs], that shows how\nto determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nThe search string can contain the wildcard characters % and _. These\nhave the same meaning as for pattern-matching operations performed with\nthe LIKE operator. For example, HELP rep% returns a list of topics that\nbegin with rep:\n\nmysql> HELP rep%\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following\ntopics:\n REPAIR TABLE\n REPEAT FUNCTION\n REPEAT LOOP\n REPLACE\n REPLACE FUNCTION\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mysql-server-side-help.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mysql-server-side-help.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (510,38,'POSITION','Syntax:\nPOSITION(substr IN str)\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (511,14,'IS_USED_LOCK','Syntax:\nIS_USED_LOCK(str)\n\nChecks whether the lock named str is in use (that is, locked). If so,\nit returns the connection identifier of the client session that holds\nthe lock. Otherwise, it returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (512,4,'POLYFROMTEXT','PolyFromText(wkt[, srid]), PolygonFromText(wkt[, srid])\n\nST_PolyFromText(), ST_PolygonFromText(), PolyFromText(), and\nPolygonFromText() are synonyms. For more information, see the\ndescription of ST_PolyFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (513,37,'ST_SRID','ST_SRID(g)\n\nReturns an integer indicating the spatial reference system ID\nassociated with the geometry value g, or NULL if the argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','mysql> SELECT ST_SRID(ST_GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------------+\n| ST_SRID(ST_GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------------+\n| 101 |\n+-----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (514,10,'ALTER USER','Syntax:\nALTER USER user_specification [, user_specification] ...\n\nuser_specification:\n user PASSWORD EXPIRE\n\nThe ALTER USER statement modifies MySQL accounts. An error occurs if\nyou try to modify a nonexistent account.\n\nTo use ALTER USER, you must have the global CREATE USER privilege or\nthe UPDATE privilege for the mysql database. When the read_only system\nvariable is enabled, ALTER USER additionally requires the SUPER\nprivilege.\n\n*Warning*:\n\nALTER USER was added in MySQL 5.6.6. However, in 5.6.6, ALTER USER also\nsets the Password column to the empty string, so do not use this\nstatement until 5.6.7.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. The host\nname part of the account name, if omitted, defaults to \'%\'. It is also\npossible to specify CURRENT_USER or CURRENT_USER() to refer to the\naccount associated with the current session.\n\nFor each account, ALTER USER expires its password. For example:\n\nALTER USER \'jeffrey\'@\'localhost\' PASSWORD EXPIRE;\n\nPassword expiration for an account affects the corresponding row of the\nmysql.user table: The server sets the password_expired column to \'Y\'.\n\nA client session operates in restricted mode if the account password\nhas been expired. In restricted mode, operations performed within the\nsession result in an error until the user establishes a new account\npassword:\n\nmysql> SELECT 1;\nERROR 1820 (HY000): You must SET PASSWORD before executing this statement\n\nmysql> SET PASSWORD = PASSWORD(\'new_password\');\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SELECT 1;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n1 row in set (0.00 sec)\n\nAs of MySQL 5.6.8, this restricted mode of operation permits SET\nstatements, which is useful if the account password has a hashing\nformat that requires old_passwords to be set to a value different from\nits default before using SET PASSWORD.\n\nIt is possible for an administrative user to reset the account\npassword, but any existing sessions for the account remain restricted.\nA client using the account must disconnect and reconnect before\nstatements can be executed successfully.\n\n*Note*:\n\nIt is possible to "reset" a password by setting it to its current\nvalue. As a matter of good policy, it is preferable to choose a\ndifferent password.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-user.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (515,12,'DES_ENCRYPT','Syntax:\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.6/en/secure-connections.html.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from\nthe DES key file is used. With a key_num argument, the given key number\n(0 to 9) from the DES key file is used. With a key_str argument, the\ngiven key string is used to encrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is\nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If\nyou use a string key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in\nthe file may be in any order. des_key_str is the string that is used to\nencrypt the message. There should be at least one space between the\nnumber and the key. The first key is the default key that is used if\nyou do not specify any key argument to DES_ENCRYPT().\n\nYou can tell MySQL to read new key values from the key file with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted column\nvalues, without giving the end user the right to decrypt those values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT customer_address FROM customer_table \n > WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (516,3,'CEIL','Syntax:\nCEIL(X)\n\nCEIL() is a synonym for CEILING().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (517,7,'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS','Syntax:\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(gtid_set[, timeout])\n\nWait until the slave SQL thread has executed all of the transactions\nwhose global transaction identifiers are contained in gtid_set (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html,\nfor a definition of "GTID sets"), or until timeout seconds have\nelapsed, whichever occurs first. timeout is optional; the default\ntimeout is 0 seconds, in which case the master simply waits until all\nof the transactions in the GTID set have been executed.\n\nPrior to MySQL 5.6.9, WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() was named\nSQL_THREAD_WAIT_AFTER_GTIDS(). (Bug #14775984)\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','mysql> SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (518,38,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multibyte\ncharacter counts as multiple bytes. This means that for a string\ncontaining five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LENGTH(\'text\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (519,38,'WEIGHT_STRING','Syntax:\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n\nlevels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nThis function returns the weight string for the input string. The\nreturn value is a binary string that represents the comparison and\nsorting value of the string. It has these properties:\n\no If WEIGHT_STRING(str1) = WEIGHT_STRING(str2), then str1 = str2 (str1\n and str2 are considered equal)\n\no If WEIGHT_STRING(str1) < WEIGHT_STRING(str2), then str1 < str2 (str1\n sorts before str2)\n\nWEIGHT_STRING() is a debugging function intended for internal use. Its\nbehavior can change without notice between MySQL versions. It can be\nused for testing and debugging of collations, especially if you are\nadding a new collation. See\nhttp://dev.mysql.com/doc/refman/5.6/en/adding-collation.html.\n\nThis list briefly summarizes the arguments. More details are given in\nthe discussion following the list.\n\no str: The input string expression.\n\no AS clause: Optional; cast the input string to a given type and\n length.\n\no LEVEL clause: Optional; specify weight levels for the return value.\n\no flags: Optional; unused.\n\nThe input string, str, is a string expression. If the input is a\nnonbinary (character) string such as a CHAR, VARCHAR, or TEXT value,\nthe return value contains the collation weights for the string. If the\ninput is a binary (byte) string such as a BINARY, VARBINARY, or BLOB\nvalue, the return value is the same as the input (the weight for each\nbyte in a binary string is the byte value). If the input is NULL,\nWEIGHT_STRING() returns NULL.\n\nExamples:\n\nmysql> SET @s = _latin1 \'AB\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = _latin1 \'ab\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'AB\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'ab\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 6162 |\n+------+---------+------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (520,31,'ST_EQUALS','ST_Equals(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html\n\n','mysql> SET @g1 = Point(1,1), @g2 = Point(2,2);\nmysql> SELECT ST_Equals(@g1, @g1), ST_Equals(@g1, @g2);\n+---------------------+---------------------+\n| ST_Equals(@g1, @g1) | ST_Equals(@g1, @g2) |\n+---------------------+---------------------+\n| 1 | 0 |\n+---------------------+---------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (521,40,'ALTER EVENT','Syntax:\nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n [DO event_body]\n\nThe ALTER EVENT statement changes one or more of the characteristics of\nan existing event without the need to drop and recreate it. The syntax\nfor each of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE /\nDISABLE, and DO clauses is exactly the same as when used with CREATE\nEVENT. (See [HELP CREATE EVENT].)\n\nAny user can alter an event defined on a database for which that user\nhas the EVENT privilege. When a user executes a successful ALTER EVENT\nstatement, that user becomes the definer for the affected event.\n\nALTER EVENT works only with an existing event:\n\nmysql> ALTER EVENT no_such_event \n > ON SCHEDULE \n > EVERY \'2:3\' DAY_HOUR;\nERROR 1517 (HY000): Unknown event \'no_such_event\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-event.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (522,32,'DATE_SUB','Syntax:\nDATE_SUB(date,INTERVAL expr unit)\n\nSee the description for DATE_ADD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (523,19,'|','Syntax:\n|\n\nBitwise OR.\n\nThe result is an unsigned 64-bit integer.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n -> 31\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (524,7,'ASYMMETRIC_SIGN','Syntax:\nASYMMETRIC_SIGN(algorithm, digest_str, priv_key_str, digest_type)\n\nSigns a digest string using a private key string, and returns the\nsignature as a binary string. If signing fails, the result is NULL.\n\ndigest_str is the digest string. It can be generated by calling\nCREATE_DIGEST(). digest_type indicates the digest algorithm used to\ngenerate the digest string.\n\npriv_key_str is the private key string to use for signing the digest\nstring. It must be a valid key string in PEM format. algorithm\nindicates the encryption algorithm used to create the key.\n\nSupported algorithm values: \'RSA\', \'DSA\'\n\nSupported digest_type values: \'SHA224\', \'SHA256\', \'SHA384\', \'SHA512\'\n\nFor a usage example, see the description of ASYMMETRIC_VERIFY().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (525,4,'GEOMFROMTEXT','GeomFromText(wkt[, srid]), GeometryFromText(wkt[, srid])\n\nST_GeomFromText(), ST_GeometryFromText(), GeomFromText(), and\nGeometryFromText() are synonyms. For more information, see the\ndescription of ST_GeomFromText().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (526,14,'UUID_SHORT','Syntax:\nUUID_SHORT()\n\nReturns a "short" universal identifier as a 64-bit unsigned integer.\nValues returned by UUID_SHORT() differ from the string-format 128-bit\nidentifiers returned by the UUID() function and have different\nuniqueness properties. The value of UUID_SHORT() is guaranteed to be\nunique if the following conditions hold:\n\no The server_id value of the current server is between 0 and 255 and is\n unique among your set of master and slave servers\n\no You do not set back the system time for your server host between\n mysqld restarts\n\no You invoke UUID_SHORT() on average fewer than 16 million times per\n second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n (server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID_SHORT();\n -> 92395783831158784\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (527,32,'DATEDIFF','Syntax:\nDATEDIFF(expr1,expr2)\n\nDATEDIFF() returns expr1 − expr2 expressed as a value in days from\none date to the other. expr1 and expr2 are date or date-and-time\nexpressions. Only the date parts of the values are used in the\ncalculation.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n -> 1\nmysql> SELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n -> -31\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (528,40,'DROP PROCEDURE','Syntax:\nDROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name\n\nThis statement is used to drop a stored procedure or function. That is,\nthe specified routine is removed from the server. You must have the\nALTER ROUTINE privilege for the routine. (If the\nautomatic_sp_privileges system variable is enabled, that privilege and\nEXECUTE are granted automatically to the routine creator when the\nroutine is created and dropped from the creator when the routine is\ndropped. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n)\n\nThe IF EXISTS clause is a MySQL extension. It prevents an error from\noccurring if the procedure or function does not exist. A warning is\nproduced that can be viewed with SHOW WARNINGS.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-procedure.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (529,5,'INSTALL PLUGIN','Syntax:\nINSTALL PLUGIN plugin_name SONAME \'shared_library_name\'\n\nThis statement installs a server plugin. It requires the INSERT\nprivilege for the mysql.plugin system table.\n\nplugin_name is the name of the plugin as defined in the plugin\ndescriptor structure contained in the library file (see\nhttp://dev.mysql.com/doc/refman/5.6/en/plugin-data-structures.html).\nPlugin names are not case sensitive. For maximal compatibility, plugin\nnames should be limited to ASCII letters, digits, and underscore\nbecause they are used in C source files, shell command lines, M4 and\nBourne shell scripts, and SQL environments.\n\nshared_library_name is the name of the shared library that contains the\nplugin code. The name includes the file name extension (for example,\nlibmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).\n\nThe shared library must be located in the plugin directory (the\ndirectory named by the plugin_dir system variable). The library must be\nin the plugin directory itself, not in a subdirectory. By default,\nplugin_dir is the plugin directory under the directory named by the\npkglibdir configuration variable, but it can be changed by setting the\nvalue of plugin_dir at server startup. For example, set its value in a\nmy.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\n\nIf the value of plugin_dir is a relative path name, it is taken to be\nrelative to the MySQL base directory (the value of the basedir system\nvariable).\n\nINSTALL PLUGIN loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its\ninitialization function, which handles any setup that the plugin must\nperform before it can be used. When the server shuts down, it executes\nthe deinitialization function for each plugin that is loaded so that\nthe plugin has a chance to perform any final cleanup.\n\nINSTALL PLUGIN also registers the plugin by adding a line that\nindicates the plugin name and library file name to the mysql.plugin\ntable. At server startup, the server loads and initializes any plugin\nthat is listed in the mysql.plugin table. This means that a plugin is\ninstalled with INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the server is\nstarted with the --skip-grant-tables option.\n\nA plugin library can contain multiple plugins. For each of them to be\ninstalled, use a separate INSTALL PLUGIN statement. Each statement\nnames a different plugin, but all of them specify the same library\nname.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/install-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/install-plugin.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (530,28,'LOAD DATA','Syntax:\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [PARTITION (partition_name,...)]\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number {LINES | ROWS}]\n [(col_name_or_user_var,...)]\n [SET col_name = expr,...]\n\nThe LOAD DATA INFILE statement reads rows from a text file into a table\nat a very high speed. LOAD DATA INFILE is the complement of SELECT ...\nINTO OUTFILE. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/select-into.html.) To write data\nfrom a table to a file, use SELECT ... INTO OUTFILE. To read the file\nback into a table, use LOAD DATA INFILE. The syntax of the FIELDS and\nLINES clauses is the same for both statements. Both clauses are\noptional, but FIELDS must precede LINES if both are specified.\n\nYou can also load data files by using the mysqlimport utility; it\noperates by sending a LOAD DATA INFILE statement to the server. The\n--local option causes mysqlimport to read data files from the client\nhost. You can specify the --compress option to get better performance\nover slow networks if the client and server support the compressed\nprotocol. See http://dev.mysql.com/doc/refman/5.6/en/mysqlimport.html.\n\nFor more information about the efficiency of INSERT versus LOAD DATA\nINFILE and speeding up LOAD DATA INFILE, see\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-optimization.html.\n\nThe file name must be given as a literal string. On Windows, specify\nbackslashes in path names as forward slashes or doubled backslashes.\nThe character_set_filesystem system variable controls the\ninterpretation of the file name.\n\nLOAD DATA supports explicit partition selection using the PARTITION\noption with a comma-separated list of one or more names of partitions,\nsubpartitions, or both. When this option is used, if any rows from the\nfile cannot be inserted into any of the partitions or subpartitions\nnamed in the list, the statement fails with the error Found a row not\nmatching the given partition set. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\nFor partitioned tables using storage engines that employ table locks,\nsuch as MyISAM, LOAD DATA cannot prune any partition locks. This does\nnot apply to tables using storage engines which employ row-level\nlocking, such as InnoDB. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locking\n.html.\n\nThe server uses the character set indicated by the\ncharacter_set_database system variable to interpret the information in\nthe file. SET NAMES and the setting of character_set_client do not\naffect interpretation of input. If the contents of the input file use a\ncharacter set that differs from the default, it is usually preferable\nto specify the character set of the file by using the CHARACTER SET\nclause. A character set of binary specifies "no conversion."\n\nLOAD DATA INFILE interprets all fields in the file as having the same\ncharacter set, regardless of the data types of the columns into which\nfield values are loaded. For proper interpretation of file contents,\nyou must ensure that it was written with the correct character set. For\nexample, if you write a data file with mysqldump -T or by issuing a\nSELECT ... INTO OUTFILE statement in mysql, be sure to use a\n--default-character-set option so that output is written in the\ncharacter set to be used when the file is loaded with LOAD DATA INFILE.\n\n*Note*:\n\nIt is not possible to load data files that use the ucs2, utf16,\nutf16le, or utf32 character set.\n\nIf you use LOW_PRIORITY, execution of the LOAD DATA statement is\ndelayed until no other clients are reading from the table. This affects\nonly storage engines that use only table-level locking (such as MyISAM,\nMEMORY, and MERGE).\n\nIf you specify CONCURRENT with a MyISAM table that satisfies the\ncondition for concurrent inserts (that is, it contains no free blocks\nin the middle), other threads can retrieve data from the table while\nLOAD DATA is executing. This option affects the performance of LOAD\nDATA a bit, even if no other thread is using the table at the same\ntime.\n\nWith row-based replication, CONCURRENT is replicated regardless of\nMySQL version. With statement-based replication CONCURRENT is not\nreplicated prior to MySQL 5.5.1 (see Bug #34628). For more information,\nsee\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-features-load-data.h\ntml.\n\nThe LOCAL keyword affects expected location of the file and error\nhandling, as described later. LOCAL works only if your server and your\nclient both have been configured to permit it. For example, if mysqld\nwas started with the local_infile system variable disabled, LOCAL does\nnot work. See\nhttp://dev.mysql.com/doc/refman/5.6/en/load-data-local.html.\n\nThe LOCAL keyword affects where the file is expected to be found:\n\no If LOCAL is specified, the file is read by the client program on the\n client host and sent to the server. The file can be given as a full\n path name to specify its exact location. If given as a relative path\n name, the name is interpreted relative to the directory in which the\n client program was started.\n\n When using LOCAL with LOAD DATA, a copy of the file is created in the\n server\'s temporary directory. This is not the directory determined by\n the value of tmpdir or slave_load_tmpdir, but rather the operating\n system\'s temporary directory, and is not configurable in the MySQL\n Server. (Typically the system temporary directory is /tmp on Linux\n systems and C:\\WINDOWS\\TEMP on Windows.) Lack of sufficient space for\n the copy in this directory can cause the LOAD DATA LOCAL statement to\n fail.\n\no If LOCAL is not specified, the file must be located on the server\n host and is read directly by the server. The server uses the\n following rules to locate the file:\n\n o If the file name is an absolute path name, the server uses it as\n given.\n\n o If the file name is a relative path name with one or more leading\n components, the server searches for the file relative to the\n server\'s data directory.\n\n o If a file name with no leading components is given, the server\n looks for the file in the database directory of the default\n database.\n\nIn the non-LOCAL case, these rules mean that a file named as\n./myfile.txt is read from the server\'s data directory, whereas the file\nnamed as myfile.txt is read from the database directory of the default\ndatabase. For example, if db1 is the default database, the following\nLOAD DATA statement reads the file data.txt from the database directory\nfor db1, even though the statement explicitly loads the file into a\ntable in the db2 database:\n\nLOAD DATA INFILE \'data.txt\' INTO TABLE db2.my_table;\n\nNon-LOCAL load operations read text files located on the server. For\nsecurity reasons, such operations require that you have the FILE\nprivilege. See\nhttp://dev.mysql.com/doc/refman/5.6/en/privileges-provided.html. Also,\nnon-LOCAL load operations are subject to the secure_file_priv system\nvariable setting. If the variable value is a nonempty directory name,\nthe file to be loaded must be located in that directory. If the\nvariable value is empty (which is insecure), the file need only be\nreadable by the server.\n\nUsing LOCAL is a bit slower than letting the server access the files\ndirectly, because the contents of the file must be sent over the\nconnection by the client to the server. On the other hand, you do not\nneed the FILE privilege to load local files.\n\nLOCAL also affects error handling:\n\no With LOAD DATA INFILE, data-interpretation and duplicate-key errors\n terminate the operation.\n\no With LOAD DATA LOCAL INFILE, data-interpretation and duplicate-key\n errors become warnings and the operation continues because the server\n has no way to stop transmission of the file in the middle of the\n operation. For duplicate-key errors, this is the same as if IGNORE is\n specified. IGNORE is explained further later in this section.\n\nThe REPLACE and IGNORE keywords control handling of input rows that\nduplicate existing rows on unique key values:\n\no If you specify REPLACE, input rows replace existing rows. In other\n words, rows that have the same value for a primary key or unique\n index as an existing row. See [HELP REPLACE].\n\no If you specify IGNORE, rows that duplicate an existing row on a\n unique key value are discarded.\n\no If you do not specify either option, the behavior depends on whether\n the LOCAL keyword is specified. Without LOCAL, an error occurs when a\n duplicate key value is found, and the rest of the text file is\n ignored. With LOCAL, the default behavior is the same as if IGNORE is\n specified; this is because the server has no way to stop transmission\n of the file in the middle of the operation.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-data.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-data.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (531,24,'DECLARE CURSOR','Syntax:\nDECLARE cursor_name CURSOR FOR select_statement\n\nThis statement declares a cursor and associates it with a SELECT\nstatement that retrieves the rows to be traversed by the cursor. To\nfetch the rows later, use a FETCH statement. The number of columns\nretrieved by the SELECT statement must match the number of output\nvariables specified in the FETCH statement.\n\nThe SELECT statement cannot have an INTO clause.\n\nCursor declarations must appear before handler declarations and after\nvariable and condition declarations.\n\nA stored program may contain multiple cursor declarations, but each\ncursor declared in a given block must have a unique name. For an\nexample, see http://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nFor information available through SHOW statements, it is possible in\nmany cases to obtain equivalent information by using a cursor with an\nINFORMATION_SCHEMA table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-cursor.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-cursor.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (532,32,'LOCALTIME','Syntax:\nLOCALTIME, LOCALTIME([fsp])\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (533,33,'ST_GEOMFROMWKB','ST_GeomFromWKB(wkb[, srid]), ST_GeometryFromWKB(wkb[, srid])\n\nConstructs a geometry value of any type using its WKB representation\nand SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (534,12,'SHA1','Syntax:\nSHA1(str), SHA(str)\n\nCalculates an SHA-1 160-bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a string of\n40 hexadecimal digits, or NULL if the argument was NULL. One of the\npossible uses for this function is as a hash key. See the notes at the\nbeginning of this section about storing hash values efficiently. You\ncan also use SHA1() as a cryptographic function for storing passwords.\nSHA() is synonymous with SHA1().\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT SHA1(\'abc\');\n -> \'a9993e364706816aba3e25717850c26c9cd0d89d\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (535,23,'BLOB','BLOB[(M)]\n\nA BLOB column with a maximum length of 65,535 (216 − 1) bytes. Each\nBLOB value is stored using a 2-byte length prefix that indicates the\nnumber of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest BLOB type large enough to hold\nvalues M bytes long.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (536,12,'PASSWORD','Syntax:\nPASSWORD(str)\n\nReturns a hashed password string calculated from the cleartext password\nstr. The return value is a nonbinary string in the connection character\nset, or NULL if the argument is NULL. This function is the SQL\ninterface to the algorithm used by the server to encrypt MySQL\npasswords for storage in the mysql.user grant table.\n\nThe old_passwords system variable controls the password hashing method\nused by the PASSWORD() function. It also influences password hashing\nperformed by CREATE USER and GRANT statements that specify a password\nusing an IDENTIFIED BY clause.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SET old_passwords = 0;\nmysql> SELECT PASSWORD(\'mypass\'), OLD_PASSWORD(\'mypass\');\n+-------------------------------------------+------------------------+\n| PASSWORD(\'mypass\') | OLD_PASSWORD(\'mypass\') |\n+-------------------------------------------+------------------------+\n| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 | 6f8c114b58f2ce9e |\n+-------------------------------------------+------------------------+\n\nmysql> SET old_passwords = 1;\nmysql> SELECT PASSWORD(\'mypass\'), OLD_PASSWORD(\'mypass\');\n+--------------------+------------------------+\n| PASSWORD(\'mypass\') | OLD_PASSWORD(\'mypass\') |\n+--------------------+------------------------+\n| 6f8c114b58f2ce9e | 6f8c114b58f2ce9e |\n+--------------------+------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (537,32,'UTC_DATE','Syntax:\nUTC_DATE, UTC_DATE()\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_DATE(), UTC_DATE() + 0;\n -> \'2003-08-14\', 20030814\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (538,37,'DIMENSION','Dimension(g)\n\nST_Dimension() and Dimension() are synonyms. For more information, see\nthe description of ST_Dimension().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (539,23,'BIT','BIT[(M)]\n\nA bit-value type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (540,31,'EQUALS','Equals(g1, g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-mbr.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (541,8,'XA','Syntax:\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER\n\nFor XA START, the JOIN and RESUME clauses are not supported.\n\nFor XA END the SUSPEND [FOR MIGRATE] clause is not supported.\n\nEach XA statement begins with the XA keyword, and most of them require\nan xid value. An xid is an XA transaction identifier. It indicates\nwhich transaction the statement applies to. xid values are supplied by\nthe client, or generated by the MySQL server. An xid value has from one\nto three parts:\n\nxid: gtrid [, bqual [, formatID ]]\n\ngtrid is a global transaction identifier, bqual is a branch qualifier,\nand formatID is a number that identifies the format used by the gtrid\nand bqual values. As indicated by the syntax, bqual and formatID are\noptional. The default bqual value is \'\' if not given. The default\nformatID value is 1 if not given.\n\ngtrid and bqual must be string literals, each up to 64 bytes (not\ncharacters) long. gtrid and bqual can be specified in several ways. You\ncan use a quoted string (\'ab\'), hex string (X\'6162\', 0x6162), or bit\nvalue (b\'nnnn\').\n\nformatID is an unsigned integer.\n\nThe gtrid and bqual values are interpreted in bytes by the MySQL\nserver\'s underlying XA support routines. However, while an SQL\nstatement containing an XA statement is being parsed, the server works\nwith some specific character set. To be safe, write gtrid and bqual as\nhex strings.\n\nxid values typically are generated by the Transaction Manager. Values\ngenerated by one TM must be different from values generated by other\nTMs. A given TM must be able to recognize its own xid values in a list\nof values returned by the XA RECOVER statement.\n\nFor XA START xid starts an XA transaction with the given xid value.\nEach XA transaction must have a unique xid value, so the value must not\ncurrently be used by another XA transaction. Uniqueness is assessed\nusing the gtrid and bqual values. All following XA statements for the\nXA transaction must be specified using the same xid value as that given\nin the XA START statement. If you use any of those statements but\nspecify an xid value that does not correspond to some existing XA\ntransaction, an error occurs.\n\nOne or more XA transactions can be part of the same global transaction.\nAll XA transactions within a given global transaction must use the same\ngtrid value in the xid value. For this reason, gtrid values must be\nglobally unique so that there is no ambiguity about which global\ntransaction a given XA transaction is part of. The bqual part of the\nxid value must be different for each XA transaction within a global\ntransaction. (The requirement that bqual values be different is a\nlimitation of the current MySQL XA implementation. It is not part of\nthe XA specification.)\n\nThe XA RECOVER statement returns information for those XA transactions\non the MySQL server that are in the PREPARED state. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/xa-states.html.) The output\nincludes a row for each such XA transaction on the server, regardless\nof which client started it.\n\nXA RECOVER output rows look like this (for an example xid value\nconsisting of the parts \'abc\', \'def\', and 7):\n\nmysql> XA RECOVER;\n+----------+--------------+--------------+--------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------+\n| 7 | 3 | 3 | abcdef |\n+----------+--------------+--------------+--------+\n\nThe output columns have the following meanings:\n\no formatID is the formatID part of the transaction xid\n\no gtrid_length is the length in bytes of the gtrid part of the xid\n\no bqual_length is the length in bytes of the bqual part of the xid\n\no data is the concatenation of the gtrid and bqual parts of the xid\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (542,2,'CENTROID','Centroid(mpoly)\n\nST_Centroid() and Centroid() are synonyms. For more information, see\nthe description of ST_Centroid().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (543,38,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (544,32,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP([fsp])\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether the function\nis used in a string or numeric context.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (545,12,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str[,init_vector])\n\nAES_ENCRYPT() and AES_DECRYPT() implement encryption and decryption of\ndata using the official AES (Advanced Encryption Standard) algorithm,\npreviously known as "Rijndael." The AES standard permits various key\nlengths. By default these functions implement AES with a 128-bit key\nlength. As of MySQL 5.6.17, key lengths of 196 or 256 bits can be used,\nas described later. The key length is a trade off between performance\nand security.\n\nAES_ENCRYPT() encrypts the string str using the key string key_str and\nreturns a binary string containing the encrypted output. AES_DECRYPT()\ndecrypts the encrypted string crypt_str using the key string key_str\nand returns the original cleartext string. If either function argument\nis NULL, the function returns NULL.\n\nThe str and crypt_str arguments can be any length, and padding is\nautomatically added to str so it is a multiple of a block as required\nby block-based algorithms such as AES. This padding is automatically\nremoved by the AES_DECRYPT() function. The length of crypt_str can be\ncalculated using this formula:\n\n16 * (trunc(string_length / 16) + 1)\n\nFor a key length of 128 bits, the most secure way to pass a key to the\nkey_str argument is to create a truly random 128-bit value and pass it\nas a binary value. For example:\n\nINSERT INTO t\nVALUES (1,AES_ENCRYPT(\'text\',UNHEX(\'F3229A0B371ED2D9441B830D21A390C3\')));\n\nA passphrase can be used to generate an AES key by hashing the\npassphrase. For example:\n\nINSERT INTO t\nVALUES (1,AES_ENCRYPT(\'text\', UNHEX(SHA2(\'My secret passphrase\',512))));\n\nDo not pass a password or passphrase directly to crypt_str, hash it\nfirst. Previous versions of this documentation suggested the former\napproach, but it is no longer recommended as the examples shown here\nare more secure.\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns\nNULL. However, it is possible for AES_DECRYPT() to return a non-NULL\nvalue (possibly garbage) if the input data or the key is invalid.\n\nAs of MySQL 5.6.17, AES_ENCRYPT() and AES_DECRYPT() permit control of\nthe block encryption mode and take an optional init_vector\ninitialization vector argument:\n\no The block_encryption_mode system variable controls the mode for\n block-based encryption algorithms. Its default value is aes-128-ecb,\n which signifies encryption using a key length of 128 bits and ECB\n mode. For a description of the permitted values of this variable, see\n http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\no The optional init_vector argument provides an initialization vector\n for block encryption modes that require it.\n\nFor modes that require the optional init_vector argument, it must be 16\nbytes or longer (bytes in excess of 16 are ignored). An error occurs if\ninit_vector is missing.\n\nFor modes that do not require init_vector, it is ignored and a warning\nis generated if it is specified.\n\nA random string of bytes to use for the initialization vector can be\nproduced by calling RANDOM_BYTES(16). For encryption modes that require\nan initialization vector, the same vector must be used for encryption\nand decryption.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SET block_encryption_mode = \'aes-256-cbc\';\nmysql> SET @key_str = SHA2(\'My secret passphrase\',512);\nmysql> SET @init_vector = RANDOM_BYTES(16);\nmysql> SET @crypt_str = AES_ENCRYPT(\'text\',@key_str,@init_vector);\nmysql> SELECT AES_DECRYPT(@crypt_str,@key_str,@init_vector);\n+-----------------------------------------------+\n| AES_DECRYPT(@crypt_str,@key_str,@init_vector) |\n+-----------------------------------------------+\n| text |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (546,3,'+','Syntax:\n+\n\nAddition:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (547,7,'GTID_SUBTRACT','Syntax:\nGTID_SUBTRACT(set,subset)\n\nGiven two sets of global transaction IDs subset and set, returns only\nthose GTIDs from set that are not in subset.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','mysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:21\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:22-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:26-57\n1 row in set (0.00 sec)\n\nmysql> SELECT GTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n -> \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\')\\G\n*************************** 1. row ***************************\nGTID_SUBTRACT(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57\',\n \'3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24\'): 3e11fa47-71ca-11e1-9e33-c80aa9429562:21-22:25-57\n1 row in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (548,14,'INET_NTOA','Syntax:\nINET_NTOA(expr)\n\nGiven a numeric IPv4 network address in network byte order, returns the\ndotted-quad string representation of the address as a nonbinary string\nin the connection character set. INET_NTOA() returns NULL if it does\nnot understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_NTOA(167773449);\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (549,32,'DAYOFWEEK','Syntax:\nDAYOFWEEK(date)\n\nReturns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC standard.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFWEEK(\'2007-02-03\');\n -> 7\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (550,3,'CEILING','Syntax:\nCEILING(X)\n\nReturns the smallest integer value not less than X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CEILING(1.23);\n -> 2\nmysql> SELECT CEILING(-1.23);\n -> -1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (551,27,'SHOW PROCESSLIST','Syntax:\nSHOW [FULL] PROCESSLIST\n\nSHOW PROCESSLIST shows you which threads are running. You can also get\nthis information from the INFORMATION_SCHEMA PROCESSLIST table or the\nmysqladmin processlist command. If you have the PROCESS privilege, you\ncan see all threads. Otherwise, you can see only your own threads (that\nis, threads associated with the MySQL account that you are using). If\nyou do not use the FULL keyword, only the first 100 characters of each\nstatement are shown in the Info field.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (552,33,'LINEFROMWKB','LineFromWKB(wkb[, srid]), LineStringFromWKB(wkb[, srid])\n\nST_LineFromWKB(), ST_LineStringFromWKB(), LineFromWKB(), and\nLineStringFromWKB() are synonyms. For more information, see the\ndescription of ST_LineFromWKB().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (553,37,'GEOMETRYTYPE','GeometryType(g)\n\nST_GeometryType() and GeometryType() are synonyms. For more\ninformation, see the description of ST_GeometryType().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-general-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (554,40,'CREATE VIEW','Syntax:\nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThe CREATE VIEW statement creates a new view, or replaces an existing\nview if the OR REPLACE clause is given. If the view does not exist,\nCREATE OR REPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR REPLACE VIEW is the same as ALTER VIEW.\n\nFor information about restrictions on view use, see\nhttp://dev.mysql.com/doc/refman/5.6/en/view-restrictions.html.\n\nThe select_statement is a SELECT statement that provides the definition\nof the view. (Selecting from the view selects, in effect, using the\nSELECT statement.) The select_statement can select from base tables or\nother views.\n\nThe view definition is "frozen" at creation time and is not affected by\nsubsequent changes to the definitions of the underlying tables. For\nexample, if a view is defined as SELECT * on a table, new columns added\nto the table later do not become part of the view, and columns dropped\nfrom the table will result in an error when selecting from the view.\n\nThe ALGORITHM clause affects how MySQL processes the view. The DEFINER\nand SQL SECURITY clauses specify the security context to be used when\nchecking access privileges at view invocation time. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates to rows in\ntables referenced by the view. These clauses are described later in\nthis section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the\nview, and some privilege for each column selected by the SELECT\nstatement. For columns used elsewhere in the SELECT statement, you must\nhave the SELECT privilege. If the OR REPLACE clause is present, you\nmust also have the DROP privilege for the view. CREATE VIEW might also\nrequire the SUPER privilege, depending on the DEFINER value, as\ndescribed later in this section.\n\nWhen a view is referenced, privilege checking occurs as described later\nin this section.\n\nA view belongs to a database. By default, a new view is created in the\ndefault database. To create the view explicitly in a given database,\nuse db_name.view_name syntax to qualify the view name with the database\nname:\n\nCREATE VIEW test.v AS SELECT * FROM t;\n\nUnqualified table or view names in the SELECT statement are also\ninterpreted with respect to the default database. A view can refer to\ntables or views in other databases by qualifying the table or view name\nwith the appropriate database name.\n\nWithin a database, base tables and views share the same namespace, so a\nbase table and a view cannot have the same name.\n\nColumns retrieved by the SELECT statement can be simple references to\ntable columns, or expressions that use functions, constant values,\noperators, and so forth.\n\nA view must have unique column names with no duplicates, just like a\nbase table. By default, the names of the columns retrieved by the\nSELECT statement are used for the view column names. To define explicit\nnames for the view columns, specify the optional column_list clause as\na list of comma-separated identifiers. The number of names in\ncolumn_list must be the same as the number of columns retrieved by the\nSELECT statement.\n\nA view can be created from many kinds of SELECT statements. It can\nrefer to base tables or other views. It can use joins, UNION, and\nsubqueries. The SELECT need not even refer to any tables:\n\nCREATE VIEW v_today (today) AS SELECT CURRENT_DATE;\n\nThe following example defines a view that selects two columns from\nanother table as well as an expression calculated from those columns:\n\nmysql> CREATE TABLE t (qty INT, price INT);\nmysql> INSERT INTO t VALUES(3, 50);\nmysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\nmysql> SELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\no The SELECT statement cannot contain a subquery in the FROM clause.\n\no The SELECT statement cannot refer to system variables or user-defined\n variables.\n\no Within a stored program, the SELECT statement cannot refer to program\n parameters or local variables.\n\no The SELECT statement cannot refer to prepared statement parameters.\n\no Any table or view referred to in the definition must exist. If, after\n the view has been created, a table or view that the definition refers\n to is dropped, use of the view results in an error. To check a view\n definition for problems of this kind, use the CHECK TABLE statement.\n\no The definition cannot refer to a TEMPORARY table, and you cannot\n create a TEMPORARY view.\n\no You cannot associate a trigger with a view.\n\no Aliases for column names in the SELECT statement are checked against\n the maximum column length of 64 characters (not the maximum alias\n length of 256 characters).\n\nORDER BY is permitted in a view definition, but it is ignored if you\nselect from a view using a statement that has its own ORDER BY or\nfiltering or grouping. When ORDER BY is combined with LIMIT or OFFSET\nin a view definition, the ordering is always enforced before the query\nresult is used by the outer query, but it does not guarantee that the\nsame ordering is used in the end result. As a workaround, add an ORDER\nBY clause to the outer query.\n\nFor other options or clauses in the definition, they are added to the\noptions or clauses of the statement that references the view, but the\neffect is undefined. For example, if a view definition includes a LIMIT\nclause, and you select from the view using a statement that has its own\nLIMIT clause, it is undefined which limit applies. This same principle\napplies to options such as ALL, DISTINCT, or SQL_SMALL_RESULT that\nfollow the SELECT keyword, and to clauses such as INTO, FOR UPDATE,\nLOCK IN SHARE MODE, and PROCEDURE.\n\nThe results obtained from a view may be affected if you change the\nquery processing environment by changing system variables:\n\nmysql> CREATE VIEW v (mycol) AS SELECT \'abc\';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SET sql_mode = \'\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol |\n+-------+\n1 row in set (0.01 sec)\n\nmysql> SET sql_mode = \'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc |\n+-------+\n1 row in set (0.00 sec)\n\nThe DEFINER and SQL SECURITY clauses determine which MySQL account to\nuse when checking access privileges for the view when a statement is\nexecuted that references the view. The valid SQL SECURITY\ncharacteristic values are DEFINER (the default) and INVOKER. These\nindicate that the required privileges must be held by the user who\ndefined or invoked the view, respectively.\n\nIf a user value is given for the DEFINER clause, it should be a MySQL\naccount specified as \'user_name\'@\'host_name\', CURRENT_USER, or\nCURRENT_USER(). The default DEFINER value is the user who executes the\nCREATE VIEW statement. This is the same as specifying DEFINER =\nCURRENT_USER explicitly.\n\nIf the DEFINER clause is present, these rules determine the valid\nDEFINER user values:\n\no If you do not have the SUPER privilege, the only valid user value is\n your own account, either specified literally or by using\n CURRENT_USER. You cannot set the definer to some other account.\n\no If you have the SUPER privilege, you can specify any syntactically\n valid account name. If the account does not exist, a warning is\n generated.\n\no Although it is possible to create a view with a nonexistent DEFINER\n account, an error occurs when the view is referenced if the SQL\n SECURITY value is DEFINER but the definer account does not exist.\n\nFor more information about view security, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-security.html.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value\nby default. For views defined with the SQL SECURITY INVOKER\ncharacteristic, CURRENT_USER returns the account for the view\'s\ninvoker. For information about user auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.6/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This\nalso affects a view defined within such a routine, if the view\ndefinition contains a DEFINER value of CURRENT_USER.\n\nMySQL checks view privileges like this:\n\no At view definition time, the view creator must have the privileges\n needed to use the top-level objects accessed by the view. For\n example, if the view definition refers to table columns, the creator\n must have some privilege for each column in the select list of the\n definition, and the SELECT privilege for each column used elsewhere\n in the definition. If the definition refers to a stored function,\n only the privileges needed to invoke the function can be checked. The\n privileges required at function invocation time can be checked only\n as it executes: For different invocations, different execution paths\n within the function might be taken.\n\no The user who references a view must have appropriate privileges to\n access it (SELECT to select from it, INSERT to insert into it, and so\n forth.)\n\no When a view has been referenced, privileges for objects accessed by\n the view are checked against the privileges held by the view DEFINER\n account or invoker, depending on whether the SQL SECURITY\n characteristic is DEFINER or INVOKER, respectively.\n\no If reference to a view causes execution of a stored function,\n privilege checking for statements executed within the function depend\n on whether the function SQL SECURITY characteristic is DEFINER or\n INVOKER. If the security characteristic is DEFINER, the function runs\n with the privileges of the DEFINER account. If the characteristic is\n INVOKER, the function runs with the privileges determined by the\n view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function\nmight invoke other stored routines. For example, the following view\ninvokes a stored function f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be\nchecked when f() executes. This might mean that privileges are needed\nfor p1() or p2(), depending on the execution path within f(). Those\nprivileges must be checked at runtime, and the user who must possess\nthe privileges is determined by the SQL SECURITY values of the view v\nand the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to\nstandard SQL. In standard SQL, views are handled using the rules for\nSQL SECURITY DEFINER. The standard says that the definer of the view,\nwhich is the same as the owner of the view\'s schema, gets applicable\nprivileges on the view (for example, SELECT) and may grant them. MySQL\nhas no concept of a schema "owner", so MySQL adds a clause to identify\nthe definer. The DEFINER clause is an extension where the intent is to\nhave what the standard has; that is, a permanent record of who defined\nthe view. This is why the default DEFINER value is the account of the\nview creator.\n\nThe optional ALGORITHM clause is a MySQL extension to standard SQL. It\naffects how MySQL processes the view. ALGORITHM takes three values:\nMERGE, TEMPTABLE, or UNDEFINED. The default algorithm is UNDEFINED if\nno ALGORITHM clause is present. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/view-algorithms.html, as well as\nhttp://dev.mysql.com/doc/refman/5.6/en/derived-table-optimization.html.\n\nSome views are updatable. That is, you can use them in statements such\nas UPDATE, DELETE, or INSERT to update the contents of the underlying\ntable. For a view to be updatable, there must be a one-to-one\nrelationship between the rows in the view and the rows in the\nunderlying table. There are also certain other constructs that make a\nview nonupdatable.\n\nThe WITH CHECK OPTION clause can be given for an updatable view to\nprevent inserts or updates to rows except those for which the WHERE\nclause in the select_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and\nCASCADED keywords determine the scope of check testing when the view is\ndefined in terms of another view. The LOCAL keyword restricts the CHECK\nOPTION only to the view being defined. CASCADED causes the checks for\nunderlying views to be evaluated as well. When neither keyword is\ngiven, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION\nclause, see\nhttp://dev.mysql.com/doc/refman/5.6/en/view-updatability.html, and\nhttp://dev.mysql.com/doc/refman/5.6/en/view-check-option.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-view.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (555,38,'TRIM','Syntax:\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nReturns the string str with all remstr prefixes or suffixes removed. If\nnone of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is\nassumed. remstr is optional and, if not specified, spaces are removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TRIM(\' bar \');\n -> \'bar\'\nmysql> SELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\');\n -> \'barxxx\'\nmysql> SELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\');\n -> \'bar\'\nmysql> SELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\');\n -> \'barx\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (556,14,'INET6_NTOA','Syntax:\nINET6_NTOA(expr)\n\nGiven an IPv6 or IPv4 network address represented in numeric form as a\nbinary string, returns the string representation of the address as a\nnonbinary string in the connection character set. If the argument is\nnot a valid address, INET6_NTOA() returns NULL.\n\nINET6_NTOA() has these properties:\n\no It does not use operating system functions to perform conversions,\n thus the output string is platform independent.\n\no The return string has a maximum length of 39 (4 x 8 + 7). Given this\n statement:\n\nCREATE TABLE t AS SELECT INET6_NTOA(expr) AS c1;\n\n The resulting table would have this definition:\n\nCREATE TABLE t (c1 VARCHAR(39) CHARACTER SET utf8 DEFAULT NULL);\n\no The return string uses lowercase letters for IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET6_NTOA(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(INET6_ATON(\'10.0.5.9\'));\n -> \'10.0.5.9\'\n\nmysql> SELECT INET6_NTOA(UNHEX(\'FDFE0000000000005A55CAFFFEFA9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(UNHEX(\'0A000509\'));\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (557,24,'SIGNAL','Syntax:\nSIGNAL condition_value\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nSIGNAL is the way to "return" an error. SIGNAL provides error\ninformation to a handler, to an outer portion of the application, or to\nthe client. Also, it provides control over the error\'s characteristics\n(error number, SQLSTATE value, message). Without SIGNAL, it is\nnecessary to resort to workarounds such as deliberately referring to a\nnonexistent table to cause a routine to return an error.\n\nNo special privileges are required to execute the SIGNAL statement.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html.\n\nThe condition_value in a SIGNAL statement indicates the error value to\nbe returned. It can be an SQLSTATE value (a 5-character string literal)\nor a condition_name that refers to a named condition previously defined\nwith DECLARE ... CONDITION (see [HELP DECLARE CONDITION]).\n\nAn SQLSTATE value can indicate errors, warnings, or "not found." The\nfirst two characters of the value indicate its error class, as\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-condition-inf\normation-items. Some signal values cause statement termination; see\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-effects.\n\nThe SQLSTATE value for a SIGNAL statement should not start with \'00\'\nbecause such values indicate success and are not valid for signaling an\nerror. This is true whether the SQLSTATE value is specified directly in\nthe SIGNAL statement or in a named condition referred to in the\nstatement. If the value is invalid, a Bad SQLSTATE error occurs.\n\nTo signal a generic SQLSTATE value, use \'45000\', which means "unhandled\nuser-defined exception."\n\nThe SIGNAL statement optionally includes a SET clause that contains\nmultiple signal items, in a comma-separated list of\ncondition_information_item_name = simple_value_specification\nassignments.\n\nEach condition_information_item_name may be specified only once in the\nSET clause. Otherwise, a Duplicate condition information item error\noccurs.\n\nValid simple_value_specification designators can be specified using\nstored procedure or function parameters, stored program local variables\ndeclared with DECLARE, user-defined variables, system variables, or\nliterals. A character literal may include a _charset introducer.\n\nFor information about permissible condition_information_item_name\nvalues, see\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-condition-inf\normation-items.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/signal.html\n\n','CREATE PROCEDURE p (pval INT)\nBEGIN\n DECLARE specialty CONDITION FOR SQLSTATE \'45000\';\n IF pval = 0 THEN\n SIGNAL SQLSTATE \'01000\';\n ELSEIF pval = 1 THEN\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSEIF pval = 2 THEN\n SIGNAL specialty\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSE\n SIGNAL SQLSTATE \'01000\'\n SET MESSAGE_TEXT = \'A warning occurred\', MYSQL_ERRNO = 1000;\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\', MYSQL_ERRNO = 1001;\n END IF;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/signal.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (558,26,'ST_NUMGEOMETRIES','ST_NumGeometries(gc)\n\nReturns the number of geometries in the GeometryCollection value gc.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT ST_NumGeometries(ST_GeomFromText(@gc));\n+----------------------------------------+\n| ST_NumGeometries(ST_GeomFromText(@gc)) |\n+----------------------------------------+\n| 2 |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-geometrycollection-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (559,8,'SAVEPOINT','Syntax:\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT,\nRELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/savepoint.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/savepoint.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (560,33,'MPOINTFROMWKB','MPointFromWKB(wkb[, srid]), MultiPointFromWKB(wkb[, srid])\n\nConstructs a MultiPoint value using its WKB representation and SRID.\n\nThe result is NULL if the WKB or SRID argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkb-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (561,40,'ALTER TABLE','Syntax:\nALTER [ONLINE|OFFLINE] [IGNORE] TABLE tbl_name\n [alter_specification [, alter_specification] ...]\n [partition_options]\n\nalter_specification:\n table_options\n | ADD [COLUMN] col_name column_definition\n [FIRST | AFTER col_name ]\n | ADD [COLUMN] (col_name column_definition,...)\n | ADD {INDEX|KEY} [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [index_name] (index_col_name,...)\n reference_definition\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}\n | CHANGE [COLUMN] old_col_name new_col_name column_definition\n [FIRST|AFTER col_name]\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | MODIFY [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | DROP [COLUMN] col_name\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} index_name\n | DROP FOREIGN KEY fk_symbol\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO|AS] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n | FORCE\n | ADD PARTITION (partition_definition)\n | DROP PARTITION partition_names\n | TRUNCATE PARTITION {partition_names | ALL}\n | COALESCE PARTITION number\n | REORGANIZE PARTITION partition_names INTO (partition_definitions)\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name\n | ANALYZE PARTITION {partition_names | ALL}\n | CHECK PARTITION {partition_names | ALL}\n | OPTIMIZE PARTITION {partition_names | ALL}\n | REBUILD PARTITION {partition_names | ALL}\n | REPAIR PARTITION {partition_names | ALL}\n | REMOVE PARTITIONING\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] value\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\nALTER TABLE changes the structure of a table. For example, you can add\nor delete columns, create or destroy indexes, change the type of\nexisting columns, or rename columns or the table itself. You can also\nchange characteristics such as the storage engine used for the table or\nthe table comment.\n\no To use ALTER TABLE, you need ALTER, CREATE, and INSERT privileges for\n the table. Renaming a table requires ALTER and DROP on the old table,\n ALTER, CREATE, and INSERT on the new table.\n\no Following the table name, specify the alterations to be made. If none\n are given, ALTER TABLE does nothing.\n\no The syntax for many of the permissible alterations is similar to\n clauses of the CREATE TABLE statement. column_definition clauses use\n the same syntax for ADD and CHANGE as for CREATE TABLE. See [HELP\n CREATE TABLE], for more information.\n\no The word COLUMN is optional and can be omitted.\n\no You can issue multiple ADD, ALTER, DROP, and CHANGE clauses in a\n single ALTER TABLE statement, separated by commas. This is a MySQL\n extension to standard SQL, which permits only one of each clause per\n ALTER TABLE statement. For example, to drop multiple columns in a\n single statement, do this:\n\nALTER TABLE t2 DROP COLUMN c, DROP COLUMN d;\n\no Some operations may result in warnings if attempted on a table for\n which the storage engine does not support the operation. These\n warnings can be displayed with SHOW WARNINGS. See [HELP SHOW\n WARNINGS]. For information on troubleshooting ALTER TABLE, see\n http://dev.mysql.com/doc/refman/5.6/en/alter-table-problems.html.\n\no For usage examples, see\n http://dev.mysql.com/doc/refman/5.6/en/alter-table-examples.html.\n\no With the mysql_info() C API function, you can find out how many rows\n were copied by ALTER TABLE, and (when IGNORE is used) how many rows\n were deleted due to duplication of unique key values. See\n http://dev.mysql.com/doc/refman/5.6/en/mysql-info.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (562,24,'LABELS','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nLabels are permitted for BEGIN ... END blocks and for the LOOP, REPEAT,\nand WHILE statements. Label use for those statements follows these\nrules:\n\no begin_label must be followed by a colon.\n\no begin_label can be given without end_label. If end_label is present,\n it must be the same as begin_label.\n\no end_label cannot be given without begin_label.\n\no Labels at the same nesting level must be distinct.\n\no Labels can be up to 16 characters long.\n\nTo refer to a label within the labeled construct, use an ITERATE or\nLEAVE statement. The following example uses those statements to\ncontinue iterating or terminate the loop:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN ITERATE label1; END IF;\n LEAVE label1;\n END LOOP label1;\nEND;\n\nThe scope of a block label does not include the code for handlers\ndeclared within the block. For details, see [HELP DECLARE HANDLER].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/statement-labels.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/statement-labels.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (563,23,'CHAR BYTE','The CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (564,20,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (565,21,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nANALYZE TABLE analyzes and stores the key distribution for a table.\nDuring the analysis, the table is locked with a read lock for InnoDB\nand MyISAM. This statement works with InnoDB, NDB, and MyISAM tables.\nFor MyISAM tables, this statement is equivalent to using myisamchk\n--analyze. This statement does not work with views.\n\nFor more information on how the analysis works within InnoDB, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-persistent-stats.html and\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-analyze-table-complexity.\nhtml. Also see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html. In\nparticular, when you enable the innodb_stats_persistent option, you\nmust run ANALYZE TABLE after loading substantial data into an InnoDB\ntable, or creating a new index for one.\n\nMySQL uses the stored key distribution to decide the order in which\ntables should be joined when you perform a join on something other than\na constant. In addition, key distributions can be used when deciding\nwhich indexes to use for a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nANALYZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... ANALYZE PARTITION to analyze one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (566,2,'ST_EXTERIORRING','ST_ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly)));\n+----------------------------------------------------+\n| ST_AsText(ST_ExteriorRing(ST_GeomFromText(@poly))) |\n+----------------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+----------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/gis-polygon-property-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (567,38,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 2\nmysql> SELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (568,40,'CONSTRAINT','MySQL supports foreign keys, which let you cross-reference related data\nacross tables, and foreign key constraints, which help keep this\nspread-out data consistent. The essential syntax for a foreign key\nconstraint definition in a CREATE TABLE or ALTER TABLE statement looks\nlike this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name, ...)\n REFERENCES tbl_name (index_col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html\n\n','CREATE TABLE product (\n category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)\n) ENGINE=INNODB;\n\nCREATE TABLE customer (\n id INT NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=INNODB;\n\nCREATE TABLE product_order (\n no INT NOT NULL AUTO_INCREMENT,\n product_category INT NOT NULL,\n product_id INT NOT NULL,\n customer_id INT NOT NULL,\n\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n INDEX (customer_id),\n\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)\n) ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (569,7,'CREATE_ASYMMETRIC_PRIV_KEY','Syntax:\nCREATE_ASYMMETRIC_PRIV_KEY(algorithm, {key_len|dh_secret})\n\nCreates a private key using the given algorithm and key length or DH\nsecret, and returns the key as a binary string in PEM format. If key\ngeneration fails, the result is NULL.\n\nSupported algorithm values: \'RSA\', \'DSA\', \'DH\'\n\nSupported key_len values: The minimum key length in bits is 1,024. The\nmaximum key length depends on the algorithm: 16,384 for RSA and 10,000\nfor DSA. These key-length limits are constraints imposed by OpenSSL.\nServer administrators can impose additional limits on maximum key\nlength by setting environment variables. See\nhttp://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-usage.html\n.\n\nFor DH keys, pass a shared DH secret instead of a key length. To create\nthe secret, pass the key length to CREATE_DH_PARAMETERS().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html\n\n','SET @priv = CREATE_ASYMMETRIC_PRIV_KEY(\'DSA\', 2048);\nSET @pub = CREATE_ASYMMETRIC_PUB_KEY(\'DSA\', @priv);\n','http://dev.mysql.com/doc/refman/5.6/en/enterprise-encryption-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (570,40,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n {ADD|DROP} DATAFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement can be used either to add a new data file, or to drop a\ndata file from a tablespace.\n\nThe ADD DATAFILE variant enables you to specify an initial size using\nan INITIAL_SIZE clause, where size is measured in bytes; the default\nvalue is 134217728 (128 MB). Prior to MySQL NDB Cluster 7.3.2, this\nvalue was required to be specified using digits (Bug #13116514, Bug\n#16104705, Bug #62858); in MySQL NDB Cluster 7.3.2 and later, you may\noptionally follow size with a one-letter abbreviation for an order of\nmagnitude, similar to those used in my.cnf. Generally, this is one of\nthe letters M (megabytes) or G (gigabytes).\n\n*Note*:\n\nAll NDB Cluster Disk Data objects share the same namespace. This means\nthat each Disk Data object must be uniquely named (and not merely each\nDisk Data object of a given type). For example, you cannot have a\ntablespace and an data file with the same name, or an undo log file and\na tablespace with the same name.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is\n4294967296 (4 GB). (Bug #29186)\n\nINITIAL_SIZE is rounded, explicitly, as for CREATE TABLESPACE.\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. You cannot drop a data file from a\ntablespace which is in use by any table; in other words, the data file\nmust be empty (no extents used). See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data-objects.\nhtml. In addition, any data file to be dropped must previously have\nbeen added to the tablespace with CREATE TABLESPACE or ALTER\nTABLESPACE.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. Currently, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.6. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+--------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nALTER TABLESPACE is useful only with Disk Data storage for NDB Cluster.\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (571,23,'ENUM','ENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nAn enumeration. A string object that can have only one value, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or the special \'\'\nerror value. ENUM values are represented internally as integers.\n\nAn ENUM column can have a maximum of 65,535 distinct elements. (The\npractical limit is less than 3000.) A table can have no more than 255\nunique element list definitions among its ENUM and SET columns\nconsidered as a group. For more information on these limits, see\nhttp://dev.mysql.com/doc/refman/5.6/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (572,38,'STRCMP','Syntax:\nSTRCMP(expr1,expr2)\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort\norder, and 1 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','mysql> SELECT STRCMP(\'text\', \'text2\');\n -> -1\nmysql> SELECT STRCMP(\'text2\', \'text\');\n -> 1\nmysql> SELECT STRCMP(\'text\', \'text\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (573,28,'INSERT DELAYED','Syntax:\nINSERT DELAYED ...\n\nThe DELAYED option for the INSERT statement is a MySQL extension to\nstandard SQL that can be used for certain kinds of tables (such as\nMyISAM). When a client uses INSERT DELAYED, it gets an okay from the\nserver at once, and the row is queued to be inserted when the table is\nnot in use by any other thread.\n\n*Note*:\n\nINSERT DELAYED is slower than a normal INSERT if the table is not\notherwise in use. There is also the additional overhead for the server\nto handle a separate thread for each table for which there are delayed\nrows. This means that you should use INSERT DELAYED only when you are\nreally sure that you need it.\n\nAs of MySQL 5.6.6, INSERT DELAYED is deprecated, and will be removed in\na future release. Use INSERT (without DELAYED) instead.\n\nThe queued rows are held only in memory until they are inserted into\nthe table. This means that if you terminate mysqld forcibly (for\nexample, with kill -9) or if mysqld dies unexpectedly, any queued rows\nthat have not been written to disk are lost.\n\nThere are some constraints on the use of DELAYED:\n\no INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE, and BLACKHOLE\n tables. For engines that do not support DELAYED, an error occurs.\n\no An error occurs for INSERT DELAYED if used with a table that has been\n locked with LOCK TABLES because the insert must be handled by a\n separate thread, not by the session that holds the lock.\n\no For MyISAM tables, if there are no free blocks in the middle of the\n data file, concurrent SELECT and INSERT statements are supported.\n Under these circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\n\no INSERT DELAYED should be used only for INSERT statements that specify\n value lists. The server ignores DELAYED for INSERT ... SELECT or\n INSERT ... ON DUPLICATE KEY UPDATE statements.\n\no Because the INSERT DELAYED statement returns immediately, before the\n rows are inserted, you cannot use LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\n\no DELAYED rows are not visible to SELECT statements until they actually\n have been inserted.\n\no Prior to MySQL 5.6, INSERT DELAYED was treated as a normal INSERT if\n the statement inserted multiple rows, binary logging was enabled, and\n the global logging format was statement-based (that is, whenever\n binlog_format was set to STATEMENT). Beginning with MySQL 5.6, INSERT\n DELAYED is always handled as a simple INSERT (that is, without the\n DELAYED option) whenever the value of binlog_format is STATEMENT or\n MIXED. (In the latter case, the statement no longer triggers a switch\n to row-based logging, and so is logged using the statement-based\n format.)\n\n This does not apply when using row-based binary logging mode\n (binlog_format set to ROW), in which INSERT DELAYED statements are\n always executed using the DELAYED option as specified, and logged as\n row-update events.\n\no DELAYED is ignored on slave replication servers, so that INSERT\n DELAYED is treated as a normal INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than the master.\n\no Pending INSERT DELAYED statements are lost if a table is write locked\n and ALTER TABLE is used to modify the table structure.\n\no INSERT DELAYED is not supported for views.\n\no INSERT DELAYED is not supported for partitioned tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert-delayed.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert-delayed.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (574,27,'SHOW PROCEDURE CODE','Syntax:\nSHOW PROCEDURE CODE proc_name\n\nThis statement is a MySQL extension that is available only for servers\nthat have been built with debugging support. It displays a\nrepresentation of the internal implementation of the named stored\nprocedure. A similar statement, SHOW FUNCTION CODE, displays\ninformation about stored functions (see [HELP SHOW FUNCTION CODE]).\n\nTo use either statement, you must be the owner of the routine or have\nSELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result\nset. Each row in the result set corresponds to one "instruction" in the\nroutine. The first column is Pos, which is an ordinal number beginning\nwith 0. The second column is Instruction, which contains an SQL\nstatement (usually changed from the original source), or a directive\nwhich has meaning only to the stored-routine handler.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-procedure-code.html\n\n','mysql> DELIMITER //\nmysql> CREATE PROCEDURE p1 ()\n -> BEGIN\n -> DECLARE fanta INT DEFAULT 55;\n -> DROP TABLE t2;\n -> LOOP\n -> INSERT INTO t3 VALUES (fanta);\n -> END LOOP;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction |\n+-----+----------------------------------------+\n| 0 | set fanta@0 55 |\n| 1 | stmt 9 "DROP TABLE t2" |\n| 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |\n| 3 | jump 2 |\n+-----+----------------------------------------+\n4 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/show-procedure-code.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (575,23,'MEDIUMTEXT','MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 16,777,215 (224 − 1)\ncharacters. The effective maximum length is less if the value contains\nmultibyte characters. Each MEDIUMTEXT value is stored using a 3-byte\nlength prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (576,27,'SHOW COLLATION','Syntax:\nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement lists collations supported by the server. By default,\nthe output from SHOW COLLATION includes all available collations. The\nLIKE clause, if present, indicates which collation names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. For example:\n\nmysql> SHOW COLLATION WHERE Charset = \'latin1\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1 | 5 | | Yes | 1 |\n| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 |\n| latin1_danish_ci | latin1 | 15 | | Yes | 1 |\n| latin1_german2_ci | latin1 | 31 | | Yes | 2 |\n| latin1_bin | latin1 | 47 | | Yes | 1 |\n| latin1_general_ci | latin1 | 48 | | Yes | 1 |\n| latin1_general_cs | latin1 | 49 | | Yes | 1 |\n| latin1_spanish_ci | latin1 | 94 | | Yes | 1 |\n+-------------------+---------+----+---------+----------+---------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-collation.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-collation.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (577,3,'LOG','Syntax:\nLOG(X), LOG(B,X)\n\nIf called with one parameter, this function returns the natural\nlogarithm of X. If X is less than or equal to 0, then NULL is returned.\n\nThe inverse of this function (when called with a single argument) is\nthe EXP() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG(2);\n -> 0.69314718055995\nmysql> SELECT LOG(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (578,20,'!=','Syntax:\n<>, !=\n\nNot equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT \'.01\' <> \'0.01\';\n -> 1\nmysql> SELECT .01 <> \'0.01\';\n -> 0\nmysql> SELECT \'zapp\' <> \'zappp\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (579,24,'WHILE','Syntax:\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition expression is true. statement_list consists of one or\nmore SQL statements, each terminated by a semicolon (;) statement\ndelimiter.\n\nA WHILE statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/while.html\n\n','CREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\n WHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n END WHILE;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/while.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (580,32,'DAYNAME','Syntax:\nDAYNAME(date)\n\nReturns the name of the weekday for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.6/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYNAME(\'2007-02-03\');\n -> \'Saturday\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (581,3,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians.\n\n*Note*:\n\nÏ€ radians equals 180 degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (582,17,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (583,20,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nThe return type of COALESCE() is the aggregated type of the argument\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); +INSERT INTO help_topic (help_topic_id,help_category_id,name,description,example,url) VALUES (584,17,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.6.38-standard\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_category (help_category_id,name,parent_category_id,url) values (1,'Geographic',0,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (2,'Polygon properties',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (3,'WKT',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (4,'Numeric Functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (5,'Plugins',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (6,'MBR',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (7,'Control flow functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (8,'Transactions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (9,'Help Metadata',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (10,'Account Management',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (11,'Point properties',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (12,'Encryption Functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (13,'LineString properties',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (14,'Miscellaneous Functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (15,'Logical operators',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (16,'Functions and Modifiers for Use with GROUP BY',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (17,'Information Functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (18,'Storage Engines',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (19,'Comparison operators',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (20,'Bit Functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (21,'Table Maintenance',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (22,'User-Defined Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (23,'Data Types',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (24,'Compound Statements',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (25,'Geometry constructors',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (26,'GeometryCollection properties',1,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (27,'Administration',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (28,'Data Manipulation',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (29,'Utility',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (30,'Language Structure',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (31,'Geometry relations',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (32,'Date and Time Functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (33,'WKB',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (34,'Procedures',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (35,'Geographic Features',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (36,'Contents',0,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (37,'Geometry properties',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (38,'String Functions',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (39,'Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (40,'Data Definition',36,''); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (0,'JOIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (1,'HOST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (2,'SERIALIZABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (3,'CONTAINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (4,'SRID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (5,'AT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (6,'SCHEDULE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (7,'RETURNS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (8,'MASTER_SSL_CA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (9,'NCHAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (10,'ONLY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (11,'ST_GEOMETRYN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (12,'ST_GEOMCOLLFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (13,'WORK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (14,'OPEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (15,'ST_INTERSECTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (16,'ESCAPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (17,'EVENTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (18,'MONTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (19,'PROFILES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (20,'ISCLOSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (21,'DUPLICATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (22,'ST_POINTN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (23,'REPLICATION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (24,'UNLOCK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (25,'STATS_PERSISTENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (26,'INNODB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (27,'YEAR_MONTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (28,'WITHIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (29,'PREPARE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (30,'LOCK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (31,'NDB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (32,'INT4'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (33,'POLYGON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (34,'MINUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (35,'SEPARATOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (36,'DELETE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (37,'ON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (38,'CONNECTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (39,'CLOSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (40,'MASTER_SSL_CRLPATH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (41,'USE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (42,'PRIVILEGES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (43,'SPATIAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (44,'SQL_BUFFER_RESULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (45,'SECURITY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (46,'AUTOEXTEND_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (47,'ST_STARTPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (48,'NDBCLUSTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (49,'ST_POLYGONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (50,'LEVEL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (51,'BINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (52,'CURRENT_USER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (53,'HOUR_MINUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (54,'UPDATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (55,'PRESERVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (56,'INTO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (57,'POLYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (58,'SQL_AFTER_GTIDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (59,'VARIABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (60,'ROLLBACK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (61,'TIMESTAMP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (62,'IMPORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (63,'CHECKSUM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (64,'THEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (65,'ENGINES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (66,'HANDLER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (67,'DAY_SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (68,'HELP_DATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (69,'BOOLEAN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (70,'MOD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (71,'ST_GEOMETRYTYPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (72,'CLASS_ORIGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (73,'MPOLYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (74,'ITERATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (75,'DO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (76,'DATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (77,'FULLTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (78,'COMMENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (79,'ST_ASTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (80,'MASTER_CONNECT_RETRY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (81,'MASTER_LOG_FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (82,'PRECISION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (83,'REQUIRE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (84,'ST_ASWKT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (85,'LONG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (86,'FORMAT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (87,'OPTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (88,'REORGANIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (89,'ELSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (90,'EXTERIORRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (91,'GEOMFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (92,'STATS_AUTO_RECALC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (93,'FROM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (94,'MULTIPOLYGON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (95,'LEFT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (96,'ELSEIF'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (97,'ST_ISCLOSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (98,'COMPACT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (99,'DEC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (100,'FOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (101,'WARNINGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (102,'ST_LINESTRINGFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (103,'STRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (104,'CONDITION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (105,'ENCLOSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (106,'AGGREGATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (107,'NUMBER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (108,'FIELDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (109,'KILL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (110,'DISJOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (111,'TABLESPACE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (112,'OVERLAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (113,'INFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (114,'MBREQUAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (115,'HELP_VERSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (116,'ORDER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (117,'MASTER_SSL_CRL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (118,'ST_GEOMFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (119,'USING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (120,'MIDDLEINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (121,'GRANT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (122,'MBRINTERSECTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (123,'GEOMETRYN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (124,'GEOMETRYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (125,'DEFAULT_AUTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (126,'FOREIGN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (127,'CACHE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (128,'MYSQL_ERRNO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (129,'SCHEMAS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (130,'LEADING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (131,'CONSTRAINT_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (132,'CONVERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (133,'DYNAMIC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (134,'POLYGONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (135,'ENVELOPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (136,'ST_ISEMPTY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (137,'HAVING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (138,'STARTING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (139,'RELOAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (140,'ISSIMPLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (141,'AUTOCOMMIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (142,'ST_Y'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (143,'REVOKE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (144,'RANDOM_BYTES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (145,'EXPLAIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (146,'CSV'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (147,'OUTFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (148,'LOW_PRIORITY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (149,'FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (150,'NODEGROUP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (151,'SCHEMA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (152,'ST_TOUCHES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (153,'MLINEFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (154,'ST_POLYGONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (155,'DUAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (156,'MULTIPOINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (157,'MULTIPOINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (158,'EXTENDED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (159,'CROSS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (160,'CONTRIBUTORS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (161,'GROUP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (162,'NATIONAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (163,'ST_ISSIMPLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (164,'SHA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (165,'POINTN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (166,'IGNORE_SERVER_IDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (167,'MASTER_AUTO_POSITION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (168,'ASBINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (169,'MBROVERLAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (170,'OWNER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (171,'TRUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (172,'CHARACTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (173,'SCHEMA_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (174,'TABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (175,'ST_LINEFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (176,'CASCADE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (177,'RELAY_LOG_POS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (178,'ASWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (179,'LEAVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (180,'MODIFY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (181,'MATCH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (182,'MASTER_LOG_POS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (183,'DISTINCTROW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (184,'X'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (185,'CURSOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (186,'ST_UNION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (187,'CROSSES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (188,'GEOMETRYCOLLECTIONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (189,'CHAIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (190,'FLUSH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (191,'CREATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (192,'DESCRIBE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (193,'PROCESSLIST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (194,'DISCARD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (195,'SOUNDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (196,'PACK_KEYS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (197,'MULTILINESTRINGFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (198,'INTERSECTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (199,'FAST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (200,'GET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (201,'LOOP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (202,'VARCHARACTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (203,'BEFORE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (204,'ALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (205,'REDUNDANT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (206,'USER_RESOURCES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (207,'PARTIAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (208,'END'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (209,'ST_CONTAINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (210,'SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (211,'FLOAT8'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (212,'PREV'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (213,'MBRCONTAINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (214,'OR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (215,'IDENTIFIED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (216,'POINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (217,'MASTER_SSL_CIPHER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (218,'SQL_SLAVE_SKIP_COUNTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (219,'BOTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (220,'YEAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (221,'UNIQUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (222,'TRIGGERS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (223,'RESIGNAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (224,'ST_NUMPOINTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (225,'MASTER_SSL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (226,'DATE_ADD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (227,'ST_ENVELOPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (228,'LIKE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (229,'PLUGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (230,'MULTIPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (231,'FETCH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (232,'MBRWITHIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (233,'COLUMN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (234,'USAGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (235,'MEMORY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (236,'QUERY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (237,'Y'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (238,'LINES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (239,'PLUGIN_DIR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (240,'SQL_THREAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (241,'INTERIORRINGN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (242,'NUMINTERIORRINGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (243,'MAX_QUERIES_PER_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (244,'ST_POLYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (245,'TRANSACTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (246,'STDDEV'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (247,'NAMES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (248,'INT1'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (249,'RIGHT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (250,'MAX_ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (251,'ALTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (252,'NATURAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (253,'MULTILINESTRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (254,'VARIABLES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (255,'ESCAPED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (256,'KEY_BLOCK_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (257,'MPOINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (258,'CHAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (259,'UPGRADE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (260,'INTERVAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (261,'NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (262,'ST_POINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (263,'REFERENCES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (264,'ST_WITHIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (265,'STORAGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (266,'ISOLATION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (267,'EVERY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (268,'INT8'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (269,'AUTHORS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (270,'ST_BUFFER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (271,'BUFFER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (272,'RESTRICT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (273,'UNCOMMITTED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (274,'LINESTRINGFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (275,'IS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (276,'ST_CENTROID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (277,'NOT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (278,'DATAFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (279,'ANALYSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (280,'DES_KEY_FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (281,'COMPRESSED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (282,'START'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (283,'IF'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (284,'ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (285,'PURGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (286,'USER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (287,'EXIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (288,'MERGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (289,'ST_DISTANCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (290,'SQL_NO_CACHE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (291,'DELAYED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (292,'PROXY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (293,'ST_POLYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (294,'WRITE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (295,'DATABASE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (296,'NULL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (297,'POWER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (298,'POINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (299,'USE_FRM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (300,'TERMINATED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (301,'NVARCHAR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (302,'RETURN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (303,'DIRECTORY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (304,'AES_DECRYPT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (305,'GLENGTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (306,'SHUTDOWN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (307,'CATALOG_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (308,'FIXED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (309,'MULTIPOLYGONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (310,'REPLACE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (311,'REPEAT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (312,'ST_SYMDIFFERENCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (313,'STARTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (314,'COMPLETION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (315,'COLUMNS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (316,'DATETIME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (317,'MODE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (318,'INTEGER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (319,'VALUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (320,'ASWKT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (321,'GEOMETRYCOLLECTIONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (322,'DROP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (323,'SQL_BIG_RESULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (324,'MASTER_SSL_VERIFY_SERVER_CERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (325,'SUBJECT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (326,'MASTER_RETRY_COUNT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (327,'CHECK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (328,'FULL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (329,'BY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (330,'NO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (331,'DAY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (332,'DATA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (333,'PARTITION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (334,'REAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (335,'SHARE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (336,'LINESTRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (337,'MESSAGE_TEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (338,'MASTER_HEARTBEAT_PERIOD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (339,'COLUMN_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (340,'X509'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (341,'LINEFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (342,'SUBCLASS_ORIGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (343,'WHERE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (344,'EVENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (345,'SUPER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (346,'IGNORE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (347,'SHA2'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (348,'QUICK'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (349,'SIGNED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (350,'ST_GEOMCOLLFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (351,'FALSE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (352,'POLYGONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (353,'FORCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (354,'CHANGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (355,'TO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (356,'POINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (357,'CREATE_DH_PARAMETERS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (358,'TABLE_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (359,'VARYING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (360,'FEDERATED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (361,'MAX_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (362,'HOUR_SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (363,'ST_DIFFERENCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (364,'TRADITIONAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (365,'GEOMETRYCOLLECTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (366,'ST_GEOMETRYCOLLECTIONFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (367,'ST_ASBINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (368,'PROCEDURE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (369,'AGAINST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (370,'ST_AREA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (371,'ENDPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (372,'SQL_BEFORE_GTIDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (373,'LONGBINARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (374,'INSERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (375,'COUNT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (376,'PORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (377,'MLINEFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (378,'EXISTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (379,'MUTEX'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (380,'GEOMCOLLFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (381,'RELEASE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (382,'DEFAULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (383,'TYPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (384,'NO_WRITE_TO_BINLOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (385,'OPTIMIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (386,'SQLSTATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (387,'RESET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (388,'INSTALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (389,'BIGINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (390,'ST_DIMENSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (391,'SET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (392,'ISSUER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (393,'STATUS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (394,'INNER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (395,'RELAYLOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (396,'MRG_MYISAM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (397,'STOP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (398,'TRAILING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (399,'PARTITIONS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (400,'ST_NUMINTERIORRINGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (401,'CASE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (402,'IO_THREAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (403,'DEALLOCATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (404,'CIPHER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (405,'CONTINUE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (406,'READ'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (407,'MINUTE_SECOND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (408,'MIN_ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (409,'ROW_COUNT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (410,'FUNCTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (411,'ST_GEOMETRYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (412,'CHARSET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (413,'INT3'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (414,'ADD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (415,'AVG_ROW_LENGTH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (416,'ARCHIVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (417,'FLOAT4'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (418,'ASTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (419,'NUMGEOMETRIES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (420,'ALGORITHM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (421,'VIEW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (422,'REPEATABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (423,'CONSTRAINT_CATALOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (424,'STARTPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (425,'MPOLYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (426,'UNSIGNED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (427,'DECIMAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (428,'INDEXES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (429,'ST_INTERSECTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (430,'HOSTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (431,'COMMIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (432,'SNAPSHOT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (433,'DECLARE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (434,'NUMPOINTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (435,'LOAD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (436,'SQL_CACHE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (437,'COLLATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (438,'ST_GEOMETRYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (439,'BYTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (440,'LINESTRINGFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (441,'GLOBAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (442,'WHEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (443,'TOUCHES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (444,'AS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (445,'ST_LINESTRINGFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (446,'AUTO_INCREMENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (447,'GEOMCOLLFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (448,'ST_INTERIORRINGN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (449,'GRANTS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (450,'OUTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (451,'CURSOR_NAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (452,'EXPIRE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (453,'FLOOR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (454,'SQL_AFTER_MTS_GAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (455,'WITH'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (456,'STD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (457,'AFTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (458,'DISABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (459,'UNINSTALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (460,'SONAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (461,'POW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (462,'INDEX'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (463,'DEFINER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (464,'MASTER_BIND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (465,'REMOVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (466,'MULTILINESTRINGFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (467,'ST_POINTFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (468,'ST_ENDPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (469,'ST_OVERLAPS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (470,'UNDO'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (471,'ZEROFILL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (472,'CLIENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (473,'MASTER_PASSWORD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (474,'RELAY_LOG_FILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (475,'MBRTOUCHES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (476,'MASTER_USER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (477,'ENGINE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (478,'INSERT_METHOD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (479,'SQL_CALC_FOUND_ROWS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (480,'UNION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (481,'MYISAM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (482,'DESC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (483,'TIME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (484,'EXPANSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (485,'NUMERIC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (486,'CODE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (487,'AREA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (488,'LOGFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (489,'EXTENT_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (490,'ST_LINEFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (491,'MAX_UPDATES_PER_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (492,'INT2'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (493,'ENDS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (494,'ISEMPTY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (495,'RECOVER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (496,'LOGS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (497,'HEAP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (498,'RETURNED_SQLSTATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (499,'EXCHANGE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (500,'BETWEEN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (501,'ST_CROSSES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (502,'REPAIR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (503,'MBRDISJOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (504,'CALL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (505,'VALUES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (506,'ST_X'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (507,'TRUNCATE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (508,'SHOW'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (509,'BINLOG'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (510,'ST_DISJOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (511,'AND'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (512,'HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (513,'SELECT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (514,'DATABASES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (515,'WRAPPER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (516,'BOOL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (517,'MASTER_PORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (518,'CONCURRENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (519,'HELP'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (520,'PROCESS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (521,'OPTIONS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (522,'CONSISTENT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (523,'MAX_CONNECTIONS_PER_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (524,'IN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (525,'DIAGNOSTICS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (526,'DUMPFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (527,'POLYFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (528,'JSON'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (529,'ST_SRID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (530,'EXECUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (531,'CEIL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (532,'MASTER_HOST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (533,'ST_EQUALS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (534,'SERVER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (535,'MULTIPOLYGONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (536,'MASTER_SSL_CERT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (537,'DAY_MINUTE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (538,'DATE_SUB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (539,'REBUILD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (540,'GEOMETRYFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (541,'GEOMFROMTEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (542,'RENAME'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (543,'PARSER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (544,'ST_ASWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (545,'SOCKET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (546,'STRAIGHT_JOIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (547,'ST_GEOMETRYCOLLECTIONFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (548,'ST_GEOMFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (549,'SHA1'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (550,'PASSWORD'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (551,'OFFSET'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (552,'NEXT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (553,'ERRORS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (554,'TEMPORARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (555,'SQL_LOG_BIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (556,'DIMENSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (557,'SQL_SMALL_RESULT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (558,'COMMITTED'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (559,'EQUALS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (560,'DELAY_KEY_WRITE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (561,'BEGIN'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (562,'XA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (563,'PROFILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (564,'MEDIUM'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (565,'CENTROID'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (566,'SSL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (567,'DAY_HOUR'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (568,'AES_ENCRYPT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (569,'CEILING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (570,'LINEFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (571,'GEOMETRYTYPE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (572,'STATS_SAMPLE_PAGES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (573,'SIGNAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (574,'PLUGINS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (575,'ST_NUMGEOMETRIES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (576,'SAVEPOINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (577,'PRIMARY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (578,'LAST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (579,'MPOINTFROMWKB'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (580,'KEYS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (581,'LIMIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (582,'KEY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (583,'UNTIL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (584,'CONSTRAINT_SCHEMA'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (585,'ST_EXTERIORRING'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (586,'ANALYZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (587,'CONSTRAINT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (588,'SERIAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (589,'ACTION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (590,'INITIAL_SIZE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (591,'SESSION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (592,'SLAVE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (593,'ASC'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (594,'ENABLE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (595,'OPTIONALLY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (596,'MAX_USER_CONNECTIONS'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (597,'WHILE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (598,'DISTINCT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (599,'LOCAL'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (600,'MASTER_SSL_KEY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (601,'NONE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (602,'TABLES'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (603,'<>'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (604,'EXPORT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (605,'RLIKE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (606,'TRIGGER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (607,'COLLATION'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (608,'HIGH_PRIORITY'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (609,'BTREE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (610,'FIRST'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (611,'COALESCE'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (612,'WAIT'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (613,'MASTER'); +INSERT INTO help_keyword (help_keyword_id,name) VALUES (614,'ROW_FORMAT'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (0,28,'JOIN','MySQL supports the following JOIN syntaxes for the table_references\npart of SELECT statements and multiple-table DELETE and UPDATE\nstatements:\n\ntable_references:\n escaped_table_reference [, escaped_table_reference] ...\n\nescaped_table_reference:\n table_reference\n | { OJ table_reference }\n\ntable_reference:\n table_factor\n | join_table\n\ntable_factor:\n tbl_name [PARTITION (partition_names)] \n [[AS] alias] [index_hint_list]\n | table_subquery [AS] alias\n | ( table_references )\n\njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n ON conditional_expr\n | USING (column_list)\n\nindex_hint_list:\n index_hint [, index_hint] ...\n\nindex_hint:\n USE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nIn MySQL 5.6.2 and later, a table reference (when it refers to a\npartitioned table) may contain a PARTITION option, including a\ncomma-separated list of partitions, subpartitions, or both. This option\nfollows the name of the table and precedes any alias declaration. The\neffect of this option is that rows are selected only from the listed\npartitions or subpartitions---in other words, any partitions or\nsubpartitions not named in the list are ignored For more information,\nsee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\nThe syntax of table_factor is extended in comparison with the SQL\nStandard. The latter accepts only table_reference, not a list of them\ninside a pair of parentheses.\n\nThis is a conservative extension if we consider each comma in a list of\ntable_reference items as equivalent to an inner join. For example:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nIn MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents\n(they can replace each other). In standard SQL, they are not\nequivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used\notherwise.\n\nIn general, parentheses can be ignored in join expressions containing\nonly inner join operations. MySQL also supports nested joins (see\nhttp://dev.mysql.com/doc/refman/5.6/en/nested-join-optimization.html).\n\nIndex hints can be specified to affect how the MySQL optimizer makes\nuse of indexes. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/index-hints.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/join.html\n\n','SELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n','http://dev.mysql.com/doc/refman/5.6/en/join.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (1,38,'HEX','Syntax:\nHEX(str), HEX(N)\n\nFor a string argument str, HEX() returns a hexadecimal string\nrepresentation of str where each character in str is converted to two\nhexadecimal digits. The inverse of this operation is performed by the\nUNHEX() function.\n\nFor a numeric argument N, HEX() returns a hexadecimal string\nrepresentation of the value of N treated as a longlong (BIGINT) number.\nThis is equivalent to CONV(N,10,16). The inverse of this operation is\nperformed by CONV(HEX(N),16,10).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT 0x616263, HEX(\'abc\'), UNHEX(HEX(\'abc\'));\n -> \'abc\', 616263, \'abc\'\nmysql> SELECT HEX(255), CONV(HEX(255),16,10);\n -> \'FF\', 255\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (2,31,'CONTAINS','Contains(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as Within().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (3,37,'SRID','SRID(g)\n\nReturns an integer indicating the Spatial Reference System ID for the\ngeometry value g.\n\nIn MySQL, the SRID value is just an integer associated with the\ngeometry value. All calculations are done assuming Euclidean (planar)\ngeometry.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n| 101 |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (4,27,'SHOW CONTRIBUTORS','Syntax:\nSHOW CONTRIBUTORS\n\nThe SHOW CONTRIBUTORS statement displays information about the people\nwho contribute to MySQL source or to causes that we support. For each\ncontributor, it displays Name, Location, and Comment values.\n\nThis statement is removed as of MySQL 5.6.8.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-contributors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-contributors.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (5,16,'VARIANCE','Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. This is an extension\nto standard SQL. The standard SQL function VAR_POP() can be used\ninstead.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (6,40,'DROP SERVER','Syntax:\nDROP SERVER [ IF EXISTS ] server_name\n\nDrops the server definition for the server named server_name. The\ncorresponding row in the mysql.servers table is deleted. This statement\nrequires the SUPER privilege.\n\nDropping a server for a table does not affect any FEDERATED tables that\nused this connection information when they were created. See [HELP\nCREATE SERVER].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-server.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-server.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (7,27,'SHOW AUTHORS','Syntax:\nSHOW AUTHORS\n\nThe SHOW AUTHORS statement displays information about the people who\nwork on MySQL. For each author, it displays Name, Location, and Comment\nvalues.\n\nThis statement is removed as of MySQL 5.6.8.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-authors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-authors.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (8,38,'CONCAT','Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are nonbinary strings, the\nresult is a nonbinary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent nonbinary string form.\n\nCONCAT() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CONCAT(\'My\', \'S\', \'QL\');\n -> \'MySQL\'\nmysql> SELECT CONCAT(\'My\', NULL, \'QL\');\n -> NULL\nmysql> SELECT CONCAT(14.3);\n -> \'14.3\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (9,35,'GEOMETRY HIERARCHY','Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n collection classes named MultiPoint, MultiLineString, and\n MultiPolygon for modeling geometries corresponding to collections of\n Points, LineStrings, and Polygons, respectively. MultiCurve and\n MultiSurface are introduced as abstract superclasses that generalize\n the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnoninstantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-geometry-class-hierarchy.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-geometry-class-hierarchy.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (10,38,'CHAR FUNCTION','Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary | utf8 |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CHAR(77,121,83,81,\'76\');\n -> \'MySQL\'\nmysql> SELECT CHAR(77,77.3,\'77.3\');\n -> \'MMM\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (11,27,'SHOW CREATE TRIGGER','Syntax:\nSHOW CREATE TRIGGER trigger_name\n\nThis statement shows a CREATE TRIGGER statement that creates the given\ntrigger.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-trigger.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (12,27,'SHOW CREATE PROCEDURE','Syntax:\nSHOW CREATE PROCEDURE proc_name\n\nThis statement is a MySQL extension. It returns the exact string that\ncan be used to re-create the named stored procedure. A similar\nstatement, SHOW CREATE FUNCTION, displays information about stored\nfunctions (see [HELP SHOW CREATE FUNCTION]).\n\nBoth statements require that you be the owner of the routine or have\nSELECT access to the mysql.proc table. If you do not have privileges\nfor the routine itself, the value displayed for the Create Procedure or\nCreate Function field will be NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-procedure.html\n\n','mysql> SHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n Procedure: simpleproc\n sql_mode:\n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nmysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode:\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS CHAR(50)\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (13,24,'OPEN','Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/open.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/open.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (14,31,'ST_INTERSECTS','ST_Intersects(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,38,'LOWER','Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT LOWER(\'QUADRATICALLY\');\n -> \'quadratically\'\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings\n(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert\nthe string to a nonbinary string:\n\nmysql> SET @str = BINARY \'New York\';\nmysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+-------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+-------------+-----------------------------------+\n| New York | new york |\n+-------------+-----------------------------------+\n\nFor Unicode character sets, LOWER() and UPPER() work accounting to\nUnicode Collation Algorithm (UCA) 5.2.0 for xxx_unicode_520_ci\ncollations and for language-specific collations that are derived from\nthem. For other Unicode collations, LOWER() and UPPER() work accounting\nto Unicode Collation Algorithm (UCA) 4.0.0. See\nhttp://dev.mysql.com/doc/refman/5.6/en/charset-unicode-sets.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (16,40,'CREATE TRIGGER','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n TRIGGER trigger_name trigger_time trigger_event\n ON tbl_name FOR EACH ROW trigger_body\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. The trigger becomes associated\nwith the table named tbl_name, which must refer to a permanent table.\nYou cannot associate a trigger with a TEMPORARY table or a view.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated\nwith the trigger. The statement might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section. If\nbinary logging is enabled, CREATE TRIGGER might require the SUPER\nprivilege, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nThe DEFINER clause determines the security context to be used when\nchecking access privileges at trigger activation time. See later in\nthis section for more information.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after each row to be\nmodified.\n\ntrigger_event indicates the kind of statement that activates the\ntrigger. The trigger_event can be one of the following:\n\no INSERT: The trigger is activated whenever a new row is inserted into\n the table; for example, through INSERT, LOAD DATA, and REPLACE\n statements.\n\no UPDATE: The trigger is activated whenever a row is modified; for\n example, through UPDATE statements.\n\no DELETE: The trigger is activated whenever a row is deleted from the\n table; for example, through DELETE and REPLACE statements. However,\n DROP TABLE and TRUNCATE TABLE statements on the table do not activate\n this trigger, because they do not use DELETE. Dropping a partition\n does not activate DELETE triggers, either. See [HELP TRUNCATE TABLE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-trigger.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (17,32,'MONTH','Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 1 to 12 for January to\nDecember, or 0 for dates such as \'0000-00-00\' or \'2008-00-00\' that have\na zero month part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MONTH(\'2008-02-03\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (18,27,'SHOW TRIGGERS','Syntax:\nSHOW TRIGGERS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a\ndatabase (the default database unless a FROM clause is given). This\nstatement returns results only for databases and tables for which you\nhave the TRIGGER privilege. The LIKE clause, if present, indicates\nwhich table names to match and causes the statement to display triggers\nfor those tables. The WHERE clause can be given to select rows using\nmore general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nFor the trigger ins_sum as defined in\nhttp://dev.mysql.com/doc/refman/5.6/en/triggers.html, the output of\nthis statement is as shown here:\n\nmysql> SHOW TRIGGERS LIKE \'acc%\'\\G\n*************************** 1. row ***************************\n Trigger: ins_sum\n Event: INSERT\n Table: account\n Statement: SET @sum = @sum + NEW.amount\n Timing: BEFORE\n Created: NULL\n sql_mode:\n Definer: myname@localhost\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\ncharacter_set_client is the session value of the character_set_client\nsystem variable when the trigger was created. collation_connection is\nthe session value of the collation_connection system variable when the\ntrigger was created. Database Collation is the collation of the\ndatabase with which the trigger is associated.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-triggers.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-triggers.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (19,38,'REGEXP','Syntax:\nexpr REGEXP pat, expr RLIKE pat\n\nPerforms a pattern match of a string expression expr against a pattern\npat. The pattern can be an extended regular expression. The syntax for\nregular expressions is discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/regexp.html. Returns 1 if expr\nmatches pat; otherwise it returns 0. If either expr or pat is NULL, the\nresult is NULL. RLIKE is a synonym for REGEXP, provided for mSQL\ncompatibility.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\n*Note*: Because MySQL uses the C escape syntax in strings (for example,\n"\\n" to represent the newline character), you must double any "\\" that\nyou use in your REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/regexp.html\n\n','mysql> SELECT \'Monty!\' REGEXP \'.*\';\n -> 1\nmysql> SELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n -> 1\nmysql> SELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n -> 1 0\nmysql> SELECT \'a\' REGEXP \'^[a-d]\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/regexp.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,24,'IF STATEMENT','Syntax:\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF\n\nThe IF statement for stored programs implements a basic conditional\nconstruct.\n\n*Note*: There is also an IF() function, which differs from the IF\nstatement described here. See\nhttp://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html. The\nIF statement can have THEN, ELSE, and ELSEIF clauses, and it is\nterminated with END IF.\n\nIf the search_condition evaluates to true, the corresponding THEN or\nELSEIF clause statement_list executes. If no search_condition matches,\nthe ELSE clause statement_list executes.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/if.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/if.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (21,12,'VALIDATE_PASSWORD_STRENGTH','Syntax:\nVALIDATE_PASSWORD_STRENGTH(str)\n\nGiven an argument representing a cleartext password, this function\nreturns an integer to indicate how strong the password is. The return\nvalue ranges from 0 (weak) to 100 (strong).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (22,31,'WITHIN','Within(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (23,27,'SHOW PLUGINS','Syntax:\nSHOW PLUGINS\n\nSHOW PLUGINS displays information about server plugins. Plugin\ninformation is also available in the INFORMATION_SCHEMA.PLUGINS table.\nSee http://dev.mysql.com/doc/refman/5.6/en/plugins-table.html.\n\nExample of SHOW PLUGINS output:\n\nmysql> SHOW PLUGINS\\G\n*************************** 1. row ***************************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 2. row ***************************\n Name: CSV\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 3. row ***************************\n Name: MEMORY\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 4. row ***************************\n Name: MyISAM\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n...\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-plugins.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-plugins.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,8,'PREPARE','Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a SQL statement and assigns it a name,\nstmt_name, by which to refer to the statement later. The prepared\nstatement is executed with EXECUTE and released with DEALLOCATE\nPREPARE. For examples, see\nhttp://dev.mysql.com/doc/refman/5.6/en/sql-syntax-prepared-statements.h\ntml.\n\nStatement names are not case sensitive. preparable_stmt is either a\nstring literal or a user variable that contains the text of the SQL\nstatement. The text must represent a single statement, not multiple\nstatements. Within the statement, ? characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query\nlater when you execute it. The ? characters should not be enclosed\nwithin quotation marks, even if you intend to bind them to string\nvalues. Parameter markers can be used only where data values should\nappear, not for SQL keywords, identifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nThe scope of a prepared statement is the session within which it is\ncreated, which as several implications:\n\no A prepared statement created in one session is not available to other\n sessions.\n\no When a session ends, whether normally or abnormally, its prepared\n statements no longer exist. If auto-reconnect is enabled, the client\n is not notified that the connection was lost. For this reason,\n clients may wish to disable auto-reconnect. See\n http://dev.mysql.com/doc/refman/5.6/en/auto-reconnect.html.\n\no A prepared statement created within a stored program continues to\n exist after the program finishes executing and can be executed\n outside the program later.\n\no A statement prepared in stored program context cannot refer to stored\n procedure or function parameters or local variables because they go\n out of scope when the program ends and would be unavailable were the\n statement to be executed later outside the program. As a workaround,\n refer instead to user-defined variables, which also have session\n scope; see\n http://dev.mysql.com/doc/refman/5.6/en/user-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/prepare.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (25,8,'LOCK','Syntax:\nLOCK TABLES\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n\nlock_type:\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n\nUNLOCK TABLES\n\nMySQL enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to\nprevent other sessions from modifying tables during periods when a\nsession requires exclusive access to them. A session can acquire or\nrelease locks only for itself. One session cannot acquire locks for\nanother session or release locks held by another session.\n\nLocks may be used to emulate transactions or to get more speed when\nupdating tables. This is explained in more detail later in this\nsection.\n\nLOCK TABLES explicitly acquires table locks for the current client\nsession. Table locks can be acquired for base tables or views. You must\nhave the LOCK TABLES privilege, and the SELECT privilege for each\nobject to be locked.\n\nFor view locking, LOCK TABLES adds all base tables used in the view to\nthe set of tables to be locked and locks them automatically. If you\nlock a table explicitly with LOCK TABLES, any tables used in triggers\nare also locked implicitly, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/lock-tables-and-triggers.html.\n\nUNLOCK TABLES explicitly releases any table locks held by the current\nsession. LOCK TABLES implicitly releases any table locks held by the\ncurrent session before acquiring new locks.\n\nAnother use for UNLOCK TABLES is to release the global read lock\nacquired with the FLUSH TABLES WITH READ LOCK statement, which enables\nyou to lock all tables in all databases. See [HELP FLUSH]. (This is a\nvery convenient way to get backups if you have a file system such as\nVeritas that can take snapshots in time.)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/lock-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/lock-tables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (26,27,'SHOW BINARY LOGS','Syntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [HELP PURGE BINARY LOGS], that shows\nhow to determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-binary-logs.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-binary-logs.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (27,25,'POLYGON','Polygon(ls1,ls2,...)\n\nConstructs a Polygon value from a number of LineString or WKB\nLineString arguments. If any argument does not represent a LinearRing\n(that is, not a closed and simple LineString), the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (28,32,'MINUTE','Syntax:\nMINUTE(time)\n\nReturns the minute for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MINUTE(\'2008-02-03 10:05:03\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,38,'MID','Syntax:\nMID(str,pos,len)\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (30,17,'CONNECTION_ID','Syntax:\nCONNECTION_ID()\n\nReturns the connection ID (thread ID) for the connection. Every\nconnection has an ID that is unique among the set of currently\nconnected clients.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT CONNECTION_ID();\n -> 23786\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (31,38,'FROM_BASE64()','Syntax:\nFROM_BASE64(str)\n\nTakes a string encoded with the base-64 encoded rules used by\nTO_BASE64() and returns the decoded result as a binary string. The\nresult is NULL if the argument is NULL or not a valid base-64 string.\nSee the description of TO_BASE64() for details about the encoding and\ndecoding rules.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (32,28,'DELETE','Syntax:\nDELETE is a DML statement that removes rows from a table.\n\nSingle-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name\n [PARTITION (partition_name,...)]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nThe DELETE statement deletes rows from tbl_name and returns the number\nof deleted rows. To check the number of deleted rows, call the\nROW_COUNT() function described in\nhttp://dev.mysql.com/doc/refman/5.6/en/information-functions.html.\n\nMain Clauses\n\nThe conditions in the optional WHERE clause identify which rows to\ndelete. With no WHERE clause, all rows are deleted.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe deleted. It is specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nIf the ORDER BY clause is specified, the rows are deleted in the order\nthat is specified. The LIMIT clause places a limit on the number of\nrows that can be deleted. These clauses apply to single-table deletes,\nbut not multi-table deletes.\n\nMultiple-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n\nPrivileges\n\nYou need the DELETE privilege on a table to delete rows from it. You\nneed only the SELECT privilege for any columns that are only read, such\nas those named in the WHERE clause.\n\nPerformance\n\nWhen you do not need to know the number of deleted rows, the TRUNCATE\nTABLE statement is a faster way to empty a table than a DELETE\nstatement with no WHERE clause. Unlike DELETE, TRUNCATE TABLE cannot be\nused within a transaction or if you have a lock on the table. See [HELP\nTRUNCATE TABLE] and [HELP LOCK].\n\nThe speed of delete operations may also be affected by factors\ndiscussed in http://dev.mysql.com/doc/refman/5.6/en/delete-speed.html.\n\nTo ensure that a given DELETE statement does not take too much time,\nthe MySQL-specific LIMIT row_count clause for DELETE specifies the\nmaximum number of rows to be deleted. If the number of rows to delete\nis larger than the limit, repeat the DELETE statement until the number\nof affected rows is less than the LIMIT value.\n\nSubqueries\n\nCurrently, you cannot delete from a table and select from the same\ntable in a subquery.\n\nPartitioned Tables\n\nBeginning with MySQL 5.6.2, DELETE supports explicit partition\nselection using the PARTITION option, which takes a comma-separated\nlist of the names of one or more partitions or subpartitions (or both)\nfrom which to select rows to be dropped. Partitions not included in the\nlist are ignored. Given a partitioned table t with a partition named\np0, executing the statement DELETE FROM t PARTITION (p0) has the same\neffect on the table as executing ALTER TABLE t TRUNCATE PARTITION (p0);\nin both cases, all rows in partition p0 are dropped.\n\nPARTITION can be used along with a WHERE condition, in which case the\ncondition is tested only on rows in the listed partitions. For example,\nDELETE FROM t PARTITION (p0) WHERE c < 5 deletes rows only from\npartition p0 for which the condition c < 5 is true; rows in any other\npartitions are not checked and thus not affected by the DELETE.\n\nThe PARTITION option can also be used in multiple-table DELETE\nstatements. You can use up to one such option per table named in the\nFROM option.\n\nSee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html,\nfor more information and examples.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/delete.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/delete.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (33,24,'CLOSE','Syntax:\nCLOSE cursor_name\n\nThis statement closes a previously opened cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nAn error occurs if the cursor is not open.\n\nIf not closed explicitly, a cursor is closed at the end of the BEGIN\n... END block in which it was declared.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/close.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/close.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (34,38,'REPLACE FUNCTION','Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REPLACE(\'www.mysql.com\', \'w\', \'Ww\');\n -> \'WwWwWw.mysql.com\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (35,29,'USE','Syntax:\nUSE db_name\n\nThe USE db_name statement tells MySQL to use the db_name database as\nthe default (current) database for subsequent statements. The database\nremains the default until the end of the session or another USE\nstatement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable; # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable; # selects from db2.mytable\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/use.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/use.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (36,7,'CASE OPERATOR','Syntax:\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nThe first version returns the result where value=compare_value. The\nsecond version returns the result for the first condition that is true.\nIf there was no matching result value, the result after ELSE is\nreturned, or NULL if there is no ELSE part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT CASE 1 WHEN 1 THEN \'one\'\n -> WHEN 2 THEN \'two\' ELSE \'more\' END;\n -> \'one\'\nmysql> SELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n -> \'true\'\nmysql> SELECT CASE BINARY \'B\'\n -> WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (37,27,'SHOW MASTER STATUS','Syntax:\nSHOW MASTER STATUS\n\nThis statement provides status information about the binary log files\nof the master. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nExample:\n\nmysql> SHOW MASTER STATUS\\G\n*************************** 1. row ***************************\n File: master-bin.000002\n Position: 1307\n Binlog_Do_DB: test\n Binlog_Ignore_DB: manual, mysql\nExecuted_Gtid_Set: 3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-master-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-master-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (38,35,'SPATIAL','For MyISAM tables, MySQL can create spatial indexes using syntax\nsimilar to that for creating regular indexes, but extended with the\nSPATIAL keyword. Currently, columns in spatial indexes must be declared\nNOT NULL. The following examples demonstrate how to create spatial\nindexes:\n\no With CREATE TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g)) ENGINE=MyISAM;\n\no With ALTER TABLE:\n\nALTER TABLE geom ADD SPATIAL INDEX(g);\n\no With CREATE INDEX:\n\nCREATE SPATIAL INDEX sp_index ON geom (g);\n\nFor MyISAM tables, SPATIAL INDEX creates an R-tree index. For storage\nengines that support nonspatial indexing of spatial columns, the engine\ncreates a B-tree index. A B-tree index on spatial values will be useful\nfor exact-value lookups, but not for range scans.\n\nFor more information on indexing spatial columns, see [HELP CREATE\nINDEX].\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\no With ALTER TABLE:\n\nALTER TABLE geom DROP INDEX g;\n\no With DROP INDEX:\n\nDROP INDEX sp_index ON geom;\n\nExample: Suppose that a table geom contains more than 32,000\ngeometries, which are stored in the column g of type GEOMETRY. The\ntable also has an AUTO_INCREMENT column fid for storing object ID\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-indexes.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-indexes.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (39,32,'TO_SECONDS','Syntax:\nTO_SECONDS(expr)\n\nGiven a date or datetime expr, returns a the number of seconds since\nthe year 0. If expr is not a valid date or datetime value, returns\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TO_SECONDS(950501);\n -> 62966505600\nmysql> SELECT TO_SECONDS(\'2009-11-29\');\n -> 63426672000\nmysql> SELECT TO_SECONDS(\'2009-11-29 13:43:32\');\n -> 63426721412\nmysql> SELECT TO_SECONDS( NOW() );\n -> 63426721458\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (40,32,'TIMESTAMPDIFF','Syntax:\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nReturns datetime_expr2 - datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be\na date and the other a datetime; a date value is treated as a datetime\nhaving the time part \'00:00:00\' where necessary. The unit for the\nresult (an integer) is given by the unit argument. The legal values for\nunit are the same as those listed in the description of the\nTIMESTAMPADD() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n -> 3\nmysql> SELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n -> -1\nmysql> SELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n -> 128885\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (41,38,'REVERSE','Syntax:\nREVERSE(str)\n\nReturns the string str with the order of the characters reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REVERSE(\'abc\');\n -> \'cba\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (42,19,'ISNULL','Syntax:\nISNULL(expr)\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT ISNULL(1+1);\n -> 0\nmysql> SELECT ISNULL(1/0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (43,23,'BINARY','BINARY(M)\n\nThe BINARY type is similar to the CHAR type, but stores binary byte\nstrings rather than nonbinary character strings. M represents the\ncolumn length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (44,23,'BLOB DATA TYPE','A BLOB is a binary large object that can hold a variable amount of\ndata. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.\nThese differ only in the maximum length of the values they can hold.\nThe four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These\ncorrespond to the four BLOB types and have the same maximum lengths and\nstorage requirements. See\nhttp://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/blob.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/blob.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (45,17,'CURRENT_USER','Syntax:\nCURRENT_USER, CURRENT_USER()\n\nReturns the user name and host name combination for the MySQL account\nthat the server used to authenticate the current client. This account\ndetermines your access privileges. The return value is a string in the\nutf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\nmysql> SELECT * FROM mysql.user;\nERROR 1044: Access denied for user \'\'@\'localhost\' to\ndatabase \'mysql\'\nmysql> SELECT CURRENT_USER();\n -> \'@localhost\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (46,19,'<=','Syntax:\n<=\n\nLess than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 0.1 <= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (47,27,'SHOW PROFILES','Syntax:\nSHOW PROFILES\n\nThe SHOW PROFILES statement, together with SHOW PROFILE, displays\nprofiling information that indicates resource usage for statements\nexecuted during the course of the current session. For more\ninformation, see [HELP SHOW PROFILE].\n\n*Note*: These statements are deprecated as of MySQL 5.6.7 and will be\nremoved in a future MySQL release. Use the Performance Schema instead;\nsee http://dev.mysql.com/doc/refman/5.6/en/performance-schema.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-profiles.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-profiles.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (48,28,'UPDATE','Syntax:\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n\nFor the single-table syntax, the UPDATE statement updates columns of\nexisting rows in the named table with new values. The SET clause\nindicates which columns to modify and the values they should be given.\nEach value can be given as an expression, or the keyword DEFAULT to set\na column explicitly to its default value. The WHERE clause, if given,\nspecifies the conditions that identify which rows to update. With no\nWHERE clause, all rows are updated. If the ORDER BY clause is\nspecified, the rows are updated in the order that is specified. The\nLIMIT clause places a limit on the number of rows that can be updated.\n\nFor the multiple-table syntax, UPDATE updates rows in each table named\nin table_references that satisfy the conditions. In this case, ORDER BY\nand LIMIT cannot be used.\n\nFor partitioned tables, both the single-single and multiple-table forms\nof this statement support the use of a PARTITION option as part of a\ntable reference. This option takes a list of one or more partitions or\nsubpartitions (or both). Only the partitions (or subpartitions) listed\nare checked for matches, and a row that is not in any of these\npartitions or subpartitions is not updated, whether it satisfies the\nwhere_condition or not.\n\n*Note*: Unlike the case when using PARTITION with an INSERT or REPLACE\nstatement, an otherwise valid UPDATE ... PARTITION statement is\nconsidered successful even if no rows in the listed partitions (or\nsubpartitions) match the where_condition.\n\nSee http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html,\nfor more information and examples.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe updated. For expression syntax, see\nhttp://dev.mysql.com/doc/refman/5.6/en/expressions.html.\n\ntable_references and where_condition are is specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE\nthat are actually updated. You need only the SELECT privilege for any\ncolumns that are read but not modified.\n\nThe UPDATE statement supports the following modifiers:\n\no With the LOW_PRIORITY keyword, execution of the UPDATE is delayed\n until no other clients are reading from the table. This affects only\n storage engines that use only table-level locking (such as MyISAM,\n MEMORY, and MERGE).\n\no With the IGNORE keyword, the update statement does not abort even if\n errors occur during the update. Rows for which duplicate-key\n conflicts occur are not updated. Rows for which columns are updated\n to values that would cause data conversion errors are updated to the\n closest valid values instead.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/update.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/update.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (49,24,'CASE STATEMENT','Syntax:\nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct.\n\n*Note*: There is also a CASE expression, which differs from the CASE\nstatement described here. See\nhttp://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated\nwith END CASE instead of END.\n\nFor the first syntax, case_value is an expression. This value is\ncompared to the when_value expression in each WHEN clause until one of\nthem is equal. When an equal when_value is found, the corresponding\nTHEN clause statement_list executes. If no when_value is equal, the\nELSE clause statement_list executes, if there is one.\n\nThis syntax cannot be used to test for equality with NULL because NULL\n= NULL is false. See\nhttp://dev.mysql.com/doc/refman/5.6/en/working-with-null.html.\n\nFor the second syntax, each WHEN clause search_condition expression is\nevaluated until one is true, at which point its corresponding THEN\nclause statement_list executes. If no search_condition is equal, the\nELSE clause statement_list executes, if there is one.\n\nIf no when_value or search_condition matches the value tested and the\nCASE statement contains no ELSE clause, a Case not found for CASE\nstatement error results.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nTo handle situations where no value is matched by any WHEN clause, use\nan ELSE containing an empty BEGIN ... END block, as shown in this\nexample. (The indentation used here in the ELSE clause is for purposes\nof clarity only, and is not otherwise significant.)\n\nDELIMITER |\n\nCREATE PROCEDURE p()\n BEGIN\n DECLARE v INT DEFAULT 1;\n\n CASE v\n WHEN 2 THEN SELECT v;\n WHEN 3 THEN SELECT 0;\n ELSE\n BEGIN\n END;\n END CASE;\n END;\n |\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/case.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/case.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (50,8,'EXECUTE STATEMENT','Syntax:\nEXECUTE stmt_name\n [USING @var_name [, @var_name] ...]\n\nAfter preparing a statement with PREPARE, you execute it with an\nEXECUTE statement that refers to the prepared statement name. If the\nprepared statement contains any parameter markers, you must supply a\nUSING clause that lists user variables containing the values to be\nbound to the parameters. Parameter values can be supplied only by user\nvariables, and the USING clause must name exactly as many variables as\nthe number of parameter markers in the statement.\n\nYou can execute a given prepared statement multiple times, passing\ndifferent variables to it or setting the variables to different values\nbefore each execution.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/execute.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/execute.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (51,40,'DROP INDEX','Syntax:\nDROP INDEX index_name ON tbl_name\n [algorithm_option | lock_option] ...\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDROP INDEX drops the index named index_name from the table tbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop the index.\nSee [HELP ALTER TABLE].\n\nTo drop a primary key, the index name is always PRIMARY, which must be\nspecified as a quoted identifier because PRIMARY is a reserved word:\n\nDROP INDEX `PRIMARY` ON t;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (52,4,'ABS','Syntax:\nABS(X)\n\nReturns the absolute value of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ABS(2);\n -> 2\nmysql> SELECT ABS(-32);\n -> 32\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (53,14,'IS_IPV4','Syntax:\nIS_IPV4(expr)\n\nReturns 1 if the argument is a valid IPv4 address specified as a\nstring, 0 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4(\'10.0.5.9\'), IS_IPV4(\'10.0.5.256\');\n -> 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (54,33,'POLYFROMWKB','PolyFromWKB(wkb[,srid]), PolygonFromWKB(wkb[,srid])\n\nConstructs a POLYGON value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (55,38,'NOT LIKE','Syntax:\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (56,38,'SPACE','Syntax:\nSPACE(N)\n\nReturns a string consisting of N space characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SPACE(6);\n -> \' \'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (57,16,'MAX','Syntax:\nMAX([DISTINCT] expr)\n\nReturns the maximum value of expr. MAX() may take a string argument; in\nsuch cases, it returns the maximum string value. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMAX() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (58,22,'CREATE FUNCTION UDF','Syntax:\nCREATE [AGGREGATE] FUNCTION function_name RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n\nA user-defined function (UDF) is a way to extend MySQL with a new\nfunction that works like a native (built-in) MySQL function such as\nABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to\ninvoke the function. The RETURNS clause indicates the type of the\nfunction\'s return value. DECIMAL is a legal value after RETURNS, but\ncurrently DECIMAL functions return string values and should be written\nlike STRING functions.\n\nshared_library_name is the basename of the shared object file that\ncontains the code that implements the function. The file must be\nlocated in the plugin directory. This directory is given by the value\nof the plugin_dir system variable. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/udf-compiling.html.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary because CREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and\nshared library name. If you do not have this table, you should run the\nmysql_upgrade command to create it. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-upgrade.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-function-udf.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (59,23,'TIMESTAMP','TIMESTAMP[(fsp)]\n\nA timestamp. The range is \'1970-01-01 00:00:01.000000\' UTC to\n\'2038-01-19 03:14:07.999999\' UTC. TIMESTAMP values are stored as the\nnumber of seconds since the epoch (\'1970-01-01 00:00:00\' UTC). A\nTIMESTAMP cannot represent the value \'1970-01-01 00:00:00\' because that\nis equivalent to 0 seconds from the epoch and the value 0 is reserved\nfor representing \'0000-00-00 00:00:00\', the "zero" TIMESTAMP value.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nThe way the server handles TIMESTAMP definitions depends on the value\nof the explicit_defaults_for_timestamp system variable (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html).\nBy default, explicit_defaults_for_timestamp is disabled and the server\nhandles TIMESTAMP as follows:\n\nUnless specified otherwise, the first TIMESTAMP column in a table is\ndefined to be automatically set to the date and time of the most recent\nmodification if not explicitly assigned a value. This makes TIMESTAMP\nuseful for recording the timestamp of an INSERT or UPDATE operation.\nYou can also set any TIMESTAMP column to the current date and time by\nassigning it a NULL value, unless it has been defined with the NULL\nattribute to permit NULL values.\n\nAutomatic initialization and updating to the current date and time can\nbe specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE\nCURRENT_TIMESTAMP column definition clauses. By default, the first\nTIMESTAMP column has these properties, as previously noted. As of MySQL\n5.6.5, any TIMESTAMP column in a table can be defined to have these\nproperties. Before 5.6.5, at most one TIMESTAMP column per table can\nhave them, but it is possible to suppress them for the first column and\ninstead assign them to a different TIMESTAMP column. See\nhttp://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html.\n\nIf explicit_defaults_for_timestamp is enabled, there is no automatic\nassignment of the DEFAULT CURRENT_TIMESTAMP or ON UPDATE\nCURRENT_TIMESTAMP attributes to any TIMESTAMP column. They must be\nincluded explicitly in the column definition. Also, any TIMESTAMP not\nexplicitly declared as NOT NULL permits NULL values.\n\nexplicit_defaults_for_timestamp is available as of MySQL 5.6.6. Before\n5.6.6, the server handles TIMESTAMP as discussed for\nexplicit_defaults_for_timestamp disabled. Those behaviors, while they\nremain the default, are nonstandard and are deprecated as of 5.6.6. For\ndiscussion regarding upgrading to an installation with\nexplicit_defaults_for_timestamp enabled, see\nhttp://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.h\ntml.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (60,27,'CACHE INDEX','Syntax:\nCACHE INDEX\n tbl_index_list [, tbl_index_list] ...\n [PARTITION (partition_list | ALL)]\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables. After the indexes have been\nassigned, they can be preloaded into the cache if desired with LOAD\nINDEX INTO CACHE.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table | Op | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status | OK |\n| test.t2 | assign_to_keycache | status | OK |\n| test.t3 | assign_to_keycache | status | OK |\n+---------+--------------------+----------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cache-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (61,12,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n -> 15\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (62,28,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for InnoDB and MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/handler.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (63,9,'HELP_DATE','This help information was generated from the MySQL 5.6 Reference Manual\non: 2013-05-12\n','',''); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (64,40,'RENAME TABLE','Syntax:\nRENAME TABLE tbl_name TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nThis statement renames one or more tables.\n\nThe rename operation is done atomically, which means that no other\nsession can access any of the tables while the rename is running. For\nexample, if you have an existing table old_table, you can create\nanother table new_table that has the same structure but is empty, and\nthen replace the existing table with the empty one as follows (assuming\nthat backup_table does not already exist):\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/rename-table.html\n\n','CREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO old_table;\n','http://dev.mysql.com/doc/refman/5.6/en/rename-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (65,23,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (66,4,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n -> 4\nmysql> SELECT 253 % 7;\n -> 1\nmysql> SELECT MOD(29,9);\n -> 2\nmysql> SELECT 29 MOD 9;\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (67,29,'HELP STATEMENT','Syntax:\nHELP \'search_string\'\n\nThe HELP statement returns online information from the MySQL Reference\nmanual. Its proper operation requires that the help tables in the mysql\ndatabase be initialized with help topic information (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-side-help-support.html).\n\nThe HELP statement searches the help tables for the given search string\nand displays the result of the search. The search string is not case\nsensitive.\n\nThe search string can contain the the wildcard characters "%" and "_".\nThese have the same meaning as for pattern-matching operations\nperformed with the LIKE operator. For example, HELP \'rep%\' returns a\nlist of topics that begin with rep.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/help.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/help.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (68,38,'UCASE','Syntax:\nUCASE(str)\n\nUCASE() is a synonym for UPPER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (69,27,'SHOW BINLOG EVENTS','Syntax:\nSHOW BINLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nShows the events in the binary log. If you do not specify \'log_name\',\nthe first binary log is displayed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-binlog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-binlog-events.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (70,33,'MPOLYFROMWKB','MPolyFromWKB(wkb[,srid]), MultiPolygonFromWKB(wkb[,srid])\n\nConstructs a MULTIPOLYGON value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (71,24,'ITERATE','Syntax:\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements.\nITERATE means "start the loop again."\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/iterate.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/iterate.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (72,28,'DO','Syntax:\nDO expr [, expr] ...\n\nDO executes the expressions but does not return any results. In most\nrespects, DO is shorthand for SELECT expr, ..., but has the advantage\nthat it is slightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/do.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/do.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (73,38,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmulti-byte character counts as a single character. This means that for\na string containing five 2-byte characters, LENGTH() returns 10,\nwhereas CHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (74,23,'DATE','DATE\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MySQL\ndisplays DATE values in \'YYYY-MM-DD\' format, but permits assignment of\nvalues to DATE columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (75,38,'EXTRACTVALUE','Syntax:\nExtractValue(xml_frag, xpath_expr)\n\nExtractValue() takes two string arguments, a fragment of XML markup\nxml_frag and an XPath expression xpath_expr (also known as a locator);\nit returns the text (CDATA) of the first text node which is a child of\nthe elements or elements matched by the XPath expression. In MySQL\n5.6.6 and earlier, the XPath expression could contain at most 127\ncharacters. This limitation was lifted in MySQL 5.6.7. (Bug #13007062,\nBug#62429)\n\nUsing this function is the equivalent of performing a match using the\nxpath_expr after appending /text(). In other words,\nExtractValue(\'Sakila\', \'/a/b\') and\nExtractValue(\'Sakila\', \'/a/b/text()\') produce the same\nresult.\n\nIf multiple matches are found, the content of the first child text node\nof each matching element is returned (in the order matched) as a\nsingle, space-delimited string.\n\nIf no matching text node is found for the expression (including the\nimplicit /text())---for whatever reason, as long as xpath_expr is\nvalid, and xml_frag consists of elements which are properly nested and\nclosed---an empty string is returned. No distinction is made between a\nmatch on an empty element and no match at all. This is by design.\n\nIf you need to determine whether no matching element was found in\nxml_frag or such an element was found but contained no child text\nnodes, you should test the result of an expression that uses the XPath\ncount() function. For example, both of these statements return an empty\nstring, as shown here:\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nHowever, you can determine whether there was actually a matching\nelement using the following:\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 1 |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'\', \'count(/a/b)\') |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n1 row in set (0.01 sec)\n\n*Important*: ExtractValue() returns only CDATA, and does not return any\ntags that might be contained within a matching tag, nor any of their\ncontent (see the result returned as val1 in the following example).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html\n\n','mysql> SELECT\n -> ExtractValue(\'cccddd\', \'/a\') AS val1,\n -> ExtractValue(\'cccddd\', \'/a/b\') AS val2,\n -> ExtractValue(\'cccddd\', \'//b\') AS val3,\n -> ExtractValue(\'cccddd\', \'/b\') AS val4,\n -> ExtractValue(\'cccdddeee\', \'//b\') AS val5;\n\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n','http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (76,12,'OLD_PASSWORD','Syntax:\nOLD_PASSWORD(str)\n\nOLD_PASSWORD() was added when the implementation of PASSWORD() was\nchanged in MySQL 4.1 to improve security. OLD_PASSWORD() returns the\nvalue of the pre-4.1 implementation of PASSWORD() as a string, and is\nintended to permit you to reset passwords for any pre-4.1 clients that\nneed to connect to your version 5.6 MySQL server without locking them\nout. See http://dev.mysql.com/doc/refman/5.6/en/password-hashing.html.\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (77,38,'FORMAT','Syntax:\nFORMAT(X,D[,locale])\n\nFormats the number X to a format like \'#,###,###.##\', rounded to D\ndecimal places, and returns the result as a string. If D is 0, the\nresult has no decimal point or fractional part.\n\nThe optional third parameter enables a locale to be specified to be\nused for the result number\'s decimal point, thousands separator, and\ngrouping between separators. Permissible locale values are the same as\nthe legal values for the lc_time_names system variable (see\nhttp://dev.mysql.com/doc/refman/5.6/en/locale-support.html). If no\nlocale is specified, the default is \'en_US\'.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FORMAT(12332.123456, 4);\n -> \'12,332.1235\'\nmysql> SELECT FORMAT(12332.1,4);\n -> \'12,332.1000\'\nmysql> SELECT FORMAT(12332.2,0);\n -> \'12,332\'\nmysql> SELECT FORMAT(12332.2,2,\'de_DE\');\n -> \'12.332,20\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (78,15,'||','Syntax:\nOR, ||\n\nLogical OR. When both operands are non-NULL, the result is 1 if any\noperand is nonzero, and 0 otherwise. With a NULL operand, the result is\n1 if the other operand is nonzero, and NULL otherwise. If both operands\nare NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 || 1;\n -> 1\nmysql> SELECT 1 || 0;\n -> 1\nmysql> SELECT 0 || 0;\n -> 0\nmysql> SELECT 0 || NULL;\n -> NULL\nmysql> SELECT 1 || NULL;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (79,38,'BIT_LENGTH','Syntax:\nBIT_LENGTH(str)\n\nReturns the length of the string str in bits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT BIT_LENGTH(\'text\');\n -> 32\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (80,2,'EXTERIORRING','ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (81,33,'GEOMFROMWKB','GeomFromWKB(wkb[,srid]), GeometryFromWKB(wkb[,srid])\n\nConstructs a geometry value of any type using its WKB representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (82,19,'BETWEEN AND','Syntax:\nexpr BETWEEN min AND max\n\nIf expr is greater than or equal to min and expr is less than or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is equivalent\nto the expression (min <= expr AND expr <= max) if all the arguments\nare of the same type. Otherwise type conversion takes place according\nto the rules described in\nhttp://dev.mysql.com/doc/refman/5.6/en/type-conversion.html, but\napplied to all the three arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1;\n -> 1, 0\nmysql> SELECT 1 BETWEEN 2 AND 3;\n -> 0\nmysql> SELECT \'b\' BETWEEN \'a\' AND \'c\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'3\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'x-3\';\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (83,25,'MULTIPOLYGON','MultiPolygon(poly1,poly2,...)\n\nConstructs a MultiPolygon value from a set of Polygon or WKB Polygon\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (84,38,'LEFT','Syntax:\nLEFT(str,len)\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LEFT(\'foobarbar\', 5);\n -> \'fooba\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (85,27,'FLUSH QUERY CACHE','You can defragment the query cache to better utilize its memory with\nthe FLUSH QUERY CACHE statement. The statement does not remove any\nqueries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the\nquery cache. The FLUSH TABLES statement also does this.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/query-cache-status-and-maintenance.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/query-cache-status-and-maintenance.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (86,23,'SET DATA TYPE','SET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA set. A string object that can have zero or more values, each of which\nmust be chosen from the list of values \'value1\', \'value2\', ... SET\nvalues are represented internally as integers.\n\nA SET column can have a maximum of 64 distinct members. A table can\nhave no more than 255 unique element list definitions among its ENUM\nand SET columns considered as a group. For more information on this\nlimit, see http://dev.mysql.com/doc/refman/5.6/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (87,4,'RAND','Syntax:\nRAND(), RAND(N)\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. If a\nconstant integer argument N is specified, it is used as the seed value,\nwhich produces a repeatable sequence of column values. In the following\nexample, note that the sequences of values produced by RAND(3) is the\nsame both places where it occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.61914388706828 |\n| 2 | 0.93845168309142 |\n| 3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.35877890638893 |\n| 2 | 0.28941420772058 |\n| 3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (88,38,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (89,23,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (90,38,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nELT() returns the Nth element of the list of strings: str1 if N = 1,\nstr2 if N = 2, and so on. Returns NULL if N is less than 1 or greater\nthan the number of arguments. ELT() is the complement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'ej\'\nmysql> SELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'foo\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (91,40,'ALTER VIEW','Syntax:\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW and the effect is the same as\nfor CREATE OR REPLACE VIEW. See [HELP CREATE VIEW]. This statement\nrequires the CREATE VIEW and DROP privileges for the view, and some\nprivilege for each column referred to in the SELECT statement. ALTER\nVIEW is permitted only to the definer or users with the SUPER\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (92,27,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-databases.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (93,32,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n -> 3938\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (94,38,'LOCATE','Syntax:\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nThe first syntax returns the position of the first occurrence of\nsubstring substr in string str. The second syntax returns the position\nof the first occurrence of substring substr in string str, starting at\nposition pos. Returns 0 if substr is not in str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LOCATE(\'bar\', \'foobarbar\');\n -> 4\nmysql> SELECT LOCATE(\'xbar\', \'foobar\');\n -> 0\nmysql> SELECT LOCATE(\'bar\', \'foobarbar\', 5);\n -> 7\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (95,27,'SHOW EVENTS','Syntax:\nSHOW EVENTS [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement displays information about Event Manager events. It\nrequires the EVENT privilege for the database from which the events are\nto be shown.\n\nIn its simplest form, SHOW EVENTS lists all of the events in the\ncurrent schema:\n\nmysql> SELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n1 row in set (0.00 sec)\n\nmysql> SHOW EVENTS\\G\n*************************** 1. row ***************************\n Db: myschema\n Name: e_daily\n Definer: jon@ghidora\n Time zone: SYSTEM\n Type: RECURRING\n Execute at: NULL\n Interval value: 10\n Interval field: SECOND\n Starts: 2006-02-09 10:41:23\n Ends: NULL\n Status: ENABLED\n Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nTo see events for a specific schema, use the FROM clause. For example,\nto see events for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-events.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (96,23,'LONGTEXT','LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\ncharacters. The effective maximum length is less if the value contains\nmulti-byte characters. The effective maximum length of LONGTEXT columns\nalso depends on the configured maximum packet size in the client/server\nprotocol and available memory. Each LONGTEXT value is stored using a\n4-byte length prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (97,27,'KILL','Syntax:\nKILL [CONNECTION | QUERY] thread_id\n\nEach connection to mysqld runs in a separate thread. You can see which\nthreads are running with the SHOW PROCESSLIST statement and kill a\nthread with the KILL thread_id statement.\n\nKILL permits an optional CONNECTION or QUERY modifier:\n\no KILL CONNECTION is the same as KILL with no modifier: It terminates\n the connection associated with the given thread_id.\n\no KILL QUERY terminates the statement that the connection is currently\n executing, but leaves the connection itself intact.\n\nIf you have the PROCESS privilege, you can see all threads. If you have\nthe SUPER privilege, you can kill all threads and statements.\nOtherwise, you can see and kill only your own threads and statements.\n\nYou can also use the mysqladmin processlist and mysqladmin kill\ncommands to examine and kill threads.\n\n*Note*: You cannot use KILL with the Embedded MySQL Server library\nbecause the embedded server merely runs inside the threads of the host\napplication. It does not create any connection threads of its own.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/kill.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/kill.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (98,31,'DISJOINT','Disjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (99,38,'LPAD','Syntax:\nLPAD(str,len,padstr)\n\nReturns the string str, left-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LPAD(\'hi\',4,\'??\');\n -> \'??hi\'\nmysql> SELECT LPAD(\'hi\',1,\'??\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (100,31,'OVERLAPS','Overlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (101,8,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (102,6,'MBREQUAL','MBREqual(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (103,34,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n that ANALYSE() notices per column. This is used by ANALYSE() to check\n whether the optimal data type should be of type ENUM; if there are\n more than max_elements distinct values, then ENUM is not a suggested\n type.\n\no max_memory (default 8192) is the maximum amount of memory that\n ANALYSE() should allocate per column while trying to find all\n distinct values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (104,9,'HELP_VERSION','This help information was generated from the MySQL 5.6 Reference Manual\non: 2013-05-12 (revision: 35152)\n\nThis information applies to MySQL 5.6 through 5.6.13.\n','',''); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (105,38,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (106,27,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-privileges.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (107,40,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n ADD DATAFILE \'file_name\'\n USE LOGFILE GROUP logfile_group\n [EXTENT_SIZE [=] extent_size]\n [INITIAL_SIZE [=] initial_size]\n [AUTOEXTEND_SIZE [=] autoextend_size]\n [MAX_SIZE [=] max_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] comment_text]\n ENGINE [=] engine_name\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for tables. One data file is\ncreated and added to the tablespace using this statement. Additional\ndata files may be added to the tablespace by using the ALTER TABLESPACE\nstatement (see [HELP ALTER TABLESPACE]). For rules covering the naming\nof tablespaces, see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and a log file group with the same name, or a\ntablespace and a data file with the same name.\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see\nhttp://dev.mysql.com/doc/refman/5.6/en/create-logfile-group.html).\nMultiple tablespaces may use the same log file group for UNDO logging.\n\nThe EXTENT_SIZE sets the size, in bytes, of the extents used by any\nfiles belonging to the tablespace. The default value is 1M. The minimum\nsize is 32K, and theoretical maximum is 2G, although the practical\nmaximum size depends on a number of factors. In most cases, changing\nthe extent size does not have any measurable effect on performance, and\nthe default value is recommended for all but the most unusual\nsituations.\n\nAn extent is a unit of disk space allocation. One extent is filled with\nas much data as that extent can contain before another extent is used.\nIn theory, up to 65,535 (64K) extents may used per data file; however,\nthe recommended maximum is 32,768 (32K). The recommended maximum size\nfor a single data file is 32G---that is, 32K extents x 1 MB per extent.\nIn addition, once an extent is allocated to a given partition, it\ncannot be used to store data from a different partition; an extent\ncannot store data from more than one partition. This means, for example\nthat a tablespace having a single datafile whose INITIAL_SIZE is 256 MB\nand whose EXTENT_SIZE is 128M has just two extents, and so can be used\nto store data from at most two different disk data table partitions.\n\nYou can see how many extents remain free in a given data file by\nquerying the INFORMATION_SCHEMA.FILES table, and so derive an estimate\nfor how much space remains free in the file. For further discussion and\nexamples, see http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nThe INITIAL_SIZE parameter sets the data file\'s total size in bytes.\nOnce the file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using ALTER TABLESPACE\n... ADD DATAFILE. See [HELP ALTER TABLESPACE].\n\nINITIAL_SIZE is optional; its default value is 128M.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nWhen setting EXTENT_SIZE or INITIAL_SIZE (either or both), you may\noptionally follow the number with a one-letter abbreviation for an\norder of magnitude, similar to those used in my.cnf. Generally, this is\none of the letters M (for megabytes) or G (for gigabytes).\n\nINITIAL_SIZE, EXTENT_SIZE, and UNDO_BUFFER_SIZE are subject to rounding\nas follows:\n\no EXTENT_SIZE and UNDO_BUFFER_SIZE are each rounded up to the nearest\n whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K.\n\n For data files, INITIAL_SIZE is subject to further rounding; the\n result just obtained is rounded up to the nearest whole multiple of\n EXTENT_SIZE (after any rounding).\n\nThe rounding just described is done explicitly, and a warning is issued\nby the MySQL Server when any such rounding is performed. The rounded\nvalues are also used by the NDB kernel for calculating\nINFORMATION_SCHEMA.FILES column values and other purposes. However, to\navoid an unexpected result, we suggest that you always use whole\nmultiples of 32K in specifying these options.\n\nAUTOEXTEND_SIZE, MAX_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but\nignored, and so currently have no effect. These options are intended\nfor future expansion.\n\nThe ENGINE parameter determines the storage engine which uses this\ntablespace, with engine_name being the name of the storage engine.\nCurrently, engine_name must be one of the values NDB or NDBCLUSTER.\n\nWhen CREATE TABLESPACE is used with ENGINE = NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+-------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+-------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n+--------------------+-------------+----------------+\n2 rows in set (0.01 sec)\n\n(See http://dev.mysql.com/doc/refman/5.6/en/files-table.html.)\n\nCREATE TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-tablespace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (108,38,'INSERT FUNCTION','Syntax:\nINSERT(str,pos,len,newstr)\n\nReturns the string str, with the substring beginning at position pos\nand len characters long replaced by the string newstr. Returns the\noriginal string if pos is not within the length of the string. Replaces\nthe rest of the string from position pos if len is not within the\nlength of the rest of the string. Returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n -> \'QuWhattic\'\nmysql> SELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n -> \'Quadratic\'\nmysql> SELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n -> \'QuWhat\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (109,15,'XOR','Syntax:\nXOR\n\nLogical XOR. Returns NULL if either operand is NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is nonzero,\notherwise 0 is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 XOR 1;\n -> 0\nmysql> SELECT 1 XOR 0;\n -> 1\nmysql> SELECT 1 XOR NULL;\n -> NULL\nmysql> SELECT 1 XOR 1 XOR 1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (110,10,'GRANT','Syntax:\nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user_specification [, user_specification] ...\n [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]\n [WITH with_option ...]\n\nGRANT PROXY ON user_specification\n TO user_specification [, user_specification] ...\n [WITH GRANT OPTION]\n\nobject_type:\n TABLE\n | FUNCTION\n | PROCEDURE\n\npriv_level:\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n\nuser_specification:\n user\n [\n IDENTIFIED BY [PASSWORD] \'password\'\n | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\n ]\n\nssl_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nwith_option:\n GRANT OPTION\n | MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n\nThe GRANT statement grants privileges to MySQL user accounts. GRANT\nalso serves to specify other account characteristics such as use of\nsecure connections and limits on access to server resources. To use\nGRANT, you must have the GRANT OPTION privilege, and you must have the\nprivileges that you are granting.\n\nNormally, a database administrator first uses CREATE USER to create an\naccount, then GRANT to define its privileges and characteristics. For\nexample:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\nGRANT SELECT ON db2.invoice TO \'jeffrey\'@\'localhost\';\nGRANT USAGE ON *.* TO \'jeffrey\'@\'localhost\' WITH MAX_QUERIES_PER_HOUR 90;\n\nHowever, if an account named in a GRANT statement does not already\nexist, GRANT may create it under the conditions described later in the\ndiscussion of the NO_AUTO_CREATE_USER SQL mode.\n\nThe REVOKE statement is related to GRANT and enables administrators to\nremove account privileges. See [HELP REVOKE].\n\nWhen successfully executed from the mysql program, GRANT responds with\nQuery OK, 0 rows affected. To determine what privileges result from the\noperation, use SHOW GRANTS. See [HELP SHOW GRANTS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/grant.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/grant.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (111,6,'MBRINTERSECTS','MBRIntersects(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 intersect.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (112,19,'IS NOT','Syntax:\nIS NOT boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (113,4,'SQRT','Syntax:\nSQRT(X)\n\nReturns the square root of a nonnegative number X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SQRT(4);\n -> 2\nmysql> SELECT SQRT(20);\n -> 4.4721359549996\nmysql> SELECT SQRT(-16);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (114,40,'CREATE INDEX','Syntax:\nCREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name\n [index_type]\n ON tbl_name (index_col_name,...)\n [algorithm_option | lock_option] ...\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n\nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes.\nSee [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY\nKEY; use ALTER TABLE instead. For more information about indexes, see\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (115,40,'ALTER DATABASE','Syntax:\nALTER {DATABASE | SCHEMA} [db_name]\n alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the\ndatabase directory. To use ALTER DATABASE, you need the ALTER privilege\non the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe database name can be omitted from the first syntax, in which case\nthe statement applies to the default database.\n\nNational Language Characteristics\n\nThe CHARACTER SET clause changes the default database character set.\nThe COLLATE clause changes the default database collation.\nhttp://dev.mysql.com/doc/refman/5.6/en/charset.html, discusses\ncharacter set and collation names.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See\n[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more\ninformation.\n\nIf you change the default character set or collation for a database,\nstored routines that use the database defaults must be dropped and\nrecreated so that they use the new defaults. (In a stored routine,\nvariables with character data types use the database defaults if the\ncharacter set or collation are not specified explicitly. See [HELP\nCREATE PROCEDURE].)\n\nUpgrading from Versions Older than MySQL 5.1\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause updates\nthe name of the directory associated with the database to use the\nencoding implemented in MySQL 5.1 for mapping database names to\ndatabase directory names (see\nhttp://dev.mysql.com/doc/refman/5.6/en/identifier-mapping.html). This\nclause is for use under these conditions:\n\no It is intended when upgrading MySQL to 5.1 or later from older\n versions.\n\no It is intended to update a database directory name to the current\n encoding format if the name contains special characters that need\n encoding.\n\no The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example, if a database in MySQL 5.0 has the name a-b-c, the name\ncontains instances of the - (dash) character. In MySQL 5.0, the\ndatabase directory is also named a-b-c, which is not necessarily safe\nfor all file systems. In MySQL 5.1 and later, the same database name is\nencoded as a@002db@002dc to produce a file system-neutral directory\nname.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an\nolder version,the server displays a name such as a-b-c (which is in the\nold format) as #mysql50#a-b-c, and you must refer to the name using the\n#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to\nexplicitly tell the server to re-encode the database directory name to\nthe current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c\nwithout the special #mysql50# prefix.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (116,26,'GEOMETRYN','GeometryN(gc,N)\n\nReturns the N-th geometry in the GeometryCollection value gc.\nGeometries are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1) |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (117,20,'<<','Syntax:\n<<\n\nShifts a longlong (BIGINT) number to the left.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 1 << 2;\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (118,27,'SHOW TABLE STATUS','Syntax:\nSHOW TABLE STATUS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of\ninformation about each non-TEMPORARY table. You can also get this list\nusing the mysqlshow --status db_name command. The LIKE clause, if\npresent, indicates which table names to match. The WHERE clause can be\ngiven to select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-table-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-table-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (119,38,'ASCII','Syntax:\nASCII(str)\n\nReturns the numeric value of the leftmost character of the string str.\nReturns 0 if str is the empty string. Returns NULL if str is NULL.\nASCII() works for 8-bit characters.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ASCII(\'2\');\n -> 50\nmysql> SELECT ASCII(2);\n -> 50\nmysql> SELECT ASCII(\'dx\');\n -> 100\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (120,4,'DIV','Syntax:\nDIV\n\nInteger division. Similar to FLOOR(), but is safe with BIGINT values.\n\nIn MySQL 5.6, if either operand has a noninteger type, the operands are\nconverted to DECIMAL and divided using DECIMAL arithmetic before\nconverting the result to BIGINT. If the result exceeds BIGINT range, an\nerror occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 5 DIV 2;\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (121,27,'SHOW SLAVE STATUS','Syntax:\nSHOW SLAVE STATUS\n\nThis statement provides status information on essential parameters of\nthe slave threads. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nIf you issue this statement using the mysql client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout:\n\nmysql> SHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: localhost\n Master_User: root\n Master_Port: 13000\n Connect_Retry: 60\n Master_Log_File: master-bin.000002\n Read_Master_Log_Pos: 1307\n Relay_Log_File: slave-relay-bin.000003\n Relay_Log_Pos: 1508\n Relay_Master_Log_File: master-bin.000002\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB:\n Replicate_Ignore_DB:\n Replicate_Do_Table:\n Replicate_Ignore_Table:\n Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n Last_Errno: 0\n Last_Error:\n Skip_Counter: 0\n Exec_Master_Log_Pos: 1307\n Relay_Log_Space: 1858\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n Master_Server_Id: 1\n Master_UUID: 3e11fa47-71ca-11e1-9e33-c80aa9429562\n Master_Info_File: /var/mysqld.2/data/master.info\n SQL_Delay: 0\n SQL_Remaining_Delay: NULL\n Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it\n Master_Retry_Count: 10\n Master_Bind:\n Last_IO_Error_Timestamp:\n Last_SQL_Error_Timestamp:\n Master_SSL_Crl:\n Master_SSL_Crlpath:\n Retrieved_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Executed_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5\n Auto_Position: 1\n1 row in set (0.00 sec)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (122,35,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Currently,\nspatial columns are supported for MyISAM, InnoDB, NDB, and ARCHIVE\ntables. See also the annotations about spatial indexes under [HELP\nSPATIAL].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-columns.html\n\n','CREATE TABLE geom (g GEOMETRY);\n','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-columns.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (123,20,'&','Syntax:\n&\n\nBitwise AND:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 29 & 15;\n -> 13\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (124,15,'ASSIGN-EQUAL','Syntax:\n=\n\nThis operator is used to perform value assignments in two cases,\ndescribed in the next two paragraphs.\n\nWithin a SET statement, = is treated as an assignment operator that\ncauses the user variable on the left hand side of the operator to take\non the value to its right. (In other words, when used in a SET\nstatement, = is treated identically to :=.) The value on the right hand\nside may be a literal value, another variable storing a value, or any\nlegal expression that yields a scalar value, including the result of a\nquery (provided that this value is a scalar value). You can perform\nmultiple assignments in the same SET statement.\n\nIn the SET clause of an UPDATE statement, = also acts as an assignment\noperator; in this case, however, it causes the column named on the left\nhand side of the operator to assume the value given to the right,\nprovided any WHERE conditions that are part of the UPDATE are met. You\ncan make multiple assignments in the same SET clause of an UPDATE\nstatement.\n\nIn any other context, = is treated as a comparison operator.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n','http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (125,38,'CONVERT','Syntax:\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nThe CONVERT() and CAST() functions take an expression of any type and\nproduce a result value of a specified type.\n\nThe type for the result can be one of the following values:\n\no BINARY[(N)]\n\no CHAR[(N)]\n\no DATE\n\no DATETIME\n\no DECIMAL[(M[,D])]\n\no SIGNED [INTEGER]\n\no TIME\n\no UNSIGNED [INTEGER]\n\nBINARY produces a string with the BINARY data type. See\nhttp://dev.mysql.com/doc/refman/5.6/en/binary-varbinary.html for a\ndescription of how this affects comparisons. If the optional length N\nis given, BINARY(N) causes the cast to use no more than N bytes of the\nargument. Values shorter than N bytes are padded with 0x00 bytes to a\nlength of N.\n\nCHAR(N) causes the cast to use no more than N characters of the\nargument.\n\nCAST() and CONVERT(... USING ...) are standard SQL syntax. The\nnon-USING form of CONVERT() is ODBC syntax.\n\nCONVERT() with USING is used to convert data between different\ncharacter sets. In MySQL, transcoding names are the same as the\ncorresponding character set names. For example, this statement converts\nthe string \'abc\' in the default character set to the corresponding\nstring in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','SELECT enum_col FROM tbl_name ORDER BY CAST(enum_col AS CHAR);\n','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (126,24,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition expression is true. Thus, a REPEAT always enters the\nloop at least once. statement_list consists of one or more statements,\neach terminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/repeat.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n -> BEGIN\n -> SET @x = 0;\n -> REPEAT\n -> SET @x = @x + 1;\n -> UNTIL @x > p1 END REPEAT;\n -> END\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/repeat.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (127,23,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (128,23,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (129,38,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multi-byte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 2562) ...\n\nIf the leftmost character is not a multi-byte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (130,37,'ENVELOPE','Envelope(g)\n\nReturns the Minimum Bounding Rectangle (MBR) for the geometry value g.\nThe result is returned as a Polygon value.\n\nThe polygon is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SELECT AsText(Envelope(GeomFromText(\'LineString(1 1,2 2)\')));\n+-------------------------------------------------------+\n| AsText(Envelope(GeomFromText(\'LineString(1 1,2 2)\'))) |\n+-------------------------------------------------------+\n| POLYGON((1 1,2 1,2 2,1 2,1 1)) |\n+-------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (131,14,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of an IPv4 network address as a\nstring, returns an integer that represents the numeric value of the\naddress in network byte order (big endian). INET_ATON() returns NULL if\nit does not understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'10.0.5.9\');\n -> 167773449\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (132,37,'ISSIMPLE','IsSimple(g)\n\nReturns 1 if the geometry value g has no anomalous geometric points,\nsuch as self-intersection or self-tangency. IsSimple() returns 0 if the\nargument is not simple, and NULL if it is NULL.\n\nThe description of each instantiable geometric class given earlier in\nthe chapter includes the specific conditions that cause an instance of\nthat class to be classified as not simple. (See [HELP Geometry\nhierarchy].)\n\nPrior to MySQL 5.6.1, this function always returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (133,4,'- BINARY','Syntax:\n-\n\nSubtraction:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3-5;\n -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (134,3,'WKT DEFINITION','The Well-Known Text (WKT) representation of Geometry is designed to\nexchange geometry data in ASCII form. For a Backus-Naur grammar that\nspecifies the formal production rules for writing WKT values, see the\nOpenGIS specification document referenced in\nhttp://dev.mysql.com/doc/refman/5.6/en/spatial-extensions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-format.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-format.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (135,32,'CURRENT_TIME','Syntax:\nCURRENT_TIME, CURRENT_TIME([fsp])\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (136,10,'REVOKE','Syntax:\nREVOKE\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL PRIVILEGES, GRANT OPTION\n FROM user [, user] ...\n\nREVOKE PROXY ON user\n FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts. Each account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nREVOKE INSERT ON *.* FROM \'jeffrey\'@\'localhost\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nFor details on the levels at which privileges exist, the permissible\npriv_type and priv_level values, and the syntax for specifying users\nand passwords, see [HELP GRANT]\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege or the UPDATE privilege for the mysql database.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/revoke.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (137,32,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (138,23,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (139,38,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar \');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (140,29,'EXPLAIN','Syntax:\n{EXPLAIN | DESCRIBE | DESC}\n tbl_name [col_name | wild]\n\n{EXPLAIN | DESCRIBE | DESC}\n [explain_type] explainable_stmt\n\nexplain_type:\n EXTENDED\n | PARTITIONS\n | FORMAT = format_name\n\nformat_name:\n TRADITIONAL\n | JSON\n\nexplainable_stmt:\n SELECT statement\n | DELETE statement\n | INSERT statement\n | REPLACE statement\n | UPDATE statement\n\nThe DESCRIBE and EXPLAIN statements are synonyms. In practice, the\nDESCRIBE keyword is more often used to obtain information about table\nstructure, whereas EXPLAIN is used to obtain a query execution plan\n(that is, an explanation of how MySQL would execute a query). The\nfollowing discussion uses the DESCRIBE and EXPLAIN keywords in\naccordance with those uses, but the MySQL parser treats them as\ncompletely synonymous.\n\nObtaining Table Structure Information\n\nDESCRIBE provides information about the columns in a table. It is a\nshortcut for SHOW COLUMNS FROM. These statements also display\ninformation for views. (See [HELP SHOW COLUMNS].)\n\ncol_name can be a column name, or a string containing the SQL "%" and\n"_" wildcard characters to obtain output only for the columns with\nnames matching the string. There is no need to enclose the string\nwithin quotation marks unless it contains spaces or other special\ncharacters.\n\nmysql> DESCRIBE City;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n5 rows in set (0.00 sec)\n\nThe description for SHOW COLUMNS provides more information about the\noutput columns (see [HELP SHOW COLUMNS]).\n\nIf the data types differ from what you expect them to be based on a\nCREATE TABLE statement, note that MySQL sometimes changes data types\nwhen you create or alter a table. The conditions under which this\noccurs are described in\nhttp://dev.mysql.com/doc/refman/5.6/en/silent-column-changes.html.\n\nThe DESCRIBE statement is provided for compatibility with Oracle.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nObtaining Query Execution Plan Information\n\nThe EXPLAIN statement provides a way to obtain information about how\nMySQL executes a statement:\n\no When you precede a statement with the keyword EXPLAIN, MySQL displays\n information from the optimizer about the statement execution plan.\n That is, MySQL explains how it would process the statement, including\n information about how tables are joined and in which order. EXPLAIN\n EXTENDED can be used to obtain additional information.\n\n As of MySQL 5.6.3, EXPLAIN provides information about SELECT, DELETE,\n INSERT, REPLACE, and UPDATE statements. Before MySQL 5.6.3, EXPLAIN\n provides information only about SELECT statements.\n\n For information about using EXPLAIN and EXPLAIN EXTENDED to obtain\n query execution plan information, see\n http://dev.mysql.com/doc/refman/5.6/en/using-explain.html.\n\no EXPLAIN PARTITIONS is useful only when examining queries involving\n partitioned tables. For details, see\n http://dev.mysql.com/doc/refman/5.6/en/partitioning-info.html.\n\no As of MySQL 5.6.5, the FORMAT option can be used to select the output\n format. TRADITIONAL presents the output in tabular format. This is\n the default if no FORMAT option is present. JSON format displays the\n information in JSON format. With FORMAT = JSON, the output includes\n extended and partition information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/explain.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (141,4,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n -> 180\nmysql> SELECT DEGREES(PI() / 2);\n -> 90\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (142,4,'- UNARY','Syntax:\n-\n\nUnary minus. This operator changes the sign of the operand.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT - 2;\n -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (143,23,'VARCHAR','[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,535. The effective maximum length\nof a VARCHAR is subject to the maximum row size (65,535 bytes, which is\nshared among all columns) and the character set used. For example, utf8\ncharacters can require up to three bytes per character, so a VARCHAR\ncolumn that uses the utf8 character set can be declared to be a maximum\nof 21,844 characters. See\nhttp://dev.mysql.com/doc/refman/5.6/en/column-count-limit.html.\n\nMySQL stores VARCHAR values as a 1-byte or 2-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A\nVARCHAR column uses one length byte if values require no more than 255\nbytes, two length bytes if values may require more than 255 bytes.\n\n*Note*: MySQL 5.6 follows the standard SQL specification, and does not\nremove trailing spaces from VARCHAR values.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the\nstandard SQL way to define that a VARCHAR column should use some\npredefined character set. MySQL 4.1 and up uses utf8 as this predefined\ncharacter set.\nhttp://dev.mysql.com/doc/refman/5.6/en/charset-national.html. NVARCHAR\nis shorthand for NATIONAL VARCHAR.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (144,38,'UNHEX','Syntax:\n\nUNHEX(str)\n\nFor a string argument str, UNHEX(str) performs the inverse operation of\nHEX(str). That is, it interprets each pair of characters in the\nargument as a hexadecimal number and converts it to the character\nrepresented by the number. The return value is a binary string.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT UNHEX(\'4D7953514C\');\n -> \'MySQL\'\nmysql> SELECT 0x4D7953514C;\n -> \'MySQL\'\nmysql> SELECT UNHEX(HEX(\'string\'));\n -> \'string\'\nmysql> SELECT HEX(UNHEX(\'1267\'));\n -> \'1267\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (145,40,'DROP TRIGGER','Syntax:\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nThis statement drops a trigger. The schema (database) name is optional.\nIf the schema is omitted, the trigger is dropped from the default\nschema. DROP TRIGGER requires the TRIGGER privilege for the table\nassociated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that\ndoes not exist. A NOTE is generated for a nonexistent trigger when\nusing IF EXISTS. See [HELP SHOW WARNINGS].\n\nTriggers for a table are also dropped if you drop the table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-trigger.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (146,8,'RESET MASTER','Syntax:\nRESET MASTER\n\nDeletes all binary log files listed in the index file, resets the\nbinary log index file to be empty, and creates a new binary log file.\n\nIn MySQL 5.6.5 and later, RESET MASTER also clears the values of the\ngtid_purged system variable (known as gtid_lost in MySQL 5.6.8 and\nearlier) as well as the global value of the gtid_executed (gtid_done,\nprior to MySQL 5.6.9) system variable (but not its session value); that\nis, executing this statement sets each of these values to an empty\nstring (\'\').\n\nThis statement is intended to be used only when the master is started\nfor the first time.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset-master.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset-master.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (147,4,'PI','Syntax:\nPI()\n\nReturns the value of π (pi). The default number of decimal places\ndisplayed is seven, but MySQL uses the full double-precision value\ninternally.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT PI();\n -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n -> 3.141592653589793116\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (148,4,'/','Syntax:\n/\n\nDivision:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3/5;\n -> 0.60\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (149,8,'PURGE BINARY LOGS','Syntax:\nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n\nThe binary log is a set of files that contain information about data\nmodifications made by the MySQL server. The log consists of a set of\nbinary log files, plus an index file (see\nhttp://dev.mysql.com/doc/refman/5.6/en/binary-log.html).\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed\nin the log index file prior to the specified log file name or date.\nBINARY and MASTER are synonyms. Deleted log files also are removed from\nthe list recorded in the index file, so that the given log file becomes\nthe first in the list.\n\nThis statement has no effect if the server was not started with the\n--log-bin option to enable binary logging.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/purge-binary-logs.html\n\n','PURGE BINARY LOGS TO \'mysql-bin.010\';\nPURGE BINARY LOGS BEFORE \'2008-04-02 22:46:26\';\n','http://dev.mysql.com/doc/refman/5.6/en/purge-binary-logs.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (150,16,'STDDEV_SAMP','Syntax:\nSTDDEV_SAMP(expr)\n\nReturns the sample standard deviation of expr (the square root of\nVAR_SAMP().\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (151,31,'ST_TOUCHES','ST_Touches(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two\ngeometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either\nthe boundary or the interior of the other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (152,17,'SCHEMA','Syntax:\nSCHEMA()\n\nThis function is a synonym for DATABASE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (153,33,'MLINEFROMWKB','MLineFromWKB(wkb[,srid]), MultiLineStringFromWKB(wkb[,srid])\n\nConstructs a MULTILINESTRING value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (154,27,'SHOW CREATE TABLE','Syntax:\nSHOW CREATE TABLE tbl_name\n\nShows the CREATE TABLE statement that creates the given table. To use\nthis statement, you must have some privilege for the table. This\nstatement also works with views.\nSHOW CREATE TABLE quotes table and column names according to the value\nof the sql_quote_show_create option. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-table.html\n\n','mysql> SHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n Table: t\nCreate Table: CREATE TABLE t (\n id INT(11) default NULL auto_increment,\n s char(60) default NULL,\n PRIMARY KEY (id)\n) ENGINE=MyISAM\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (155,28,'DUAL','You are permitted to specify DUAL as a dummy table name in situations\nwhere no tables are referenced:\n\nmysql> SELECT 1 + 1 FROM DUAL;\n -> 2\n\nDUAL is purely for the convenience of people who require that all\nSELECT statements should have FROM and possibly other clauses. MySQL\nmay ignore the clauses. MySQL does not require FROM DUAL if no tables\nare referenced.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/select.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (156,38,'INSTR','Syntax:\nINSTR(str,substr)\n\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of LOCATE(),\nexcept that the order of the arguments is reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT INSTR(\'foobarbar\', \'bar\');\n -> 4\nmysql> SELECT INSTR(\'xbar\', \'foobar\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (157,19,'>=','Syntax:\n>=\n\nGreater than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 >= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (158,4,'EXP','Syntax:\nEXP(X)\n\nReturns the value of e (the base of natural logarithms) raised to the\npower of X. The inverse of this function is LOG() (using a single\nargument only) or LN().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT EXP(2);\n -> 7.3890560989307\nmysql> SELECT EXP(-2);\n -> 0.13533528323661\nmysql> SELECT EXP(0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (159,13,'POINTN','PointN(ls,N)\n\nReturns the N-th Point in the Linestring value ls. Points are numbered\nbeginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2) |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (160,38,'OCT','Syntax:\nOCT(N)\n\nReturns a string representation of the octal value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT OCT(12);\n -> \'14\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (161,32,'SYSDATE','Syntax:\nSYSDATE()\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the\ntime at which the statement began to execute. (Within a stored function\nor trigger, NOW() returns the time at which the function or triggering\nstatement began to execute.)\n\nmysql> SELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |\n+---------------------+----------+---------------------+\n\nmysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |\n+---------------------+----------+---------------------+\n\nIn addition, the SET TIMESTAMP statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp settings in the\nbinary log have no effect on invocations of SYSDATE().\n\nBecause SYSDATE() can return different values even within the same\nstatement, and is not affected by SET TIMESTAMP, it is nondeterministic\nand therefore unsafe for replication if statement-based binary logging\nis used. If that is a problem, you can use row-based logging.\n\nAlternatively, you can use the --sysdate-is-now option to cause\nSYSDATE() to be an alias for NOW(). This works if the option is used on\nboth the master and the slave.\n\nThe nondeterministic nature of SYSDATE() also means that indexes cannot\nbe used for evaluating expressions that refer to it.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (162,5,'UNINSTALL PLUGIN','Syntax:\nUNINSTALL PLUGIN plugin_name\n\nThis statement removes an installed server plugin. It requires the\nDELETE privilege for the mysql.plugin table.\n\nplugin_name must be the name of some plugin that is listed in the\nmysql.plugin table. The server executes the plugin\'s deinitialization\nfunction and removes the row for the plugin from the mysql.plugin\ntable, so that subsequent server restarts will not load and initialize\nthe plugin. UNINSTALL PLUGIN does not remove the plugin\'s shared\nlibrary file.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/uninstall-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/uninstall-plugin.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (163,33,'ASBINARY','AsBinary(g), AsWKB(g)\n\nConverts a value in internal geometry format to its WKB representation\nand returns the binary result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-to-convert-geometries-between-formats.html\n\n','SELECT AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.6/en/functions-to-convert-geometries-between-formats.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (164,27,'SHOW TABLES','Syntax:\nSHOW [FULL] TABLES [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLES lists the non-TEMPORARY tables in a given database. You can\nalso get this list using the mysqlshow db_name command. The LIKE\nclause, if present, indicates which table names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nMatching performed by the LIKE clause is dependent on the setting of\nthe lower_case_table_names system variable.\n\nThis statement also lists any views in the database. The FULL modifier\nis supported such that SHOW FULL TABLES displays a second output\ncolumn. Values for the second column are BASE TABLE for a table and\nVIEW for a view.\n\nIf you have no privileges for a base table or view, it does not show up\nin the output from SHOW TABLES or mysqlshow db_name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-tables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (165,32,'MAKEDATE','Syntax:\nMAKEDATE(year,dayofyear)\n\nReturns a date, given year and day-of-year values. dayofyear must be\ngreater than 0 or the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n -> \'2011-01-31\', \'2011-02-01\'\nmysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n -> \'2011-12-31\', \'2014-12-31\'\nmysql> SELECT MAKEDATE(2011,0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (166,38,'BINARY OPERATOR','Syntax:\nBINARY\n\nThe BINARY operator casts the string following it to a binary string.\nThis is an easy way to force a column comparison to be done byte by\nbyte rather than character by character. This causes the comparison to\nbe case sensitive even if the column is not defined as BINARY or BLOB.\nBINARY also causes trailing spaces to be significant.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','mysql> SELECT \'a\' = \'A\';\n -> 1\nmysql> SELECT BINARY \'a\' = \'A\';\n -> 0\nmysql> SELECT \'a\' = \'a \';\n -> 1\nmysql> SELECT BINARY \'a\' = \'a \';\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (167,6,'MBROVERLAPS','MBROverlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 overlap. The term spatially overlaps is\nused if two geometries intersect and their intersection results in a\ngeometry of the same dimension but not equal to either of the given\ngeometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (168,28,'INSERT SELECT','Syntax:\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name \n [PARTITION (partition_name,...)]\n [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table\nfrom one or many tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert-select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert-select.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (169,40,'CREATE PROCEDURE','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n FUNCTION sp_name ([func_parameter[,...]])\n RETURNS type\n [characteristic ...] routine_body\n\nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n\nfunc_parameter:\n param_name type\n\ntype:\n Any valid MySQL data type\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nroutine_body:\n Valid SQL routine statement\n\nThese statements create stored routines. By default, a routine is\nassociated with the default database. To associate the routine\nexplicitly with a given database, specify the name as db_name.sp_name\nwhen you create it.\n\nThe CREATE FUNCTION statement is also used in MySQL to support UDFs\n(user-defined functions). See\nhttp://dev.mysql.com/doc/refman/5.6/en/adding-functions.html. A UDF can\nbe regarded as an external stored function. Stored functions share\ntheir namespace with UDFs. See\nhttp://dev.mysql.com/doc/refman/5.6/en/function-resolution.html, for\nthe rules describing how the server interprets references to different\nkinds of functions.\n\nTo invoke a stored procedure, use the CALL statement (see [HELP CALL]).\nTo invoke a stored function, refer to it in an expression. The function\nreturns a value during expression evaluation.\n\nCREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE\nprivilege. They might also require the SUPER privilege, depending on\nthe DEFINER value, as described later in this section. If binary\nlogging is enabled, CREATE FUNCTION might require the SUPER privilege,\nas described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nBy default, MySQL automatically grants the ALTER ROUTINE and EXECUTE\nprivileges to the routine creator. This behavior can be changed by\ndisabling the automatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be\nused when checking access privileges at routine execution time, as\ndescribed later in this section.\n\nIf the routine name is the same as the name of a built-in SQL function,\na syntax error occurs unless you use a space between the name and the\nfollowing parenthesis when defining the routine or invoking it later.\nFor this reason, avoid using the names of existing SQL functions for\nyour own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always permissible to have spaces after a stored\nroutine name, regardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present.\nIf there are no parameters, an empty parameter list of () should be\nused. Parameter names are not case sensitive.\n\nEach parameter is an IN parameter by default. To specify otherwise for\na parameter, use the keyword OUT or INOUT before the parameter name.\n\n*Note*: Specifying a parameter as IN, OUT, or INOUT is valid only for a\nPROCEDURE. For a FUNCTION, parameters are always regarded as IN\nparameters.\n\nAn IN parameter passes a value into a procedure. The procedure might\nmodify the value, but the modification is not visible to the caller\nwhen the procedure returns. An OUT parameter passes a value from the\nprocedure back to the caller. Its initial value is NULL within the\nprocedure, and its value is visible to the caller when the procedure\nreturns. An INOUT parameter is initialized by the caller, can be\nmodified by the procedure, and any change made by the procedure is\nvisible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the\nCALL statement that invokes the procedure so that you can obtain its\nvalue when the procedure returns. If you are calling the procedure from\nwithin another stored procedure or function, you can also pass a\nroutine parameter or local routine variable as an IN or INOUT\nparameter.\n\nRoutine parameters cannot be referenced in statements prepared within\nthe routine; see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-program-restrictions.html\n.\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter:\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE simpleproc (OUT param1 INT)\n -> BEGIN\n -> SELECT COUNT(*) INTO param1 FROM t;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter ;\n\nmysql> CALL simpleproc(@a);\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @a;\n+------+\n| @a |\n+------+\n| 3 |\n+------+\n1 row in set (0.00 sec)\n\nThe example uses the mysql client delimiter command to change the\nstatement delimiter from ; to // while the procedure is being defined.\nThis enables the ; delimiter used in the procedure body to be passed\nthrough to the server rather than being interpreted by mysql itself.\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-defining.html.\n\nThe RETURNS clause may be specified only for a FUNCTION, for which it\nis mandatory. It indicates the return type of the function, and the\nfunction body must contain a RETURN value statement. If the RETURN\nstatement returns a value of a different type, the value is coerced to\nthe proper type. For example, if a function specifies an ENUM or SET\nvalue in the RETURNS clause, but the RETURN statement returns an\ninteger, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nThe following example function takes a parameter, performs an operation\nusing an SQL function, and returns the result. In this case, it is\nunnecessary to use delimiter because the function definition contains\nno internal ; statement delimiters:\n\nmysql> CREATE FUNCTION hello (s CHAR(20))\nmysql> RETURNS CHAR(50) DETERMINISTIC\n -> RETURN CONCAT(\'Hello, \',s,\'!\');\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n1 row in set (0.00 sec)\n\nParameter types and function return types can be declared to use any\nvalid data type. The COLLATE attribute can be used if preceded by the\nCHARACTER SET attribute.\n\nThe routine_body consists of a valid SQL routine statement. This can be\na simple statement such as SELECT or INSERT, or a compound statement\nwritten using BEGIN and END. Compound statements can contain\ndeclarations, loops, and other control structure statements. The syntax\nfor these statements is described in\nhttp://dev.mysql.com/doc/refman/5.6/en/sql-syntax-compound-statements.h\ntml.\n\nMySQL permits routines to contain DDL statements, such as CREATE and\nDROP. MySQL also permits stored procedures (but not stored functions)\nto contain SQL transaction statements such as COMMIT. Stored functions\nmay not contain statements that perform explicit or implicit commit or\nrollback. Support for these statements is not required by the SQL\nstandard, which states that each DBMS vendor may decide whether to\npermit them.\n\nStatements that return a result set can be used within a stored\nprocedure but not within a stored function. This prohibition includes\nSELECT statements that do not have an INTO var_list clause and other\nstatements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that\ncan be determined at function definition time to return a result set, a\nNot allowed to return a result set from a function error occurs\n(ER_SP_NO_RETSET). For statements that can be determined only at\nruntime to return a result set, a PROCEDURE %s can\'t return a result\nset in the given context error occurs (ER_SP_BADSELECT).\n\nUSE statements within stored routines are not permitted. When a routine\nis invoked, an implicit USE db_name is performed (and undone when the\nroutine terminates). The causes the routine to have the given default\ndatabase while it executes. References to objects in databases other\nthan the routine default database should be qualified with the\nappropriate database name.\n\nFor additional information about statements that are not permitted in\nstored routines, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-program-restrictions.html\n.\n\nFor information about invoking stored procedures from within programs\nwritten in a language that has a MySQL interface, see [HELP CALL].\n\nMySQL stores the sql_mode system variable setting that is in effect at\nthe time a routine is created, and always executes the routine with\nthis setting in force, regardless of the server SQL mode in effect when\nthe routine is invoked.\n\nThe switch from the SQL mode of the invoker to that of the routine\noccurs after evaluation of arguments and assignment of the resulting\nvalues to routine parameters. If you define a routine in strict SQL\nmode but invoke it in nonstrict mode, assignment of arguments to\nroutine parameters does not take place in strict mode. If you require\nthat expressions passed to a routine be assigned in strict SQL mode,\nyou should invoke the routine with strict mode in effect.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (170,17,'SQL_THREAD_WAIT_AFTER_GTIDS','Syntax:\nSQL_THREAD_WAIT_AFTER_GTIDS(gtid_set[, timeout])\n\nSQL_THREAD_WAIT_AFTER_GTIDS() was added in MySQL 5.6.5, and replaced by\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() in MySQL 5.6.9. (Bug #14775984)\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (171,24,'GET DIAGNOSTICS','Syntax:\nGET [CURRENT] DIAGNOSTICS\n{\n statement_information_item\n [, statement_information_item] ... \n | CONDITION condition_number\n condition_information_item\n [, condition_information_item] ...\n}\n\nstatement_information_item:\n target = statement_information_item_name\n\ncondition_information_item:\n target = condition_information_item_name\n\nstatement_information_item_name:\n NUMBER\n | ROW_COUNT\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | RETURNED_SQLSTATE\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_number, target:\n (see following discussion)\n\nSQL statements produce diagnostic information that populates the\ndiagnostics area. The GET DIAGNOSTICS statement enables applications to\ninspect this information. It is available as of MySQL 5.6.4. (You can\nalso use SHOW WARNINGS or SHOW ERRORS to see conditions or errors.)\n\nNo special privileges are required to execute GET DIAGNOSTICS.\n\nThe keyword CURRENT means to retrieve information from the current\ndiagnostics area. In MySQL, it has no effect because that is the\ndefault behavior.\n\nGET DIAGNOSTICS is typically used in a handler within a stored program,\nbut it is a MySQL extension that it is permitted outside handler\ncontext to check the execution of any SQL statement. For example, if\nyou invoke the mysql client program, you can enter these statements at\nthe prompt:\n\nmysql> DROP TABLE test.no_such_table;\nERROR 1051 (42S02): Unknown table \'test.no_such_table\'\nmysql> GET DIAGNOSTICS CONDITION 1\n -> @p1 = RETURNED_SQLSTATE, @p2 = MESSAGE_TEXT;\nmysql> SELECT @p1, @p2;\n+-------+------------------------------------+\n| @p1 | @p2 |\n+-------+------------------------------------+\n| 42S02 | Unknown table \'test.no_such_table\' |\n+-------+------------------------------------+\n\nFor a description of the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html. Briefly,\nit contains two kinds of information:\n\no Statement information, such as the number of conditions that occurred\n or the affected-rows count.\n\no Condition information, such as the error code and message. If a\n statement raises multiple conditions, this part of the diagnostics\n area has a condition area for each one. If a statement raises no\n conditions, this part of the diagnostics area is empty.\n\nFor a statement that produces three conditions, the diagnostics area\ncontains statement and condition information like this:\n\nStatement information:\n row count\n ... other statement information items ...\nCondition area list:\n Condition area 1:\n error code for condition 1\n error message for condition 1\n ... other condition information items ...\n Condition area 2:\n error code for condition 2:\n error message for condition 2\n ... other condition information items ...\n Condition area 3:\n error code for condition 3\n error message for condition 3\n ... other condition information items ...\n\nGET DIAGNOSTICS can obtain either statement or condition information,\nbut not both in the same statement:\n\no To obtain statement information, retrieve the desired statement items\n into target variables. This instance of GET DIAGNOSTICS assigns the\n number of available conditions and the rows-affected count to the\n user variables @p1 and @p2:\n\nGET DIAGNOSTICS @p1 = NUMBER, @p2 = ROW_COUNT;\n\no To obtain condition information, specify the condition number and\n retrieve the desired condition items into target variables. This\n instance of GET DIAGNOSTICS assigns the SQLSTATE value and error\n message to the user variables @p3 and @p4:\n\nGET DIAGNOSTICS CONDITION 1\n @p3 = RETURNED_SQLSTATE, @p4 = MESSAGE_TEXT;\n\nThe retrieval list specifies one or more target = item_name\nassignments, separated by commas. Each assignment names a target\nvariable and either a statement_information_item_name or\ncondition_information_item_name designator, depending on whether the\nstatement retrieves statement or condition information.\n\nValid target designators for storing item information can be stored\nprocedure or function parameters, stored program local variables\ndeclared with DECLARE, or user-defined variables.\n\nValid condition_number designators can be stored procedure or function\nparameters, stored program local variables declared with DECLARE,\nuser-defined variables, system variables, or literals. A character\nliteral may include a _charset introducer. A warning occurs if the\ncondition number is not in the range from 1 to the number of condition\nareas that have information. In this case, the warning is added to the\ndiagnostics area without clearing it.\n\nCurrently, when a condition occurs, MySQL does not populate all\ncondition items recognized by GET DIAGNOSTICS. For example:\n\nmysql> GET DIAGNOSTICS CONDITION 1\n -> @p5 = SCHEMA_NAME, @p6 = TABLE_NAME;\nmysql> SELECT @p5, @p6;\n+------+------+\n| @p5 | @p6 |\n+------+------+\n| | |\n+------+------+\n\nIn standard SQL, if there are multiple conditions, the first condition\nrelates to the SQLSTATE value returned for the previous SQL statement.\nIn MySQL, this is not guaranteed. To get the main error, you cannot do\nthis:\n\nGET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;\n\nInstead, retrieve the condition count first, then use it to specify\nwhich condition number to inspect:\n\nGET DIAGNOSTICS @cno = NUMBER;\nGET DIAGNOSTICS CONDITION @cno @errno = MYSQL_ERRNO;\n\nFor information about permissible statement and condition information\nitems, and which ones are populated when a condition occurs, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html#diagnostic\ns-area-information-items.\n\nHere is an example that uses GET DIAGNOSTICS and an exception handler\nin stored procedure context to assess the outcome of an insert\noperation. If the insert was successful, the procedure uses GET\nDIAGNOSTICS to get the rows-affected count. This shows that you can use\nGET DIAGNOSTICS multiple times to retrieve information about a\nstatement as long as the diagnostics area has not been cleared.\n\nCREATE PROCEDURE do_insert(value INT)\nBEGIN\n -- Declare variables to hold diagnostics area information\n DECLARE code CHAR(5) DEFAULT \'00000\';\n DECLARE msg TEXT;\n DECLARE rows INT;\n DECLARE result TEXT;\n -- Declare exception handler for failed insert\n DECLARE CONTINUE HANDLER FOR SQLEXCEPTION\n BEGIN\n GET DIAGNOSTICS CONDITION 1\n code = RETURNED_SQLSTATE, msg = MESSAGE_TEXT;\n END;\n\n -- Perform the insert\n INSERT INTO t1 (int_col) VALUES(value);\n -- Check whether the insert was successful\n IF code = \'00000\' THEN\n GET DIAGNOSTICS rows = ROW_COUNT;\n SET result = CONCAT(\'insert succeeded, row count = \',rows);\n ELSE\n SET result = CONCAT(\'insert failed, error = \',code,\', message = \',msg);\n END IF;\n -- Say what happened\n SELECT result;\nEND;\n\nSuppose that t1.int_col is an integer column that is declared as NOT\nNULL. The procedure produces these results when invoked to insert\nnon-NULL and NULL values:\n\nmysql> CALL do_insert(1);\n+---------------------------------+\n| result |\n+---------------------------------+\n| insert succeeded, row count = 1 |\n+---------------------------------+\n\nmysql> CALL do_insert(NULL);\n+-------------------------------------------------------------------------+\n| result |\n+-------------------------------------------------------------------------+\n| insert failed, error = 23000, message = Column \'int_col\' cannot be null |\n+-------------------------------------------------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (172,38,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/regexp.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/regexp.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (173,24,'LEAVE','Syntax:\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the\ngiven label. If the label is for the outermost stored program block,\nLEAVE exits the program.\n\nLEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/leave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/leave.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (174,19,'NOT IN','Syntax:\nexpr NOT IN (value,...)\n\nThis is the same as NOT (expr IN (value,...)).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (175,15,'&&','Syntax:\nAND, &&\n\nLogical AND. Evaluates to 1 if all operands are nonzero and not NULL,\nto 0 if one or more operands are 0, otherwise NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT 1 && 1;\n -> 1\nmysql> SELECT 1 && 0;\n -> 0\nmysql> SELECT 1 && NULL;\n -> NULL\nmysql> SELECT 0 && NULL;\n -> 0\nmysql> SELECT NULL && 0;\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (176,11,'X','X(p)\n\nReturns the X-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SELECT X(POINT(56.7, 53.34));\n+-----------------------+\n| X(POINT(56.7, 53.34)) |\n+-----------------------+\n| 56.7 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (177,17,'FOUND_ROWS','Syntax:\nFOUND_ROWS()\n\nA SELECT statement may include a LIMIT clause to restrict the number of\nrows the server returns to the client. In some cases, it is desirable\nto know how many rows the statement would have returned without the\nLIMIT, but without running the statement again. To obtain this row\ncount, include a SQL_CALC_FOUND_ROWS option in the SELECT statement,\nand then invoke FOUND_ROWS() afterward:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n -> WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (178,31,'CROSSES','Crosses(g1,g2)\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect\n\no Their intersection results in a geometry that has a dimension that is\n one less than the maximum dimension of the two given geometries\n\no Their intersection is not equal to either of the two given geometries\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (179,16,'BIT_XOR','Syntax:\nBIT_XOR(expr)\n\nReturns the bitwise XOR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (180,27,'FLUSH','Syntax:\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n flush_option [, flush_option] ...\n\nThe FLUSH statement has several variant forms that clear or reload\nvarious internal caches, flush tables, or acquire locks. To execute\nFLUSH, you must have the RELOAD privilege. Specific flush options might\nrequire additional privileges, as described later.\n\nBy default, the server writes FLUSH statements to the binary log so\nthat they replicate to replication slaves. To suppress logging, specify\nthe optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\n*Note*: FLUSH LOGS, FLUSH TABLES WITH READ LOCK (with or without a\ntable list), and FLUSH TABLES tbl_name ... FOR EXPORT are not written\nto the binary log in any case because they would cause problems if\nreplicated to a slave.\n\nSending a SIGHUP signal to the server causes several flush operations\nto occur that are similar to various forms of the FLUSH statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-signal-response.html.\n\nThe FLUSH statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nThe RESET statement is similar to FLUSH. See [HELP RESET], for\ninformation about using the RESET statement with replication.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/flush.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/flush.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (181,24,'BEGIN END','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\nBEGIN ... END syntax is used for writing compound statements, which can\nappear within stored programs (stored procedures and functions,\ntriggers, and events). A compound statement can contain multiple\nstatements, enclosed by the BEGIN and END keywords. statement_list\nrepresents a list of one or more statements, each terminated by a\nsemicolon (;) statement delimiter. The statement_list itself is\noptional, so the empty compound statement (BEGIN END) is legal.\n\nBEGIN ... END blocks can be nested.\n\nUse of multiple statements requires that a client is able to send\nstatement strings containing the ; statement delimiter. In the mysql\ncommand-line client, this is handled with the delimiter command.\nChanging the ; end-of-statement delimiter (for example, to //) permit ;\nto be used in a program body. For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-defining.html.\n\nA BEGIN ... END block can be labeled. See [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/begin-end.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/begin-end.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (182,27,'SHOW PROCEDURE STATUS','Syntax:\nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is a MySQL extension. It returns characteristics of a\nstored procedure, such as the database, name, type, creator, creation\nand modification dates, and character set information. A similar\nstatement, SHOW FUNCTION STATUS, displays information about stored\nfunctions (see [HELP SHOW FUNCTION STATUS]).\n\nThe LIKE clause, if present, indicates which procedure or function\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-procedure-status.html\n\n','mysql> SHOW PROCEDURE STATUS LIKE \'sp1\'\\G\n*************************** 1. row ***************************\n Db: test\n Name: sp1\n Type: PROCEDURE\n Definer: testuser@localhost\n Modified: 2004-08-03 15:29:37\n Created: 2004-08-03 15:29:37\n Security_type: DEFINER\n Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-procedure-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (183,16,'STDDEV_POP','Syntax:\nSTDDEV_POP(expr)\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent\nbut not standard SQL.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (184,27,'SHOW CHARACTER SET','Syntax:\nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n\nThe SHOW CHARACTER SET statement shows all available character sets.\nThe LIKE clause, if present, indicates which character set names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. For example:\n\nmysql> SHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1 | cp1252 West European | latin1_swedish_ci | 1 |\n| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |\n| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |\n| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |\n+---------+-----------------------------+-------------------+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-character-set.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (185,31,'INTERSECTS','Intersects(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (186,24,'LOOP','Syntax:\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\nLOOP implements a simple loop construct, enabling repeated execution of\nthe statement list, which consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter. The statements\nwithin the loop are repeated until the loop is terminated. Usually,\nthis is accomplished with a LEAVE statement. Within a stored function,\nRETURN can also be used, which exits the function entirely.\n\nNeglecting to include a loop-termination statement results in an\ninfinite loop.\n\nA LOOP statement can be labeled. For the rules regarding label use, see\n[HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/loop.html\n\n','CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/loop.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (187,19,'GREATEST','Syntax:\nGREATEST(value1,value2,...)\n\nWith two or more arguments, returns the largest (maximum-valued)\nargument. The arguments are compared using the same rules as for\nLEAST().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT GREATEST(2,0);\n -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n -> 767.0\nmysql> SELECT GREATEST(\'B\',\'A\',\'C\');\n -> \'C\'\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (188,31,'ST_CONTAINS','ST_Contains(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as ST_Within().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (189,16,'BIT_AND','Syntax:\nBIT_AND(expr)\n\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (190,32,'SECOND','Syntax:\nSECOND(time)\n\nReturns the second for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SECOND(\'10:05:03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (191,6,'MBRCONTAINS','MBRContains(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\ncontains the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);\n----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n| 1 | 0 |\n+----------------------+----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (192,4,'COT','Syntax:\nCOT(X)\n\nReturns the cotangent of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT COT(12);\n -> -1.5726734063977\nmysql> SELECT COT(0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (193,27,'SHOW CREATE EVENT','Syntax:\nSHOW CREATE EVENT event_name\n\nThis statement displays the CREATE EVENT statement needed to re-create\na given event. It requires the EVENT privilege for the database from\nwhich the event is to be shown. For example (using the same event\ne_daily defined and then altered in [HELP SHOW EVENTS]):\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-event.html\n\n','mysql> SHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row ***************************\n Event: e_daily\n sql_mode:\n time_zone: SYSTEM\n Create Event: CREATE EVENT `e_daily`\n ON SCHEDULE EVERY 1 DAY\n STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n ON COMPLETION NOT PRESERVE\n ENABLE\n COMMENT \'Saves total number of sessions then\n clears the table each day\'\n DO BEGIN\n INSERT INTO site_activity.totals (time, total)\n SELECT CURRENT_TIMESTAMP, COUNT(*)\n FROM site_activity.sessions;\n DELETE FROM site_activity.sessions;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (194,38,'LOAD_FILE','Syntax:\nLOAD_FILE(file_name)\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify\nthe full path name to the file, and you must have the FILE privilege.\nThe file must be readable by all and its size less than\nmax_allowed_packet bytes. If the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nIf the file does not exist or cannot be read because one of the\npreceding conditions is not satisfied, the function returns NULL.\n\nThe character_set_filesystem system variable controls interpretation of\nfile names that are given as literal strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> UPDATE t\n SET blob_col=LOAD_FILE(\'/tmp/picture\')\n WHERE id=1;\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (195,3,'POINTFROMTEXT','PointFromText(wkt[,srid])\n\nConstructs a POINT value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (196,32,'DATE_FORMAT','Syntax:\nDATE_FORMAT(date,format)\n\nFormats the date value according to the format string.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n -> \'Sunday October 2009\'\nmysql> SELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n -> \'22:23:00\'\nmysql> SELECT DATE_FORMAT(\'1900-10-04 22:23:00\',\n -> \'%D %y %a %d %m %b %j\');\n -> \'4th 00 Thu 04 10 Oct 277\'\nmysql> SELECT DATE_FORMAT(\'1997-10-04 22:23:00\',\n -> \'%H %k %I %r %T %S %w\');\n -> \'22 22 10 10:23:00 PM 22:23:00 00 6\'\nmysql> SELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n -> \'1998 52\'\nmysql> SELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n -> \'00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (197,32,'YEAR','Syntax:\nYEAR(date)\n\nReturns the year for date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT YEAR(\'1987-01-01\');\n -> 1987\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (198,19,'IS NULL','Syntax:\nIS NULL\n\nTests whether a value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n -> 0, 0, 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (199,40,'ALTER SERVER','Syntax:\nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n\nAlters the server information for server_name, adjusting any of the\noptions permitted in the CREATE SERVER statement. The corresponding\nfields in the mysql.servers table are updated accordingly. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-server.html\n\n','ALTER SERVER s OPTIONS (USER \'sally\');\n','http://dev.mysql.com/doc/refman/5.6/en/alter-server.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (200,24,'RESIGNAL','Syntax:\nRESIGNAL [condition_value]\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nRESIGNAL passes on the error condition information that is available\nduring execution of a condition handler within a compound statement\ninside a stored procedure or function, trigger, or event. RESIGNAL may\nchange some or all information before passing it on. RESIGNAL is\nrelated to SIGNAL, but instead of originating a condition as SIGNAL\ndoes, RESIGNAL relays existing condition information, possibly after\nmodifying it.\n\nRESIGNAL makes it possible to both handle an error and return the error\ninformation. Otherwise, by executing an SQL statement within the\nhandler, information that caused the handler\'s activation is destroyed.\nRESIGNAL also can make some procedures shorter if a given handler can\nhandle part of a situation, then pass the condition "up the line" to\nanother handler.\n\nNo special privileges are required to execute the RESIGNAL statement.\n\nAll forms of RESIGNAL require that the current context be a condition\nhandler. Otherwise, RESIGNAL is illegal and a RESIGNAL when handler not\nactive error occurs.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html.\n\nFor condition_value and signal_information_item, the definitions and\nrules are the same for RESIGNAL as for SIGNAL. For example, the\ncondition_value can be an SQLSTATE value, and the value can indicate\nerrors, warnings, or "not found." For additional information, see [HELP\nSIGNAL].\n\nThe RESIGNAL statement takes condition_value and SET clauses, both of\nwhich are optional. This leads to several possible uses:\n\no RESIGNAL alone:\n\nRESIGNAL;\n\no RESIGNAL with new signal information:\n\nRESIGNAL SET signal_information_item [, signal_information_item] ...;\n\no RESIGNAL with a condition value and possibly new signal information:\n\nRESIGNAL condition_value\n [SET signal_information_item [, signal_information_item] ...];\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/resignal.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/resignal.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (201,32,'TIME FUNCTION','Syntax:\nTIME(expr)\n\nExtracts the time part of the time or datetime expression expr and\nreturns it as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME(\'2003-12-31 01:02:03\');\n -> \'01:02:03\'\nmysql> SELECT TIME(\'2003-12-31 01:02:03.000123\');\n -> \'01:02:03.000123\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (202,32,'DATE_ADD','Syntax:\nDATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)\n\nThese functions perform date arithmetic. The date argument specifies\nthe starting date or datetime value. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is a string; it may start with a "-" for negative intervals. unit\nis a keyword indicating the units in which the expression should be\ninterpreted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n -> \'2009-01-01 00:00:00\'\nmysql> SELECT INTERVAL 1 DAY + \'2008-12-31\';\n -> \'2009-01-01\'\nmysql> SELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n -> \'2004-12-31 23:59:59\'\nmysql> SELECT DATE_ADD(\'2000-12-31 23:59:59\',\n -> INTERVAL 1 SECOND);\n -> \'2001-01-01 00:00:00\'\nmysql> SELECT DATE_ADD(\'2010-12-31 23:59:59\',\n -> INTERVAL 1 DAY);\n -> \'2011-01-01 23:59:59\'\nmysql> SELECT DATE_ADD(\'2100-12-31 23:59:59\',\n -> INTERVAL \'1:1\' MINUTE_SECOND);\n -> \'2101-01-01 00:01:00\'\nmysql> SELECT DATE_SUB(\'2005-01-01 00:00:00\',\n -> INTERVAL \'1 1:1:1\' DAY_SECOND);\n -> \'2004-12-30 22:58:59\'\nmysql> SELECT DATE_ADD(\'1900-01-01 00:00:00\',\n -> INTERVAL \'-1 10\' DAY_HOUR);\n -> \'1899-12-30 14:00:00\'\nmysql> SELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n -> \'1997-12-02\'\nmysql> SELECT DATE_ADD(\'1992-12-31 23:59:59.000002\',\n -> INTERVAL \'1.999999\' SECOND_MICROSECOND);\n -> \'1993-01-01 00:00:01.000001\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (203,38,'LIKE','Syntax:\nexpr LIKE pat [ESCAPE \'escape_char\']\n\nPattern matching using SQL simple regular expression comparison.\nReturns 1 (TRUE) or 0 (FALSE). If either expr or pat is NULL, the\nresult is NULL.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','mysql> SELECT \'David!\' LIKE \'David_\';\n -> 1\nmysql> SELECT \'David!\' LIKE \'%D%v%\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (204,25,'MULTIPOINT','MultiPoint(pt1,pt2,...)\n\nConstructs a MultiPoint value using Point or WKB Point arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (205,20,'>>','Syntax:\n>>\n\nShifts a longlong (BIGINT) number to the right.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 4 >> 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (206,24,'FETCH','Syntax:\nFETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ...\n\nThis statement fetches the next row for the SELECT statement associated\nwith the specified cursor (which must be open), and advances the cursor\npointer. If a row exists, the fetched columns are stored in the named\nvariables. The number of columns retrieved by the SELECT statement must\nmatch the number of output variables specified in the FETCH statement.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE\nvalue \'02000\'. To detect this condition, you can set up a handler for\nit (or for a NOT FOUND condition). For an example, see\nhttp://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/fetch.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/fetch.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (207,30,'TRUE FALSE','The constants TRUE and FALSE evaluate to 1 and 0, respectively. The\nconstant names can be written in any lettercase.\n\nmysql> SELECT TRUE, true, FALSE, false;\n -> 1, 1, 0, 0\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/boolean-literals.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/boolean-literals.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (208,6,'MBRWITHIN','MBRWithin(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\nis within the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nmysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (209,17,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,27,'SHOW CREATE FUNCTION','Syntax:\nSHOW CREATE FUNCTION func_name\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored\nfunctions. See [HELP SHOW CREATE PROCEDURE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (211,32,'STR_TO_DATE','Syntax:\nSTR_TO_DATE(str,format)\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string\nstr and a format string format. STR_TO_DATE() returns a DATETIME value\nif the format string contains both date and time parts, or a DATE or\nTIME value if the string contains only date or time parts. If the date,\ntime, or datetime value extracted from str is illegal, STR_TO_DATE()\nreturns NULL and produces a warning.\n\nThe server scans str attempting to match format to it. The format\nstring can contain literal characters and format specifiers beginning\nwith %. Literal characters in format must match literally in str.\nFormat specifiers in format must match a date or time part in str. For\nthe specifiers that can be used in format, see the DATE_FORMAT()\nfunction description.\n\nmysql> SELECT STR_TO_DATE(\'01,5,2013\',\'%d,%m,%Y\');\n -> \'2013-05-01\'\nmysql> SELECT STR_TO_DATE(\'May 1, 2013\',\'%M %d,%Y\');\n -> \'2013-05-01\'\n\nScanning starts at the beginning of str and fails if format is found\nnot to match. Extra characters at the end of str are ignored.\n\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'a%h:%i:%s\');\n -> \'09:30:17\'\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'%h:%i:%s\');\n -> NULL\nmysql> SELECT STR_TO_DATE(\'09:30:17a\',\'%h:%i:%s\');\n -> \'09:30:17\'\n\nUnspecified date or time parts have a value of 0, so incompletely\nspecified values in str produce a result with some or all parts set to\n0:\n\nmysql> SELECT STR_TO_DATE(\'abc\',\'abc\');\n -> \'0000-00-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%m\');\n -> \'0000-09-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%s\');\n -> \'00:00:09\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (212,11,'Y','Y(p)\n\nReturns the Y-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SELECT Y(POINT(56.7, 53.34));\n+-----------------------+\n| Y(POINT(56.7, 53.34)) |\n+-----------------------+\n| 53.34 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (213,21,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nCHECKSUM TABLE reports a checksum for the contents of a table. You can\nuse this statement to verify that the contents are the same before and\nafter a backup, rollback, or other operation that is intended to put\nthe data back to a known state. This statement requires the SELECT\nprivilege for the table.\n\nPerformance Considerations\n\nBy default, the entire table is read row by row and the checksum is\ncalculated. For large tables, this could take a long time, thus you\nwould only perform this operation occasionally. This row-by-row\ncalculation is what you get with the EXTENDED clause, with InnoDB and\nall other storage engines other than MyISAM, and with MyISAM tables not\ncreated with the CHECKSUM=1 clause.\n\nFor MyISAM tables created with the CHECKSUM=1 clause, CHECKSUM TABLE or\nCHECKSUM TABLE ... QUICK returns the "live" table checksum that can be\nreturned very fast. If the table does not meet all these conditions,\nthe QUICK method returns NULL. See [HELP CREATE TABLE] for the syntax\nof the CHECKSUM clause.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a\nwarning.\n\nPrior to MySQL 5.6.4, CHECKSUM TABLE returned 0 for partitioned tables\nunless the EXTENDED option was used. (Bug #11933226, Bug #60681)\n\nThe checksum value depends on the table row format. If the row format\nchanges, the checksum also changes. For example, the storage format for\nVARCHAR changed between MySQL 4.1 and 5.0, so if a 4.1 table is\nupgraded to MySQL 5.0, the checksum value may change.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/checksum-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/checksum-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (214,2,'NUMINTERIORRINGS','NumInteriorRings(poly)\n\nReturns the number of interior rings in the Polygon value poly.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n| 1 |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (215,2,'INTERIORRINGN','InteriorRingN(poly,N)\n\nReturns the N-th interior ring for the Polygon value poly as a\nLineString. Rings are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (216,32,'UTC_TIME','Syntax:\nUTC_TIME, UTC_TIME([fsp])\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIME(), UTC_TIME() + 0;\n -> \'18:07:53\', 180753.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (217,14,'IS_IPV4_COMPAT','Syntax:\nIS_IPV4_COMPAT(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-compatible IPv6 address, 0 otherwise.\nIPv4-compatible addresses have the form ::ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.5.9\'));\n -> 1\nmysql> SELECT IS_IPV4_COMPAT(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (218,40,'DROP FUNCTION','The DROP FUNCTION statement is used to drop stored functions and\nuser-defined functions (UDFs):\n\no For information about dropping stored functions, see [HELP DROP\n PROCEDURE].\n\no For information about dropping user-defined functions, see [HELP DROP\n FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (219,16,'STDDEV','Syntax:\nSTDDEV(expr)\n\nReturns the population standard deviation of expr. This function is\nprovided for compatibility with Oracle. The standard SQL function\nSTDDEV_POP() can be used instead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (220,32,'PERIOD_ADD','Syntax:\nPERIOD_ADD(P,N)\n\nAdds N months to period P (in the format YYMM or YYYYMM). Returns a\nvalue in the format YYYYMM. Note that the period argument P is not a\ndate value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_ADD(200801,2);\n -> 200803\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (221,38,'RIGHT','Syntax:\nRIGHT(str,len)\n\nReturns the rightmost len characters from the string str, or NULL if\nany argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT RIGHT(\'foobarbar\', 4);\n -> \'rbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (222,40,'DROP TABLESPACE','Syntax:\nDROP TABLESPACE tablespace_name\n ENGINE [=] engine_name\n\nThis statement drops a tablespace that was previously created using\nCREATE TABLESPACE (see [HELP CREATE TABLESPACE]).\n\n*Important*: The tablespace to be dropped must not contain any data\nfiles; in other words, before you can drop a tablespace, you must first\ndrop each of its data files using ALTER TABLESPACE ... DROP DATAFILE\n(see [HELP ALTER TABLESPACE]).\n\nThe ENGINE clause (required) specifies the storage engine used by the\ntablespace. Currently, the only accepted values for engine_name are NDB\nand NDBCLUSTER.\n\nDROP TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-tablespace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (223,21,'CHECK TABLE','Syntax:\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nInnoDB, MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, the key\nstatistics are updated as well.\n\nTo check a table, you must have some privilege for it.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nCHECK TABLE is supported for partitioned tables, and you can use ALTER\nTABLE ... CHECK PARTITION to check one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/check-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/check-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (224,38,'BIN','Syntax:\nBIN(N)\n\nReturns a string representation of the binary value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT BIN(12);\n -> \'1100\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (225,25,'MULTILINESTRING','MultiLineString(ls1,ls2,...)\n\nConstructs a MultiLineString value using LineString or WKB LineString\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (226,27,'SHOW RELAYLOG EVENTS','Syntax:\nSHOW RELAYLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nShows the events in the relay log of a replication slave. If you do not\nspecify \'log_name\', the first relay log is displayed. This statement\nhas no effect on the master.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-relaylog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-relaylog-events.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (227,3,'MPOINTFROMTEXT','MPointFromText(wkt[,srid]), MultiPointFromText(wkt[,srid])\n\nConstructs a MULTIPOINT value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (228,38,'SUBSTR','Syntax:\nSUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str\nFROM pos FOR len)\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (229,23,'CHAR','[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA fixed-length string that is always right-padded with spaces to the\nspecified length when stored. M represents the column length in\ncharacters. The range of M is 0 to 255. If M is omitted, the length is\n1.\n\n*Note*: Trailing spaces are removed when CHAR values are retrieved\nunless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (230,16,'COUNT DISTINCT','Syntax:\nCOUNT(DISTINCT expr,[expr...])\n\nReturns a count of the number of rows with different non-NULL expr\nvalues.\n\nCOUNT(DISTINCT) returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT COUNT(DISTINCT results) FROM student;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (231,27,'SHOW CREATE VIEW','Syntax:\nSHOW CREATE VIEW view_name\n\nThis statement shows a CREATE VIEW statement that creates the given\nview.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-create-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (232,19,'INTERVAL','Syntax:\nINTERVAL(N,N1,N2,N3,...)\n\nReturns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All\narguments are treated as integers. It is required that N1 < N2 < N3 <\n... < Nn for this function to work correctly. This is because a binary\nsearch is used (very fast).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (233,32,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_DAYS(730669);\n -> \'2007-07-03\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (234,40,'ALTER PROCEDURE','Syntax:\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a\nstored procedure using this statement; to make such changes, you must\ndrop and re-create the procedure using DROP PROCEDURE and CREATE\nPROCEDURE.\n\nYou must have the ALTER ROUTINE privilege for the procedure. By\ndefault, that privilege is granted automatically to the procedure\ncreator. This behavior can be changed by disabling the\nautomatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (235,20,'BIT_COUNT','Syntax:\nBIT_COUNT(N)\n\nReturns the number of bits that are set in the argument N.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n -> 4, 3\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (236,31,'ST_WITHIN','ST_Within(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as ST_Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (237,4,'ACOS','Syntax:\nACOS(X)\n\nReturns the arc cosine of X, that is, the value whose cosine is X.\nReturns NULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ACOS(1);\n -> 0\nmysql> SELECT ACOS(1.0001);\n -> NULL\nmysql> SELECT ACOS(0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (238,8,'ISOLATION','Syntax:\nSET [GLOBAL | SESSION] TRANSACTION\n transaction_characteristic [, transaction_characteristic] ...\n\ntransaction_characteristic:\n ISOLATION LEVEL level\n | READ WRITE\n | READ ONLY\n\nlevel:\n REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n\nThis statement specifies transaction characteristics. It takes a list\nof one or more characteristic values separated by commas. These\ncharacteristics set the transaction isolation level or access mode. The\nisolation level is used for operations on InnoDB tables. The access\nmode may be specified as of MySQL 5.6.5 and indicates whether\ntransactions operate in read/write or read-only mode.\n\nIn addition, SET TRANSACTION can include an optional GLOBAL or SESSION\nkeyword to indicate the scope of the statement.\n\nScope of Transaction Characteristics\n\nYou can set transaction characteristics globally, for the current\nsession, or for the next transaction:\n\no With the GLOBAL keyword, the statement applies globally for all\n subsequent sessions. Existing sessions are unaffected.\n\no With the SESSION keyword, the statement applies to all subsequent\n transactions performed within the current session.\n\no Without any SESSION or GLOBAL keyword, the statement applies to the\n next (not started) transaction performed within the current session.\n\nA global change to transaction characteristics requires the SUPER\nprivilege. Any session is free to change its session characteristics\n(even in the middle of a transaction), or the characteristics for its\nnext transaction.\n\nSET TRANSACTION without GLOBAL or SESSION is not permitted while there\nis an active transaction:\n\nmysql> START TRANSACTION;\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be changed\nwhile a transaction is in progress\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option to mysqld on the command line or\nin an option file. Values of level for this option use dashes rather\nthan spaces, so the permissible values are READ-UNCOMMITTED,\nREAD-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. For example, to set\nthe default isolation level to REPEATABLE READ, use these lines in the\n[mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\n\nIt is possible to check or set the global and session transaction\nisolation levels at runtime by using the tx_isolation system variable:\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\nSET GLOBAL tx_isolation=\'REPEATABLE-READ\';\nSET SESSION tx_isolation=\'SERIALIZABLE\';\n\nSimilarly, to set the transaction access mode at server startup or at\nruntime, use the --transaction-read-only option or tx_read_only system\nvariable. By default, these are OFF (the mode is read/write) but can be\nset to ON for a default mode of read only.\n\nSetting the global or session value of tx_isolation or tx_read_only is\nequivalent to setting the isolation level or access mode with SET\nGLOBAL TRANSACTION or SET SESSION TRANSACTION.\n\nDetails and Usage of Isolation Levels\n\nInnoDB supports each of the transaction isolation levels described here\nusing different locking strategies. You can enforce a high degree of\nconsistency with the default REPEATABLE READ level, for operations on\ncrucial data where ACID compliance is important. Or you can relax the\nconsistency rules with READ COMMITTED or even READ UNCOMMITTED, in\nsituations such as bulk reporting where precise consistency and\nrepeatable results are less important than minimizing the amount of\noverhead for locking. SERIALIZABLE enforces even stricter rules than\nREPEATABLE READ, and is used mainly in specialized situations, such as\nwith XA transactions and for troubleshooting issues with concurrency\nand deadlocks.\n\nFor full information about how these isolation levels work with InnoDB\ntransactions, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-transaction-model.html.\nIn particular, for additional information about InnoDB record-level\nlocks and how it uses them to execute various types of statements, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-record-level-locks.html\nand http://dev.mysql.com/doc/refman/5.6/en/innodb-locks-set.html.\n\nThe following list describes how MySQL supports the different\ntransaction levels. The list goes from the most commonly used level to\nthe least used.\n\no REPEATABLE READ\n\n This is the default isolation level for InnoDB. For consistent reads,\n there is an important difference from the READ COMMITTED isolation\n level: All consistent reads within the same transaction read the\n snapshot established by the first read. This convention means that if\n you issue several plain (nonlocking) SELECT statements within the\n same transaction, these SELECT statements are consistent also with\n respect to each other. See\n http://dev.mysql.com/doc/refman/5.6/en/innodb-consistent-read.html.\n\n For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n UPDATE, and DELETE statements, locking depends on whether the\n statement uses a unique index with a unique search condition, or a\n range-type search condition. For a unique index with a unique search\n condition, InnoDB locks only the index record found, not the gap\n before it. For other search conditions, InnoDB locks the index range\n scanned, using gap locks or next-key locks to block insertions by\n other sessions into the gaps covered by the range.\n\no READ COMMITTED\n\n A somewhat Oracle-like isolation level with respect to consistent\n (nonlocking) reads: Each consistent read, even within the same\n transaction, sets and reads its own fresh snapshot. See\n http://dev.mysql.com/doc/refman/5.6/en/innodb-consistent-read.html.\n\n For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n InnoDB locks only index records, not the gaps before them, and thus\n permits the free insertion of new records next to locked records. For\n UPDATE and DELETE statements, locking depends on whether the\n statement uses a unique index with a unique search condition (such as\n WHERE id = 100), or a range-type search condition (such as WHERE id >\n 100). For a unique index with a unique search condition, InnoDB locks\n only the index record found, not the gap before it. For range-type\n searches, InnoDB locks the index range scanned, using gap locks or\n next-key locks to block insertions by other sessions into the gaps\n covered by the range. This is necessary because "phantom rows" must\n be blocked for MySQL replication and recovery to work.\n\n *Note*: In MySQL 5.6, if the READ COMMITTED isolation level is used,\n or the deprecated innodb_locks_unsafe_for_binlog system variable is\n enabled, there is no InnoDB gap locking except for foreign-key\n constraint checking and duplicate-key checking. Also, record locks\n for nonmatching rows are released after MySQL has evaluated the WHERE\n condition. If you use READ COMMITTED or enable\n innodb_locks_unsafe_for_binlog, you must use row-based binary\n logging.\n\no READ UNCOMMITTED\n\n SELECT statements are performed in a nonlocking fashion, but a\n possible earlier version of a row might be used. Thus, using this\n isolation level, such reads are not consistent. This is also called a\n dirty read. Otherwise, this isolation level works like READ\n COMMITTED.\n\no SERIALIZABLE\n\n This level is like REPEATABLE READ, but InnoDB implicitly converts\n all plain SELECT statements to SELECT ... LOCK IN SHARE MODE if\n autocommit is disabled. If autocommit is enabled, the SELECT is its\n own transaction. It therefore is known to be read only and can be\n serialized if performed as a consistent (nonlocking) read and need\n not block for other transactions. (To force a plain SELECT to block\n if other transactions have modified the selected rows, disable\n autocommit.)\n\nTransaction Access Mode\n\nAs of MySQL 5.6.5, the transaction access mode may be specified with\nSET TRANSACTION. By default, a transaction takes place in read/write\nmode, with both reads and writes permitted to tables used in the\ntransaction. This mode may be specified explicitly using an access mode\nof READ WRITE.\n\nIf the transaction access mode is set to READ ONLY, changes to tables\nare prohibited. This may enable storage engines to make performance\nimprovements that are possible when writes are not permitted.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the\nsame statement.\n\nIn read-only mode, it remains possible to change tables created with\nthe TEMPORARY keyword using DML statements. Changes made with DDL\nstatements are not permitted, just as with permanent tables.\n\nThe READ WRITE and READ ONLY access modes also may be specified for an\nindividual transaction using the START TRANSACTION statement.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-transaction.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-transaction.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (239,4,'SIN','Syntax:\nSIN(X)\n\nReturns the sine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SIN(PI());\n -> 1.2246063538224e-16\nmysql> SELECT ROUND(SIN(PI()));\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (240,26,'BUFFER','Buffer(g,d)\n\nReturns a geometry that represents all points whose distance from the\ngeometry value g is less than or equal to a distance of d.\n\nBuffer() supports negative distances for polygons, multipolygons, and\ngeometry collections containing polygons or multipolygons. For point,\nmultipoint, linestring, multilinestring, and geometry collections not\ncontaining any polygons or multipolygons, Buffer() with a negative\ndistance returns NULL.\n\nPrior to MySQL 5.6.1, this function is unimplemented.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-that-create-new-geometries-from-existing-ones.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-that-create-new-geometries-from-existing-ones.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (241,19,'IS','Syntax:\nIS boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n -> 1, 1, 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (242,32,'GET_FORMAT','Syntax:\nGET_FORMAT({DATE|TIME|DATETIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nReturns a format string. This function is useful in combination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n -> \'03.10.2003\'\nmysql> SELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n -> \'2003-10-31\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (243,23,'TINYBLOB','TINYBLOB\n\nA BLOB column with a maximum length of 255 (28 - 1) bytes. Each\nTINYBLOB value is stored using a 1-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (244,17,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (245,21,'REPAIR TABLE','Syntax:\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n\nREPAIR TABLE repairs a possibly corrupted table, for certain storage\nengines only. By default, it has the same effect as myisamchk --recover\ntbl_name.\n\n*Note*: REPAIR TABLE only applies to MyISAM, ARCHIVE, and CSV tables.\nSee http://dev.mysql.com/doc/refman/5.6/en/myisam-storage-engine.html,\nand http://dev.mysql.com/doc/refman/5.6/en/archive-storage-engine.html,\nand http://dev.mysql.com/doc/refman/5.6/en/csv-storage-engine.html\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nREPAIR TABLE is supported for partitioned tables. However, the USE_FRM\noption cannot be used with this statement on a partitioned table.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nYou can use ALTER TABLE ... REPAIR PARTITION to repair one or more\npartitions; for more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/repair-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/repair-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (246,18,'MERGE','The MERGE storage engine, also known as the MRG_MyISAM engine, is a\ncollection of identical MyISAM tables that can be used as one.\n"Identical" means that all tables have identical column and index\ninformation. You cannot merge MyISAM tables in which the columns are\nlisted in a different order, do not have exactly the same columns, or\nhave the indexes in different order. However, any or all of the MyISAM\ntables can be compressed with myisampack. See\nhttp://dev.mysql.com/doc/refman/5.6/en/myisampack.html. Differences in\ntable options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not\nmatter.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/merge-storage-engine.html\n\n','mysql> CREATE TABLE t1 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> CREATE TABLE t2 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> INSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\nmysql> INSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\nmysql> CREATE TABLE total (\n -> a INT NOT NULL AUTO_INCREMENT,\n -> message CHAR(20), INDEX(a))\n -> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n','http://dev.mysql.com/doc/refman/5.6/en/merge-storage-engine.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (247,40,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...)\n [table_options]\n [partition_options]\n\nOr:\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)]\n [table_options]\n [partition_options]\n select_statement\n\nOr:\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_tbl_name | (LIKE old_tbl_name) }\n\ncreate_definition:\n col_name column_definition\n | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n [index_option] ...\n | {INDEX|KEY} [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]\n [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name,...) reference_definition\n | CHECK (expr)\n\ncolumn_definition:\n data_type [NOT NULL | NULL] [DEFAULT default_value]\n [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]\n [COMMENT \'string\']\n [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n [STORAGE {DISK|MEMORY|DEFAULT}]\n [reference_definition]\n\ndata_type:\n BIT[(length)]\n | TINYINT[(length)] [UNSIGNED] [ZEROFILL]\n | SMALLINT[(length)] [UNSIGNED] [ZEROFILL]\n | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]\n | INT[(length)] [UNSIGNED] [ZEROFILL]\n | INTEGER[(length)] [UNSIGNED] [ZEROFILL]\n | BIGINT[(length)] [UNSIGNED] [ZEROFILL]\n | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DECIMAL[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | NUMERIC[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | DATE\n | TIME\n | TIMESTAMP\n | DATETIME\n | YEAR\n | CHAR[(length)]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | VARCHAR(length)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | BINARY[(length)]\n | VARBINARY(length)\n | TINYBLOB\n | BLOB\n | MEDIUMBLOB\n | LONGBLOB\n | TINYTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | TEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | MEDIUMTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | LONGTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | ENUM(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | SET(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | spatial_type\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nreference_definition:\n REFERENCES tbl_name (index_col_name,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list)\n | RANGE{(expr) | COLUMNS(column_list)}\n | LIST{(expr) | COLUMNS(column_list)} }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY [ALGORITHM={1|2}] (column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\n\npartition_definition:\n PARTITION partition_name\n [VALUES \n {LESS THAN {(expr | value_list) | MAXVALUE} \n | \n IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n [(subpartition_definition [, subpartition_definition] ...)]\n\nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n\nselect_statement:\n [IGNORE | REPLACE] [AS] SELECT ... (Some valid select statement)\n\nCREATE TABLE creates a table with the given name. You must have the\nCREATE privilege for the table.\n\nRules for permissible table names are given in\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html. By default,\nthe table is created in the default database, using the InnoDB storage\nengine. An error occurs if the table exists, if there is no default\ndatabase, or if the database does not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (248,32,'MICROSECOND','Syntax:\nMICROSECOND(expr)\n\nReturns the microseconds from the time or datetime expression expr as a\nnumber in the range from 0 to 999999.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MICROSECOND(\'12:00:00.123456\');\n -> 123456\nmysql> SELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n -> 10\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (249,40,'CREATE SERVER','Syntax:\nCREATE SERVER server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n\noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n\nThis statement creates the definition of a server for use with the\nFEDERATED storage engine. The CREATE SERVER statement creates a new row\nin the servers table in the mysql database. This statement requires the\nSUPER privilege.\n\nThe server_name should be a unique reference to the server. Server\ndefinitions are global within the scope of the server, it is not\npossible to qualify the server definition to a specific database.\nserver_name has a maximum length of 64 characters (names longer than 64\ncharacters are silently truncated), and is case insensitive. You may\nspecify the name as a quoted string.\n\nThe wrapper_name should be mysql, and may be quoted with single\nquotation marks. Other values for wrapper_name are not currently\nsupported.\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are\nsilently truncated to 64 characters. Numeric literals must be a number\nbetween 0 and 9999, default value is 0.\n\n*Note*: The OWNER option is currently not applied, and has no effect on\nthe ownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table\nthat can later be used with the CREATE TABLE statement when creating a\nFEDERATED table. The options that you specify will be used to populate\nthe columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-server.html\n\n','CREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n','http://dev.mysql.com/doc/refman/5.6/en/create-server.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (250,32,'MAKETIME','Syntax:\nMAKETIME(hour,minute,second)\n\nReturns a time value calculated from the hour, minute, and second\narguments.\n\nAs of MySQL 5.6.4, the second argument can have a fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MAKETIME(12,15,30);\n -> \'12:15:30\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (251,32,'CURDATE','Syntax:\nCURDATE()\n\nReturns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CURDATE();\n -> \'2008-06-13\'\nmysql> SELECT CURDATE() + 0;\n -> 20080613\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (252,10,'SET PASSWORD','Syntax:\nSET PASSWORD [FOR user] =\n {\n PASSWORD(\'cleartext password\')\n | OLD_PASSWORD(\'cleartext password\')\n | \'encrypted password\'\n }\n\nThe SET PASSWORD statement assigns a password to an existing MySQL user\naccount. When the read_only system variable is enabled, the SUPER\nprivilege is required to use SET PASSWORD, in addition to whatever\nother privileges might be required.\n\nIf the password is specified using the PASSWORD() or OLD_PASSWORD()\nfunction, the cleartext (unencrypted) password should be given as the\nargument to the function, which hashes the password and returns the\nencrypted password string. If the password is specified without using\neither function, it should be the already encrypted password value as a\nliteral string. In all cases, the encrypted password string must be in\nthe format required by the authentication method used for the account.\n\nWith no FOR user clause, this statement sets the password for the\ncurrent user. (To see which account the server authenticated you as,\ninvoke the CURRENT_USER() function.) Any client who successfully\nconnects to the server using a nonanonymous account can change the\npassword for that account.\n\nWith a FOR user clause, this statement sets the password for the named\nuser. You must have the UPDATE privilege for the mysql database to do\nthis. The user account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. The user\nvalue should be given as \'user_name\'@\'host_name\', where \'user_name\' and\n\'host_name\' are exactly as listed in the User and Host columns of the\nmysql.user table row. (If you specify only a user name, a host name of\n\'%\' is used.) For example, to set the password for an account with User\nand Host column values of \'bob\' and \'%.example.org\', write the\nstatement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.example.org\' = PASSWORD(\'cleartext password\');\n\nThat is equivalent to the following statements:\n\nUPDATE mysql.user SET Password=PASSWORD(\'cleartext password\')\n WHERE User=\'bob\' AND Host=\'%.example.org\';\nFLUSH PRIVILEGES;\n\nAnother way to set the password is to use GRANT:\n\nGRANT USAGE ON *.* TO \'bob\'@\'%.example.org\' IDENTIFIED BY \'cleartext password\';\n\nThe old_passwords system variable value determines the hashing method\nused by PASSWORD(). If you specify the password using that function and\nSET PASSWORD rejects the password as not being in the correct format,\nit may be necessary to set old_passwords to change the hashing method.\nFor descriptions of the permitted values, see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-password.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-password.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (253,17,'DATABASE','Syntax:\nDATABASE()\n\nReturns the default (current) database name as a string in the utf8\ncharacter set. If there is no default database, DATABASE() returns\nNULL. Within a stored routine, the default database is the database\nthat the routine is associated with, which is not necessarily the same\nas the database that is the default in the calling context.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT DATABASE();\n -> \'test\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (254,7,'IF FUNCTION','Syntax:\nIF(expr1,expr2,expr3)\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns\nexpr2; otherwise it returns expr3. IF() returns a numeric or string\nvalue, depending on the context in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT IF(1>2,2,3);\n -> 3\nmysql> SELECT IF(1<2,\'yes\',\'no\');\n -> \'yes\'\nmysql> SELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n -> \'no\'\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (255,33,'POINTFROMWKB','PointFromWKB(wkb[,srid])\n\nConstructs a POINT value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (256,4,'POWER','Syntax:\nPOWER(X,Y)\n\nThis is a synonym for POW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (257,4,'ATAN','Syntax:\nATAN(X)\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(2);\n -> 1.1071487177941\nmysql> SELECT ATAN(-2);\n -> -1.1071487177941\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (258,27,'SHOW PROFILE','Syntax:\nSHOW PROFILE [type [, type] ... ]\n [FOR QUERY n]\n [LIMIT row_count [OFFSET offset]]\n\ntype:\n ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling\ninformation that indicates resource usage for statements executed\nduring the course of the current session.\n\n*Note*: These statements are deprecated as of MySQL 5.6.7 and will be\nremoved in a future MySQL release. Use the Performance Schema instead;\nsee http://dev.mysql.com/doc/refman/5.6/en/performance-schema.html.\n\nProfiling is controlled by the profiling session variable, which has a\ndefault value of 0 (OFF). Profiling is enabled by setting profiling to\n1 or ON:\n\nmysql> SET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nserver. The size of the list is controlled by the\nprofiling_history_size session variable, which has a default value of\n15. The maximum value is 100. Setting the value to 0 has the practical\neffect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILE and SHOW PROFILES, so\nyou will find neither of those statements in the profile list.\nMalformed statements are profiled. For example, SHOW PROFILING is an\nillegal statement, and a syntax error occurs if you try to execute it,\nbut it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement.\nWithout the FOR QUERY n clause, the output pertains to the most\nrecently executed statement. If FOR QUERY n is included, SHOW PROFILE\ndisplays information for statement n. The values of n correspond to the\nQuery_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to\nrow_count rows. If LIMIT is given, OFFSET offset may be added to begin\nthe output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The\nStatus values are like the State values displayed by SHOW PROCESSLIST,\nalthough there might be some minor differences in interpretion for the\ntwo statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/thread-information.html).\n\nOptional type values may be specified to display specific additional\ntypes of information:\n\no ALL displays all information\n\no BLOCK IO displays counts for block input and output operations\n\no CONTEXT SWITCHES displays counts for voluntary and involuntary\n context switches\n\no CPU displays user and system CPU usage times\n\no IPC displays counts for messages sent and received\n\no MEMORY is not currently implemented\n\no PAGE FAULTS displays counts for major and minor page faults\n\no SOURCE displays the names of functions from the source code, together\n with the name and line number of the file in which the function\n occurs\n\no SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-profile.html\n\n','mysql> SELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> SET profiling = 1;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> DROP TABLE IF EXISTS t1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> CREATE TABLE T1 (id INT);\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SHOW PROFILES;\n+----------+----------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+----------+--------------------------+\n| 0 | 0.000088 | SET PROFILING = 1 |\n| 1 | 0.000136 | DROP TABLE IF EXISTS t1 |\n| 2 | 0.011947 | CREATE TABLE t1 (id INT) |\n+----------+----------+--------------------------+\n3 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| checking permissions | 0.000040 |\n| creating table | 0.000056 |\n| After create | 0.011363 |\n| query end | 0.000375 |\n| freeing items | 0.000089 |\n| logging slow query | 0.000019 |\n| cleaning up | 0.000005 |\n+----------------------+----------+\n7 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE FOR QUERY 1;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| query end | 0.000107 |\n| freeing items | 0.000008 |\n| logging slow query | 0.000015 |\n| cleaning up | 0.000006 |\n+--------------------+----------+\n4 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE CPU FOR QUERY 2;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| checking permissions | 0.000040 | 0.000038 | 0.000002 |\n| creating table | 0.000056 | 0.000028 | 0.000028 |\n| After create | 0.011363 | 0.000217 | 0.001571 |\n| query end | 0.000375 | 0.000013 | 0.000028 |\n| freeing items | 0.000089 | 0.000010 | 0.000014 |\n| logging slow query | 0.000019 | 0.000009 | 0.000010 |\n| cleaning up | 0.000005 | 0.000003 | 0.000002 |\n+----------------------+----------+----------+------------+\n7 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/show-profile.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (259,4,'LN','Syntax:\nLN(X)\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X.\nIf X is less than or equal to 0, then NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LN(2);\n -> 0.69314718055995\nmysql> SELECT LN(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (260,24,'RETURN','Syntax:\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and\nreturns the value expr to the function caller. There must be at least\none RETURN statement in a stored function. There may be more than one\nif the function has multiple exit points.\n\nThis statement is not used in stored procedures, triggers, or events.\nThe LEAVE statement can be used to exit a stored program of those\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/return.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/return.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (261,8,'SET SQL_LOG_BIN','Syntax:\nSET sql_log_bin = {0|1}\n\nThe sql_log_bin variable controls whether logging to the binary log is\ndone. The default value is 1 (do logging). To change logging for the\ncurrent session, change the session value of this variable. The session\nuser must have the SUPER privilege to set this variable.\n\nIn MySQL 5.6, it is not possible to set @@session.sql_log_bin within a\ntransaction or subquery. (Bug #53437)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-sql-log-bin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-sql-log-bin.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (262,12,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str)\n\nThis function decrypts data using the official AES (Advanced Encryption\nStandard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (263,17,'COERCIBILITY','Syntax:\nCOERCIBILITY(str)\n\nReturns the collation coercibility value of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n -> 0\nmysql> SELECT COERCIBILITY(USER());\n -> 3\nmysql> SELECT COERCIBILITY(\'abc\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (264,23,'INT','INT[(M)] [UNSIGNED] [ZEROFILL]\n\nA normal-size integer. The signed range is -2147483648 to 2147483647.\nThe unsigned range is 0 to 4294967295.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (265,13,'GLENGTH','GLength(ls)\n\nReturns as a double-precision number the length of the LineString value\nls in its associated spatial reference.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n| 2.8284271247462 |\n+----------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (266,38,'MAKE_SET','Syntax:\nMAKE_SET(bits,str1,str2,...)\n\nReturns a set value (a string containing substrings separated by ","\ncharacters) consisting of the strings that have the corresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL\nvalues in str1, str2, ... are not appended to the result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n -> \'a\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n -> \'hello,world\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n -> \'hello\'\nmysql> SELECT MAKE_SET(0,\'a\',\'b\',\'c\');\n -> \'\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (267,38,'FIND_IN_SET','Syntax:\nFIND_IN_SET(str,strlist)\n\nReturns a value in the range of 1 to N if the string str is in the\nstring list strlist consisting of N substrings. A string list is a\nstring composed of substrings separated by "," characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimized to use bit arithmetic. Returns\n0 if str is not in strlist or if strlist is the empty string. Returns\nNULL if either argument is NULL. This function does not work properly\nif the first argument contains a comma (",") character.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIND_IN_SET(\'b\',\'a,b,c,d\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (268,16,'MIN','Syntax:\nMIN([DISTINCT] expr)\n\nReturns the minimum value of expr. MIN() may take a string argument; in\nsuch cases, it returns the minimum string value. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the minimum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMIN() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (269,28,'REPLACE','Syntax:\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name,...)] \n [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name,...)] \n SET col_name={expr | DEFAULT}, ...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n [PARTITION (partition_name,...)] \n [(col_name,...)]\n SELECT ...\n\nREPLACE works exactly like INSERT, except that if an old row in the\ntable has the same value as a new row for a PRIMARY KEY or a UNIQUE\nindex, the old row is deleted before the new row is inserted. See [HELP\nINSERT].\n\nREPLACE is a MySQL extension to the SQL standard. It either inserts, or\ndeletes and inserts. For another MySQL extension to standard SQL---that\neither inserts or updates---see\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html.\n\nNote that unless the table has a PRIMARY KEY or UNIQUE index, using a\nREPLACE statement makes no sense. It becomes equivalent to INSERT,\nbecause there is no index to be used to determine whether a new row\nduplicates another.\n\nValues for all columns are taken from the values specified in the\nREPLACE statement. Any missing columns are set to their default values,\njust as happens for INSERT. You cannot refer to values from the current\nrow and use them in the new row. If you use an assignment such as SET\ncol_name = col_name + 1, the reference to the column name on the right\nhand side is treated as DEFAULT(col_name), so the assignment is\nequivalent to SET col_name = DEFAULT(col_name) + 1.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for\nthe table.\n\nBeginning with MySQL 5.6.2, REPLACE supports explicit partition\nselection using the PARTITION option with a comma-separated list of\nnames of partitions, subpartitions, or both. As with INSERT, if it is\nnot possible to insert the new row into any of these partitions or\nsubpartitions, the REPLACE statement fails with the error Found a row\nnot matching the given partition set. See\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html, for\nmore information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/replace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/replace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (270,32,'CURRENT_TIMESTAMP','Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP([fsp])\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (271,17,'GTID_SUBSET','Syntax:\nGTID_SUBSET(subset,set)\n\nGiven two sets of global transaction IDs subset and set, returns true\nif all GTIDs in subset are also in set. Returns false otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (272,16,'VAR_SAMP','Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (273,23,'DATETIME','DATETIME[(fsp)]\n\nA date and time combination. The supported range is \'1000-01-01\n00:00:00.000000\' to \'9999-12-31 23:59:59.999999\'. MySQL displays\nDATETIME values in \'YYYY-MM-DD HH:MM:SS[.fraction]\' format, but permits\nassignment of values to DATETIME columns using either strings or\nnumbers.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nAs of MySQL 5.6.5, automatic initialization and updating to the current\ndate and time for DATETIME columns can be specified using DEFAULT and\nON UPDATE column definition clauses, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (274,23,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (275,27,'SHOW COLUMNS','Syntax:\nSHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. The LIKE clause, if present, indicates which\ncolumn names to match. The WHERE clause can be given to select rows\nusing more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nSHOW COLUMNS displays information only for those columns for which you\nhave some privilege.\n\nmysql> SHOW COLUMNS FROM City;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n5 rows in set (0.00 sec)\n\nIf the data types differ from what you expect them to be based on a\nCREATE TABLE statement, note that MySQL sometimes changes data types\nwhen you create or alter a table. The conditions under which this\noccurs are described in\nhttp://dev.mysql.com/doc/refman/5.6/en/silent-column-changes.html.\n\nThe FULL keyword causes the output to include the column collation and\ncomments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. In other words, these two statements are equivalent:\n\nmysql> SHOW COLUMNS FROM mytable FROM mydb;\nmysql> SHOW COLUMNS FROM mydb.mytable;\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for nonbinary string columns, or NULL\nfor other columns. This value is displayed only if you use the FULL\nkeyword.\n\nThe Null field contains YES if NULL values can be stored in the column,\nNO if not.\n\nThe Key field indicates whether the column is indexed:\n\no If Key is empty, the column either is not indexed or is indexed only\n as a secondary column in a multiple-column, nonunique index.\n\no If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n in a multiple-column PRIMARY KEY.\n\no If Key is UNI, the column is the first column of a UNIQUE index. (A\n UNIQUE index permits multiple NULL values, but you can tell whether\n the column permits NULL by checking the Null field.)\n\no If Key is MUL, the column is the first column of a nonunique index in\n which multiple occurrences of a given value are permitted within the\n column.\n\nIf more than one of the Key values applies to a given column of a\ntable, Key displays the one with the highest priority, in the order\nPRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values\nand there is no PRIMARY KEY in the table. A UNIQUE index may display as\nMUL if several columns form a composite UNIQUE index; although the\ncombination of the columns is unique, each column can still hold\nmultiple occurrences of a given value.\n\nThe Default field indicates the default value that is assigned to the\ncolumn. This is NULL if the column has an explicit default of NULL, or\nif the column definition has no DEFAULT clause.\n\nThe Extra field contains any additional information that is available\nabout a given column. The value is nonempty in these cases:\nauto_increment for columns that have the AUTO_INCREMENT attribute; on\nupdate CURRENT_TIMESTAMP for TIMESTAMP or DATETIME columns that have\nthe ON UPDATE CURRENT_TIMESTAMP attribute.\n\nPrivileges indicates the privileges you have for the column. This value\nis displayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed\nonly if you use the FULL keyword.\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. You can also list a table\'s\ncolumns with the mysqlshow db_name tbl_name command.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee http://dev.mysql.com/doc/refman/5.6/en/describe.html.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-columns.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (276,23,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (277,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (278,20,'^','Syntax:\n^\n\nBitwise XOR:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (279,40,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view. If any of the views named in the argument list do not\nexist, MySQL returns an error indicating by name which nonexisting\nviews it was unable to drop, but it also drops all of the views in the\nlist that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (280,32,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() enables you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n -> 53\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (281,22,'DROP FUNCTION UDF','Syntax:\nDROP FUNCTION function_name\n\nThis statement drops the user-defined function (UDF) named\nfunction_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql\ndatabase. This is because DROP FUNCTION removes a row from the\nmysql.func system table that records the function\'s name, type, and\nshared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-function-udf.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (282,38,'UPDATEXML','Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a single portion of a given fragment of XML\nmarkup xml_target with a new XML fragment new_xml, and then returns the\nchanged XML. The portion of xml_target that is replaced matches an\nXPath expression xpath_expr supplied by the user. In MySQL 5.6.6 and\nearlier, the XPath expression could contain at most 127 characters.\nThis limitation is lifted in MySQL 5.6.7. (Bug #13007062, Bug #62429)\n\nIf no expression matching xpath_expr is found, or if multiple matches\nare found, the function returns the original xml_target XML fragment.\nAll three arguments should be strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html\n\n','mysql> SELECT\n -> UpdateXML(\'ccc\', \'/a\', \'fff\') AS val1,\n -> UpdateXML(\'ccc\', \'/b\', \'fff\') AS val2,\n -> UpdateXML(\'ccc\', \'//b\', \'fff\') AS val3,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val4,\n -> UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val5\n -> \\G\n\n*************************** 1. row ***************************\nval1: fff\nval2: ccc\nval3: fff\nval4: cccfff\nval5: ccc\n','http://dev.mysql.com/doc/refman/5.6/en/xml-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (283,8,'RESET SLAVE','Syntax:\nRESET SLAVE [ALL]\n\nRESET SLAVE makes the slave forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean\nstart: It deletes the master.info and relay-log.info files, all the\nrelay log files, and starts a new relay log file. It also resets to 0\nthe replication delay specified with the MASTER_DELAY option to CHANGE\nMASTER TO. To use RESET SLAVE, the slave replication threads must be\nstopped (use STOP SLAVE if necessary).\n\n*Note*: All relay log files are deleted, even if they have not been\ncompletely executed by the slave SQL thread. (This is a condition\nlikely to exist on a replication slave if you have issued a STOP SLAVE\nstatement or if the slave is highly loaded.)\n\nIn MySQL 5.6 (unlike the case in MySQL 5.1 and earlier), RESET SLAVE\ndoes not change any replication connection parameters such as master\nhost, master port, master user, or master password, which are retained\nin memory. This means that START SLAVE can be issued without requiring\na CHANGE MASTER TO statement following RESET SLAVE.\n\nConnection parameters are reset if the slave mysqld is shut down\nfollowing RESET SLAVE. In MySQL 5.6.3 and later, you can instead use\nRESET SLAVE ALL to reset these connection parameters (Bug #11809016).\n\nIn MySQL 5.6.7 and later, RESET SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nIf the slave SQL thread was in the middle of replicating temporary\ntables when it was stopped, and RESET SLAVE is issued, these replicated\ntemporary tables are deleted on the slave.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset-slave.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (284,32,'DAY','Syntax:\nDAY(date)\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (285,14,'UUID','Syntax:\nUUID()\n\nReturns a Universal Unique Identifier (UUID) generated according to\n"DCE 1.1: Remote Procedure Call" (Appendix A) CAE (Common Applications\nEnvironment) Specifications published by The Open Group in October 1997\n(Document Number C706,\nhttp://www.opengroup.org/public/pubs/catalog/c706.htm).\n\nA UUID is designed as a number that is globally unique in space and\ntime. Two calls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate computers\nthat are not connected to each other.\n\nA UUID is a 128-bit number represented by a utf8 string of five\nhexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:\n\no The first three numbers are generated from a timestamp.\n\no The fourth number preserves temporal uniqueness in case the timestamp\n value loses monotonicity (for example, due to daylight saving time).\n\no The fifth number is an IEEE 802 node number that provides spatial\n uniqueness. A random number is substituted if the latter is not\n available (for example, because the host computer has no Ethernet\n card, or we do not know how to find the hardware address of an\n interface on your operating system). In this case, spatial uniqueness\n cannot be guaranteed. Nevertheless, a collision should have very low\n probability.\n\n Currently, the MAC address of an interface is taken into account only\n on FreeBSD and Linux. On other operating systems, MySQL uses a\n randomly generated 48-bit number.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID();\n -> \'6ccd780c-baba-1026-9564-0040f4311e29\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (286,14,'SLEEP','Syntax:\nSLEEP(duration)\n\nSleeps (pauses) for the number of seconds given by the duration\nargument, then returns 0. If SLEEP() is interrupted, it returns 1. The\nduration may have a fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (287,25,'LINESTRING','LineString(pt1,pt2,...)\n\nConstructs a LineString value from a number of Point or WKB Point\narguments. If the number of arguments is less than two, the return\nvalue is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (288,7,'NULLIF','Syntax:\nNULLIF(expr1,expr2)\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n -> NULL\nmysql> SELECT NULLIF(1,2);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (289,4,'ROUND','Syntax:\nROUND(X), ROUND(X,D)\n\nRounds the argument X to D decimal places. The rounding algorithm\ndepends on the data type of X. D defaults to 0 if not specified. D can\nbe negative to cause D digits left of the decimal point of the value X\nto become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ROUND(-1.23);\n -> -1\nmysql> SELECT ROUND(-1.58);\n -> -2\nmysql> SELECT ROUND(1.58);\n -> 2\nmysql> SELECT ROUND(1.298, 1);\n -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n -> 1\nmysql> SELECT ROUND(23.298, -1);\n -> 20\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (290,32,'TIMEDIFF','Syntax:\nTIMEDIFF(expr1,expr2)\n\nTIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and\nexpr2 are time or date-and-time expressions, but both must be of the\nsame type.\n\nThe result returned by TIMEDIFF() is limited to the range allowed for\nTIME values. Alternatively, you can use either of the functions\nTIMESTAMPDIFF() and UNIX_TIMESTAMP(), both of which return integers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMEDIFF(\'2000:01:01 00:00:00\',\n -> \'2000:01:01 00:00:00.000001\');\n -> \'-00:00:00.000001\'\nmysql> SELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\',\n -> \'2008-12-30 01:01:01.000002\');\n -> \'46:58:57.999999\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (291,8,'STOP SLAVE','Syntax:\nSTOP SLAVE [thread_types]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege.\nRecommended best practice is to execute STOP SLAVE on the slave before\nstopping the slave server (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-shutdown.html, for more\ninformation).\n\nWhen using the row-based logging format: You should execute STOP SLAVE\nor STOP SLAVE SQL_THREAD on the slave prior to shutting down the slave\nserver if you are replicating any tables that use a nontransactional\nstorage engine (see the Note later in this section).\n\nLike START SLAVE, this statement may be used with the IO_THREAD and\nSQL_THREAD options to name the thread or threads to be stopped.\n\nIn MySQL 5.6.7 and later, STOP SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\n*Note*: In MySQL 5.6, STOP SLAVE waits until the current replication\nevent group affecting one or more nontransactional tables has finished\nexecuting (if there is any such replication group), or until the user\nissues a KILL QUERY or KILL CONNECTION statement. (Bug #319, Bug\n#38205)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/stop-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/stop-slave.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (292,3,'LINEFROMTEXT','LineFromText(wkt[,srid]), LineStringFromText(wkt[,srid])\n\nConstructs a LINESTRING value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (293,32,'ADDTIME','Syntax:\nADDTIME(expr1,expr2)\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time\nor datetime expression, and expr2 is a time expression.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n -> \'2008-01-02 01:01:01.000001\'\nmysql> SELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'03:00:01.999997\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (294,38,'UPPER','Syntax:\nUPPER(str)\n\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT UPPER(\'Hej\');\n -> \'HEJ\'\n\nSee the description of LOWER() for information that also applies to\nUPPER(). This included information about how to perform lettercase\nconversion of binary strings (BINARY, VARBINARY, BLOB) for which these\nfunctions are ineffective, and information about case folding for\nUnicode character sets.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (295,23,'MEDIUMBLOB','MEDIUMBLOB\n\nA BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each\nMEDIUMBLOB value is stored using a 3-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (296,32,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether\nthe function is used in a string or numeric context. The value is\nexpressed in the current time zone. unix_timestamp is an internal\ntimestamp value such as is produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format\nstring, which is used the same way as listed in the entry for the\nDATE_FORMAT() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_UNIXTIME(1196440219);\n -> \'2007-11-30 10:30:19\'\nmysql> SELECT FROM_UNIXTIME(1196440219) + 0;\n -> 20071130103019.000000\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2007 30th November 10:30:59 2007\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (297,12,'SHA2','Syntax:\nSHA2(str, hash_length)\n\nCalculates the SHA-2 family of hash functions (SHA-224, SHA-256,\nSHA-384, and SHA-512). The first argument is the cleartext string to be\nhashed. The second argument indicates the desired bit length of the\nresult, which must have a value of 224, 256, 384, 512, or 0 (which is\nequivalent to 256). If either argument is NULL or the hash length is\nnot one of the permitted values, the return value is NULL. Otherwise,\nthe function result is a hash value containing the desired number of\nbits. See the notes at the beginning of this section about storing hash\nvalues efficiently.\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT SHA2(\'abc\', 224);\n -> \'23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (298,7,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2. IFNULL() returns a numeric or string value, depending on the\ncontext in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html\n\n','mysql> SELECT IFNULL(1,0);\n -> 1\nmysql> SELECT IFNULL(NULL,10);\n -> 10\nmysql> SELECT IFNULL(1/0,10);\n -> 10\nmysql> SELECT IFNULL(1/0,\'yes\');\n -> \'yes\'\n','http://dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (299,27,'SHOW FUNCTION CODE','Syntax:\nSHOW FUNCTION CODE func_name\n\nThis statement is similar to SHOW PROCEDURE CODE but for stored\nfunctions. See [HELP SHOW PROCEDURE CODE].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-function-code.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-function-code.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (300,19,'LEAST','Syntax:\nLEAST(value1,value2,...)\n\nWith two or more arguments, returns the smallest (minimum-valued)\nargument. The arguments are compared using the following rules:\n\no If any argument is NULL, the result is NULL. No comparison is needed.\n\no If the return value is used in an INTEGER context or all arguments\n are integer-valued, they are compared as integers.\n\no If the return value is used in a REAL context or all arguments are\n real-valued, they are compared as reals.\n\no If the arguments comprise a mix of numbers and strings, they are\n compared as numbers.\n\no If any argument is a nonbinary (character) string, the arguments are\n compared as nonbinary strings.\n\no In all other cases, the arguments are compared as binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT LEAST(2,0);\n -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n -> 3.0\nmysql> SELECT LEAST(\'B\',\'A\',\'C\');\n -> \'A\'\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (301,27,'SHOW ERRORS','Syntax:\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW COUNT(*) ERRORS\n\nThis statement is similar to SHOW WARNINGS, except that it displays\ninformation only for errors, rather than for errors, warnings, and\nnotes.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You\ncan also retrieve this number from the error_count variable:\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nSHOW ERRORS and error_count apply only to errors, not warnings or\nnotes. In other respects, they are similar to SHOW WARNINGS and\nwarning_count. In particular, SHOW ERRORS cannot display information\nfor more than max_error_count messages, and error_count can exceed the\nvalue of max_error_count if the number of errors exceeds\nmax_error_count.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-errors.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-errors.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (302,19,'=','=\n\nEqual:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 = 0;\n -> 0\nmysql> SELECT \'0\' = 0;\n -> 1\nmysql> SELECT \'0.0\' = 0;\n -> 1\nmysql> SELECT \'0.01\' = 0;\n -> 0\nmysql> SELECT \'.01\' = 0.01;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (303,14,'IS_IPV4_MAPPED','Syntax:\nIS_IPV4_MAPPED(expr)\n\nThis function takes an IPv6 address represented in numeric form as a\nbinary string, as returned by INET6_ATON(). It returns 1 if the\nargument is a valid IPv4-mapped IPv6 address, 0 otherwise. IPv4-mapped\naddresses have the form ::ffff:ipv4_address.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.5.9\'));\n -> 0\nmysql> SELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.5.9\'));\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (304,37,'BOUNDARY','Boundary(g)\n\nReturns a geometry that is the closure of the combinatorial boundary of\nthe geometry value g.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (305,10,'CREATE USER','Syntax:\nCREATE USER user_specification\n [, user_specification] ...\n\nuser_specification:\n user\n [\n IDENTIFIED BY [PASSWORD] \'password\'\n | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\n ]\n\nThe CREATE USER statement creates new MySQL accounts. To use it, you\nmust have the global CREATE USER privilege or the INSERT privilege for\nthe mysql database. For each account, CREATE USER creates a new row in\nthe mysql.user table and assigns the account no privileges. An error\noccurs if the account already exists.\n\nFor CREATE USER statements that do not specify an IDENTIFIED WITH\nauth_plugin clause, the server associates the account with the default\nauthentication plugin. As of MySQL 5.6.6, this is the plugin named by\nthe --default-authentication-plugin option at server startup, or\nmysql_native_password if that option is not used. Before 5.6.6, the\ndefault plugin is mysql_native_password. For information about\nauthentication plugins, see\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nThe user specification may indicate how the user should authenticate\nwhen connecting to the server:\n\no To enable the user to connect with no password (which is insecure),\n include no IDENTIFIED BY clause:\n\nCREATE USER \'jeffrey\'@\'localhost\';\n\n In this case, the account uses the default authentication plugin and\n clients must provide no password.\n\no To assign a password, use IDENTIFIED BY with the literal plaintext\n password value:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\n The account uses the default authentication plugin and clients must\n match the given password.\n\no To avoid specifying the plaintext password if you know its hash value\n (the value that PASSWORD() would return for the password), specify\n the hash value preceded by the keyword PASSWORD:\n\nCREATE USER \'jeffrey\'@\'localhost\'\nIDENTIFIED BY PASSWORD \'*90E462C37378CED12064BB3388827D2BA3A9B689\';\n\n The account uses the default authentication plugin and the has must\n be in the format required by that plugin. Clients must match the\n given password.\n\no To authenticate the account using a specific authentication plugin,\n use IDENTIFIED WITH, where auth_plugin is the plugin name. It can be\n an unquoted name or a quoted string literal. \'auth_string\' is an\n optional quoted string literal to pass to the plugin. The plugin\n interprets the meaning of the string, so its format is plugin\n specific. Consult the documentation for a given plugin for\n information about the authentication string values it accepts.\n\nCREATE USER \'jeffrey\'@\'localhost\'\nIDENTIFIED WITH my_auth_plugin;\n\n For connections that use this account, the server invokes the named\n plugin and clients must provide credentials as required for the\n authentication method that the plugin implements. If the server\n cannot find the plugin, either at account-creation time or connect\n time, an error occurs.\n\nThe IDENTIFIED BY and IDENTIFIED WITH clauses are mutually exclusive,\nso at most one of them can be specified for a given user.\n\nFor additional information about setting passwords, see\nhttp://dev.mysql.com/doc/refman/5.6/en/assigning-passwords.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-user.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (306,25,'POINT','Point(x,y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (307,38,'LCASE','Syntax:\nLCASE(str)\n\nLCASE() is a synonym for LOWER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (308,19,'IS NOT NULL','Syntax:\nIS NOT NULL\n\nTests whether a value is not NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (309,38,'MATCH AGAINST','Syntax:\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nMySQL has support for full-text indexing and searching:\n\no A full-text index in MySQL is an index of type FULLTEXT.\n\no Full-text indexes can be used only with InnoDB or MyISAM tables, and\n can be created only for CHAR, VARCHAR, or TEXT columns.\n\no A FULLTEXT index definition can be given in the CREATE TABLE\n statement when a table is created, or added later using ALTER TABLE\n or CREATE INDEX.\n\no For large data sets, it is much faster to load your data into a table\n that has no FULLTEXT index and then create the index after that, than\n to load data into a table that has an existing FULLTEXT index.\n\nFull-text searching is performed using MATCH() ... AGAINST syntax.\nMATCH() takes a comma-separated list that names the columns to be\nsearched. AGAINST takes a string to search for, and an optional\nmodifier that indicates what type of search to perform. The search\nstring must be a string value that is constant during query evaluation.\nThis rules out, for example, a table column because that can differ for\neach row.\n\nThere are three types of full-text searches:\n\no A natural language search interprets the search string as a phrase in\n natural human language (a phrase in free text). There are no special\n operators. The stopword list applies, controlled by\n innodb_ft_enable_stopword, innodb_ft_server_stopword_table, and\n innodb_ft_user_stopword_table for InnoDB search indexes, and\n ft_stopword_file for MyISAM ones.\n\no Full-text searches are natural language searches if the IN NATURAL\n LANGUAGE MODE modifier is given or if no modifier is given. For more\n information, see\n http://dev.mysql.com/doc/refman/5.6/en/fulltext-natural-language.html\n .\n\no A boolean search interprets the search string using the rules of a\n special query language. The string contains the words to search for.\n It can also contain operators that specify requirements such that a\n word must be present or absent in matching rows, or that it should be\n weighted higher or lower than usual. Certain common words (stopwords)\n are omitted from the search index and do not match if present in the\n search string. The IN BOOLEAN MODE modifier specifies a boolean\n search. For more information, see\n http://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html.\n\no A query expansion search is a modification of a natural language\n search. The search string is used to perform a natural language\n search. Then words from the most relevant rows returned by the search\n are added to the search string and the search is done again. The\n query returns the rows from the second search. The IN NATURAL\n LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier\n specifies a query expansion search. For more information, see\n http://dev.mysql.com/doc/refman/5.6/en/fulltext-query-expansion.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html\n\n','mysql> SELECT id, body, MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE) AS score\n FROM articles WHERE MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE);\n+----+-----------------------+------------------------------------------+\n| id | title | body |\n+----+-----------------------+------------------------------------------+\n| 5 | MySQL vs. YourSQL | In the following database comparison ... |\n| 1 | MySQL Tutorial | DBMS stands for DataBase ... |\n| 3 | Optimizing MySQL | In this tutorial we will show ... |\n| 6 | MySQL Security | When configured properly, MySQL ... |\n| 2 | How To Use MySQL Well | After you went through a ... |\n| 4 | 1001 MySQL Tricks | 1. Never run mysqld as root. 2. ... |\n+----+-----------------------+------------------------------------------+\n6 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (310,40,'CREATE EVENT','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n EVENT\n [IF NOT EXISTS]\n event_name\n ON SCHEDULE schedule\n [ON COMPLETION [NOT] PRESERVE]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n DO event_body;\n\nschedule:\n AT timestamp [+ INTERVAL interval] ...\n | EVERY interval\n [STARTS timestamp [+ INTERVAL interval] ...]\n [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nThis statement creates and schedules a new event. The event will not\nrun unless the Event Scheduler is enabled. For information about\nchecking Event Scheduler status and enabling it if necessary, see\nhttp://dev.mysql.com/doc/refman/5.6/en/events-configuration.html.\n\nCREATE EVENT requires the EVENT privilege for the schema in which the\nevent is to be created. It might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section.\n\nThe minimum requirements for a valid CREATE EVENT statement are as\nfollows:\n\no The keywords CREATE EVENT plus an event name, which uniquely\n identifies the event in a database schema.\n\no An ON SCHEDULE clause, which determines when and how often the event\n executes.\n\no A DO clause, which contains the SQL statement to be executed by an\n event.\n\nThis is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event\nexecutes once---one hour following its creation---by running an SQL\nstatement that increments the value of the myschema.mytable table\'s\nmycol column by 1.\n\nThe event_name must be a valid MySQL identifier with a maximum length\nof 64 characters. Event names are not case sensitive, so you cannot\nhave two events named myevent and MyEvent in the same schema. In\ngeneral, the rules governing event names are the same as those for\nnames of stored routines. See\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\nAn event is associated with a schema. If no schema is indicated as part\nof event_name, the default (current) schema is assumed. To create an\nevent in a specific schema, qualify the event name with a schema using\nschema_name.event_name syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (311,6,'MBR DEFINITION','Its MBR (Minimum Bounding Rectangle), or Envelope. This is the bounding\ngeometry, formed by the minimum and maximum (X,Y) coordinates:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html\n\n','((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n','http://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (312,25,'GEOMETRYCOLLECTION','GeometryCollection(g1,g2,...)\n\nConstructs a GeometryCollection.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (313,4,'*','Syntax:\n*\n\nMultiplication:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3*5;\n -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n -> out-of-range error\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (314,12,'DES_DECRYPT','Syntax:\nDES_DECRYPT(crypt_str[,key_str])\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs,\nthis function returns NULL.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.6/en/ssl-connections.html.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte\nof the encrypted string to determine the DES key number that was used\nto encrypt the original string, and then reads the key from the DES key\nfile to decrypt the message. For this to work, the user must have the\nSUPER privilege. The key file can be specified with the --des-key-file\nserver option.\n\nIf you pass this function a key_str argument, that string is used as\nthe key for decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string,\nMySQL returns the given crypt_str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (315,13,'ENDPOINT','EndPoint(ls)\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3) |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (316,16,'COUNT','Syntax:\nCOUNT(expr)\n\nReturns a count of the number of non-NULL values of expr in the rows\nretrieved by a SELECT statement. The result is a BIGINT value.\n\nCOUNT() returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student.student_name,COUNT(*)\n -> FROM student,course\n -> WHERE student.student_id=course.student_id\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (317,28,'INSERT','Syntax:\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name,...)] \n [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name,...)]\n SET col_name={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n [PARTITION (partition_name,...)] \n [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nINSERT inserts new rows into an existing table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based on\nexplicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed\nfurther in [HELP INSERT SELECT].\n\nIn MySQL 5.6.2 and later, when inserting into a partitioned table, you\ncan control which partitions and subpartitions accept new rows. The\nPARTITION option takes a comma-separated list of the names of one or\nmore partitions or subpartitions (or both) of the table. If any of the\nrows to be inserted by a given INSERT statement do not match one of the\npartitions listed, the INSERT statement fails with the error Found a\nrow not matching the given partition set. See\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html, for\nmore information and examples.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (318,3,'MLINEFROMTEXT','MLineFromText(wkt[,srid]), MultiLineStringFromText(wkt[,srid])\n\nConstructs a MULTILINESTRING value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (319,33,'GEOMCOLLFROMWKB','GeomCollFromWKB(wkb[,srid]), GeometryCollectionFromWKB(wkb[,srid])\n\nConstructs a GEOMETRYCOLLECTION value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (320,23,'TINYTEXT','TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 255 (28 - 1) characters. The\neffective maximum length is less if the value contains multi-byte\ncharacters. Each TINYTEXT value is stored using a 1-byte length prefix\nthat indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (321,14,'DEFAULT','Syntax:\nDEFAULT(col_name)\n\nReturns the default value for a table column. An error results if the\ncolumn has no default value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (322,12,'DECODE','Syntax:\nDECODE(crypt_str,pass_str)\n\nDecrypts the encrypted string crypt_str using pass_str as the password.\ncrypt_str should be a string returned from ENCODE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (323,21,'OPTIMIZE TABLE','Syntax:\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nReorganizes the physical storage of table data and associated index\ndata, to reduce storage space and improve I/O efficiency when accessing\nthe table. The exact changes made to each table depend on the storage\nengine used by that table.\n\nUse OPTIMIZE TABLE in these cases, depending on the type of table:\n\no After doing substantial insert, update, or delete operations on an\n InnoDB table that has its own .ibd file because it was created with\n the innodb_file_per_table option enabled. The table and indexes are\n reorganized, and disk space can be reclaimed for use by the operating\n system.\n\no After doing substantial insert, update, or delete operations on\n columns that are part of a FULLTEXT index in an InnoDB table. Set the\n configuration option innodb_optimize_fulltext_only=1 first. To keep\n the index maintenance period to a reasonable time, set the\n innodb_ft_num_word_optimize option to specify how many words to\n update in the search index, and run a sequence of OPTIMIZE TABLE\n statements until the search index is fully updated.\n\no After deleting a large part of a MyISAM or ARCHIVE table, or making\n many changes to a MyISAM or ARCHIVE table with variable-length rows\n (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted\n rows are maintained in a linked list and subsequent INSERT operations\n reuse old row positions. You can use OPTIMIZE TABLE to reclaim the\n unused space and to defragment the data file. After extensive changes\n to a table, this statement may also improve performance of statements\n that use the table, sometimes significantly.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nOPTIMIZE TABLE is also supported for partitioned tables. For\ninformation about using this statement with partitioned tables and\ntable partitions, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/optimize-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/optimize-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (324,19,'<=>','Syntax:\n<=>\n\nNULL-safe equal. This operator performs an equality comparison like the\n= operator, but returns 1 rather than NULL if both operands are NULL,\nand 0 rather than NULL if one operand is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n -> 1, 1, 0\nmysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;\n -> 1, NULL, NULL\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (325,27,'RESET','Syntax:\nRESET reset_option [, reset_option] ...\n\nThe RESET statement is used to clear the state of various server\noperations. You must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement. See [HELP\nFLUSH].\n\nThe RESET statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/reset.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/reset.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (326,14,'GET_LOCK','Syntax:\nGET_LOCK(str,timeout)\n\nTries to obtain a lock with a name given by the string str, using a\ntimeout of timeout seconds. Returns 1 if the lock was obtained\nsuccessfully, 0 if the attempt timed out (for example, because another\nclient has previously locked the name), or NULL if an error occurred\n(such as running out of memory or the thread was killed with mysqladmin\nkill). If you have a lock obtained with GET_LOCK(), it is released when\nyou execute RELEASE_LOCK(), execute a new GET_LOCK(), or your\nconnection terminates (either normally or abnormally). Locks obtained\nwith GET_LOCK() do not interact with transactions. That is, committing\na transaction does not release any such locks obtained during the\ntransaction.\n\nThis function can be used to implement application locks or to simulate\nrecord locks. Names are locked on a server-wide basis. If a name has\nbeen locked by one client, GET_LOCK() blocks any request by another\nclient for a lock with the same name. This enables clients that agree\non a given lock name to use the name to perform cooperative advisory\nlocking. But be aware that it also enables a client that is not among\nthe set of cooperating clients to lock a name, either inadvertently or\ndeliberately, and thus prevent any of the cooperating clients from\nlocking that name. One way to reduce the likelihood of this is to use\nlock names that are database-specific or application-specific. For\nexample, use lock names of the form db_name.str or app_name.str.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT GET_LOCK(\'lock1\',10);\n -> 1\nmysql> SELECT IS_FREE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT GET_LOCK(\'lock2\',10);\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock1\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (327,23,'BIGINT','BIGINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (328,32,'CURTIME','Syntax:\nCURTIME([fsp])\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS format,\ndepending on whether the function is used in a string or numeric\ncontext. The value is expressed in the current time zone.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CURTIME();\n -> \'23:50:26\'\nmysql> SELECT CURTIME() + 0;\n -> 235026.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (329,27,'SET','Syntax:\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n user_var_name = expr\n | [GLOBAL | SESSION] system_var_name = expr\n | [@@global. | @@session. | @@]system_var_name = expr\n\nThe SET statement assigns values to different types of variables that\naffect the operation of the server or your client.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/set-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/set-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (330,38,'TO_BASE64()','Syntax:\nTO_BASE64(str)\n\nConverts the string argument to base-64 encoded form and returns the\nresult as a character string with the connection character set and\ncollation. If the argument is not a string, it is converted to a string\nbefore conversion takes place. The result is NULL if the argument is\nNULL. Base-64 encoded strings can be decoded using the the\nFROM_BASE64() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TO_BASE64(\'abc\'), FROM_BASE64(TO_BASE64(\'abc\'));\n -> \'JWJj\', \'abc\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (331,4,'CONV','Syntax:\nCONV(N,from_base,to_base)\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base\nto_base. Returns NULL if any argument is NULL. The argument N is\ninterpreted as an integer, but may be specified as an integer or a\nstring. The minimum base is 2 and the maximum base is 36. If to_base is\na negative number, N is regarded as a signed number. Otherwise, N is\ntreated as unsigned. CONV() works with 64-bit precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CONV(\'a\',16,2);\n -> \'1010\'\nmysql> SELECT CONV(\'6E\',18,8);\n -> \'172\'\nmysql> SELECT CONV(-17,10,-18);\n -> \'-H\'\nmysql> SELECT CONV(10+\'10\'+\'10\'+0xa,10,10);\n -> \'40\'\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (332,28,'LOAD XML','Syntax:\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE [db_name.]tbl_name\n [PARTITION (partition_name,...)]\n [CHARACTER SET charset_name]\n [ROWS IDENTIFIED BY \'\']\n [IGNORE number {LINES | ROWS}]\n [(column_or_user_var,...)]\n [SET col_name = expr,...]\n\nThe LOAD XML statement reads data from an XML file into a table. The\nfile_name must be given as a literal string. The tagname in the\noptional ROWS IDENTIFIED BY clause must also be given as a literal\nstring, and must be surrounded by angle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML\noutput mode (that is, starting the client with the --xml option). To\nwrite data from a table to an XML file, use a command such as the\nfollowing one from the system shell:\n\nshell> mysql --xml -e \'SELECT * FROM mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default,\nthe element is considered to be the equivalent of a database\ntable row; this can be changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\no Column names as attributes and column values as attribute values:\n\n\n\no Column names as tags and column values as the content of these tags:\n\n\n value1\n value2\n\n\no Column names are the name attributes of tags, and values are\n the contents of these tags:\n\n\n value1\n value2\n\n\n This is the format used by other MySQL tools, such as mysqldump.\n\nAll 3 formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it\ncorrectly. Tags are matched based on the tag or attribute name and the\ncolumn name.\n\nThe following clauses work essentially the same way for LOAD XML as\nthey do for LOAD DATA:\n\no LOW_PRIORITY or CONCURRENT\n\no LOCAL\n\no REPLACE or IGNORE\n\no PARTITION\n\no CHARACTER SET\n\no (column_or_user_var,...)\n\no SET\n\nSee [HELP LOAD DATA], for more information about these clauses.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first\nnumber rows in the XML file to be skipped. It is analogous to the LOAD\nDATA statement\'s IGNORE ... LINES clause.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-xml.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-xml.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (333,15,'ASSIGN-VALUE','Syntax:\n:=\n\nAssignment operator. Causes the user variable on the left hand side of\nthe operator to take on the value to its right. The value on the right\nhand side may be a literal value, another variable storing a value, or\nany legal expression that yields a scalar value, including the result\nof a query (provided that this value is a scalar value). You can\nperform multiple assignments in the same SET statement. You can perform\nmultiple assignments in the same statement-\n\nUnlike =, the := operator is never interpreted as a comparison\noperator. This means you can use := in any valid SQL statement (not\njust in SET statements) to assign a value to a variable.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n\nmysql> SELECT @var1:=COUNT(*) FROM t1;\n -> 4\nmysql> SELECT @var1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/assignment-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (334,27,'SHOW OPEN TABLES','Syntax:\nSHOW OPEN TABLES [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open\nin the table cache. See\nhttp://dev.mysql.com/doc/refman/5.6/en/table-cache.html. The FROM\nclause, if present, restricts the tables shown to those present in the\ndb_name database. The LIKE clause, if present, indicates which table\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-open-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-open-tables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (335,32,'EXTRACT','Syntax:\nEXTRACT(unit FROM date)\n\nThe EXTRACT() function uses the same kinds of unit specifiers as\nDATE_ADD() or DATE_SUB(), but extracts parts from the date rather than\nperforming date arithmetic.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT EXTRACT(YEAR FROM \'2009-07-02\');\n -> 2009\nmysql> SELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n -> 200907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n -> 20102\nmysql> SELECT EXTRACT(MICROSECOND\n -> FROM \'2003-01-02 10:30:00.000123\');\n -> 123\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (336,12,'ENCRYPT','Syntax:\nENCRYPT(str[,salt])\n\nEncrypts str using the Unix crypt() system call and returns a binary\nstring. The salt argument must be a string with at least two characters\nor the result will be NULL. If no salt argument is given, a random\nvalue is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT ENCRYPT(\'hello\');\n -> \'VxuFAJXVARROc\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (337,27,'SHOW STATUS','Syntax:\nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW STATUS provides server status information. This information also\ncan be obtained using the mysqladmin extended-status command. The LIKE\nclause, if present, indicates which variable names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern:\n\nmysql> SHOW STATUS LIKE \'Key%\';\n+--------------------+----------+\n| Variable_name | Value |\n+--------------------+----------+\n| Key_blocks_used | 14955 |\n| Key_read_requests | 96854827 |\n| Key_reads | 162040 |\n| Key_write_requests | 7589728 |\n| Key_writes | 3813196 |\n+--------------------+----------+\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for\nall connections to MySQL. With SESSION, it displays the status values\nfor the current connection. If no modifier is present, the default is\nSESSION. LOCAL is a synonym for SESSION.\n\nSome status variables have only a global value. For these, you get the\nsame value for both GLOBAL and SESSION. The scope for each status\nvariable is listed at\nhttp://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html.\n\nEach invocation of the SHOW STATUS statement uses an internal temporary\ntable and increments the global Created_tmp_tables value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (338,14,'INET6_ATON','Syntax:\nINET6_ATON(expr)\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary\nstring that represents the numeric value of the address in network byte\norder (big endian). Because numeric-format IPv6 addresses require more\nbytes than the largest integer type, the representation returned by\nthis function has the VARBINARY data type: VARBINARY(16) for IPv6\naddresses and VARBINARY(4) for IPv4 addresses. If the argument is not a\nvalid address, INET6_ATON() returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT HEX(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'FDFE0000000000005A55CAFFFEFA9089\'\nmysql> SELECT HEX(INET6_ATON(\'10.0.5.9\'));\n -> \'0A000509\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (339,27,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster.\n\nThe list is displayed on any server (not just the master server). The\noutput looks like this:\n\nmysql> SHOW SLAVE HOSTS;\n+-----------+-----------+-------+-----------+--------------------------------------+\n| Server_id | Host | Port | Master_id | Slave_UUID |\n+-----------+-----------+-------+-----------+--------------------------------------+\n| 192168010 | iconnect2 | 3306 | 192168011 | 14cb6624-7f93-11e0-b2c0-c80aa9429562 |\n| 1921680101 | athena | 3306 | 192168011 | 07af4990-f41f-11df-a566-7ac56fdaf645 |\n+------------+-----------+------+-----------+--------------------------------------+\n\no Server_id: The unique server ID of the slave server, as configured in\n the server\'s option file, or on the command line with\n --server-id=value.\n\no Host: The host name of the slave server, as configured in the\n server\'s option file, or on the command line with\n --report-host=host_name. Note that this can differ from the machine\n name as configured in the operating system.\n\no Port: The port the slave server is listening on.\n\n In MySQL 5.6.5 and later, a zero in this column means that the slave\n port (--report-port) was not set. Prior to MySQL 5.6.5, 3306 was used\n as the default in such cases (Bug #13333431).\n\no Master_id: The unique server ID of the master server that the slave\n server is replicating from.\n\no Slave_UUID: The globally unique ID of this slave, as generated on the\n slave and found in the slave\'s auto.cnf file.\n\n This column was added in MySQL 5.6.0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-slave-hosts.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-slave-hosts.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (340,8,'START TRANSACTION','Syntax:\nSTART TRANSACTION\n [transaction_characteristic [, transaction_characteristic] ...]\n\ntransaction_characteristic:\n WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n\nBEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\nThese statements provide control over use of transactions:\n\no START TRANSACTION or BEGIN start a new transaction.\n\no COMMIT commits the current transaction, making its changes permanent.\n\no ROLLBACK rolls back the current transaction, canceling its changes.\n\no SET autocommit disables or enables the default autocommit mode for\n the current session.\n\nBy default, MySQL runs with autocommit mode enabled. This means that as\nsoon as you execute a statement that updates (modifies) a table, MySQL\nstores the update on disk to make it permanent. The change cannot be\nrolled back.\n\nTo disable autocommit mode implicitly for a single series of\nstatements, use the START TRANSACTION statement:\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nWith START TRANSACTION, autocommit remains disabled until you end the\ntransaction with COMMIT or ROLLBACK. The autocommit mode then reverts\nto its previous state.\n\nSTART TRANSACTION permits several modifiers that control transaction\ncharacteristics. To specify multiple modifiers, separate them by\ncommas.\n\no The WITH CONSISTENT SNAPSHOT modifier starts a consistent read for\n storage engines that are capable of it. This applies only to InnoDB.\n The effect is the same as issuing a START TRANSACTION followed by a\n SELECT from any InnoDB table. See\n http://dev.mysql.com/doc/refman/5.6/en/innodb-consistent-read.html.\n The WITH CONSISTENT SNAPSHOT modifier does not change the current\n transaction isolation level, so it provides a consistent snapshot\n only if the current isolation level is one that permits consistent\n read (REPEATABLE READ or SERIALIZABLE).\n\no The READ WRITE and READ ONLY modifiers set the transaction access\n mode. They permit or prohibit changes to tables used in the\n transaction. The READ ONLY restriction prevents the transaction from\n modifying or locking both transactional and nontransactional tables\n that are visible to other transactions; the transaction can still\n modify or lock temporary tables. These modifiers are available as of\n MySQL 5.6.5.\n\n MySQL enables extra optimizations for queries on InnoDB tables when\n the transaction is known to be read-only. Specifying READ ONLY\n ensures these optimizations are applied in cases where the read-only\n status cannot be determined automatically. See\n http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb\n -performance-ro-txn for more information.\n\n If no access mode is specified, the default mode applies. Unless the\n default has been changed, it is read/write. It is not permitted to\n specify both READ WRITE and READ ONLY in the same statement.\n\n In read-only mode, it remains possible to change tables created with\n the TEMPORARY keyword using DML statements. Changes made with DDL\n statements are not permitted, just as with permanent tables.\n\n For additional information about transaction access mode, including\n ways to change the default mode, see [HELP ISOLATION].\n\n If the read_only system variable is enabled, explicitly starting a\n transaction with START TRANSACTION READ WRITE requires the SUPER\n privilege.\n\n*Important*: Many APIs used for writing MySQL client applications (such\nas JDBC) provide their own methods for starting transactions that can\n(and sometimes should) be used instead of sending a START TRANSACTION\nstatement from the client. See\nhttp://dev.mysql.com/doc/refman/5.6/en/connectors-apis.html, or the\ndocumentation for your API, for more information.\n\nTo disable autocommit mode explicitly, use the following statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to\nzero, changes to transaction-safe tables (such as those for InnoDB or\nNDB) are not made permanent immediately. You must use COMMIT to store\nyour changes to disk or ROLLBACK to ignore the changes.\n\nautocommit is a session variable and must be set for each session. To\ndisable autocommit mode for each new connection, see the description of\nthe autocommit system variable at\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nBEGIN and BEGIN WORK are supported as aliases of START TRANSACTION for\ninitiating a transaction. START TRANSACTION is standard SQL syntax, is\nthe recommended way to start an ad-hoc transaction, and permits\nmodifiers that BEGIN does not.\n\nThe BEGIN statement differs from the use of the BEGIN keyword that\nstarts a BEGIN ... END compound statement. The latter does not begin a\ntransaction. See [HELP BEGIN END].\n\n*Note*: Within all stored programs (stored procedures and functions,\ntriggers, and events), the parser treats BEGIN [WORK] as the beginning\nof a BEGIN ... END block. Begin a transaction in this context with\nSTART TRANSACTION instead.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are\nthe CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of the\ncompletion_type system variable determines the default completion\nbehavior. See\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the\ncurrent one ends, and the new transaction has the same isolation level\nas the just-terminated transaction. The RELEASE clause causes the\nserver to disconnect the current client session after terminating the\ncurrent transaction. Including the NO keyword suppresses CHAIN or\nRELEASE completion, which can be useful if the completion_type system\nvariable is set to cause chaining or release completion by default.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/commit.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/commit.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (341,32,'TIME_FORMAT','Syntax:\nTIME_FORMAT(time,format)\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, seconds, and\nmicroseconds. Other specifiers produce a NULL value or 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n -> \'100 100 04 04 4\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (342,40,'CREATE DATABASE','Syntax:\nCREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n [create_specification] ...\n\ncreate_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nCREATE DATABASE creates a database with the given name. To use this\nstatement, you need the CREATE privilege for the database. CREATE\nSCHEMA is a synonym for CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (343,16,'VAR_POP','Syntax:\nVAR_POP(expr)\n\nReturns the population standard variance of expr. It considers rows as\nthe whole population, not as a sample, so it has the number of rows as\nthe denominator. You can also use VARIANCE(), which is equivalent but\nis not standard SQL.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (344,38,'CONCAT_WS','Syntax:\nCONCAT_WS(separator,str1,str2,...)\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form\nof CONCAT(). The first argument is the separator for the rest of the\narguments. The separator is added between the strings to be\nconcatenated. The separator can be a string, as can the rest of the\narguments. If the separator is NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n -> \'First name,Second name,Last Name\'\nmysql> SELECT CONCAT_WS(\',\',\'First name\',NULL,\'Last Name\');\n -> \'First name,Last Name\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (345,23,'TEXT','TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 65,535 (216 - 1) characters. The\neffective maximum length is less if the value contains multi-byte\ncharacters. Each TEXT value is stored using a 2-byte length prefix that\nindicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest TEXT type large enough to hold\nvalues M characters long.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (346,20,'~','Syntax:\n~\n\nInvert all bits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 5 & ~1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (347,4,'ASIN','Syntax:\nASIN(X)\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ASIN(0.2);\n -> 0.20135792079033\nmysql> SELECT ASIN(\'foo\');\n\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (348,17,'ROW_COUNT','Syntax:\nROW_COUNT()\n\nIn MySQL 5.6, ROW_COUNT() returns a value as follows:\n\no DDL statements: 0. This applies to statements such as CREATE TABLE or\n DROP TABLE.\n\no DML statements other than SELECT: The number of affected rows. This\n applies to statements such as UPDATE, INSERT, or DELETE (as before),\n but now also to statements such as ALTER TABLE and LOAD DATA INFILE.\n\no SELECT: -1 if the statement returns a result set, or the number of\n rows "affected" if it does not. For example, for SELECT * FROM t1,\n ROW_COUNT() returns -1. For SELECT * FROM t1 INTO OUTFILE\n \'file_name\', ROW_COUNT() returns the number of rows written to the\n file.\n\no SIGNAL statements: 0.\n\nFor UPDATE statements, the affected-rows value by default is the number\nof rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to\nmysql_real_connect() when connecting to mysqld, the affected-rows value\nis the number of rows "found"; that is, matched by the WHERE clause.\n\nFor REPLACE statements, the affected-rows value is 2 if the new row\nreplaced an old row, because in this case, one row was inserted after\nthe duplicate was deleted.\n\nFor INSERT ... ON DUPLICATE KEY UPDATE statements, the affected-rows\nvalue is 1 if the row is inserted as a new row and 2 if an existing row\nis updated.\n\nThe ROW_COUNT() value is similar to the value from the\nmysql_affected_rows() C API function and the row count that the mysql\nclient displays following statement execution.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> DELETE FROM t WHERE i IN(1,2);\nQuery OK, 2 rows affected (0.00 sec)\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (349,4,'SIGN','Syntax:\nSIGN(X)\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X\nis negative, zero, or positive.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT SIGN(-32);\n -> -1\nmysql> SELECT SIGN(0);\n -> 0\nmysql> SELECT SIGN(234);\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (350,23,'FLOAT','FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA small (single-precision) floating-point number. Permissible values\nare -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to\n3.402823466E+38. These are the theoretical limits, based on the IEEE\nstandard. The actual range might be slightly smaller depending on your\nhardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A single-precision floating-point\nnumber is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all\ncalculations in MySQL are done with double precision. See\nhttp://dev.mysql.com/doc/refman/5.6/en/no-matching-rows.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (351,17,'CHARSET','Syntax:\nCHARSET(str)\n\nReturns the character set of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT CHARSET(\'abc\');\n -> \'latin1\'\nmysql> SELECT CHARSET(CONVERT(\'abc\' USING utf8));\n -> \'utf8\'\nmysql> SELECT CHARSET(USER());\n -> \'utf8\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (352,32,'SUBDATE','Syntax:\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE()\nis a synonym for DATE_SUB(). For information on the INTERVAL unit\nargument, see the discussion for DATE_ADD().\n\nmysql> SELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\nmysql> SELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\n\nThe second form enables the use of an integer value for days. In such\ncases, it is interpreted as the number of days to be subtracted from\nthe date or datetime expression expr.\n\nmysql> SELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n -> \'2007-12-02 12:00:00\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (353,32,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n -> 34\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (354,4,'%','Syntax:\nN % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M. For more\ninformation, see the description for the MOD() function in\nhttp://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (355,3,'ASTEXT','AsText(g), AsWKT(g)\n\nConverts a value in internal geometry format to its WKT representation\nand returns the string result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-to-convert-geometries-between-formats.html\n\n','mysql> SET @g = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(GeomFromText(@g));\n+--------------------------+\n| AsText(GeomFromText(@g)) |\n+--------------------------+\n| LINESTRING(1 1,2 2,3 3) |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/functions-to-convert-geometries-between-formats.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (356,24,'DECLARE CONDITION','Syntax:\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n\nThe DECLARE ... CONDITION statement declares a named error condition,\nassociating a name with a condition that needs specific handling. The\nname can be referred to in a subsequent DECLARE ... HANDLER statement\n(see [HELP DECLARE HANDLER]).\n\nCondition declarations must appear before cursor or handler\ndeclarations.\n\nThe condition_value for DECLARE ... CONDITION can be a MySQL error code\n(a number) or an SQLSTATE value (a 5-character string literal). You\nshould not use MySQL error code 0 or SQLSTATE values that begin with\n\'00\', because those indicate success rather than an error condition.\nFor a list of MySQL error codes and SQLSTATE values, see\nhttp://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-condition.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-condition.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (357,32,'MONTHNAME','Syntax:\nMONTHNAME(date)\n\nReturns the full name of the month for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.6/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT MONTHNAME(\'2008-02-03\');\n -> \'February\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (358,26,'NUMGEOMETRIES','NumGeometries(gc)\n\nReturns the number of geometries in the GeometryCollection value gc.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT NumGeometries(GeomFromText(@gc));\n+----------------------------------+\n| NumGeometries(GeomFromText(@gc)) |\n+----------------------------------+\n| 2 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (359,32,'TIMESTAMP FUNCTION','Syntax:\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nWith a single argument, this function returns the date or datetime\nexpression expr as a datetime value. With two arguments, it adds the\ntime expression expr2 to the date or datetime expression expr1 and\nreturns the result as a datetime value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMP(\'2003-12-31\');\n -> \'2003-12-31 00:00:00\'\nmysql> SELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'12:00:00\');\n -> \'2004-01-01 00:00:00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,40,'DROP DATABASE','Syntax:\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDROP DATABASE drops all tables in the database and deletes the\ndatabase. Be very careful with this statement! To use DROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is a synonym\nfor DROP DATABASE.\n\n*Important*: When a database is dropped, user privileges on the\ndatabase are not automatically dropped. See [HELP GRANT].\n\nIF EXISTS is used to prevent an error from occurring if the database\ndoes not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-database.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (361,8,'CHANGE MASTER TO','Syntax:\nCHANGE MASTER TO option [, option] ...\n\noption:\n MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_RETRY_COUNT = count\n | MASTER_DELAY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | MASTER_AUTO_POSITION = {0|1}\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | IGNORE_SERVER_IDS = (server_id_list)\n\nserver_id_list:\n [server_id [, server_id] ... ]\n\nCHANGE MASTER TO changes the parameters that the slave server uses for\nconnecting to the master server, for reading the master binary log, and\nreading the slave relay log. It also updates the contents of the\nmaster.info and relay-log.info files. To use CHANGE MASTER TO, the\nslave replication threads must be stopped (use STOP SLAVE if\nnecessary). In MySQL 5.6.11 and later, gtid_next must also be set to\nAUTOMATIC (Bug #16062608).\n\nOptions not specified retain their value, except as indicated in the\nfollowing discussion. Thus, in most cases, there is no need to specify\noptions that do not change. For example, if the password to connect to\nyour MySQL master has changed, you just need to issue these statements\nto tell the slave about the new password:\n\nSTOP SLAVE; -- if replication was running\nCHANGE MASTER TO MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE; -- if you want to restart replication\n\nMASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide\ninformation to the slave about how to connect to its master:\n\no MASTER_HOST and MASTER_PORT are the host name (or IP address) of the\n master host and its TCP/IP port.\n\n *Note*: Replication cannot use Unix socket files. You must be able to\n connect to the master MySQL server using TCP/IP.\n\n If you specify the MASTER_HOST or MASTER_PORT option, the slave\n assumes that the master server is different from before (even if the\n option value is the same as its current value.) In this case, the old\n values for the master binary log file name and position are\n considered no longer applicable, so if you do not specify\n MASTER_LOG_FILE and MASTER_LOG_POS in the statement,\n MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4 are silently appended to it.\n\n Setting MASTER_HOST=\'\' (that is, setting its value explicitly to an\n empty string) is not the same as not setting MASTER_HOST at all.\n Beginning with MySQL 5.5, trying to set MASTER_HOST to an empty\n string fails with an error. Previously, setting MASTER_HOST to an\n empty string caused START SLAVE subsequently to fail. (Bug #28796)\n\n In MySQL 5.6.5 and later, values used for MASTER_HOST and other\n CHANGE MASTER TO options are checked for linefeed (\\n or 0x0A)\n characters; the presence of such characters in these values causes\n the statement to fail with ER_MASTER_INFO. (Bug #11758581, Bug\n #50801)\n\no MASTER_USER and MASTER_PASSWORD are the user name and password of the\n account to use for connecting to the master.\n\n In MySQL 5.6.4 and later, MASTER_USER cannot be made empty; setting\n MASTER_USER = \'\' or leaving it unset when setting a value for for\n MASTER_PASSWORD causes an error (Bug #13427949).\n\n Currently, a password used for a replication slave account is\n effectively limited to 32 characters in length; the password can be\n longer, but any excess characters are truncated. This is not due to\n any limit imposed by the MySQL Server generally, but rather is an\n issue specific to MySQL Replication. (For more information, see Bug\n #43439.)\n\n The text of a running CHANGE MASTER TO statement, including values\n for MASTER_USER and MASTER_PASSWORD, can be seen in the output of a\n concurrent SHOW PROCESSLIST statement. (The complete text of a START\n SLAVE statement is also visible to SHOW PROCESSLIST.)\n\nThe MASTER_SSL_xxx options provide information about using SSL for the\nconnection. They correspond to the --ssl-xxx options described in\nhttp://dev.mysql.com/doc/refman/5.6/en/ssl-options.html, and\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-solutions-ssl.html.\nThese options can be changed even on slaves that are compiled without\nSSL support. They are saved to the master.info file, but are ignored if\nthe slave does not have SSL support enabled. MASTER_SSL_CRL and\nMASTER_SSL_CRLPATH were added in MySQL 5.6.3.\n\nMASTER_CONNECT_RETRY specifies how many seconds to wait between connect\nretries. The default is 60.\n\nMASTER_RETRY_COUNT, added in MySQL 5.6.1, limits the number of\nreconnection attempts and updates the value of the Master_Retry_Count\ncolumn in the output of SHOW SLAVE STATUS (also added in MySQL 5.6.1).\nThe default value is 24 * 3600 = 86400. MASTER_RETRY_COUNT is intended\nto replace the older --master-retry-count server option, and is now the\npreferred method for setting this limit. You are encouraged not to rely\non --master-retry-count in new applications and, when upgrading to\nMySQL 5.6.1 or later from earlier versions of MySQL, to update any\nexisting applications that rely on it, so that they use CHANGE MASTER\nTO ... MASTER_RETRY_COUNT instead.\n\nMASTER_DELAY specifies how many seconds behind the master the slave\nmust lag. An event received from the master is not executed until at\nleast interval seconds later than its execution on the master. The\ndefault is 0. An error occurs if interval is not a nonnegative integer\nin the range from 0 to 231-1. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-delayed.html. This\noption was added in MySQL 5.6.0.\n\nMASTER_BIND is for use on replication slaves having multiple network\ninterfaces, and determines which of the slave\'s network interfaces is\nchosen for connecting to the master.\n\nThe address configured with this option, if any, can be seen in the\nMaster_Bind column of the output from SHOW SLAVE STATUS. If you are\nusing slave status log tables (server started with\n--master-info-repository=TABLE), the value can also be seen as the\nMaster_bind column of the mysql.slave_master_info table.\n\nThe ability to bind a replication slave to a specific network interface\nwas added in MySQL 5.6.2. This is also supported by MySQL Cluster NDB\n7.3.1 and later.\n\nMASTER_HEARTBEAT_PERIOD sets the interval in seconds between\nreplication heartbeats. Whenever the master\'s binary log is updated\nwith an event, the waiting period for the next heartbeat is reset.\ninterval is a decimal value having the range 0 to 4294967 seconds and a\nresolution in milliseconds; the smallest nonzero value is 0.001.\nHeartbeats are sent by the master only if there are no unsent events in\nthe binary log file for a period longer than interval.\n\nIf you are logging master connection information to tables,\nMASTER_HEARTBEAT_PERIOD can be seen as the value of the Heartbeat\ncolumn of the mysql.slave_master_info table.\n\nSetting interval to 0 disables heartbeats altogether. The default value\nfor interval is equal to the value of slave_net_timeout divided by 2.\n\nSetting @@global.slave_net_timeout to a value less than that of the\ncurrent heartbeat interval results in a warning being issued. The\neffect of issuing RESET SLAVE on the heartbeat interval is to reset it\nto the default value.\n\nMASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the\nslave I/O thread should begin reading from the master the next time the\nthread starts. RELAY_LOG_FILE and RELAY_LOG_POS are the coordinates at\nwhich the slave SQL thread should begin reading from the relay log the\nnext time the thread starts. If you specify either of MASTER_LOG_FILE\nor MASTER_LOG_POS, you cannot specify RELAY_LOG_FILE or RELAY_LOG_POS.\nIn MySQL 5.6.5 and later, if you specify either of MASTER_LOG_FILE or\nMASTER_LOG_POS, you also cannot specify MASTER_AUTO_POSITION = 1\n(described later in this section). If neither of MASTER_LOG_FILE or\nMASTER_LOG_POS is specified, the slave uses the last coordinates of the\nslave SQL thread before CHANGE MASTER TO was issued. This ensures that\nthere is no discontinuity in replication, even if the slave SQL thread\nwas late compared to the slave I/O thread, when you merely want to\nchange, say, the password to use.\n\nMASTER_AUTO_POSITION was added in MySQL 5.6.5. If MASTER_AUTO_POSITION\n= 1 is used with CHANGE MASTER TO, the slave attempts to connect to the\nmaster using the GTID-based replication protocol. In this case, the\ncoordinates represented by MASTER_LOG_FILE and MASTER_LOG_POS are not\nused, and global transaction identifiers are used instead. Thus the use\nof either or both of these options together with MASTER_AUTO_POSITION\ncauses an error.\n\nBeginning with MySQL 5.6.10, you can see whether replication is running\nwith autopositioning enabled by checking the output of SHOW SLAVE\nSTATUS. (Bug #15992220)\n\ngtid_mode must also be enabled before issuing CHANGE MASTER TO ...\nMASTER_AUTO_POSITION = 1. Otherwise, the statement fails with an error.\n\nTo revert to the older file-based replication protocol after using\nGTIDs, you can issue a new CHANGE MASTER TO statement that specifies\nMASTER_AUTO_POSITION = 0, as well as at least one of MASTER_LOG_FILE or\nMASTER_LOG_POSITION.\n\nCHANGE MASTER TO deletes all relay log files and starts a new one,\nunless you specify RELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay\nlog files are kept; the relay_log_purge global variable is set silently\nto 0.\n\nPrior to MySQL 5.6.2, RELAY_LOG_FILE required an absolute path.\nBeginning with MySQL 5.6.2, the path can be relative, in which case it\nis assumed to be relative to the slave\'s data directory. (Bug #12190)\n\nIGNORE_SERVER_IDS takes a comma-separated list of 0 or more server IDs.\nEvents originating from the corresponding servers are ignored, with the\nexception of log rotation and deletion events, which are still recorded\nin the relay log.\n\nIn circular replication, the originating server normally acts as the\nterminator of its own events, so that they are not applied more than\nonce. Thus, this option is useful in circular replication when one of\nthe servers in the circle is removed. Suppose that you have a circular\nreplication setup with 4 servers, having server IDs 1, 2, 3, and 4, and\nserver 3 fails. When bridging the gap by starting replication from\nserver 2 to server 4, you can include IGNORE_SERVER_IDS = (3) in the\nCHANGE MASTER TO statement that you issue on server 4 to tell it to use\nserver 2 as its master instead of server 3. Doing so causes it to\nignore and not to propagate any statements that originated with the\nserver that is no longer in use.\n\nIf a CHANGE MASTER TO statement is issued without any IGNORE_SERVER_IDS\noption, any existing list is preserved; RESET SLAVE also has no effect\non the server ID list. To clear the list of ignored servers, it is\nnecessary to use the option with an empty list:\n\nCHANGE MASTER TO IGNORE_SERVER_IDS = ();\n\nIf IGNORE_SERVER_IDS contains the server\'s own ID and the server was\nstarted with the --replicate-same-server-id option enabled, an error\nresults.\n\nIn MySQL 5.6, the master.info file and the output of SHOW SLAVE STATUS\nprovide the list of servers that are currently ignored. For more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.6/en/slave-logs-status.html, and\n[HELP SHOW SLAVE STATUS].\n\nIn MySQL 5.6, invoking CHANGE MASTER TO causes the previous values for\nMASTER_HOST, MASTER_PORT, MASTER_LOG_FILE, and MASTER_LOG_POS to be\nwritten to the error log, along with other information about the\nslave\'s state prior to execution.\n\nIn MySQL 5.6.7 and later, CHANGE MASTER TO causes an implicit commit of\nan ongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nCHANGE MASTER TO is useful for setting up a slave when you have the\nsnapshot of the master and have recorded the master binary log\ncoordinates corresponding to the time of the snapshot. After loading\nthe snapshot into the slave to synchronize it to the slave, you can run\nCHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos on\nthe slave to specify the coordinates at which the slave should begin\nreading the master binary log.\n\nThe following example changes the master server the slave uses and\nestablishes the master binary log coordinates from which the slave\nbegins reading. This is used when you want to set up the slave to\nreplicate the master:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\n\nThe next example shows an operation that is less frequently employed.\nIt is used when the slave has relay log files that you want it to\nexecute again for some reason. To do this, the master need not be\nreachable. You need only use CHANGE MASTER TO and start the SQL thread\n(START SLAVE SQL_THREAD):\n\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (362,27,'SHOW GRANTS','Syntax:\nSHOW GRANTS [FOR user]\n\nThis statement lists the GRANT statement or statements that must be\nissued to duplicate the privileges that are granted to a MySQL user\naccount. The account is named using the same format as for the GRANT\nstatement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used.\nFor additional information about specifying account names, see [HELP\nGRANT].\n\nmysql> SHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo list the privileges granted to the account that you are using to\nconnect to the server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is\nused in DEFINER context, such as within a stored procedure that is\ndefined with SQL SECURITY DEFINER), the grants displayed are those of\nthe definer and not the invoker.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-grants.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-grants.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (363,4,'CRC32','Syntax:\nCRC32(expr)\n\nComputes a cyclic redundancy check value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is\nexpected to be a string and (if possible) is treated as one if it is\nnot.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CRC32(\'MySQL\');\n -> 3259397556\nmysql> SELECT CRC32(\'mysql\');\n -> 2501908538\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (364,13,'STARTPOINT','StartPoint(ls)\n\nReturns the Point that is the start point of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(StartPoint(GeomFromText(@ls)));\n+---------------------------------------+\n| AsText(StartPoint(GeomFromText(@ls))) |\n+---------------------------------------+\n| POINT(1 1) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (365,3,'MPOLYFROMTEXT','MPolyFromText(wkt[,srid]), MultiPolygonFromText(wkt[,srid])\n\nConstructs a MULTIPOLYGON value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (366,24,'DECLARE VARIABLE','Syntax:\nDECLARE var_name [, var_name] ... type [DEFAULT value]\n\nThis statement declares local variables within stored programs. To\nprovide a default value for a variable, include a DEFAULT clause. The\nvalue can be specified as an expression; it need not be a constant. If\nthe DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect\nto data type and overflow checking. See [HELP CREATE PROCEDURE].\n\nVariable declarations must appear before cursor or handler\ndeclarations.\n\nLocal variable names are not case sensitive. Permissible characters and\nquoting rules are the same as for other identifiers, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/identifiers.html.\n\nThe scope of a local variable is the BEGIN ... END block within which\nit is declared. The variable can be referred to in blocks nested within\nthe declaring block, except those blocks that declare a variable with\nthe same name.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-local-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-local-variable.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (367,19,'NOT BETWEEN','Syntax:\nexpr NOT BETWEEN min AND max\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (368,32,'YEARWEEK','Syntax:\nYEARWEEK(date), YEARWEEK(date,mode)\n\nReturns year and week for a date. The mode argument works exactly like\nthe mode argument to WEEK(). The year in the result may be different\nfrom the year in the date argument for the first and the last week of\nthe year.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT YEARWEEK(\'1987-01-01\');\n -> 198653\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (369,16,'BIT_OR','Syntax:\nBIT_OR(expr)\n\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (370,4,'LOG10','Syntax:\nLOG10(X)\n\nReturns the base-10 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG10(2);\n -> 0.30102999566398\nmysql> SELECT LOG10(100);\n -> 2\nmysql> SELECT LOG10(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (371,23,'DECIMAL','DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nA packed "exact" fixed-point number. M is the total number of digits\n(the precision) and D is the number of digits after the decimal point\n(the scale). The decimal point and (for negative numbers) the "-" sign\nare not counted in M. If D is 0, values have no decimal point or\nfractional part. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30. If D is omitted,\nthe default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with\na precision of 65 digits.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (372,40,'CREATE FUNCTION','The CREATE FUNCTION statement is used to create stored functions and\nuser-defined functions (UDFs):\n\no For information about creating stored functions, see [HELP CREATE\n PROCEDURE].\n\no For information about creating user-defined functions, see [HELP\n CREATE FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (373,19,'<','Syntax:\n<\n\nLess than:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 < 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (374,12,'MD5','Syntax:\nMD5(str)\n\nCalculates an MD5 128-bit checksum for the string. The value is\nreturned as a string of 32 hex digits, or NULL if the argument was\nNULL. The return value can, for example, be used as a hash key. See the\nnotes at the beginning of this section about storing hash values\nefficiently.\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT MD5(\'testing\');\n -> \'ae2b1fca515949e5d54fb22b8ed95575\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (375,32,'DAYOFMONTH','Syntax:\nDAYOFMONTH(date)\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for\ndates such as \'0000-00-00\' or \'2008-00-00\' that have a zero day part.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFMONTH(\'2007-02-03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (376,32,'UNIX_TIMESTAMP','Syntax:\nUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If UNIX_TIMESTAMP()\nis called with a date argument, it returns the value of the argument as\nseconds since \'1970-01-01 00:00:00\' UTC. date may be a DATE string, a\nDATETIME string, a TIMESTAMP, or a number in the format YYMMDD or\nYYYYMMDD. The server interprets date as a value in the current time\nzone and converts it to an internal value in UTC. Clients can set their\ntime zone as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/time-zone-support.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UNIX_TIMESTAMP();\n -> 1196440210\nmysql> SELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n -> 1196440219\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (377,10,'RENAME USER','Syntax:\nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n\nThe RENAME USER statement renames existing MySQL accounts. To use it,\nyou must have the global CREATE USER privilege or the UPDATE privilege\nfor the mysql database. An error occurs if any old account does not\nexist or any new account exists. Each account name uses the format\ndescribed in http://dev.mysql.com/doc/refman/5.6/en/account-names.html.\nFor example:\n\nRENAME USER \'jeffrey\'@\'localhost\' TO \'jeff\'@\'127.0.0.1\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nRENAME USER causes the privileges held by the old user to be those held\nby the new user. However, RENAME USER does not automatically drop or\ninvalidate databases or objects within them that the old user created.\nThis includes stored programs or views for which the DEFINER attribute\nnames the old user. Attempts to access such objects may produce an\nerror if they execute in definer security context. (For information\nabout security context, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-security.html.)\n\nThe privilege changes take effect as indicated in\nhttp://dev.mysql.com/doc/refman/5.6/en/privilege-changes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/rename-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/rename-user.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (378,13,'NUMPOINTS','NumPoints(ls)\n\nReturns the number of Point objects in the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n| 3 |\n+------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (379,40,'ALTER LOGFILE GROUP','Syntax:\nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement adds an UNDO file named \'file_name\' to an existing log\nfile group logfile_group. An ALTER LOGFILE GROUP statement has one and\nonly one ADD UNDOFILE clause. No DROP UNDOFILE clause is currently\nsupported.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an undo log file with the same name, or an undo\nlog file and a data file with the same name.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size\nin bytes; if not specified, the initial size default to 128M (128\nmegabytes). You may optionally follow size with a one-letter\nabbreviation for an order of magnitude, similar to those used in\nmy.cnf. Generally, this is one of the letters M (for megabytes) or G\n(for gigabytes).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nThe minimum permitted value for INITIAL_SIZE is 1M. (Bug #29574)\n\n*Note*: WAIT is parsed but otherwise ignored. This keyword currently\nhas no effect, and is intended for future expansion.\n\nThe ENGINE parameter (required) determines the storage engine which is\nused by this log file group, with engine_name being the name of the\nstorage engine. Currently, the only accepted values for engine_name are\n"NDBCLUSTER" and "NDB". The two values are equivalent.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-logfile-group.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (380,32,'LOCALTIMESTAMP','Syntax:\nLOCALTIMESTAMP, LOCALTIMESTAMP([fsp])\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (381,32,'ADDDATE','Syntax:\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE()\nis a synonym for DATE_ADD(). The related function SUBDATE() is a\nsynonym for DATE_SUB(). For information on the INTERVAL unit argument,\nsee the discussion for DATE_ADD().\n\nmysql> SELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\nmysql> SELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\n\nWhen invoked with the days form of the second argument, MySQL treats it\nas an integer number of days to be added to expr.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT ADDDATE(\'2008-01-02\', 31);\n -> \'2008-02-02\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (382,40,'ALTER FUNCTION','Syntax:\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nfunction. More than one change may be specified in an ALTER FUNCTION\nstatement. However, you cannot change the parameters or body of a\nstored function using this statement; to make such changes, you must\ndrop and re-create the function using DROP FUNCTION and CREATE\nFUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That\nprivilege is granted automatically to the function creator.) If binary\nlogging is enabled, the ALTER FUNCTION statement might also require the\nSUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-logging.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-function.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (383,14,'IS_FREE_LOCK','Syntax:\nIS_FREE_LOCK(str)\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock\nis in use, and NULL if an error occurs (such as an incorrect argument).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (384,8,'DEALLOCATE PREPARE','Syntax:\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nTo deallocate a prepared statement produced with PREPARE, use a\nDEALLOCATE PREPARE statement that refers to the prepared statement\nname. Attempting to execute a prepared statement after deallocating it\nresults in an error. If too many prepared statements are created and\nnot deallocated by either the DEALLOCATE PREPARE statement or the end\nof the session, you might encounter the upper limit enforced by the\nmax_prepared_stmt_count system variable.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/deallocate-prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/deallocate-prepare.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (385,31,'TOUCHES','Touches(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two\ngeometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either\nthe boundary or the interior of the other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (386,23,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/example-auto-increment.html\n\n','CREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n);\n\nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'lax\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n','http://dev.mysql.com/doc/refman/5.6/en/example-auto-increment.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (387,12,'UNCOMPRESS','Syntax:\nUNCOMPRESS(string_to_uncompress)\n\nUncompresses a string compressed by the COMPRESS() function. If the\nargument is not a compressed value, the result is NULL. This function\nrequires MySQL to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESS(COMPRESS(\'any string\'));\n -> \'any string\'\nmysql> SELECT UNCOMPRESS(\'any string\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (388,3,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt[,srid]), GeometryCollectionFromText(wkt[,srid])\n\nConstructs a GEOMETRYCOLLECTION value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (389,17,'LAST_INSERT_ID','Syntax:\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nLAST_INSERT_ID() (with no argument) returns a BIGINT (64-bit) value\nrepresenting the first automatically generated value successfully\ninserted for an AUTO_INCREMENT column as a result of the most recently\nexecuted INSERT statement. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT\nvalue, you can get the value like this:\n\nmysql> SELECT LAST_INSERT_ID();\n -> 195\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table with its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain\nstable in the second statement; its value for the second and later rows\nis not affected by the earlier row insertions. (However, if you mix\nreferences to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is\nundefined.)\n\nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if the\nstatement is rolled back due to an error, the value of LAST_INSERT_ID()\nis left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()\nis not restored to that before the transaction; it remains as it was at\nthe point of the ROLLBACK.\n\nWithin the body of a stored routine (procedure or function) or a\ntrigger, the value of LAST_INSERT_ID() changes the same way as for\nstatements executed outside the body of these kinds of objects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements depends on the\nkind of routine:\n\no If a stored procedure executes statements that change the value of\n LAST_INSERT_ID(), the changed value is seen by statements that follow\n the procedure call.\n\no For stored functions and triggers that change the value, the value is\n restored when the function or trigger ends, so following statements\n will not see a changed value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,4,'FLOOR','Syntax:\nFLOOR(X)\n\nReturns the largest integer value not greater than X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT FLOOR(1.23);\n -> 1\nmysql> SELECT FLOOR(-1.23);\n -> -2\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (391,4,'COS','Syntax:\nCOS(X)\n\nReturns the cosine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT COS(PI());\n -> -1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (392,16,'STD','Syntax:\nSTD(expr)\n\nReturns the population standard deviation of expr. This is an extension\nto standard SQL. The standard SQL function STDDEV_POP() can be used\ninstead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (393,32,'DATE FUNCTION','Syntax:\nDATE(expr)\n\nExtracts the date part of the date or datetime expression expr.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATE(\'2003-12-31 01:02:03\');\n -> \'2003-12-31\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (394,4,'TAN','Syntax:\nTAN(X)\n\nReturns the tangent of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT TAN(PI());\n -> -1.2246063538224e-16\nmysql> SELECT TAN(PI()+1);\n -> 1.5574077246549\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (395,32,'WEEKOFYEAR','Syntax:\nWEEKOFYEAR(date)\n\nReturns the calendar week of the date as a number in the range from 1\nto 53. WEEKOFYEAR() is a compatibility function that is equivalent to\nWEEK(date,3).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKOFYEAR(\'2008-02-20\');\n -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (396,12,'UNCOMPRESSED_LENGTH','Syntax:\nUNCOMPRESSED_LENGTH(compressed_string)\n\nReturns the length that the compressed string had before being\ncompressed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n -> 30\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (397,32,'SUBTIME','Syntax:\nSUBTIME(expr1,expr2)\n\nSUBTIME() returns expr1 - expr2 expressed as a value in the same format\nas expr1. expr1 is a time or datetime expression, and expr2 is a time\nexpression.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n -> \'2007-12-30 22:58:58.999997\'\nmysql> SELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'-00:59:59.999999\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (398,4,'LOG2','Syntax:\nLOG2(X)\n\nReturns the base-2 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG2(65536);\n -> 16\nmysql> SELECT LOG2(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (399,4,'POW','Syntax:\nPOW(X,Y)\n\nReturns the value of X raised to the power of Y.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT POW(2,2);\n -> 4\nmysql> SELECT POW(2,-2);\n -> 0.25\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (400,40,'DROP TABLE','Syntax:\nDROP [TEMPORARY] TABLE [IF EXISTS]\n tbl_name [, tbl_name] ...\n [RESTRICT | CASCADE]\n\nDROP TABLE removes one or more tables. You must have the DROP privilege\nfor each table. All table data and the table definition are removed, so\nbe careful with this statement! If any of the tables named in the\nargument list do not exist, MySQL returns an error indicating by name\nwhich nonexisting tables it was unable to drop, but it also drops all\nof the tables in the list that do exist.\n\n*Important*: When a table is dropped, user privileges on the table are\nnot automatically dropped. See [HELP GRANT].\n\nNote that for a partitioned table, DROP TABLE permanently removes the\ntable definition, all of its partitions, and all of the data which was\nstored in those partitions. It also removes the partitioning definition\n(.par) file associated with the dropped table.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not\nexist. A NOTE is generated for each nonexistent table when using IF\nEXISTS. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE are permitted to make porting easier. In MySQL\n5.6, they do nothing.\n\n*Note*: DROP TABLE automatically commits the current active\ntransaction, unless you use the TEMPORARY keyword.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (401,32,'NOW','Syntax:\nNOW([fsp])\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context. The value is expressed in the current time\nzone.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT NOW();\n -> \'2007-12-15 23:50:26\'\nmysql> SELECT NOW() + 0;\n -> 20071215235026.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (402,27,'SHOW ENGINES','Syntax:\nSHOW [STORAGE] ENGINES\n\nSHOW ENGINES displays status information about the server\'s storage\nengines. This is particularly useful for checking whether a storage\nengine is supported, or to see what the default engine is.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-engines.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-engines.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (403,14,'IS_IPV6','Syntax:\nIS_IPV6(expr)\n\nReturns 1 if the argument is a valid IPv6 address specified as a\nstring, 0 otherwise. This function does not consider IPv4 addresses to\nbe valid IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT IS_IPV6(\'10.0.5.9\'), IS_IPV6(\'::1\');\n -> 0, 1\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (404,23,'LONGBLOB','LONGBLOB\n\nA BLOB column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\nbytes. The effective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol and\navailable memory. Each LONGBLOB value is stored using a 4-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (405,31,'ST_OVERLAPS','ST_Overlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (406,23,'YEAR DATA TYPE','YEAR[(2|4)]\n\nA year in two-digit or four-digit format. The default is four-digit\nformat. YEAR(2) or YEAR(4) differ in display format, but have the same\nrange of values. In four-digit format, values display as 1901 to 2155,\nand 0000. In two-digit format, values display as 70 to 69, representing\nyears from 1970 to 2069. MySQL displays YEAR values in YYYY or\nYYformat, but permits assignment of values to YEAR columns using either\nstrings or numbers.\n\n*Note*: The YEAR(2) data type has certain issues that you should\nconsider before choosing to use it. As of MySQL 5.6.6, YEAR(2) is\ndeprecated. YEAR(2) columns in existing tables are treated as before,\nbut YEAR(2) in new or altered tables are converted to YEAR(4). For more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.6/en/migrating-to-year4.html.\n\nFor additional information about YEAR display format and interpretation\nof input values, see http://dev.mysql.com/doc/refman/5.6/en/year.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (407,16,'SUM','Syntax:\nSUM([DISTINCT] expr)\n\nReturns the sum of expr. If the return set has no rows, SUM() returns\nNULL. The DISTINCT keyword can be used to sum only the distinct values\nof expr.\n\nSUM() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (408,38,'REPEAT FUNCTION','Syntax:\nREPEAT(str,count)\n\nReturns a string consisting of the string str repeated count times. If\ncount is less than 1, returns an empty string. Returns NULL if str or\ncount are NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT REPEAT(\'MySQL\', 3);\n -> \'MySQLMySQLMySQL\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (409,38,'SOUNDEX','Syntax:\nSOUNDEX(str)\n\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis four characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get a\nstandard soundex string. All nonalphabetic characters in str are\nignored. All international alphabetic characters outside the A-Z range\nare treated as vowels.\n\n*Important*: When using SOUNDEX(), you should be aware of the following\nlimitations:\n\no This function, as currently implemented, is intended to work well\n with strings that are in the English language only. Strings in other\n languages may not produce reliable results.\n\no This function is not guaranteed to provide consistent results with\n strings that use multi-byte character sets, including utf-8.\n\n We hope to remove these limitations in a future release. See Bug\n #22638 for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SOUNDEX(\'Hello\');\n -> \'H400\'\nmysql> SELECT SOUNDEX(\'Quadratically\');\n -> \'Q36324\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (410,6,'MBRTOUCHES','MBRTouches(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 touch. Two geometries spatially touch if\nthe interiors of the geometries do not intersect, but the boundary of\none of the geometries intersects either the boundary or the interior of\nthe other.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (411,40,'DROP EVENT','Syntax:\nDROP EVENT [IF EXISTS] event_name\n\nThis statement drops the event named event_name. The event immediately\nceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown\nevent \'event_name\' results. You can override this and cause the\nstatement to generate a warning for nonexistent events instead using IF\nEXISTS.\n\nThis statement requires the EVENT privilege for the schema to which the\nevent to be dropped belongs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (412,23,'VARBINARY','VARBINARY(M)\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary\nbyte strings rather than nonbinary character strings. M represents the\nmaximum column length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (413,27,'LOAD INDEX','Syntax:\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n [PARTITION (partition_list | ALL)]\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key\ncache to which it has been assigned by an explicit CACHE INDEX\nstatement, or into the default key cache otherwise.\n\nLOAD INDEX INTO CACHE is used only for MyISAM tables. In MySQL 5.6, it\nis also supported for partitioned MyISAM tables; in addition, indexes\non partitioned tables can be preloaded for one, several, or all\npartitions.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of\nthe index to be preloaded.\n\nIGNORE LEAVES is also supported for partitioned MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (414,28,'UNION','Syntax:\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n\nUNION is used to combine the result from multiple SELECT statements\ninto a single result set.\n\nThe column names from the first SELECT statement are used as the column\nnames for the results returned. Selected columns listed in\ncorresponding positions of each SELECT statement should have the same\ndata type. (For example, the first column selected by the first\nstatement should have the same type as the first column selected by the\nother statements.)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/union.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/union.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (415,32,'TO_DAYS','Syntax:\nTO_DAYS(date)\n\nGiven a date date, returns a day number (the number of days since year\n0).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TO_DAYS(950501);\n -> 728779\nmysql> SELECT TO_DAYS(\'2007-10-07\');\n -> 733321\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (416,27,'SHOW CREATE DATABASE','Syntax:\nSHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n\nShows the CREATE DATABASE statement that creates the given database. If\nthe SHOW statement includes an IF NOT EXISTS clause, the output too\nincludes such a clause. SHOW CREATE SCHEMA is a synonym for SHOW CREATE\nDATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-create-database.html\n\n','mysql> SHOW CREATE DATABASE test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n\nmysql> SHOW CREATE SCHEMA test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n','http://dev.mysql.com/doc/refman/5.6/en/show-create-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (417,27,'SHOW INDEX','Syntax:\nSHOW {INDEX | INDEXES | KEYS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [WHERE expr]\n\nSHOW INDEX returns table index information. The format resembles that\nof the SQLStatistics call in ODBC. This statement requires some\nprivilege for any column in the table.\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nThe WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nYou can also list a table\'s indexes with the mysqlshow -k db_name\ntbl_name command.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-index.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (418,15,'!','Syntax:\nNOT, !\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnonzero, and NOT NULL returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html\n\n','mysql> SELECT NOT 10;\n -> 0\nmysql> SELECT NOT 0;\n -> 1\nmysql> SELECT NOT NULL;\n -> NULL\nmysql> SELECT ! (1+1);\n -> 0\nmysql> SELECT ! 1+1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (419,23,'DOUBLE','DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA normal-size (double-precision) floating-point number. Permissible\nvalues are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and\n2.2250738585072014E-308 to 1.7976931348623157E+308. These are the\ntheoretical limits, based on the IEEE standard. The actual range might\nbe slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A double-precision floating-point\nnumber is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (420,24,'DECLARE HANDLER','Syntax:\nDECLARE handler_action HANDLER\n FOR condition_value [, condition_value] ...\n statement\n\nhandler_action:\n CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n\nThe DECLARE ... HANDLER statement specifies a handler that deals with\none or more conditions. If one of these conditions occurs, the\nspecified statement executes. statement can be a simple statement such\nas SET var_name = value, or a compound statement written using BEGIN\nand END (see [HELP BEGIN END]).\n\nHandler declarations must appear after variable or condition\ndeclarations.\n\nThe handler_action value indicates what action the handler takes after\nexecution of the handler statement:\n\no CONTINUE: Execution of the current program continues.\n\no EXIT: Execution terminates for the BEGIN ... END compound statement\n in which the handler is declared. This is true even if the condition\n occurs in an inner block.\n\no UNDO: Not supported.\n\nThe condition_value for DECLARE ... HANDLER indicates the specific\ncondition or class of conditions that activates the handler:\n\no A MySQL error code (a number) or an SQLSTATE value (a 5-character\n string literal). You should not use MySQL error code 0 or SQLSTATE\n values that begin with \'00\', because those indicate success rather\n than an error condition. For a list of MySQL error codes and SQLSTATE\n values, see\n http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html.\n\no A condition name previously specified with DECLARE ... CONDITION. A\n condition name can be associated with a MySQL error code or SQLSTATE\n value. See [HELP DECLARE CONDITION].\n\no SQLWARNING is shorthand for the class of SQLSTATE values that begin\n with \'01\'.\n\no NOT FOUND is shorthand for the class of SQLSTATE values that begin\n with \'02\'. This is relevant within the context of cursors and is used\n to control what happens when a cursor reaches the end of a data set.\n If no more rows are available, a No Data condition occurs with\n SQLSTATE value \'02000\'. To detect this condition, you can set up a\n handler for it (or for a NOT FOUND condition). For an example, see\n http://dev.mysql.com/doc/refman/5.6/en/cursors.html. This condition\n also occurs for SELECT ... INTO var_list statements that retrieve no\n rows.\n\no SQLEXCEPTION is shorthand for the class of SQLSTATE values that do\n not begin with \'00\', \'01\', or \'02\'.\n\nFor information about how the server chooses handlers when a condition\noccurs, see http://dev.mysql.com/doc/refman/5.6/en/handler-scope.html.\n\nIf a condition occurs for which no handler has been declared, the\naction taken depends on the condition class:\n\no For SQLEXCEPTION conditions, the stored program terminates at the\n statement that raised the condition, as if there were an EXIT\n handler. If the program was called by another stored program, the\n calling program handles the condition using the handler selection\n rules applied to its own handlers.\n\no For SQLWARNING conditions, the program continues executing, as if\n there were a CONTINUE handler.\n\no For NOT FOUND conditions, if the condition was raised normally, the\n action is CONTINUE. If it was raised by SIGNAL or RESIGNAL, the\n action is EXIT.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-handler.html\n\n','mysql> CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE handlerdemo ()\n -> BEGIN\n -> DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n -> SET @x = 1;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 2;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 3;\n -> END;\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL handlerdemo()//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n +------+\n | @x |\n +------+\n | 3 |\n +------+\n 1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/declare-handler.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (421,23,'TIME','TIME[(fsp)]\n\nA time. The range is \'-838:59:59.000000\' to \'838:59:59.000000\'. MySQL\ndisplays TIME values in \'HH:MM:SS[.fraction]\' format, but permits\nassignment of values to TIME columns using either strings or numbers.\n\nAs of MySQL 5.6.4, an optional fsp value in the range from 0 to 6 may\nbe given to specify fractional seconds precision. A value of 0\nsignifies that there is no fractional part. If omitted, the default\nprecision is 0.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (422,17,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (423,32,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (424,40,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege.\n\nLogically, TRUNCATE TABLE is similar to a DELETE statement that deletes\nall rows, or a sequence of DROP TABLE and CREATE TABLE statements. To\nachieve high performance, it bypasses the DML method of deleting data.\nThus, it cannot be rolled back, it does not cause ON DELETE triggers to\nfire, and it cannot be performed for InnoDB tables with parent-child\nforeign key relationships.\n\nAlthough TRUNCATE TABLE is similar to DELETE, it is classified as a DDL\nstatement rather than a DML statement. It differs from DELETE in the\nfollowing ways in MySQL 5.6:\n\no Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit, and so cannot be rolled\n back.\n\no Truncation operations cannot be performed if the session holds an\n active table lock.\n\no TRUNCATE TABLE fails for an InnoDB table if there are any FOREIGN KEY\n constraints from other tables that reference the table. Foreign key\n constraints between columns of the same table are permitted.\n\no Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n be re-created as an empty table with TRUNCATE TABLE, even if the data\n or index files have become corrupted.\n\no Any AUTO_INCREMENT value is reset to its start value. This is true\n even for MyISAM and InnoDB, which normally do not reuse sequence\n values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n\no The TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (425,2,'AREA','Area(poly)\n\nReturns as a double-precision number the area of the Polygon value\npoly, as measured in its spatial reference system.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\nmysql> SELECT Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n| 4 |\n+---------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (426,8,'START SLAVE','Syntax:\nSTART SLAVE [thread_types] [until_option] [connection_options]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type: \n IO_THREAD | SQL_THREAD\n\nuntil_option:\n UNTIL { {SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS} = gtid_set\n | MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n | RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n | SQL_AFTER_MTS_GAPS }\n\nconnection_options: \n [USER=\'user_name\'] [PASSWORD=\'user_pass\'] [DEFAULT_AUTH=\'plugin_name\'] [PLUGIN_DIR=\'plugin_dir\']\n\n\ngtid_set:\n uuid_set [, uuid_set] ...\n | \'\'\n\nuuid_set:\n uuid:interval[:interval]...\n\nuuid:\n hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh\n\nh:\n [0-9,A-F]\n\ninterval:\n n[-n]\n\n (n >= 1) \n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nIn MySQL 5.6.7 and later, START SLAVE causes an implicit commit of an\nongoing transaction. See\nhttp://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html.\n\nBeginning with MySQL 5.6.11, gtid_next must be set to AUTOMATIC before\nissuing this statement (Bug #16062608).\n\nMySQL 5.6.4 and later supports pluggable user-password authentication\nwith START SLAVE with the USER, PASSWORD, DEFAULT_AUTH and PLUGIN_DIR\noptions, as described in the following list:\n\no USER: User name. Cannot be set to an empty or null string, or left\n unset if PASSWORD is used.\n\no PASSWORD: Password.\n\no DEFAULT_AUTH: Name of plugin; default is MySQL native authentication.\n\no PLUGIN_DIR: Location of plugin.\n\nStarting with MySQL 5.6.4, you cannot use the SQL_THREAD option when\nspecifying USER, PASSWORD, or both. (Bug #13083642).\n\nSee\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html,\nfor more information.\n\nIf an insecure connection is used with any these options, the server\nissues the warning Sending passwords in plain text without SSL/TLS is\nextremely insecure.\n\nStarting with MySQL 5.6.6, START SLAVE ... UNTIL supports two\nadditional options for use with global transaction identifiers (GTIDs)\n(see http://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html).\nEach of these takes a set of one or more global transaction identifiers\ngtid_set as an argument (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html#\nreplication-gtids-concepts-gtid-sets, for more information).\n\nWhen no thread_type is specified, START SLAVE UNTIL SQL_BEFORE_GTIDS\ncauses both the slave SQL thread to process and the slave I/O thread to\nfetch transactions until both of them have reached the first\ntransaction whose GTID is listed in the gtid_set. START SLAVE UNTIL\nSQL_AFTER_GTIDS causes the slave threads to process all transactions\nuntil the last transaction in the gtid_set has been processed by both\nthreads. In other words, START SLAVE UNTIL SQL_BEFORE_GTIDS causes the\nslave SQL to process and I/O threads to fetch all transactions\noccurring before the first GTID in the gtid_set is reached, and START\nSLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to handle all\ntransactions, including those whose GTIDs are found in gtid_set, until\neach has encountered a transaction whose GTID is not part of the set.\nSQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the SQL_THREAD and\nIO_THREAD options.\n\nFor example, START SLAVE SQL_THREAD UNTIL SQL_BEFORE_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56 causes the slave SQL thread\nto process all transactions originating from the master whose\nserver_uuid is 3E11FA47-71CA-11E1-9E33-C80AA9429562 until it encounters\nthe transaction having sequence number 11; it then stops without\nprocessing this transaction. In other words, all transactions up to and\nincluding the transaction with sequence number 10 are processed.\nExecuting START SLAVE IO_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave I/O thread to obtain all transactions just mentioned\nfrom the master, including all of the transactions having the sequence\nnumbers 11 through 56, and then to stop without processing any\nadditional transactions; that is, the transaction having sequence\nnumber 56 would be the last transaction fetched by the slave I/O\nthread.\n\nWith neither the SQL_THREAD option nor the IO_THREAD option, the\nprevious statement would cause the slave SQL thread to execute all\ntransactions originating from this master, including all transactions\nwith sequence numbers 11 through 56, and then to stop without\nprocessing any additional transactions. The same command would also\ncause the slave I/O thread to start. When the SQL thread reaches the\ncondition, it is stopped. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS has the same effect as START SLAVE SQL_THREAD,\nIO_THREAD UNTIL SQL_BEFORE_GTIDS; the slave SQL thread and slave I/O\nthread are each started, and the SQL thread continues executing\ntransactions until the stop condition for that thread is met.\n(Similarly, START SLAVE UNTIL SQL_AFTER_GTIDS is effectively the same\nas START SLAVE SQL_THREAD, IO_THREAD UNTIL SQL_AFTER_GTIDS.)\n\n*Note*: The SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS keywords are present\nin the MySQL 5.6.5 server; however, neither of them functioned\ncorrectly as options with START SLAVE [SQL_THREAD | IO_THREAD] UNTIL in\nthat version, and are therefore supported beginning only with MySQL\n5.6.6. (Bug#13810456)\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS is available in MySQL 5.6.6 or\nlater. This statement causes a multi-threaded slave\'s SQL threads to\nrun until no more gaps are found in the relay log, and then to stop.\nThis statement can take an SQL_THREAD option, but the effects of the\nstatement remain unchanged. It has no effect on the slave I/O thread\n(and cannot be used with the IO_THREAD option). START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS should be used before switching the slave from\nmulti-threaded mode to single-threaded mode (that is, when resetting\nslave_parallel_workers back to 0 from a positive, nonzero value) after\nslave has failed with errors in multi-threaded mode.\n\nTo change a failed multi-threaded slave to single-threaded mode, you\ncan issue the following series of statements, in the order shown:\n\nSTART SLAVE UNTIL SQL_AFTER_MTS_GAPS;\n\nSET @@GLOBAL.slave_parallel_workers = 0;\n\nSTART SLAVE SQL_THREAD;\n\nIf you were running the failed multi-threaded slave with\nrelay_log_recovery enabled, then you must issue START SLAVE UNTIL\nSQL_AFTER_MTS_GAPS prior to executing CHANGE MASTER TO. Otherwise the\nlatter statement fails.\n\n*Note*: It is possible to view the entire text of a running START SLAVE\n... statement, including any USER or PASSWORD values used, in the\noutput of SHOW PROCESSLIST. This is also true for the text of a running\nCHANGE MASTER TO statement, including any values it employs for\nMASTER_USER or MASTER_PASSWORD.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/start-slave.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (427,27,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS shows information about the conditions (errors, warnings,\nand notes) that resulted from the last statement in the current session\nthat generated messages. It shows nothing if the last statement used a\ntable and generated no messages. (That is, a statement that uses a\ntable but generates no messages clears the message list.) Statements\nthat do not use tables and do not generate messages have no effect on\nthe message list.\n\nWarnings are generated for DML statements such as INSERT, UPDATE, and\nLOAD DATA INFILE as well as DDL statements such as CREATE TABLE and\nALTER TABLE.\n\nSHOW WARNINGS is also used following EXPLAIN EXTENDED, to display the\nextra information generated by EXPLAIN when the EXTENDED keyword is\nused. See http://dev.mysql.com/doc/refman/5.6/en/explain-extended.html.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.6/en/select.html.\n\nA related statement, SHOW ERRORS, shows only the error conditions (it\nexcludes warnings and notes). See [HELP SHOW ERRORS]. GET DIAGNOSTICS\ncan be used to examine information for individual conditions. See [HELP\nGET DIAGNOSTICS].\n\nThe SHOW COUNT(*) WARNINGS statement displays the total number of\nerrors, warnings, and notes. You can also retrieve this number from the\nwarning_count system variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-warnings.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (428,10,'DROP USER','Syntax:\nDROP USER user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts and their\nprivileges. It removes privilege rows for the account from all grant\ntables. To use this statement, you must have the global CREATE USER\nprivilege or the DELETE privilege for the mysql database. Each account\nname uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. For example:\n\nDROP USER \'jeffrey\'@\'localhost\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-user.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (429,38,'SUBSTRING','Syntax:\nSUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nThe forms without a len argument return a substring from string str\nstarting at position pos. The forms with a len argument return a\nsubstring len characters long from string str, starting at position\npos. The forms that use FROM are standard SQL syntax. It is also\npossible to use a negative value for pos. In this case, the beginning\nof the substring is pos characters from the end of the string, rather\nthan the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nFor all forms of SUBSTRING(), the position of the first character in\nthe string from which the substring is to be extracted is reckoned as\n1.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SUBSTRING(\'Quadratically\',5);\n -> \'ratically\'\nmysql> SELECT SUBSTRING(\'foobarbar\' FROM 4);\n -> \'barbar\'\nmysql> SELECT SUBSTRING(\'Quadratically\',5,6);\n -> \'ratica\'\nmysql> SELECT SUBSTRING(\'Sakila\', -3);\n -> \'ila\'\nmysql> SELECT SUBSTRING(\'Sakila\', -5, 3);\n -> \'aki\'\nmysql> SELECT SUBSTRING(\'Sakila\' FROM -4 FOR 2);\n -> \'ki\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (430,37,'ISEMPTY','IsEmpty(g)\n\nThis function is a placeholder that returns 0 for any valid geometry\nvalue, 1 for any invalid geometry value or NULL.\n\nMySQL does not support GIS EMPTY values such as POINT EMPTY.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (431,27,'SHOW FUNCTION STATUS','Syntax:\nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored\nfunctions. See [HELP SHOW PROCEDURE STATUS].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-function-status.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-function-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (432,38,'LTRIM','Syntax:\nLTRIM(str)\n\nReturns the string str with leading space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LTRIM(\' barbar\');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (433,31,'ST_CROSSES','ST_Crosses(g1,g2)\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect\n\no Their intersection results in a geometry that has a dimension that is\n one less than the maximum dimension of the two given geometries\n\no Their intersection is not equal to either of the two given geometries\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (434,14,'VALUES','Syntax:\nVALUES(col_name)\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column\nvalues from the INSERT portion of the statement. In other words,\nVALUES(col_name) in the UPDATE clause refers to the value of col_name\nthat would be inserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts. The VALUES()\nfunction is meaningful only in the ON DUPLICATE KEY UPDATE clause of\nINSERT statements and returns NULL otherwise. See\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (435,6,'MBRDISJOINT','MBRDisjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 are disjoint (do not intersect).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (436,28,'CALL','Syntax:\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nThe CALL statement invokes a stored procedure that was defined\npreviously with CREATE PROCEDURE.\n\nStored procedures that take no arguments can be invoked without\nparentheses. That is, CALL p() and CALL p are equivalent.\n\nCALL can pass back values to its caller using parameters that are\ndeclared as OUT or INOUT parameters. When the procedure returns, a\nclient program can also obtain the number of rows affected for the\nfinal statement executed within the routine: At the SQL level, call the\nROW_COUNT() function; from the C API, call the mysql_affected_rows()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/call.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/call.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (437,12,'ENCODE','Syntax:\nENCODE(str,pass_str)\n\nEncrypt str using pass_str as the password. To decrypt the result, use\nDECODE().\n\nThe result is a binary string of the same length as str.\n\nThe strength of the encryption is based on how good the random\ngenerator is. It should suffice for short strings.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (438,38,'SUBSTRING_INDEX','Syntax:\nSUBSTRING_INDEX(str,delim,count)\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the\nfinal delimiter (counting from the left) is returned. If count is\nnegative, everything to the right of the final delimiter (counting from\nthe right) is returned. SUBSTRING_INDEX() performs a case-sensitive\nmatch when searching for delim.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', 2);\n -> \'www.mysql\'\nmysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', -2);\n -> \'mysql.com\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (439,32,'TIMESTAMPADD','Syntax:\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument,\nwhich should be one of the following values: MICROSECOND\n(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or\nYEAR.\n\nThe unit value may be specified using one of keywords as shown, or with\na prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n -> \'2003-01-02 00:01:00\'\nmysql> SELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n -> \'2003-01-09\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (440,4,'TRUNCATE','Syntax:\nTRUNCATE(X,D)\n\nReturns the number X, truncated to D decimal places. If D is 0, the\nresult has no decimal point or fractional part. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT TRUNCATE(1.223,1);\n -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n -> -1.9\nmysql> SELECT TRUNCATE(122,-2);\n -> 100\nmysql> SELECT TRUNCATE(10.28*100,0);\n -> 1028\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (441,27,'SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. This section describes\nthose following:\n\nSHOW AUTHORS\nSHOW {BINARY | MASTER} LOGS\nSHOW BINLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\nSHOW CONTRIBUTORS\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE FUNCTION func_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW MASTER STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW SLAVE HOSTS\nSHOW SLAVE STATUS\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW [FULL] TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\'\npart, \'pattern\' is a string that can contain the SQL "%" and "_"\nwildcard characters. The pattern is useful for restricting statement\noutput to matching values.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (442,27,'SHOW VARIABLES','Syntax:\nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW VARIABLES shows the values of MySQL system variables. This\ninformation also can be obtained using the mysqladmin variables\ncommand. The LIKE clause, if present, indicates which variable names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. This\nstatement does not require any privilege. It requires only the ability\nto connect to the server.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are\nused for new connections to MySQL. In MySQL 5.6, if a variable has no\nglobal value, no value is displayed. With SESSION, SHOW VARIABLES\ndisplays the values that are in effect for the current connection. If\nno modifier is present, the default is SESSION. LOCAL is a synonym for\nSESSION.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern. To obtain the row for a\nspecific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'max_join_size\';\nSHOW SESSION VARIABLES LIKE \'max_join_size\';\n\nTo get a list of variables whose name match a pattern, use the "%"\nwildcard character in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%size%\';\nSHOW GLOBAL VARIABLES LIKE \'%size%\';\n\nWildcard characters can be used in any position within the pattern to\nbe matched. Strictly speaking, because "_" is a wildcard that matches\nany single character, you should escape it as "\\_" to match it\nliterally. In practice, this is rarely necessary.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-variables.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-variables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (443,27,'BINLOG','Syntax:\nBINLOG \'str\'\n\nBINLOG is an internal-use statement. It is generated by the mysqlbinlog\nprogram as the printable representation of certain events in binary log\nfiles. (See http://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog.html.)\nThe \'str\' value is a base 64-encoded string the that server decodes to\ndetermine the data change indicated by the corresponding event. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/binlog.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/binlog.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (444,31,'ST_DISJOINT','ST_Disjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (445,4,'ATAN2','Syntax:\nATAN(Y,X), ATAN2(Y,X)\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both\narguments are used to determine the quadrant of the result.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(-2,2);\n -> -0.78539816339745\nmysql> SELECT ATAN2(PI(),0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (446,32,'HOUR','Syntax:\nHOUR(time)\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much\nlarger, so HOUR can return values greater than 23.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT HOUR(\'10:05:03\');\n -> 10\nmysql> SELECT HOUR(\'272:59:59\');\n -> 272\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (447,28,'SELECT','Syntax:\nSELECT\n [ALL | DISTINCT | DISTINCTROW ]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [FROM table_references\n [PARTITION partition_list]\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position}\n [ASC | DESC], ... [WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position}\n [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n [PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n export_options\n | INTO DUMPFILE \'file_name\'\n | INTO var_name [, var_name]]\n [FOR UPDATE | LOCK IN SHARE MODE]]\n\nSELECT is used to retrieve rows selected from one or more tables, and\ncan include UNION statements and subqueries. See [HELP UNION], and\nhttp://dev.mysql.com/doc/refman/5.6/en/subqueries.html.\n\nThe most commonly used clauses of SELECT statements are these:\n\no Each select_expr indicates a column that you want to retrieve. There\n must be at least one select_expr.\n\no table_references indicates the table or tables from which to retrieve\n rows. Its syntax is described in [HELP JOIN].\n\no Starting in MySQL 5.6.2, SELECT supports explicit partition selection\n using the PARTITION keyword with a list of partitions or\n subpartitions (or both) following the name of the table in a\n table_reference (see [HELP JOIN]). In this case, rows are selected\n only from the partitions listed, and any other partitions of the\n table are ignored. For more information and examples, see\n http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\n In MySQL 5.6.6 and later, SELECT ... PARTITION from tables using\n storage engines such as MyISAM that perform table-level locks (and\n thus partition locks) lock only the partitions or subpartitions named\n by the PARTITION option.\n\n See\n http://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locki\n ng.html, for more information.\n\no The WHERE clause, if given, indicates the condition or conditions\n that rows must satisfy to be selected. where_condition is an\n expression that evaluates to true for each row to be selected. The\n statement selects all rows if there is no WHERE clause.\n\n In the WHERE expression, you can use any of the functions and\n operators that MySQL supports, except for aggregate (summary)\n functions. See\n http://dev.mysql.com/doc/refman/5.6/en/expressions.html, and\n http://dev.mysql.com/doc/refman/5.6/en/functions.html.\n\nSELECT can also be used to retrieve rows computed without reference to\nany table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/select.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (448,16,'GROUP_CONCAT','Syntax:\nGROUP_CONCAT(expr)\n\nThis function returns a string result with the concatenated non-NULL\nvalues from a group. It returns NULL if there are no non-NULL values.\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n [ORDER BY {unsigned_integer | col_name | expr}\n [ASC | DESC] [,col_name ...]]\n [SEPARATOR str_val])\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name,\n -> GROUP_CONCAT(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (449,17,'BENCHMARK','Syntax:\nBENCHMARK(count,expr)\n\nThe BENCHMARK() function executes the expression expr repeatedly count\ntimes. It may be used to time how quickly MySQL processes the\nexpression. The result value is always 0. The intended use is from\nwithin the mysql client, which reports query execution times:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n| 0 |\n+----------------------------------------------+\n1 row in set (4.74 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (450,14,'NAME_CONST','Syntax:\nNAME_CONST(name,value)\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments\nshould be constants.\n\nmysql> SELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (451,27,'SHOW ENGINE','Syntax:\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nSHOW ENGINE displays operational information about a storage engine.\nThe following statements currently are supported:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE {NDB | NDBCLUSTER} STATUS\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n\nSHOW ENGINE INNODB STATUS displays extensive information from the\nstandard InnoDB Monitor about the state of the InnoDB storage engine.\nFor information about the standard monitor and other InnoDB Monitors\nthat provide information about InnoDB processing, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-monitors.html.\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics. The\nstatement displays the following fields:\n\no Type\n\n Always InnoDB.\n\no Name\n\n The source file where the mutex is implemented, and the line number\n in the file where the mutex is created. The line number may change\n depending on your version of MySQL.\n\no Status\n\n The mutex status. This field displays several values if UNIV_DEBUG\n was defined at MySQL compilation time (for example, in include/univ.i\n in the InnoDB part of the MySQL source tree). If UNIV_DEBUG was not\n defined, the statement displays only the os_waits value. In the\n latter case (without UNIV_DEBUG), the information on which the output\n is based is insufficient to distinguish regular mutexes and mutexes\n that protect rw-locks (which permit multiple readers or a single\n writer). Consequently, the output may appear to contain multiple rows\n for the same mutex.\n\n o count indicates how many times the mutex was requested.\n\n o spin_waits indicates how many times the spinlock had to run.\n\n o spin_rounds indicates the number of spinlock rounds. (spin_rounds\n divided by spin_waits provides the average round count.)\n\n o os_waits indicates the number of operating system waits. This\n occurs when the spinlock did not work (the mutex was not locked\n during the spinlock and it was necessary to yield to the operating\n system and wait).\n\n o os_yields indicates the number of times a the thread trying to lock\n a mutex gave up its timeslice and yielded to the operating system\n (on the presumption that permitting other threads to run will free\n the mutex so that it can be locked).\n\n o os_wait_times indicates the amount of time (in ms) spent in\n operating system waits, if the timed_mutexes system variable is 1\n (ON). If timed_mutexes is 0 (OFF), timing is disabled, so\n os_wait_times is 0. timed_mutexes is off by default.\n\nInformation from this statement can be used to diagnose system\nproblems. For example, large values of spin_waits and spin_rounds may\nindicate scalability problems.\n\nUse SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal\noperation of the Performance Schema code:\n\nmysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\\G\n...\n*************************** 3. row ***************************\n Type: performance_schema\n Name: events_waits_history.row_size\nStatus: 76\n*************************** 4. row ***************************\n Type: performance_schema\n Name: events_waits_history.row_count\nStatus: 10000\n*************************** 5. row ***************************\n Type: performance_schema\n Name: events_waits_history.memory\nStatus: 760000\n...\n*************************** 57. row ***************************\n Type: performance_schema\n Name: performance_schema.memory\nStatus: 26459600\n...\n\nThis statement is intended to help the DBA understand the effects that\ndifferent Performance Schema options have on memory requirements.\n\nName values consist of two parts, which name an internal buffer and a\nbuffer attribute, respectively. Interpret buffer names as follows:\n\no An internal buffer that is not exposed as a table is named within\n parentheses. Examples: (pfs_cond_class).row_size,\n (pfs_mutex_class).memory.\n\no An internal buffer that is exposed as a table in the\n performance_schema database is named after the table, without\n parentheses. Examples: events_waits_history.row_size,\n mutex_instances.row_count.\n\no A value that applies to the Performance Schema as a whole begins with\n performance_schema. Example: performance_schema.memory.\n\nBuffer attributes have these meanings:\n\no row_size is the size of the internal record used by the\n implementation, such as the size of a row in a table. row_size values\n cannot be changed.\n\no row_count is the number of internal records, such as the number of\n rows in a table. row_count values can be changed using Performance\n Schema configuration options.\n\no For a table, tbl_name.memory is the product of row_size and\n row_count. For the Performance Schema as a whole,\n performance_schema.memory is the sum of all the memory used (the sum\n of all other memory values).\n\nIn some cases, there is a direct relationship between a Performance\nSchema configuration parameter and a SHOW ENGINE value. For example,\nevents_waits_history_long.row_count corresponds to\nperformance_schema_events_waits_history_long_size. In other cases, the\nrelationship is more complex. For example,\nevents_waits_history.row_count corresponds to\nperformance_schema_events_waits_history_size (the number of rows per\nthread) multiplied by performance_schema_max_thread_instances ( the\nnumber of threads).\n\nSHOW ENGINE NDB STATUS If the server has the NDB storage engine\nenabled, SHOW ENGINE NDB STATUS displays cluster status information\nsuch as the number of connected data nodes, the cluster connectstring,\nand cluster binlog epochs, as well as counts of various Cluster API\nobjects created by the MySQL Server when connected to the cluster.\nSample output from this statement is shown here:\n\nmysql> SHOW ENGINE NDB STATUS;\n+------------+-----------------------+--------------------------------------------------+\n| Type | Name | Status |\n+------------+-----------------------+--------------------------------------------------+\n| ndbcluster | connection | cluster_node_id=7,\n connected_host=192.168.0.103, connected_port=1186, number_of_data_nodes=4,\n number_of_ready_data_nodes=3, connect_count=0 |\n| ndbcluster | NdbTransaction | created=6, free=0, sizeof=212 |\n| ndbcluster | NdbOperation | created=8, free=8, sizeof=660 |\n| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744 |\n| ndbcluster | NdbIndexOperation | created=0, free=0, sizeof=664 |\n| ndbcluster | NdbRecAttr | created=1285, free=1285, sizeof=60 |\n| ndbcluster | NdbApiSignal | created=16, free=16, sizeof=136 |\n| ndbcluster | NdbLabel | created=0, free=0, sizeof=196 |\n| ndbcluster | NdbBranch | created=0, free=0, sizeof=24 |\n| ndbcluster | NdbSubroutine | created=0, free=0, sizeof=68 |\n| ndbcluster | NdbCall | created=0, free=0, sizeof=16 |\n| ndbcluster | NdbBlob | created=1, free=1, sizeof=264 |\n| ndbcluster | NdbReceiver | created=4, free=0, sizeof=68 |\n| ndbcluster | binlog | latest_epoch=155467, latest_trans_epoch=148126,\n latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,\n latest_applied_binlog_epoch=0 |\n+------------+-----------------------+--------------------------------------------------+\n\nThe rows with connection and binlog in the Name column were added to\nthe output of this statement in MySQL 5.1. The Status column in each of\nthese rows provides information about the MySQL server\'s connection to\nthe cluster and about the cluster binary log\'s status, respectively.\nThe Status information is in the form of comma-delimited set of\nname/value pairs.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-engine.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-engine.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (452,14,'RELEASE_LOCK','Syntax:\nRELEASE_LOCK(str)\n\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not\nestablished by this thread (in which case the lock is not released),\nand NULL if the named lock did not exist. The lock does not exist if it\nwas never obtained by a call to GET_LOCK() or if it has previously been\nreleased.\n\nThe DO statement is convenient to use with RELEASE_LOCK(). See [HELP\nDO].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (453,32,'WEEKDAY','Syntax:\nWEEKDAY(date)\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =\nSunday).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKDAY(\'2008-02-03 22:23:00\');\n -> 6\nmysql> SELECT WEEKDAY(\'2007-11-06\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (454,32,'TIME_TO_SEC','Syntax:\nTIME_TO_SEC(time)\n\nReturns the time argument, converted to seconds.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_TO_SEC(\'22:23:00\');\n -> 80580\nmysql> SELECT TIME_TO_SEC(\'00:39:38\');\n -> 2378\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (455,32,'CONVERT_TZ','Syntax:\nCONVERT_TZ(dt,from_tz,to_tz)\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by\nfrom_tz to the time zone given by to_tz and returns the resulting\nvalue. Time zones are specified as described in\nhttp://dev.mysql.com/doc/refman/5.6/en/time-zone-support.html. This\nfunction returns NULL if the arguments are invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'GMT\',\'MET\');\n -> \'2004-01-01 13:00:00\'\nmysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n -> \'2004-01-01 22:00:00\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (456,38,'EXPORT_SET','Syntax:\nEXPORT_SET(bits,on,off[,separator[,number_of_bits]])\n\nReturns a string such that for every bit set in the value bits, you get\nan on string and for every bit not set in the value, you get an off\nstring. Bits in bits are examined from right to left (from low-order to\nhigh-order bits). Strings are added to the result from left to right,\nseparated by the separator string (the default being the comma\ncharacter ","). The number of bits examined is given by number_of_bits,\nwhich has a default of 64 if not specified. number_of_bits is silently\nclipped to 64 if larger than 64. It is treated as an unsigned integer,\nso a value of -1 is effectively the same as 64.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n -> \'Y,N,Y,N\'\nmysql> SELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n -> \'0,1,1,0,0,0,0,0,0,0\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (457,38,'CAST','Syntax:\nCAST(expr AS type)\n\nThe CAST() function takes an expression of any type and produces a\nresult value of a specified type, similar to CONVERT(). See the\ndescription of CONVERT() for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/cast-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (458,38,'SOUNDS LIKE','Syntax:\nexpr1 SOUNDS LIKE expr2\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (459,32,'PERIOD_DIFF','Syntax:\nPERIOD_DIFF(P1,P2)\n\nReturns the number of months between periods P1 and P2. P1 and P2\nshould be in the format YYMM or YYYYMM. Note that the period arguments\nP1 and P2 are not date values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_DIFF(200802,200703);\n -> 11\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (460,16,'AVG','Syntax:\nAVG([DISTINCT] expr)\n\nReturns the average value of expr. The DISTINCT option can be used to\nreturn the average of the distinct values of expr.\n\nAVG() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html\n\n','mysql> SELECT student_name, AVG(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (461,38,'QUOTE','Syntax:\nQUOTE(str)\n\nQuotes a string to produce a result that can be used as a properly\nescaped data value in an SQL statement. The string is returned enclosed\nby single quotation marks and with each instance of backslash ("\\"),\nsingle quote ("\'"), ASCII NUL, and Control+Z preceded by a backslash.\nIf the argument is NULL, the return value is the word "NULL" without\nenclosing single quotation marks.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT QUOTE(\'Don\\\'t!\');\n -> \'Don\\\'t!\'\nmysql> SELECT QUOTE(NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (462,19,'IN','Syntax:\nexpr IN (value,...)\n\nReturns 1 if expr is equal to any of the values in the IN list, else\nreturns 0. If all values are constants, they are evaluated according to\nthe type of expr and sorted. The search for the item then is done using\na binary search. This means IN is very quick if the IN value list\nconsists entirely of constants. Otherwise, type conversion takes place\naccording to the rules described in\nhttp://dev.mysql.com/doc/refman/5.6/en/type-conversion.html, but\napplied to all the arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 IN (0,3,5,7);\n -> 0\nmysql> SELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (463,32,'QUARTER','Syntax:\nQUARTER(date)\n\nReturns the quarter of the year for date, in the range 1 to 4.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT QUARTER(\'2008-04-01\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (464,27,'HELP COMMAND','Syntax:\nmysql> help search_string\n\nIf you provide an argument to the help command, mysql uses it as a\nsearch string to access server-side help from the contents of the MySQL\nReference Manual. The proper operation of this command requires that\nthe help tables in the mysql database be initialized with help topic\ninformation (see\nhttp://dev.mysql.com/doc/refman/5.6/en/server-side-help-support.html).\n\nIf there is no match for the search string, the search fails:\n\nmysql> help me\n\nNothing found\nPlease try to run \'help contents\' for a list of all accessible topics\n\nUse help contents to see a list of the help categories:\n\nmysql> help contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help \', where is one of the\nfollowing categories:\n Account Management\n Administration\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Language Structure\n Plugins\n Storage Engines\n Stored Routines\n Table Maintenance\n Transactions\n Triggers\n\nIf the search string matches multiple items, mysql shows a list of\nmatching topics:\n\nmysql> help logs\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following topics:\n SHOW\n SHOW BINARY LOGS\n SHOW ENGINE\n SHOW LOGS\n\nUse a topic as the search string to see the help entry for that topic:\n\nmysql> help show binary logs\nName: \'SHOW BINARY LOGS\'\nDescription:\nSyntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [purge-binary-logs], that shows how\nto determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nThe search string can contain the the wildcard characters "%" and "_".\nThese have the same meaning as for pattern-matching operations\nperformed with the LIKE operator. For example, HELP rep% returns a list\nof topics that begin with rep:\n\nmysql> HELP rep%\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following\ntopics:\n REPAIR TABLE\n REPEAT FUNCTION\n REPEAT LOOP\n REPLACE\n REPLACE FUNCTION\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mysql-server-side-help.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mysql-server-side-help.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (465,38,'POSITION','Syntax:\nPOSITION(substr IN str)\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (466,14,'IS_USED_LOCK','Syntax:\nIS_USED_LOCK(str)\n\nChecks whether the lock named str is in use (that is, locked). If so,\nit returns the connection identifier of the client that holds the lock.\nOtherwise, it returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (467,3,'POLYFROMTEXT','PolyFromText(wkt[,srid]), PolygonFromText(wkt[,srid])\n\nConstructs a POLYGON value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (468,12,'DES_ENCRYPT','Syntax:\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.6/en/ssl-connections.html.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from\nthe DES key file is used. With a key_num argument, the given key number\n(0 to 9) from the DES key file is used. With a key_str argument, the\ngiven key string is used to encrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is\nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If\nyou use a string key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in\nthe file may be in any order. des_key_str is the string that is used to\nencrypt the message. There should be at least one space between the\nnumber and the key. The first key is the default key that is used if\nyou do not specify any key argument to DES_ENCRYPT().\n\nYou can tell MySQL to read new key values from the key file with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted column\nvalues, without giving the end user the right to decrypt those values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT customer_address FROM customer_table \n > WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (469,10,'ALTER USER','Syntax:\nALTER USER user_specification\n [, user_specification] ...\n\nuser_specification:\n user PASSWORD EXPIRE\n\nThe ALTER USER statement alters MySQL accounts. To use it, you must\nhave the global CREATE USER privilege or the INSERT privilege for the\nmysql database. This statement was added in MySQL 5.6.6.\n\nFor each account, ALTER USER expires its password. For example:\n\nALTER USER \'jeffrey\'@\'localhost\' PASSWORD EXPIRE;\n\nThe account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. If you\nspecify only the user name part of the account name, a host name part\nof \'%\' is used.\n\nPassword expiration for an account affects the corresponding row of the\nmysql.user table: The server sets the password_expired column to \'Y\'.\n\n*Warning*: In MySQL 5.6.6, ALTER USER also sets the Password column to\nthe empty string, so do not use this statement until 5.6.7.\n\nAfter an account\'s password has been expired, all operations performed\nin subsequent connections to the server using the account result in an\nerror until the user issues a SET PASSWORD statement to establish a new\naccount password:\n\nmysql> SELECT 1;\nERROR 1820 (HY000): You must SET PASSWORD before executing this statement\n\nmysql> SET PASSWORD = PASSWORD(\'new_password\');\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SELECT 1;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n1 row in set (0.00 sec)\n\nAs of MySQL 5.6.8, this restricted mode of operation also permits SET\nstatements, which is useful if the account password uses a hashing\nformat that requires old_passwords to be set to a value different from\nits default.\n\nIt is also possible for an administrative user to reset the account\npassword, but any existing connections for the account remain under\nrestriction. Clients using the account must disconnect and reconnect\nbefore statements can be executed successfully.\n\nIt is possible after password expiration to "reset" a password by using\nSET PASSWORD to set it to its current value. As a matter of good\npolicy, it is preferable to choose a different password.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-user.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-user.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (470,4,'CEIL','Syntax:\nCEIL(X)\n\nCEIL() is a synonym for CEILING().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (471,17,'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS','Syntax:\nWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(gtid_set[, timeout])\n\nWait until the slave SQL thread has executed all of the transactions\nwhose global transaction identifiers are contained in gtid_set (see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html,\nfor a definition of "GTID sets"), or until timeout seconds have\nelapsed, whichever occurs first. timeout is optional; the default\ntimeout is 0 seconds, in which case the master simply waits until all\nof the transactions in the GTID set have been executed.\n\nPrior to MySQL 5.6.9, WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() was named\nSQL_THREAD_WAIT_AFTER_GTIDS(). (Bug #14775984)\n\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-gtids.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','mysql> SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(\'3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (472,38,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multi-byte\ncharacter counts as multiple bytes. This means that for a string\ncontaining five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT LENGTH(\'text\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (473,38,'WEIGHT_STRING','Syntax:\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n\nlevels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nThis function returns the weight string for the input string. The\nreturn value is a binary string that represents the sorting and\ncomparison value of the string. It has these properties:\n\no If WEIGHT_STRING(str1) = WEIGHT_STRING(str2), then str1 = str2 (str1\n and str2 are considered equal)\n\no If WEIGHT_STRING(str1) < WEIGHT_STRING(str2), then str1 < str2 (str1\n sorts before str2)\n\nWEIGHT_STRING() can be used for testing and debugging of collations,\nespecially if you are adding a new collation. See\nhttp://dev.mysql.com/doc/refman/5.6/en/adding-collation.html.\n\nThe input string, str, is a string expression. If the input is a\nnonbinary (character) string such as a CHAR, VARCHAR, or TEXT value,\nthe return value contains the collation weights for the string. If the\ninput is a binary (byte) string such as a BINARY, VARBINARY, or BLOB\nvalue, the return value is the same as the input (the weight for each\nbyte in a binary string is the byte value). If the input is NULL,\nWEIGHT_STRING() returns NULL.\n\nExamples:\n\nmysql> SET @s = _latin1 \'AB\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = _latin1 \'ab\' COLLATE latin1_swedish_ci;\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'AB\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| AB | 4142 | 4142 |\n+------+---------+------------------------+\n\nmysql> SET @s = CAST(\'ab\' AS BINARY);\nmysql> SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));\n+------+---------+------------------------+\n| @s | HEX(@s) | HEX(WEIGHT_STRING(@s)) |\n+------+---------+------------------------+\n| ab | 6162 | 6162 |\n+------+---------+------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (474,31,'ST_EQUALS','ST_Equals(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (475,40,'ALTER EVENT','Syntax:\nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n [DO event_body]\n\nThe ALTER EVENT statement changes one or more of the characteristics of\nan existing event without the need to drop and recreate it. The syntax\nfor each of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE /\nDISABLE, and DO clauses is exactly the same as when used with CREATE\nEVENT. (See [HELP CREATE EVENT].)\n\nAny user can alter an event defined on a database for which that user\nhas the EVENT privilege. When a user executes a successful ALTER EVENT\nstatement, that user becomes the definer for the affected event.\n\nALTER EVENT works only with an existing event:\n\nmysql> ALTER EVENT no_such_event \n > ON SCHEDULE \n > EVERY \'2:3\' DAY_HOUR;\nERROR 1517 (HY000): Unknown event \'no_such_event\'\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-event.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (476,32,'DATE_SUB','Syntax:\nDATE_SUB(date,INTERVAL expr unit)\n\nSee the description for DATE_ADD().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (477,20,'|','Syntax:\n|\n\nBitwise OR:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n -> 31\n','http://dev.mysql.com/doc/refman/5.6/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (478,14,'UUID_SHORT','Syntax:\nUUID_SHORT()\n\nReturns a "short" universal identifier as a 64-bit unsigned integer\n(rather than a string-form 128-bit identifier as returned by the UUID()\nfunction).\n\nThe value of UUID_SHORT() is guaranteed to be unique if the following\nconditions hold:\n\no The server_id of the current host is unique among your set of master\n and slave servers\n\no server_id is between 0 and 255\n\no You do not set back your system time for your server between mysqld\n restarts\n\no You do not invoke UUID_SHORT() on average more than 16 million times\n per second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n (server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID_SHORT();\n -> 92395783831158784\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (479,3,'GEOMFROMTEXT','GeomFromText(wkt[,srid]), GeometryFromText(wkt[,srid])\n\nConstructs a geometry value of any type using its WKT representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (480,32,'DATEDIFF','Syntax:\nDATEDIFF(expr1,expr2)\n\nDATEDIFF() returns expr1 - expr2 expressed as a value in days from one\ndate to the other. expr1 and expr2 are date or date-and-time\nexpressions. Only the date parts of the values are used in the\ncalculation.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n -> 1\nmysql> SELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n -> -31\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (481,40,'DROP PROCEDURE','Syntax:\nDROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name\n\nThis statement is used to drop a stored procedure or function. That is,\nthe specified routine is removed from the server. You must have the\nALTER ROUTINE privilege for the routine. (If the\nautomatic_sp_privileges system variable is enabled, that privilege and\nEXECUTE are granted automatically to the routine creator when the\nroutine is created and dropped from the creator when the routine is\ndropped. See\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-routines-privileges.html.\n)\n\nThe IF EXISTS clause is a MySQL extension. It prevents an error from\noccurring if the procedure or function does not exist. A warning is\nproduced that can be viewed with SHOW WARNINGS.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/drop-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/drop-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (482,5,'INSTALL PLUGIN','Syntax:\nINSTALL PLUGIN plugin_name SONAME \'shared_library_name\'\n\nThis statement installs a server plugin. It requires the INSERT\nprivilege for the mysql.plugin table.\n\nplugin_name is the name of the plugin as defined in the plugin\ndescriptor structure contained in the library file (see\nhttp://dev.mysql.com/doc/refman/5.6/en/plugin-data-structures.html).\nPlugin names are not case sensitive. For maximal compatibility, plugin\nnames should be limited to ASCII letters, digits, and underscore\nbecause they are used in C source files, shell command lines, M4 and\nBourne shell scripts, and SQL environments.\n\nshared_library_name is the name of the shared library that contains the\nplugin code. The name includes the file name extension (for example,\nlibmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).\n\nThe shared library must be located in the plugin directory (the\ndirectory named by the plugin_dir system variable). The library must be\nin the plugin directory itself, not in a subdirectory. By default,\nplugin_dir is the plugin directory under the directory named by the\npkglibdir configuration variable, but it can be changed by setting the\nvalue of plugin_dir at server startup. For example, set its value in a\nmy.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\n\nIf the value of plugin_dir is a relative path name, it is taken to be\nrelative to the MySQL base directory (the value of the basedir system\nvariable).\n\nINSTALL PLUGIN loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its\ninitialization function, which handles any setup that the plugin must\nperform before it can be used. When the server shuts down, it executes\nthe deinitialization function for each plugin that is loaded so that\nthe plugin has a change to perform any final cleanup.\n\nINSTALL PLUGIN also registers the plugin by adding a line that\nindicates the plugin name and library file name to the mysql.plugin\ntable. At server startup, the server loads and initializes any plugin\nthat is listed in the mysql.plugin table. This means that a plugin is\ninstalled with INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the server is\nstarted with the --skip-grant-tables option.\n\nA plugin library can contain multiple plugins. For each of them to be\ninstalled, use a separate INSTALL PLUGIN statement. Each statement\nnames a different plugin, but all of them specify the same library\nname.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/install-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/install-plugin.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (483,28,'LOAD DATA','Syntax:\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [PARTITION (partition_name,...)]\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number {LINES | ROWS}]\n [(col_name_or_user_var,...)]\n [SET col_name = expr,...]\n\nThe LOAD DATA INFILE statement reads rows from a text file into a table\nat a very high speed. LOAD DATA INFILE is the complement of SELECT ...\nINTO OUTFILE. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/select-into.html.) To write data\nfrom a table to a file, use SELECT ... INTO OUTFILE. To read the file\nback into a table, use LOAD DATA INFILE. The syntax of the FIELDS and\nLINES clauses is the same for both statements. Both clauses are\noptional, but FIELDS must precede LINES if both are specified.\n\nYou can also load data files by using the mysqlimport utility; it\noperates by sending a LOAD DATA INFILE statement to the server. The\n--local option causes mysqlimport to read data files from the client\nhost. You can specify the --compress option to get better performance\nover slow networks if the client and server support the compressed\nprotocol. See http://dev.mysql.com/doc/refman/5.6/en/mysqlimport.html.\n\nFor more information about the efficiency of INSERT versus LOAD DATA\nINFILE and speeding up LOAD DATA INFILE, see\nhttp://dev.mysql.com/doc/refman/5.6/en/insert-speed.html.\n\nThe file name must be given as a literal string. On Windows, specify\nbackslashes in path names as forward slashes or doubled backslashes.\nThe character_set_filesystem system variable controls the\ninterpretation of the file name.\n\nIn MySQL 5.6.2 and later, LOAD DATA supports explicit partition\nselection using the PARTITION option with a comma-separated list of\nmore or more names of partitions, subpartitions, or both. When this\noption is used, if any rows from the file cannot be inserted into any\nof the partitions or subpartitions named in the list, the statement\nfails with the error Found a row not matching the given partition set.\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html.\n\nFor partitioned tables using storage engines that employ table locks,\nsuch as MyISAM, LOAD DATA cannot prune any partition locks. This does\nnot apply to tables using storage engines which employ row-level\nlocking, such as InnoDB. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations-locking\n.html.\n\nThe character set indicated by the character_set_database system\nvariable is used to interpret the information in the file. SET NAMES\nand the setting of character_set_client do not affect interpretation of\ninput. If the contents of the input file use a character set that\ndiffers from the default, it is usually preferable to specify the\ncharacter set of the file by using the CHARACTER SET clause. A\ncharacter set of binary specifies "no conversion."\n\nLOAD DATA INFILE interprets all fields in the file as having the same\ncharacter set, regardless of the data types of the columns into which\nfield values are loaded. For proper interpretation of file contents,\nyou must ensure that it was written with the correct character set. For\nexample, if you write a data file with mysqldump -T or by issuing a\nSELECT ... INTO OUTFILE statement in mysql, be sure to use a\n--default-character-set option so that output is written in the\ncharacter set to be used when the file is loaded with LOAD DATA INFILE.\n\n*Note*: It is not possible to load data files that use the ucs2, utf16,\nutf16le, or utf32 character set.\n\nIf you use LOW_PRIORITY, execution of the LOAD DATA statement is\ndelayed until no other clients are reading from the table. This affects\nonly storage engines that use only table-level locking (such as MyISAM,\nMEMORY, and MERGE).\n\nIf you specify CONCURRENT with a MyISAM table that satisfies the\ncondition for concurrent inserts (that is, it contains no free blocks\nin the middle), other threads can retrieve data from the table while\nLOAD DATA is executing. This option affects the performance of LOAD\nDATA a bit, even if no other thread is using the table at the same\ntime.\n\nWith row-based replication, CONCURRENT is replicated regardless of\nMySQL version. With statement-based replication CONCURRENT is not\nreplicated prior to MySQL 5.5.1 (see Bug #34628). For more information,\nsee\nhttp://dev.mysql.com/doc/refman/5.6/en/replication-features-load-data.h\ntml.\n\nThe LOCAL keyword affects expected location of the file and error\nhandling, as described later. LOCAL works only if your server and your\nclient both have been configured to permit it. For example, if mysqld\nwas started with --local-infile=0, LOCAL does not work. See\nhttp://dev.mysql.com/doc/refman/5.6/en/load-data-local.html.\n\nThe LOCAL keyword affects where the file is expected to be found:\n\no If LOCAL is specified, the file is read by the client program on the\n client host and sent to the server. The file can be given as a full\n path name to specify its exact location. If given as a relative path\n name, the name is interpreted relative to the directory in which the\n client program was started.\n\n When using LOCAL with LOAD DATA, a copy of the file is created in the\n server\'s temporary directory. This is not the directory determined by\n the value of tmpdir or slave_load_tmpdir, but rather the operating\n system\'s temporary directory, and is not configurable in the MySQL\n Server. (Typically the system temporary directory is /tmp on Linux\n systems and C:\\WINDOWS\\TEMP on Windows.) Lack of sufficient space for\n the copy in this directory can cause the LOAD DATA LOCAL statement to\n fail.\n\no If LOCAL is not specified, the file must be located on the server\n host and is read directly by the server. The server uses the\n following rules to locate the file:\n\n o If the file name is an absolute path name, the server uses it as\n given.\n\n o If the file name is a relative path name with one or more leading\n components, the server searches for the file relative to the\n server\'s data directory.\n\n o If a file name with no leading components is given, the server\n looks for the file in the database directory of the default\n database.\n\nIn the non-LOCAL case, these rules mean that a file named as\n./myfile.txt is read from the server\'s data directory, whereas the file\nnamed as myfile.txt is read from the database directory of the default\ndatabase. For example, if db1 is the default database, the following\nLOAD DATA statement reads the file data.txt from the database directory\nfor db1, even though the statement explicitly loads the file into a\ntable in the db2 database:\n\nLOAD DATA INFILE \'data.txt\' INTO TABLE db2.my_table;\n\nFor security reasons, when reading text files located on the server,\nthe files must either reside in the database directory or be readable\nby all. Also, to use LOAD DATA INFILE on server files, you must have\nthe FILE privilege. See\nhttp://dev.mysql.com/doc/refman/5.6/en/privileges-provided.html. For\nnon-LOCAL load operations, if the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nUsing LOCAL is a bit slower than letting the server access the files\ndirectly, because the contents of the file must be sent over the\nconnection by the client to the server. On the other hand, you do not\nneed the FILE privilege to load local files.\n\nLOCAL also affects error handling:\n\no With LOAD DATA INFILE, data-interpretation and duplicate-key errors\n terminate the operation.\n\no With LOAD DATA LOCAL INFILE, data-interpretation and duplicate-key\n errors become warnings and the operation continues because the server\n has no way to stop transmission of the file in the middle of the\n operation. For duplicate-key errors, this is the same as if IGNORE is\n specified. IGNORE is explained further later in this section.\n\nThe REPLACE and IGNORE keywords control handling of input rows that\nduplicate existing rows on unique key values:\n\no If you specify REPLACE, input rows replace existing rows. In other\n words, rows that have the same value for a primary key or unique\n index as an existing row. See [HELP REPLACE].\n\no If you specify IGNORE, input rows that duplicate an existing row on a\n unique key value are skipped.\n\no If you do not specify either option, the behavior depends on whether\n the LOCAL keyword is specified. Without LOCAL, an error occurs when a\n duplicate key value is found, and the rest of the text file is\n ignored. With LOCAL, the default behavior is the same as if IGNORE is\n specified; this is because the server has no way to stop transmission\n of the file in the middle of the operation.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/load-data.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/load-data.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (484,24,'DECLARE CURSOR','Syntax:\nDECLARE cursor_name CURSOR FOR select_statement\n\nThis statement declares a cursor and associates it with a SELECT\nstatement that retrieves the rows to be traversed by the cursor. To\nfetch the rows later, use a FETCH statement. The number of columns\nretrieved by the SELECT statement must match the number of output\nvariables specified in the FETCH statement.\n\nThe SELECT statement cannot have an INTO clause.\n\nCursor declarations must appear before handler declarations and after\nvariable and condition declarations.\n\nA stored program may contain multiple cursor declarations, but each\ncursor declared in a given block must have a unique name. For an\nexample, see http://dev.mysql.com/doc/refman/5.6/en/cursors.html.\n\nFor information available through SHOW statements, it is possible in\nmany cases to obtain equivalent information by using a cursor with an\nINFORMATION_SCHEMA table.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/declare-cursor.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/declare-cursor.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (485,32,'LOCALTIME','Syntax:\nLOCALTIME, LOCALTIME([fsp])\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (486,12,'SHA1','Syntax:\nSHA1(str), SHA(str)\n\nCalculates an SHA-1 160-bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a string of\n40 hex digits, or NULL if the argument was NULL. One of the possible\nuses for this function is as a hash key. See the notes at the beginning\nof this section about storing hash values efficiently. You can also use\nSHA1() as a cryptographic function for storing passwords. SHA() is\nsynonymous with SHA1().\n\nThe return value is a nonbinary string in the connection character set.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SELECT SHA1(\'abc\');\n -> \'a9993e364706816aba3e25717850c26c9cd0d89d\'\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (487,23,'BLOB','BLOB[(M)]\n\nA BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each\nBLOB value is stored using a 2-byte length prefix that indicates the\nnumber of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest BLOB type large enough to hold\nvalues M bytes long.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (488,12,'PASSWORD','Syntax:\nPASSWORD(str)\n\nCalculates and returns a hashed password string from the cleartext\npassword str and returns a nonbinary string in the connection character\nset, or NULL if the argument is NULL. This function is the SQL\ninterface to the algorithm used by the server to encrypt MySQL\npasswords for storage in the mysql.user grant table.\n\nThe password hashing method used by PASSWORD() depends on the value of\nthe old_passwords system variable:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','mysql> SET old_passwords = 0;\nmysql> SELECT PASSWORD(\'mypass\');\n+-------------------------------------------+\n| PASSWORD(\'mypass\') |\n+-------------------------------------------+\n| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |\n+-------------------------------------------+\n\nmysql> SET old_passwords = 1;\nmysql> SELECT PASSWORD(\'mypass\');\n+--------------------+\n| PASSWORD(\'mypass\') |\n+--------------------+\n| 6f8c114b58f2ce9e |\n+--------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (489,32,'UTC_DATE','Syntax:\nUTC_DATE, UTC_DATE()\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_DATE(), UTC_DATE() + 0;\n -> \'2003-08-14\', 20030814\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (490,37,'DIMENSION','Dimension(g)\n\nReturns the inherent dimension of the geometry value g. The result can\nbe -1, 0, 1, or 2. The meaning of these values is given in\nhttp://dev.mysql.com/doc/refman/5.6/en/gis-class-geometry.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (491,23,'BIT','BIT[(M)]\n\nA bit-field type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (492,31,'EQUALS','Equals(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (493,8,'XA','Syntax:\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER\n\nFor XA START, the JOIN and RESUME clauses are not supported.\n\nFor XA END the SUSPEND [FOR MIGRATE] clause is not supported.\n\nEach XA statement begins with the XA keyword, and most of them require\nan xid value. An xid is an XA transaction identifier. It indicates\nwhich transaction the statement applies to. xid values are supplied by\nthe client, or generated by the MySQL server. An xid value has from one\nto three parts:\n\nxid: gtrid [, bqual [, formatID ]]\n\ngtrid is a global transaction identifier, bqual is a branch qualifier,\nand formatID is a number that identifies the format used by the gtrid\nand bqual values. As indicated by the syntax, bqual and formatID are\noptional. The default bqual value is \'\' if not given. The default\nformatID value is 1 if not given.\n\ngtrid and bqual must be string literals, each up to 64 bytes (not\ncharacters) long. gtrid and bqual can be specified in several ways. You\ncan use a quoted string (\'ab\'), hex string (0x6162, X\'ab\'), or bit\nvalue (b\'nnnn\').\n\nformatID is an unsigned integer.\n\nThe gtrid and bqual values are interpreted in bytes by the MySQL\nserver\'s underlying XA support routines. However, while an SQL\nstatement containing an XA statement is being parsed, the server works\nwith some specific character set. To be safe, write gtrid and bqual as\nhex strings.\n\nxid values typically are generated by the Transaction Manager. Values\ngenerated by one TM must be different from values generated by other\nTMs. A given TM must be able to recognize its own xid values in a list\nof values returned by the XA RECOVER statement.\n\nXA START xid starts an XA transaction with the given xid value. Each XA\ntransaction must have a unique xid value, so the value must not\ncurrently be used by another XA transaction. Uniqueness is assessed\nusing the gtrid and bqual values. All following XA statements for the\nXA transaction must be specified using the same xid value as that given\nin the XA START statement. If you use any of those statements but\nspecify an xid value that does not correspond to some existing XA\ntransaction, an error occurs.\n\nOne or more XA transactions can be part of the same global transaction.\nAll XA transactions within a given global transaction must use the same\ngtrid value in the xid value. For this reason, gtrid values must be\nglobally unique so that there is no ambiguity about which global\ntransaction a given XA transaction is part of. The bqual part of the\nxid value must be different for each XA transaction within a global\ntransaction. (The requirement that bqual values be different is a\nlimitation of the current MySQL XA implementation. It is not part of\nthe XA specification.)\n\nThe XA RECOVER statement returns information for those XA transactions\non the MySQL server that are in the PREPARED state. (See\nhttp://dev.mysql.com/doc/refman/5.6/en/xa-states.html.) The output\nincludes a row for each such XA transaction on the server, regardless\nof which client started it.\n\nXA RECOVER output rows look like this (for an example xid value\nconsisting of the parts \'abc\', \'def\', and 7):\n\nmysql> XA RECOVER;\n+----------+--------------+--------------+--------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------+\n| 7 | 3 | 3 | abcdef |\n+----------+--------------+--------------+--------+\n\nThe output columns have the following meanings:\n\no formatID is the formatID part of the transaction xid\n\no gtrid_length is the length in bytes of the gtrid part of the xid\n\no bqual_length is the length in bytes of the bqual part of the xid\n\no data is the concatenation of the gtrid and bqual parts of the xid\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/xa-statements.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (494,38,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (495,32,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP([fsp])\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS format, depending on whether the function\nis used in a string or numeric context.\n\nAs of MySQL 5.6.4, if the fsp argument is given to specify a fractional\nseconds precision from 0 to 6, the return value includes a fractional\nseconds part of that many digits. Before 5.6.4, any argument is\nignored.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (496,12,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str)\n\nAES_ENCRYPT() and AES_DECRYPT() enable encryption and decryption of\ndata using the official AES (Advanced Encryption Standard) algorithm,\npreviously known as "Rijndael." Encoding with a 128-bit key length is\nused, but you can extend it up to 256 bits by modifying the source. We\nchose 128 bits because it is much faster and it is secure enough for\nmost purposes.\n\nAES_ENCRYPT() encrypts a string and returns a binary string.\nAES_DECRYPT() decrypts the encrypted string and returns the original\nstring. The input arguments may be any length. If either argument is\nNULL, the result of this function is also NULL.\n\nBecause AES is a block-level algorithm, padding is used to encode\nuneven length strings and so the result string length may be calculated\nusing this formula:\n\n16 * (trunc(string_length / 16) + 1)\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns\nNULL. However, it is possible for AES_DECRYPT() to return a non-NULL\nvalue (possibly garbage) if the input data or the key is invalid.\n\nYou can use the AES functions to store data in an encrypted form by\nmodifying your queries:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html\n\n','INSERT INTO t VALUES (1,AES_ENCRYPT(\'text\',\'password\'));\n','http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (497,4,'+','Syntax:\n+\n\nAddition:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n -> 8\n','http://dev.mysql.com/doc/refman/5.6/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (498,17,'GTID_SUBTRACT','Syntax:\nGTID_SUBTRACT(set,subset)\n\nGiven two sets of global transaction IDs subset and set, returns only\nthose GTIDs from set that are not in subset.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (499,14,'INET_NTOA','Syntax:\nINET_NTOA(expr)\n\nGiven a numeric IPv4 network address in network byte order, returns the\ndotted-quad string representation of the address as a nonbinary string\nin the connection character set. INET_NTOA() returns NULL if it does\nnot understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_NTOA(167773449);\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (500,32,'DAYOFWEEK','Syntax:\nDAYOFWEEK(date)\n\nReturns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC standard.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFWEEK(\'2007-02-03\');\n -> 7\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (501,4,'CEILING','Syntax:\nCEILING(X)\n\nReturns the smallest integer value not less than X.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT CEILING(1.23);\n -> 2\nmysql> SELECT CEILING(-1.23);\n -> -1\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (502,33,'LINEFROMWKB','LineFromWKB(wkb[,srid]), LineStringFromWKB(wkb[,srid])\n\nConstructs a LINESTRING value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (503,27,'SHOW PROCESSLIST','Syntax:\nSHOW [FULL] PROCESSLIST\n\nSHOW PROCESSLIST shows you which threads are running. You can also get\nthis information from the INFORMATION_SCHEMA PROCESSLIST table or the\nmysqladmin processlist command. If you have the PROCESS privilege, you\ncan see all threads. Otherwise, you can see only your own threads (that\nis, threads associated with the MySQL account that you are using). If\nyou do not use the FULL keyword, only the first 100 characters of each\nstatement are shown in the Info field.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (504,37,'GEOMETRYTYPE','GeometryType(g)\n\nReturns as a binary string the name of the geometry type of which the\ngeometry instance g is a member. The name corresponds to one of the\ninstantiable Geometry subclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','mysql> SELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT |\n+------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (505,40,'CREATE VIEW','Syntax:\nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThe CREATE VIEW statement creates a new view, or replaces an existing\none if the OR REPLACE clause is given. If the view does not exist,\nCREATE OR REPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR REPLACE VIEW is the same as ALTER VIEW.\n\nThe select_statement is a SELECT statement that provides the definition\nof the view. (When you select from the view, you select in effect using\nthe SELECT statement.) select_statement can select from base tables or\nother views.\n\nThe view definition is "frozen" at creation time, so changes to the\nunderlying tables afterward do not affect the view definition. For\nexample, if a view is defined as SELECT * on a table, new columns added\nto the table later do not become part of the view.\n\nThe ALGORITHM clause affects how MySQL processes the view. The DEFINER\nand SQL SECURITY clauses specify the security context to be used when\nchecking access privileges at view invocation time. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates to rows in\ntables referenced by the view. These clauses are described later in\nthis section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the\nview, and some privilege for each column selected by the SELECT\nstatement. For columns used elsewhere in the SELECT statement you must\nhave the SELECT privilege. If the OR REPLACE clause is present, you\nmust also have the DROP privilege for the view. CREATE VIEW might also\nrequire the SUPER privilege, depending on the DEFINER value, as\ndescribed later in this section.\n\nWhen a view is referenced, privilege checking occurs as described later\nin this section.\n\nA view belongs to a database. By default, a new view is created in the\ndefault database. To create the view explicitly in a given database,\nspecify the name as db_name.view_name when you create it:\n\nmysql> CREATE VIEW test.v AS SELECT * FROM t;\n\nWithin a database, base tables and views share the same namespace, so a\nbase table and a view cannot have the same name.\n\nColumns retrieved by the SELECT statement can be simple references to\ntable columns. They can also be expressions that use functions,\nconstant values, operators, and so forth.\n\nViews must have unique column names with no duplicates, just like base\ntables. By default, the names of the columns retrieved by the SELECT\nstatement are used for the view column names. To define explicit names\nfor the view columns, the optional column_list clause can be given as a\nlist of comma-separated identifiers. The number of names in column_list\nmust be the same as the number of columns retrieved by the SELECT\nstatement.\n\nUnqualified table or view names in the SELECT statement are interpreted\nwith respect to the default database. A view can refer to tables or\nviews in other databases by qualifying the table or view name with the\nproper database name.\n\nA view can be created from many kinds of SELECT statements. It can\nrefer to base tables or other views. It can use joins, UNION, and\nsubqueries. The SELECT need not even refer to any tables. The following\nexample defines a view that selects two columns from another table, as\nwell as an expression calculated from those columns:\n\nmysql> CREATE TABLE t (qty INT, price INT);\nmysql> INSERT INTO t VALUES(3, 50);\nmysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\nmysql> SELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\no The SELECT statement cannot contain a subquery in the FROM clause.\n\no The SELECT statement cannot refer to system or user variables.\n\no Within a stored program, the definition cannot refer to program\n parameters or local variables.\n\no The SELECT statement cannot refer to prepared statement parameters.\n\no Any table or view referred to in the definition must exist. However,\n after a view has been created, it is possible to drop a table or view\n that the definition refers to. In this case, use of the view results\n in an error. To check a view definition for problems of this kind,\n use the CHECK TABLE statement.\n\no The definition cannot refer to a TEMPORARY table, and you cannot\n create a TEMPORARY view.\n\no Any tables named in the view definition must exist at definition\n time.\n\no You cannot associate a trigger with a view.\n\no Aliases for column names in the SELECT statement are checked against\n the maximum column length of 64 characters (not the maximum alias\n length of 256 characters).\n\nORDER BY is permitted in a view definition, but it is ignored if you\nselect from a view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the\noptions or clauses of the statement that references the view, but the\neffect is undefined. For example, if a view definition includes a LIMIT\nclause, and you select from the view using a statement that has its own\nLIMIT clause, it is undefined which limit applies. This same principle\napplies to options such as ALL, DISTINCT, or SQL_SMALL_RESULT that\nfollow the SELECT keyword, and to clauses such as INTO, FOR UPDATE,\nLOCK IN SHARE MODE, and PROCEDURE.\n\nIf you create a view and then change the query processing environment\nby changing system variables, that may affect the results that you get\nfrom the view:\n\nmysql> CREATE VIEW v (mycol) AS SELECT \'abc\';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SET sql_mode = \'\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol |\n+-------+\n1 row in set (0.01 sec)\n\nmysql> SET sql_mode = \'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc |\n+-------+\n1 row in set (0.00 sec)\n\nThe DEFINER and SQL SECURITY clauses determine which MySQL account to\nuse when checking access privileges for the view when a statement is\nexecuted that references the view. The valid SQL SECURITY\ncharacteristic values are DEFINER and INVOKER. These indicate that the\nrequired privileges must be held by the user who defined or invoked the\nview, respectively. The default SQL SECURITY value is DEFINER.\n\nIf a user value is given for the DEFINER clause, it should be a MySQL\naccount specified as \'user_name\'@\'host_name\' (the same format used in\nthe GRANT statement), CURRENT_USER, or CURRENT_USER(). The default\nDEFINER value is the user who executes the CREATE VIEW statement. This\nis the same as specifying DEFINER = CURRENT_USER explicitly.\n\nIf you specify the DEFINER clause, these rules determine the valid\nDEFINER user values:\n\no If you do not have the SUPER privilege, the only valid user value is\n your own account, either specified literally or by using\n CURRENT_USER. You cannot set the definer to some other account.\n\no If you have the SUPER privilege, you can specify any syntactically\n valid account name. If the account does not actually exist, a warning\n is generated.\n\no Although it is possible to create a view with a nonexistent DEFINER\n account, an error occurs when the view is referenced if the SQL\n SECURITY value is DEFINER but the definer account does not exist.\n\nFor more information about view security, see\nhttp://dev.mysql.com/doc/refman/5.6/en/stored-programs-security.html.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value\nby default. For views defined with the SQL SECURITY INVOKER\ncharacteristic, CURRENT_USER returns the account for the view\'s\ninvoker. For information about user auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.6/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This\nalso affects a view defined within such a routine, if the view\ndefinition contains a DEFINER value of CURRENT_USER.\n\nView privileges are checked like this:\n\no At view definition time, the view creator must have the privileges\n needed to use the top-level objects accessed by the view. For\n example, if the view definition refers to table columns, the creator\n must have some privilege for each column in the select list of the\n definition, and the SELECT privilege for each column used elsewhere\n in the definition. If the definition refers to a stored function,\n only the privileges needed to invoke the function can be checked. The\n privileges required at function invocation time can be checked only\n as it executes: For different invocations, different execution paths\n within the function might be taken.\n\no The user who references a view must have appropriate privileges to\n access it (SELECT to select from it, INSERT to insert into it, and so\n forth.)\n\no When a view has been referenced, privileges for objects accessed by\n the view are checked against the privileges held by the view DEFINER\n account or invoker, depending on whether the SQL SECURITY\n characteristic is DEFINER or INVOKER, respectively.\n\no If reference to a view causes execution of a stored function,\n privilege checking for statements executed within the function depend\n on whether the function SQL SECURITY characteristic is DEFINER or\n INVOKER. If the security characteristic is DEFINER, the function runs\n with the privileges of the DEFINER account. If the characteristic is\n INVOKER, the function runs with the privileges determined by the\n view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function\nmight invoke other stored routines. For example, the following view\ninvokes a stored function f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be\nchecked when f() executes. This might mean that privileges are needed\nfor p1() or p2(), depending on the execution path within f(). Those\nprivileges must be checked at runtime, and the user who must possess\nthe privileges is determined by the SQL SECURITY values of the view v\nand the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to\nstandard SQL. In standard SQL, views are handled using the rules for\nSQL SECURITY DEFINER. The standard says that the definer of the view,\nwhich is the same as the owner of the view\'s schema, gets applicable\nprivileges on the view (for example, SELECT) and may grant them. MySQL\nhas no concept of a schema "owner", so MySQL adds a clause to identify\nthe definer. The DEFINER clause is an extension where the intent is to\nhave what the standard has; that is, a permanent record of who defined\nthe view. This is why the default DEFINER value is the account of the\nview creator.\n\nThe optional ALGORITHM clause is a MySQL extension to standard SQL. It\naffects how MySQL processes the view. ALGORITHM takes three values:\nMERGE, TEMPTABLE, or UNDEFINED. The default algorithm is UNDEFINED if\nno ALGORITHM clause is present. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/view-algorithms.html.\n\nSome views are updatable. That is, you can use them in statements such\nas UPDATE, DELETE, or INSERT to update the contents of the underlying\ntable. For a view to be updatable, there must be a one-to-one\nrelationship between the rows in the view and the rows in the\nunderlying table. There are also certain other constructs that make a\nview nonupdatable.\n\nThe WITH CHECK OPTION clause can be given for an updatable view to\nprevent inserts or updates to rows except those for which the WHERE\nclause in the select_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and\nCASCADED keywords determine the scope of check testing when the view is\ndefined in terms of another view. The LOCAL keyword restricts the CHECK\nOPTION only to the view being defined. CASCADED causes the checks for\nunderlying views to be evaluated as well. When neither keyword is\ngiven, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION\nclause, see\nhttp://dev.mysql.com/doc/refman/5.6/en/view-updatability.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/create-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (506,38,'TRIM','Syntax:\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nReturns the string str with all remstr prefixes or suffixes removed. If\nnone of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is\nassumed. remstr is optional and, if not specified, spaces are removed.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT TRIM(\' bar \');\n -> \'bar\'\nmysql> SELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\');\n -> \'barxxx\'\nmysql> SELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\');\n -> \'bar\'\nmysql> SELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\');\n -> \'barx\'\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (507,14,'INET6_NTOA','Syntax:\nINET6_NTOA(expr)\n\nGiven an IPv6 or IPv4 network address represented in numeric form as a\nbinary string, returns the string representation of the address as a\nnonbinary string in the connection character set. If the argument is\nnot a valid address, INET6_NTOA() returns NULL.\n\nINET6_NTOA() has these properties:\n\no It does not use operating system functions to perform conversions,\n thus the output string is platform independent.\n\no The return string has a maximum length of 39 (4 x 8 + 7). Given this\n statement:\n\nCREATE TABLE t AS SELECT INET6_NTOA(expr) AS c1;\n\n The resulting table would have this definition:\n\nCREATE TABLE t (c1 VARCHAR(39) CHARACTER SET utf8 DEFAULT NULL);\n\no The return string uses lowercase letters for IPv6 addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html\n\n','mysql> SELECT INET6_NTOA(INET6_ATON(\'fdfe::5a55:caff:fefa:9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(INET6_ATON(\'10.0.5.9\'));\n -> \'10.0.5.9\'\n\nmysql> SELECT INET6_NTOA(UNHEX(\'FDFE0000000000005A55CAFFFEFA9089\'));\n -> \'fdfe::5a55:caff:fefa:9089\'\nmysql> SELECT INET6_NTOA(UNHEX(\'0A000509\'));\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (508,24,'SIGNAL','Syntax:\nSIGNAL condition_value\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nSIGNAL is the way to "return" an error. SIGNAL provides error\ninformation to a handler, to an outer portion of the application, or to\nthe client. Also, it provides control over the error\'s characteristics\n(error number, SQLSTATE value, message). Without SIGNAL, it is\nnecessary to resort to workarounds such as deliberately referring to a\nnonexistent table to cause a routine to return an error.\n\nNo special privileges are required to execute the SIGNAL statement.\n\nTo retrieve information from the diagnostics area, use the GET\nDIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information\nabout the diagnostics area, see\nhttp://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html.\n\nThe condition_value in a SIGNAL statement indicates the error value to\nbe returned. It can be an SQLSTATE value (a 5-character string literal)\nor a condition_name that refers to a named condition previously defined\nwith DECLARE ... CONDITION (see [HELP DECLARE CONDITION]).\n\nAn SQLSTATE value can indicate errors, warnings, or "not found." The\nfirst two characters of the value indicate its error class, as\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-condition-inf\normation-items. Some signal values cause statement termination; see\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-effects.\n\nThe SQLSTATE value for a SIGNAL statement should not start with \'00\'\nbecause such values indicate success and are not valid for signaling an\nerror. This is true whether the SQLSTATE value is specified directly in\nthe SIGNAL statement or in a named condition referred to in the\nstatement. If the value is invalid, a Bad SQLSTATE error occurs.\n\nTo signal a generic SQLSTATE value, use \'45000\', which means "unhandled\nuser-defined exception."\n\nThe SIGNAL statement optionally includes a SET clause that contains\nmultiple signal items, in a comma-separated list of\ncondition_information_item_name = simple_value_specification\nassignments.\n\nEach condition_information_item_name may be specified only once in the\nSET clause. Otherwise, a Duplicate condition information item error\noccurs.\n\nValid simple_value_specification designators can be specified using\nstored procedure or function parameters, stored program local variables\ndeclared with DECLARE, user-defined variables, system variables, or\nliterals. A character literal may include a _charset introducer.\n\nFor information about permissible condition_information_item_name\nvalues, see\nhttp://dev.mysql.com/doc/refman/5.6/en/signal.html#signal-condition-inf\normation-items.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/signal.html\n\n','CREATE PROCEDURE p (pval INT)\nBEGIN\n DECLARE specialty CONDITION FOR SQLSTATE \'45000\';\n IF pval = 0 THEN\n SIGNAL SQLSTATE \'01000\';\n ELSEIF pval = 1 THEN\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSEIF pval = 2 THEN\n SIGNAL specialty\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSE\n SIGNAL SQLSTATE \'01000\'\n SET MESSAGE_TEXT = \'A warning occurred\', MYSQL_ERRNO = 1000;\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\', MYSQL_ERRNO = 1001;\n END IF;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/signal.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (509,8,'SAVEPOINT','Syntax:\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT,\nRELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/savepoint.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/savepoint.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (510,33,'MPOINTFROMWKB','MPointFromWKB(wkb[,srid]), MultiPointFromWKB(wkb[,srid])\n\nConstructs a MULTIPOINT value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (511,40,'ALTER TABLE','Syntax:\nALTER [IGNORE] TABLE tbl_name\n [alter_specification [, alter_specification] ...]\n [partition_options]\n\nalter_specification:\n table_options\n | ADD [COLUMN] col_name column_definition\n [FIRST | AFTER col_name ]\n | ADD [COLUMN] (col_name column_definition,...)\n | ADD {INDEX|KEY} [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [index_name] (index_col_name,...)\n reference_definition\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY}\n | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}\n | CHANGE [COLUMN] old_col_name new_col_name column_definition\n [FIRST|AFTER col_name]\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | MODIFY [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | DROP [COLUMN] col_name\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} index_name\n | DROP FOREIGN KEY fk_symbol\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO|AS] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n | FORCE\n | ADD PARTITION (partition_definition)\n | DROP PARTITION partition_names\n | TRUNCATE PARTITION {partition_names | ALL}\n | COALESCE PARTITION number\n | REORGANIZE PARTITION partition_names INTO (partition_definitions)\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name\n | ANALYZE PARTITION {partition_names | ALL}\n | CHECK PARTITION {partition_names | ALL}\n | OPTIMIZE PARTITION {partition_names | ALL}\n | REBUILD PARTITION {partition_names | ALL}\n | REPAIR PARTITION {partition_names | ALL}\n | REMOVE PARTITIONING\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\ntable_options:\n table_option [[,] table_option] ... (see CREATE TABLE options)\n\npartition_options:\n (see CREATE TABLE options)\n\nALTER TABLE changes the structure of a table. For example, you can add\nor delete columns, create or destroy indexes, change the type of\nexisting columns, or rename columns or the table itself. You can also\nchange characteristics such as the storage engine used for the table or\nthe table comment.\n\nPartitioning-related clauses for ALTER TABLE can be used with\npartitioned tables for repartitioning, for adding, dropping, merging,\nand splitting partitions, and for performing partitioning maintenance.\nIt is possible for an ALTER TABLE statement to contain a PARTITION BY\nor REMOVE PARTITION clause in an addition to other alter\nspecifications, but the PARTITION BY or REMOVE PARTITION clause must be\nspecified last after any other specifications. The ADD PARTITION, DROP\nPARTITION, COALESCE PARTITION, REORGANIZE PARTITION, ANALYZE PARTITION,\nCHECK PARTITION, and REPAIR PARTITION options cannot be combined with\nother alter specifications in a single ALTER TABLE, since the options\njust listed act on individual partitions. For more information, see\nhttp://dev.mysql.com/doc/refman/5.6/en/alter-table-partition-operations\n.html.\n\nFollowing the table name, specify the alterations to be made. If none\nare given, ALTER TABLE does nothing.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (512,24,'LABELS','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nLabels are permitted for BEGIN ... END blocks and for the LOOP, REPEAT,\nand WHILE statements. Label use for those statements follows these\nrules:\n\no begin_label must be followed by a colon.\n\no begin_label can be given without end_label. If end_label is present,\n it must be the same as begin_label.\n\no end_label cannot be given without begin_label.\n\no Labels at the same nesting level must be distinct.\n\no Labels can be up to 16 characters long.\n\nTo refer to a label within the labeled construct, use an ITERATE or\nLEAVE statement. The following example uses those statements to\ncontinue iterating or terminate the loop:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN ITERATE label1; END IF;\n LEAVE label1;\n END LOOP label1;\nEND;\n\nThe scope of a block label does not include the code for handlers\ndeclared within the block. For details, see [HELP DECLARE HANDLER].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/statement-labels.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/statement-labels.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (513,23,'CHAR BYTE','The CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (514,19,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (515,21,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nANALYZE TABLE analyzes and stores the key distribution for a table.\nDuring the analysis, the table is locked with a read lock for InnoDB\nand MyISAM. This statement works with InnoDB, NDB, and MyISAM tables.\nFor MyISAM tables, this statement is equivalent to using myisamchk\n--analyze.\n\nFor more information on how the analysis works within InnoDB, see\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-p\nersistent-stats and\nhttp://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html. In\nparticular, when you enable the innodb_stats_persistent option, you\nmust run ANALYZE TABLE after loading substantial data into an InnoDB\ntable, or creating a new index for one.\n\nMySQL uses the stored key distribution to decide the order in which\ntables should be joined when you perform a join on something other than\na constant. In addition, key distributions can be used when deciding\nwhich indexes to use for a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nANALYZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... ANALYZE PARTITION to analyze one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.6/en/partitioning-maintenance.html.\n\nIn MySQL 5.6.11 only, gtid_next must be set to AUTOMATIC before issuing\nthis statement. (Bug #16062608, Bug #16715809, Bug #69045)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/analyze-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (516,38,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-functions.html\n\n','mysql> SELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 2\nmysql> SELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (517,40,'CONSTRAINT','MySQL supports foreign keys, which let you cross-reference related data\nacross tables, and foreign key constraints, which help keep this\nspread-out data consistent. The essential syntax for a foreign key\nconstraint definition in a CREATE TABLE or ALTER TABLE statement looks\nlike this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name, ...)\n REFERENCES tbl_name (index_col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html\n\n','CREATE TABLE product (\n category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)\n) ENGINE=INNODB;\n\nCREATE TABLE customer (\n id INT NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=INNODB;\n\nCREATE TABLE product_order (\n no INT NOT NULL AUTO_INCREMENT,\n product_category INT NOT NULL,\n product_id INT NOT NULL,\n customer_id INT NOT NULL,\n\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n INDEX (customer_id),\n\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)\n) ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (518,40,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n {ADD|DROP} DATAFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement can be used either to add a new data file, or to drop a\ndata file from a tablespace.\n\nThe ADD DATAFILE variant enables you to specify an initial size using\nan INITIAL_SIZE clause, where size is measured in bytes; the default\nvalue is 128M (128 megabytes). You may optionally follow this integer\nvalue with a one-letter abbreviation for an order of magnitude, similar\nto those used in my.cnf. Generally, this is one of the letters M (for\nmegabytes) or G (for gigabytes).\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an data file with the same name, or an undo log\nfile and a tablespace with the same name.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nINITIAL_SIZE is rounded, explicitly, as for CREATE TABLESPACE.\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. You cannot drop a data file from a\ntablespace which is in use by any table; in other words, the data file\nmust be empty (no extents used). See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data-objects.\nhtml. In addition, any data file to be dropped must previously have\nbeen added to the tablespace with CREATE TABLESPACE or ALTER\nTABLESPACE.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. Currently, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.6. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+--------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.6/en/files-table.html.\n\nALTER TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/alter-tablespace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (519,23,'ENUM','ENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nAn enumeration. A string object that can have only one value, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or the special \'\'\nerror value. ENUM values are represented internally as integers.\n\nAn ENUM column can have a maximum of 65,535 distinct elements. (The\npractical limit is less than 3000.) A table can have no more than 255\nunique element list definitions among its ENUM and SET columns\nconsidered as a group. For more information on these limits, see\nhttp://dev.mysql.com/doc/refman/5.6/en/limits-frm-file.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (520,38,'STRCMP','Syntax:\nSTRCMP(expr1,expr2)\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort\norder, and 1 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html\n\n','mysql> SELECT STRCMP(\'text\', \'text2\');\n -> -1\nmysql> SELECT STRCMP(\'text2\', \'text\');\n -> 1\nmysql> SELECT STRCMP(\'text\', \'text\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.6/en/string-comparison-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (521,28,'INSERT DELAYED','Syntax:\nINSERT DELAYED ...\n\nThe DELAYED option for the INSERT statement is a MySQL extension to\nstandard SQL that can be used for certain kinds of tables (such as\nMyISAM). When a client uses INSERT DELAYED, it gets an okay from the\nserver at once, and the row is queued to be inserted when the table is\nnot in use by any other thread.\n\n*Note*: INSERT DELAYED is slower than a normal INSERT if the table is\nnot otherwise in use. There is also the additional overhead for the\nserver to handle a separate thread for each table for which there are\ndelayed rows. This means that you should use INSERT DELAYED only when\nyou are really sure that you need it. As of MySQL 5.6.6, INSERT DELAYED\nis deprecated, and will be removed in a future release. Use INSERT\n(without DELAYED) instead.\n\nThe queued rows are held only in memory until they are inserted into\nthe table. This means that if you terminate mysqld forcibly (for\nexample, with kill -9) or if mysqld dies unexpectedly, any queued rows\nthat have not been written to disk are lost.\n\nThere are some constraints on the use of DELAYED:\n\no INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE, and BLACKHOLE\n tables. For engines that do not support DELAYED, an error occurs.\n\no An error occurs for INSERT DELAYED if used with a table that has been\n locked with LOCK TABLES because the insert must be handled by a\n separate thread, not by the session that holds the lock.\n\no For MyISAM tables, if there are no free blocks in the middle of the\n data file, concurrent SELECT and INSERT statements are supported.\n Under these circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\n\no INSERT DELAYED should be used only for INSERT statements that specify\n value lists. The server ignores DELAYED for INSERT ... SELECT or\n INSERT ... ON DUPLICATE KEY UPDATE statements.\n\no Because the INSERT DELAYED statement returns immediately, before the\n rows are inserted, you cannot use LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\n\no DELAYED rows are not visible to SELECT statements until they actually\n have been inserted.\n\no Prior to MySQL 5.6, INSERT DELAYED was treated as a normal INSERT if\n the statement inserted multiple rows, binary logging was enabled, and\n the global logging format was statement-based (that is, whenever\n binlog_format was set to STATEMENT). Beginning with MySQL 5.6, INSERT\n DELAYED is always handled as a simple INSERT (that is, without the\n DELAYED option) whenever the value of binlog_format is STATEMENT or\n MIXED. (In the latter case, the statement no longer triggers a switch\n to row-based logging, and so is logged using the statement-based\n format.)\n\n This does not apply when using row-based binary logging mode\n (binlog_format set to ROW), in which INSERT DELAYED statements are\n always executed using the DELAYED option as specified, and logged as\n row-update events.\n\no DELAYED is ignored on slave replication servers, so that INSERT\n DELAYED is treated as a normal INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than the master.\n\no Pending INSERT DELAYED statements are lost if a table is write locked\n and ALTER TABLE is used to modify the table structure.\n\no INSERT DELAYED is not supported for views.\n\no INSERT DELAYED is not supported for partitioned tables.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/insert-delayed.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/insert-delayed.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (522,27,'SHOW PROCEDURE CODE','Syntax:\nSHOW PROCEDURE CODE proc_name\n\nThis statement is a MySQL extension that is available only for servers\nthat have been built with debugging support. It displays a\nrepresentation of the internal implementation of the named stored\nprocedure. A similar statement, SHOW FUNCTION CODE, displays\ninformation about stored functions (see [HELP SHOW FUNCTION CODE]).\n\nBoth statements require that you be the owner of the routine or have\nSELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result\nset. Each row in the result set corresponds to one "instruction" in the\nroutine. The first column is Pos, which is an ordinal number beginning\nwith 0. The second column is Instruction, which contains an SQL\nstatement (usually changed from the original source), or a directive\nwhich has meaning only to the stored-routine handler.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-procedure-code.html\n\n','mysql> DELIMITER //\nmysql> CREATE PROCEDURE p1 ()\n -> BEGIN\n -> DECLARE fanta INT DEFAULT 55;\n -> DROP TABLE t2;\n -> LOOP\n -> INSERT INTO t3 VALUES (fanta);\n -> END LOOP;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction |\n+-----+----------------------------------------+\n| 0 | set fanta@0 55 |\n| 1 | stmt 9 "DROP TABLE t2" |\n| 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |\n| 3 | jump 2 |\n+-----+----------------------------------------+\n4 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.6/en/show-procedure-code.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (523,23,'MEDIUMTEXT','MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 16,777,215 (224 - 1) characters.\nThe effective maximum length is less if the value contains multi-byte\ncharacters. Each MEDIUMTEXT value is stored using a 3-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (524,4,'LOG','Syntax:\nLOG(X), LOG(B,X)\n\nIf called with one parameter, this function returns the natural\nlogarithm of X. If X is less than or equal to 0, then NULL is returned.\n\nThe inverse of this function (when called with a single argument) is\nthe EXP() function.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT LOG(2);\n -> 0.69314718055995\nmysql> SELECT LOG(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (525,27,'SHOW COLLATION','Syntax:\nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement lists collations supported by the server. By default,\nthe output from SHOW COLLATION includes all available collations. The\nLIKE clause, if present, indicates which collation names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.6/en/extended-show.html. For example:\n\nmysql> SHOW COLLATION LIKE \'latin1%\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1 | 5 | | | 0 |\n| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 0 |\n| latin1_danish_ci | latin1 | 15 | | | 0 |\n| latin1_german2_ci | latin1 | 31 | | Yes | 2 |\n| latin1_bin | latin1 | 47 | | Yes | 0 |\n| latin1_general_ci | latin1 | 48 | | | 0 |\n| latin1_general_cs | latin1 | 49 | | | 0 |\n| latin1_spanish_ci | latin1 | 94 | | | 0 |\n+-------------------+---------+----+---------+----------+---------+\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/show-collation.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/show-collation.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (526,19,'!=','Syntax:\n<>, !=\n\nNot equal:\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT \'.01\' <> \'0.01\';\n -> 1\nmysql> SELECT .01 <> \'0.01\';\n -> 0\nmysql> SELECT \'zapp\' <> \'zappp\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (527,24,'WHILE','Syntax:\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition expression is true. statement_list consists of one or\nmore SQL statements, each terminated by a semicolon (;) statement\ndelimiter.\n\nA WHILE statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/while.html\n\n','CREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\n WHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n END WHILE;\nEND;\n','http://dev.mysql.com/doc/refman/5.6/en/while.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (528,32,'DAYNAME','Syntax:\nDAYNAME(date)\n\nReturns the name of the weekday for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.6/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html\n\n','mysql> SELECT DAYNAME(\'2007-02-03\');\n -> \'Saturday\'\n','http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (529,17,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (530,4,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians. (Note that\nπ radians equals 180 degrees.)\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (531,19,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (532,17,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.6.13-standard\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,0); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,0); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,1); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,2); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (2,3); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (3,4); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,5); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,6); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,6); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,7); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,8); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (249,9); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,10); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,10); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,10); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (8,11); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (9,12); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,13); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (16,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,14); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (17,15); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (222,16); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,17); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,17); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (104,17); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,18); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,19); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (23,20); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,21); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (25,22); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,23); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,24); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,25); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,25); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,26); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,26); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,27); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (28,28); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (30,29); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (422,29); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,29); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,30); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,30); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,30); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,30); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,30); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,31); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,32); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (33,33); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,34); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,35); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,36); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,36); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,36); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,37); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,37); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,37); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,37); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (106,38); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,38); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,38); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (38,39); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,39); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,40); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,41); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (40,41); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,41); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (115,42); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,42); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,42); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,43); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,44); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,45); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,46); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (48,47); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,48); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,49); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,50); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,51); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,51); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,51); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,52); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,52); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,53); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,54); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,54); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,54); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,54); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,55); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (454,56); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,56); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,56); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,56); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (60,57); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,58); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (364,59); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,60); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (559,60); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,60); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (395,61); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (65,61); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,62); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,62); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,63); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,63); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,63); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,64); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,64); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,64); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,65); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,65); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,66); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,66); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,67); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (70,68); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,69); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,69); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (73,70); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (390,70); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (74,71); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,72); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (78,73); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (79,74); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,75); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,75); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (80,75); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (579,75); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (432,76); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (82,76); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,76); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,76); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,77); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,77); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,77); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,78); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,78); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,78); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,78); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,78); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,78); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (83,79); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,80); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,81); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,82); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,83); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (83,84); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,85); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,86); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,87); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,87); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,88); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,89); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,89); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (88,90); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,91); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,92); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (555,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,93); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (91,94); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,95); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,96); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (93,97); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,98); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,99); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (531,100); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (468,101); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (182,102); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,103); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,104); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,105); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,106); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,107); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,108); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,108); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,108); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (106,109); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (107,110); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,111); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,111); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,111); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,111); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (109,112); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,113); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,113); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (111,114); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (113,115); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,116); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,117); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,118); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,119); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (56,119); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,119); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,120); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,121); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,121); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (121,122); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (126,123); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,124); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,125); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,126); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,126); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,126); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,126); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (454,127); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (67,127); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (94,127); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,128); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,128); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,128); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,129); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (101,129); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (555,130); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,131); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,131); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,131); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (502,132); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,133); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (512,134); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (140,135); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (141,136); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,137); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,138); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,139); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (143,140); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,141); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (147,142); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,143); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (151,144); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,145); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,146); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,146); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,147); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,148); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,149); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,150); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,151); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,151); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,151); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,151); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,151); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (164,152); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (166,153); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (238,154); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (168,155); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (560,156); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (247,157); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,158); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,158); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,159); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,160); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (4,160); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,161); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (156,162); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (249,162); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (172,163); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,164); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (173,165); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,166); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,167); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,168); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (181,169); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,170); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (226,171); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (249,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (156,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (285,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,172); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,173); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,173); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,173); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (71,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (232,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (128,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,174); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (182,175); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,176); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,176); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,176); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,176); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,177); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (177,178); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (189,179); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,180); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,181); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,182); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,183); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (191,184); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (531,185); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (194,186); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (193,187); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (426,188); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,189); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,190); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (94,190); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (554,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (185,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (15,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (19,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (229,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,191); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,192); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,193); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (551,193); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,194); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (503,195); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,196); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,196); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,197); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (201,198); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,199); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,200); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (202,201); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (156,202); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,203); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,204); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (455,204); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,204); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,204); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,204); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,205); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,206); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,207); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (202,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (136,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (579,208); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (204,209); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,210); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,211); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,212); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (207,213); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (210,214); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,215); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,215); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,215); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (212,216); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,217); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,218); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (555,219); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,220); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,221); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (22,222); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,222); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,223); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (218,224); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,225); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,226); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (221,227); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (503,228); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (176,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (529,229); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (223,230); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (225,231); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (227,232); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,233); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,234); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,235); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,236); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (106,236); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (94,236); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (231,237); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,238); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,238); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,239); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,240); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,240); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (234,241); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (233,242); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,243); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (238,244); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,245); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,245); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (239,246); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,247); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,248); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,249); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,250); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,250); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (100,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (216,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (420,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,251); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,252); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (245,253); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,254); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,254); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,255); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,256); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,256); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (247,257); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (563,258); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,258); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,259); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,259); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,260); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,260); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,261); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (256,262); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,263); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,263); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,263); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (257,264); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,265); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,266); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,267); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (361,268); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (7,269); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,269); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (261,270); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (262,271); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,272); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,272); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,272); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,273); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (320,274); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,275); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,275); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (263,275); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,275); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (265,276); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,277); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (122,277); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,277); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,277); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (459,277); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,278); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,278); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,279); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,280); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,281); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,282); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,282); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,282); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (279,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (26,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,283); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,284); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,285); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,286); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (414,286); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,286); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (470,286); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,286); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,286); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,287); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,288); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (270,289); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,290); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,291); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,291); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (573,291); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (148,292); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (274,293); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,294); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,294); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,294); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,294); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,295); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,295); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,295); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,295); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,295); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,295); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (338,296); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,296); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (215,296); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (281,297); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (280,298); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,299); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,300); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (156,301); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (286,302); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,303); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,303); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,303); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (288,304); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (291,305); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,306); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,307); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,307); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,307); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,308); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,308); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,309); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,310); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,310); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,310); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (136,311); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (297,312); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,313); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,314); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,314); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,315); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,315); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,315); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,315); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,315); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,316); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,317); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,317); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,318); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,318); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,318); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,319); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,319); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,319); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,319); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (424,319); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (391,320); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (353,321); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (422,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (158,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (470,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,322); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,323); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,324); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,325); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,326); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,327); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,327); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,327); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,328); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,328); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,328); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,328); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (551,328); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,329); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,330); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,330); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,331); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,332); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,332); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,332); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,332); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,332); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,333); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,334); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,334); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,335); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (313,336); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,337); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,337); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,337); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,338); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,339); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,339); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,339); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,340); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (320,341); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,342); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,342); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,342); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,343); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,343); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,343); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,343); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,343); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,344); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,344); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,344); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,344); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,345); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,346); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (325,347); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,348); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,348); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,348); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,349); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,350); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (226,351); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (60,352); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,353); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,354); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,354); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,355); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (559,355); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,355); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (335,356); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (337,357); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,358); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,358); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,358); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (156,359); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,360); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,361); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,362); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (342,363); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,364); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (343,365); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (332,366); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (345,367); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (15,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (254,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (185,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (574,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (112,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,368); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,369); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (348,370); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (349,371); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,372); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (445,373); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (118,374); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,374); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (573,374); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (184,374); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (328,375); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (250,375); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (468,375); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,376); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (352,377); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (452,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (396,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,378); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,379); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (495,379); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (353,380); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,381); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (559,381); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,381); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (402,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (424,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,382); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,383); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,384); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,384); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,384); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,384); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,385); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,385); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,386); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,386); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,387); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (359,387); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (159,387); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (94,387); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (529,388); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (130,389); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (363,390); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (364,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (329,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (285,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (277,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,391); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,392); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (473,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (495,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (42,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (128,393); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,394); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,395); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,396); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,397); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (555,398); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,399); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (372,400); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,401); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,401); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,402); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,402); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (422,403); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,404); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,405); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,406); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,406); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,406); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,406); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,406); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,407); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,408); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,408); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,409); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (327,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (473,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (308,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (185,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (528,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (229,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (408,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (237,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (420,410); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,411); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (285,412); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (150,413); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,414); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,414); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,414); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,414); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,415); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,415); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,416); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (385,417); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (391,418); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (394,419); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,420); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,420); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,420); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (554,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (306,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (100,421); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,422); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,423); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,423); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,423); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (400,424); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (401,425); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (385,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (361,426); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (98,427); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,427); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,427); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,428); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (413,429); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,430); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,430); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,431); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,431); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,432); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,432); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,433); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (392,433); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (531,433); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (402,433); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (415,434); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (454,435); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,435); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,436); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (377,437); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,437); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (125,437); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,437); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (117,438); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (563,439); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (552,440); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (364,441); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,441); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (110,441); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,441); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,441); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (55,442); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (41,442); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (423,443); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,444); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (469,445); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,446); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (426,447); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (427,448); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,449); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (398,449); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,450); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,451); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,452); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (130,453); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,454); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,455); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,455); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,455); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,455); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,455); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (431,456); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,457); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,458); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,458); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,458); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (176,459); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (64,460); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (438,461); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (454,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (57,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (67,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,462); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,463); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,463); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,464); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,465); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (166,466); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (442,467); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (443,468); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (446,469); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (461,470); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (460,471); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (290,471); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,471); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,471); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (385,471); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (361,471); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,472); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,473); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,474); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (451,475); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,476); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (495,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (242,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,477); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,478); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,478); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,479); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (455,480); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,480); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,481); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,482); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,482); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,482); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (462,483); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (219,483); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (135,483); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,484); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (407,485); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (327,486); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (574,486); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (466,487); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,488); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (315,488); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (416,488); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,489); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (469,490); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,491); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (137,492); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,493); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (472,494); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,495); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,496); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,496); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,496); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,497); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,498); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,499); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (90,500); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (475,501); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,502); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,502); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (476,503); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (478,504); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,505); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,505); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (481,506); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (465,507); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,507); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (115,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (327,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (200,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (328,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (473,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (4,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (167,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (7,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (441,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (128,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (15,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (53,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (22,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (209,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (495,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (101,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (574,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (283,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (576,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (458,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (104,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (42,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (229,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (198,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (468,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (398,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (551,508); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,509); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (486,509); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (487,510); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (489,511); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (90,511); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,512); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (295,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (184,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,513); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,514); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (101,514); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,515); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (72,516); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (303,516); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,517); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,518); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,518); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (509,519); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (75,519); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,520); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (216,521); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,521); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,522); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,522); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,523); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (302,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (339,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,524); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,525); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,526); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (512,527); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (153,528); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (513,529); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (56,530); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,530); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (516,531); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,532); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (520,533); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (216,534); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,534); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (6,534); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (78,535); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,536); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,537); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,538); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,539); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (89,540); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (525,541); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,542); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (71,542); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (414,542); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,542); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,543); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,543); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,543); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (345,544); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,545); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (0,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,546); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (9,547); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (533,548); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (534,549); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (273,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (277,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (514,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (334,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,550); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,551); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,552); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (328,553); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,553); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (439,554); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (287,555); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (538,556); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,557); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,558); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (540,559); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,560); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,560); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (375,561); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (197,561); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,561); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (541,562); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (283,563); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (243,564); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (542,565); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,566); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (220,567); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (545,568); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (550,569); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (552,570); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (553,571); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,572); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,572); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,573); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (29,574); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (558,575); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (559,576); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,577); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,578); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (560,579); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,580); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (457,580); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,580); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (246,581); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (37,581); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (77,581); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,581); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (54,581); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,581); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,582); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (45,582); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,582); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,582); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,582); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (136,583); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (557,584); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (217,584); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (187,584); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (566,585); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,586); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,586); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,587); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,587); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,588); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (424,588); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (568,589); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,589); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,590); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,590); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (364,591); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (259,591); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (485,591); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (371,591); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (374,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (310,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (131,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (319,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (467,592); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,593); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,593); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (521,594); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (340,594); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,594); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,595); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,596); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (579,597); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (294,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (63,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (505,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (448,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (250,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (455,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (492,598); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (268,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (366,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (356,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (530,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (565,599); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,600); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (120,601); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (368,602); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,602); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (178,602); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (31,602); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (578,603); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (196,604); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (24,605); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,606); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (19,606); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (158,606); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (484,607); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (576,607); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (491,608); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (351,608); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (124,609); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,610); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (69,610); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,610); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,611); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (116,612); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (570,612); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (32,613); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (42,613); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (162,613); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (397,613); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (159,613); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (271,614); +INSERT INTO help_relation (help_topic_id,help_keyword_id) VALUES (561,614); -insert into help_keyword (help_keyword_id,name) values (0,'JOIN'); -insert into help_keyword (help_keyword_id,name) values (1,'HOST'); -insert into help_keyword (help_keyword_id,name) values (2,'REPEAT'); -insert into help_keyword (help_keyword_id,name) values (3,'SERIALIZABLE'); -insert into help_keyword (help_keyword_id,name) values (4,'REPLACE'); -insert into help_keyword (help_keyword_id,name) values (5,'AT'); -insert into help_keyword (help_keyword_id,name) values (6,'SCHEDULE'); -insert into help_keyword (help_keyword_id,name) values (7,'RETURNS'); -insert into help_keyword (help_keyword_id,name) values (8,'STARTS'); -insert into help_keyword (help_keyword_id,name) values (9,'MASTER_SSL_CA'); -insert into help_keyword (help_keyword_id,name) values (10,'NCHAR'); -insert into help_keyword (help_keyword_id,name) values (11,'ONLY'); -insert into help_keyword (help_keyword_id,name) values (12,'COLUMNS'); -insert into help_keyword (help_keyword_id,name) values (13,'COMPLETION'); -insert into help_keyword (help_keyword_id,name) values (14,'WORK'); -insert into help_keyword (help_keyword_id,name) values (15,'DATETIME'); -insert into help_keyword (help_keyword_id,name) values (16,'MODE'); -insert into help_keyword (help_keyword_id,name) values (17,'OPEN'); -insert into help_keyword (help_keyword_id,name) values (18,'INTEGER'); -insert into help_keyword (help_keyword_id,name) values (19,'ESCAPE'); -insert into help_keyword (help_keyword_id,name) values (20,'VALUE'); -insert into help_keyword (help_keyword_id,name) values (21,'MASTER_SSL_VERIFY_SERVER_CERT'); -insert into help_keyword (help_keyword_id,name) values (22,'SQL_BIG_RESULT'); -insert into help_keyword (help_keyword_id,name) values (23,'DROP'); -insert into help_keyword (help_keyword_id,name) values (24,'GEOMETRYCOLLECTIONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (25,'EVENTS'); -insert into help_keyword (help_keyword_id,name) values (26,'MONTH'); -insert into help_keyword (help_keyword_id,name) values (27,'PROFILES'); -insert into help_keyword (help_keyword_id,name) values (28,'DUPLICATE'); -insert into help_keyword (help_keyword_id,name) values (29,'REPLICATION'); -insert into help_keyword (help_keyword_id,name) values (30,'UNLOCK'); -insert into help_keyword (help_keyword_id,name) values (31,'STATS_PERSISTENT'); -insert into help_keyword (help_keyword_id,name) values (32,'INNODB'); -insert into help_keyword (help_keyword_id,name) values (33,'YEAR_MONTH'); -insert into help_keyword (help_keyword_id,name) values (34,'SUBJECT'); -insert into help_keyword (help_keyword_id,name) values (35,'MASTER_RETRY_COUNT'); -insert into help_keyword (help_keyword_id,name) values (36,'PREPARE'); -insert into help_keyword (help_keyword_id,name) values (37,'LOCK'); -insert into help_keyword (help_keyword_id,name) values (38,'NDB'); -insert into help_keyword (help_keyword_id,name) values (39,'CHECK'); -insert into help_keyword (help_keyword_id,name) values (40,'FULL'); -insert into help_keyword (help_keyword_id,name) values (41,'INT4'); -insert into help_keyword (help_keyword_id,name) values (42,'BY'); -insert into help_keyword (help_keyword_id,name) values (43,'NO'); -insert into help_keyword (help_keyword_id,name) values (44,'MINUTE'); -insert into help_keyword (help_keyword_id,name) values (45,'PARTITION'); -insert into help_keyword (help_keyword_id,name) values (46,'DATA'); -insert into help_keyword (help_keyword_id,name) values (47,'DAY'); -insert into help_keyword (help_keyword_id,name) values (48,'SHARE'); -insert into help_keyword (help_keyword_id,name) values (49,'REAL'); -insert into help_keyword (help_keyword_id,name) values (50,'SEPARATOR'); -insert into help_keyword (help_keyword_id,name) values (51,'MESSAGE_TEXT'); -insert into help_keyword (help_keyword_id,name) values (52,'MASTER_HEARTBEAT_PERIOD'); -insert into help_keyword (help_keyword_id,name) values (53,'DELETE'); -insert into help_keyword (help_keyword_id,name) values (54,'ON'); -insert into help_keyword (help_keyword_id,name) values (55,'COLUMN_NAME'); -insert into help_keyword (help_keyword_id,name) values (56,'CONNECTION'); -insert into help_keyword (help_keyword_id,name) values (57,'CLOSE'); -insert into help_keyword (help_keyword_id,name) values (58,'MASTER_SSL_CRLPATH'); -insert into help_keyword (help_keyword_id,name) values (59,'X509'); -insert into help_keyword (help_keyword_id,name) values (60,'USE'); -insert into help_keyword (help_keyword_id,name) values (61,'SUBCLASS_ORIGIN'); -insert into help_keyword (help_keyword_id,name) values (62,'WHERE'); -insert into help_keyword (help_keyword_id,name) values (63,'PRIVILEGES'); -insert into help_keyword (help_keyword_id,name) values (64,'SPATIAL'); -insert into help_keyword (help_keyword_id,name) values (65,'EVENT'); -insert into help_keyword (help_keyword_id,name) values (66,'SUPER'); -insert into help_keyword (help_keyword_id,name) values (67,'SQL_BUFFER_RESULT'); -insert into help_keyword (help_keyword_id,name) values (68,'IGNORE'); -insert into help_keyword (help_keyword_id,name) values (69,'SHA2'); -insert into help_keyword (help_keyword_id,name) values (70,'QUICK'); -insert into help_keyword (help_keyword_id,name) values (71,'SIGNED'); -insert into help_keyword (help_keyword_id,name) values (72,'SECURITY'); -insert into help_keyword (help_keyword_id,name) values (73,'AUTOEXTEND_SIZE'); -insert into help_keyword (help_keyword_id,name) values (74,'NDBCLUSTER'); -insert into help_keyword (help_keyword_id,name) values (75,'POLYGONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (76,'FALSE'); -insert into help_keyword (help_keyword_id,name) values (77,'LEVEL'); -insert into help_keyword (help_keyword_id,name) values (78,'FORCE'); -insert into help_keyword (help_keyword_id,name) values (79,'BINARY'); -insert into help_keyword (help_keyword_id,name) values (80,'TO'); -insert into help_keyword (help_keyword_id,name) values (81,'CHANGE'); -insert into help_keyword (help_keyword_id,name) values (82,'CURRENT_USER'); -insert into help_keyword (help_keyword_id,name) values (83,'HOUR_MINUTE'); -insert into help_keyword (help_keyword_id,name) values (84,'UPDATE'); -insert into help_keyword (help_keyword_id,name) values (85,'PRESERVE'); -insert into help_keyword (help_keyword_id,name) values (86,'TABLE_NAME'); -insert into help_keyword (help_keyword_id,name) values (87,'INTO'); -insert into help_keyword (help_keyword_id,name) values (88,'FEDERATED'); -insert into help_keyword (help_keyword_id,name) values (89,'VARYING'); -insert into help_keyword (help_keyword_id,name) values (90,'MAX_SIZE'); -insert into help_keyword (help_keyword_id,name) values (91,'HOUR_SECOND'); -insert into help_keyword (help_keyword_id,name) values (92,'SQL_AFTER_GTIDS'); -insert into help_keyword (help_keyword_id,name) values (93,'VARIABLE'); -insert into help_keyword (help_keyword_id,name) values (94,'ROLLBACK'); -insert into help_keyword (help_keyword_id,name) values (95,'PROCEDURE'); -insert into help_keyword (help_keyword_id,name) values (96,'TIMESTAMP'); -insert into help_keyword (help_keyword_id,name) values (97,'IMPORT'); -insert into help_keyword (help_keyword_id,name) values (98,'AGAINST'); -insert into help_keyword (help_keyword_id,name) values (99,'CHECKSUM'); -insert into help_keyword (help_keyword_id,name) values (100,'SQL_BEFORE_GTIDS'); -insert into help_keyword (help_keyword_id,name) values (101,'COUNT'); -insert into help_keyword (help_keyword_id,name) values (102,'LONGBINARY'); -insert into help_keyword (help_keyword_id,name) values (103,'THEN'); -insert into help_keyword (help_keyword_id,name) values (104,'INSERT'); -insert into help_keyword (help_keyword_id,name) values (105,'ENGINES'); -insert into help_keyword (help_keyword_id,name) values (106,'HANDLER'); -insert into help_keyword (help_keyword_id,name) values (107,'PORT'); -insert into help_keyword (help_keyword_id,name) values (108,'DAY_SECOND'); -insert into help_keyword (help_keyword_id,name) values (109,'EXISTS'); -insert into help_keyword (help_keyword_id,name) values (110,'MUTEX'); -insert into help_keyword (help_keyword_id,name) values (111,'HELP_DATE'); -insert into help_keyword (help_keyword_id,name) values (112,'RELEASE'); -insert into help_keyword (help_keyword_id,name) values (113,'BOOLEAN'); -insert into help_keyword (help_keyword_id,name) values (114,'MOD'); -insert into help_keyword (help_keyword_id,name) values (115,'DEFAULT'); -insert into help_keyword (help_keyword_id,name) values (116,'TYPE'); -insert into help_keyword (help_keyword_id,name) values (117,'NO_WRITE_TO_BINLOG'); -insert into help_keyword (help_keyword_id,name) values (118,'OPTIMIZE'); -insert into help_keyword (help_keyword_id,name) values (119,'SQLSTATE'); -insert into help_keyword (help_keyword_id,name) values (120,'RESET'); -insert into help_keyword (help_keyword_id,name) values (121,'CLASS_ORIGIN'); -insert into help_keyword (help_keyword_id,name) values (122,'INSTALL'); -insert into help_keyword (help_keyword_id,name) values (123,'ITERATE'); -insert into help_keyword (help_keyword_id,name) values (124,'DO'); -insert into help_keyword (help_keyword_id,name) values (125,'BIGINT'); -insert into help_keyword (help_keyword_id,name) values (126,'SET'); -insert into help_keyword (help_keyword_id,name) values (127,'ISSUER'); -insert into help_keyword (help_keyword_id,name) values (128,'DATE'); -insert into help_keyword (help_keyword_id,name) values (129,'STATUS'); -insert into help_keyword (help_keyword_id,name) values (130,'FULLTEXT'); -insert into help_keyword (help_keyword_id,name) values (131,'COMMENT'); -insert into help_keyword (help_keyword_id,name) values (132,'MASTER_CONNECT_RETRY'); -insert into help_keyword (help_keyword_id,name) values (133,'INNER'); -insert into help_keyword (help_keyword_id,name) values (134,'RELAYLOG'); -insert into help_keyword (help_keyword_id,name) values (135,'STOP'); -insert into help_keyword (help_keyword_id,name) values (136,'MASTER_LOG_FILE'); -insert into help_keyword (help_keyword_id,name) values (137,'MRG_MYISAM'); -insert into help_keyword (help_keyword_id,name) values (138,'PRECISION'); -insert into help_keyword (help_keyword_id,name) values (139,'REQUIRE'); -insert into help_keyword (help_keyword_id,name) values (140,'TRAILING'); -insert into help_keyword (help_keyword_id,name) values (141,'PARTITIONS'); -insert into help_keyword (help_keyword_id,name) values (142,'LONG'); -insert into help_keyword (help_keyword_id,name) values (143,'OPTION'); -insert into help_keyword (help_keyword_id,name) values (144,'REORGANIZE'); -insert into help_keyword (help_keyword_id,name) values (145,'ELSE'); -insert into help_keyword (help_keyword_id,name) values (146,'DEALLOCATE'); -insert into help_keyword (help_keyword_id,name) values (147,'IO_THREAD'); -insert into help_keyword (help_keyword_id,name) values (148,'CASE'); -insert into help_keyword (help_keyword_id,name) values (149,'CIPHER'); -insert into help_keyword (help_keyword_id,name) values (150,'STATS_AUTO_RECALC'); -insert into help_keyword (help_keyword_id,name) values (151,'CONTINUE'); -insert into help_keyword (help_keyword_id,name) values (152,'FROM'); -insert into help_keyword (help_keyword_id,name) values (153,'READ'); -insert into help_keyword (help_keyword_id,name) values (154,'LEFT'); -insert into help_keyword (help_keyword_id,name) values (155,'ELSEIF'); -insert into help_keyword (help_keyword_id,name) values (156,'MINUTE_SECOND'); -insert into help_keyword (help_keyword_id,name) values (157,'COMPACT'); -insert into help_keyword (help_keyword_id,name) values (158,'DEC'); -insert into help_keyword (help_keyword_id,name) values (159,'FOR'); -insert into help_keyword (help_keyword_id,name) values (160,'WARNINGS'); -insert into help_keyword (help_keyword_id,name) values (161,'MIN_ROWS'); -insert into help_keyword (help_keyword_id,name) values (162,'STRING'); -insert into help_keyword (help_keyword_id,name) values (163,'CONDITION'); -insert into help_keyword (help_keyword_id,name) values (164,'ROW_COUNT'); -insert into help_keyword (help_keyword_id,name) values (165,'ENCLOSED'); -insert into help_keyword (help_keyword_id,name) values (166,'FUNCTION'); -insert into help_keyword (help_keyword_id,name) values (167,'AGGREGATE'); -insert into help_keyword (help_keyword_id,name) values (168,'NUMBER'); -insert into help_keyword (help_keyword_id,name) values (169,'FIELDS'); -insert into help_keyword (help_keyword_id,name) values (170,'INT3'); -insert into help_keyword (help_keyword_id,name) values (171,'ARCHIVE'); -insert into help_keyword (help_keyword_id,name) values (172,'AVG_ROW_LENGTH'); -insert into help_keyword (help_keyword_id,name) values (173,'ADD'); -insert into help_keyword (help_keyword_id,name) values (174,'KILL'); -insert into help_keyword (help_keyword_id,name) values (175,'FLOAT4'); -insert into help_keyword (help_keyword_id,name) values (176,'TABLESPACE'); -insert into help_keyword (help_keyword_id,name) values (177,'VIEW'); -insert into help_keyword (help_keyword_id,name) values (178,'ALGORITHM'); -insert into help_keyword (help_keyword_id,name) values (179,'REPEATABLE'); -insert into help_keyword (help_keyword_id,name) values (180,'INFILE'); -insert into help_keyword (help_keyword_id,name) values (181,'HELP_VERSION'); -insert into help_keyword (help_keyword_id,name) values (182,'ORDER'); -insert into help_keyword (help_keyword_id,name) values (183,'MASTER_SSL_CRL'); -insert into help_keyword (help_keyword_id,name) values (184,'USING'); -insert into help_keyword (help_keyword_id,name) values (185,'CONSTRAINT_CATALOG'); -insert into help_keyword (help_keyword_id,name) values (186,'MIDDLEINT'); -insert into help_keyword (help_keyword_id,name) values (187,'GRANT'); -insert into help_keyword (help_keyword_id,name) values (188,'UNSIGNED'); -insert into help_keyword (help_keyword_id,name) values (189,'DECIMAL'); -insert into help_keyword (help_keyword_id,name) values (190,'GEOMETRYFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (191,'INDEXES'); -insert into help_keyword (help_keyword_id,name) values (192,'DEFAULT_AUTH'); -insert into help_keyword (help_keyword_id,name) values (193,'FOREIGN'); -insert into help_keyword (help_keyword_id,name) values (194,'CACHE'); -insert into help_keyword (help_keyword_id,name) values (195,'HOSTS'); -insert into help_keyword (help_keyword_id,name) values (196,'MYSQL_ERRNO'); -insert into help_keyword (help_keyword_id,name) values (197,'COMMIT'); -insert into help_keyword (help_keyword_id,name) values (198,'SCHEMAS'); -insert into help_keyword (help_keyword_id,name) values (199,'LEADING'); -insert into help_keyword (help_keyword_id,name) values (200,'SNAPSHOT'); -insert into help_keyword (help_keyword_id,name) values (201,'CONSTRAINT_NAME'); -insert into help_keyword (help_keyword_id,name) values (202,'DECLARE'); -insert into help_keyword (help_keyword_id,name) values (203,'LOAD'); -insert into help_keyword (help_keyword_id,name) values (204,'SQL_CACHE'); -insert into help_keyword (help_keyword_id,name) values (205,'CONVERT'); -insert into help_keyword (help_keyword_id,name) values (206,'DYNAMIC'); -insert into help_keyword (help_keyword_id,name) values (207,'COLLATE'); -insert into help_keyword (help_keyword_id,name) values (208,'POLYGONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (209,'BYTE'); -insert into help_keyword (help_keyword_id,name) values (210,'GLOBAL'); -insert into help_keyword (help_keyword_id,name) values (211,'LINESTRINGFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (212,'WHEN'); -insert into help_keyword (help_keyword_id,name) values (213,'HAVING'); -insert into help_keyword (help_keyword_id,name) values (214,'AS'); -insert into help_keyword (help_keyword_id,name) values (215,'STARTING'); -insert into help_keyword (help_keyword_id,name) values (216,'RELOAD'); -insert into help_keyword (help_keyword_id,name) values (217,'AUTOCOMMIT'); -insert into help_keyword (help_keyword_id,name) values (218,'REVOKE'); -insert into help_keyword (help_keyword_id,name) values (219,'GRANTS'); -insert into help_keyword (help_keyword_id,name) values (220,'OUTER'); -insert into help_keyword (help_keyword_id,name) values (221,'CURSOR_NAME'); -insert into help_keyword (help_keyword_id,name) values (222,'EXPIRE'); -insert into help_keyword (help_keyword_id,name) values (223,'SQL_AFTER_MTS_GAPS'); -insert into help_keyword (help_keyword_id,name) values (224,'FLOOR'); -insert into help_keyword (help_keyword_id,name) values (225,'EXPLAIN'); -insert into help_keyword (help_keyword_id,name) values (226,'WITH'); -insert into help_keyword (help_keyword_id,name) values (227,'AFTER'); -insert into help_keyword (help_keyword_id,name) values (228,'STD'); -insert into help_keyword (help_keyword_id,name) values (229,'CSV'); -insert into help_keyword (help_keyword_id,name) values (230,'DISABLE'); -insert into help_keyword (help_keyword_id,name) values (231,'UNINSTALL'); -insert into help_keyword (help_keyword_id,name) values (232,'OUTFILE'); -insert into help_keyword (help_keyword_id,name) values (233,'LOW_PRIORITY'); -insert into help_keyword (help_keyword_id,name) values (234,'FILE'); -insert into help_keyword (help_keyword_id,name) values (235,'NODEGROUP'); -insert into help_keyword (help_keyword_id,name) values (236,'SCHEMA'); -insert into help_keyword (help_keyword_id,name) values (237,'SONAME'); -insert into help_keyword (help_keyword_id,name) values (238,'POW'); -insert into help_keyword (help_keyword_id,name) values (239,'DUAL'); -insert into help_keyword (help_keyword_id,name) values (240,'MULTIPOINTFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (241,'INDEX'); -insert into help_keyword (help_keyword_id,name) values (242,'MULTIPOINTFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (243,'DEFINER'); -insert into help_keyword (help_keyword_id,name) values (244,'MASTER_BIND'); -insert into help_keyword (help_keyword_id,name) values (245,'REMOVE'); -insert into help_keyword (help_keyword_id,name) values (246,'EXTENDED'); -insert into help_keyword (help_keyword_id,name) values (247,'MULTILINESTRINGFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (248,'CROSS'); -insert into help_keyword (help_keyword_id,name) values (249,'CONTRIBUTORS'); -insert into help_keyword (help_keyword_id,name) values (250,'NATIONAL'); -insert into help_keyword (help_keyword_id,name) values (251,'GROUP'); -insert into help_keyword (help_keyword_id,name) values (252,'SHA'); -insert into help_keyword (help_keyword_id,name) values (253,'UNDO'); -insert into help_keyword (help_keyword_id,name) values (254,'IGNORE_SERVER_IDS'); -insert into help_keyword (help_keyword_id,name) values (255,'MASTER_AUTO_POSITION'); -insert into help_keyword (help_keyword_id,name) values (256,'ZEROFILL'); -insert into help_keyword (help_keyword_id,name) values (257,'CLIENT'); -insert into help_keyword (help_keyword_id,name) values (258,'MASTER_PASSWORD'); -insert into help_keyword (help_keyword_id,name) values (259,'OWNER'); -insert into help_keyword (help_keyword_id,name) values (260,'RELAY_LOG_FILE'); -insert into help_keyword (help_keyword_id,name) values (261,'TRUE'); -insert into help_keyword (help_keyword_id,name) values (262,'CHARACTER'); -insert into help_keyword (help_keyword_id,name) values (263,'MASTER_USER'); -insert into help_keyword (help_keyword_id,name) values (264,'SCHEMA_NAME'); -insert into help_keyword (help_keyword_id,name) values (265,'TABLE'); -insert into help_keyword (help_keyword_id,name) values (266,'ENGINE'); -insert into help_keyword (help_keyword_id,name) values (267,'INSERT_METHOD'); -insert into help_keyword (help_keyword_id,name) values (268,'CASCADE'); -insert into help_keyword (help_keyword_id,name) values (269,'RELAY_LOG_POS'); -insert into help_keyword (help_keyword_id,name) values (270,'SQL_CALC_FOUND_ROWS'); -insert into help_keyword (help_keyword_id,name) values (271,'UNION'); -insert into help_keyword (help_keyword_id,name) values (272,'MYISAM'); -insert into help_keyword (help_keyword_id,name) values (273,'LEAVE'); -insert into help_keyword (help_keyword_id,name) values (274,'MODIFY'); -insert into help_keyword (help_keyword_id,name) values (275,'MATCH'); -insert into help_keyword (help_keyword_id,name) values (276,'MASTER_LOG_POS'); -insert into help_keyword (help_keyword_id,name) values (277,'DISTINCTROW'); -insert into help_keyword (help_keyword_id,name) values (278,'DESC'); -insert into help_keyword (help_keyword_id,name) values (279,'TIME'); -insert into help_keyword (help_keyword_id,name) values (280,'NUMERIC'); -insert into help_keyword (help_keyword_id,name) values (281,'EXPANSION'); -insert into help_keyword (help_keyword_id,name) values (282,'CODE'); -insert into help_keyword (help_keyword_id,name) values (283,'CURSOR'); -insert into help_keyword (help_keyword_id,name) values (284,'GEOMETRYCOLLECTIONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (285,'CHAIN'); -insert into help_keyword (help_keyword_id,name) values (286,'LOGFILE'); -insert into help_keyword (help_keyword_id,name) values (287,'FLUSH'); -insert into help_keyword (help_keyword_id,name) values (288,'CREATE'); -insert into help_keyword (help_keyword_id,name) values (289,'DESCRIBE'); -insert into help_keyword (help_keyword_id,name) values (290,'EXTENT_SIZE'); -insert into help_keyword (help_keyword_id,name) values (291,'MAX_UPDATES_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (292,'INT2'); -insert into help_keyword (help_keyword_id,name) values (293,'PROCESSLIST'); -insert into help_keyword (help_keyword_id,name) values (294,'ENDS'); -insert into help_keyword (help_keyword_id,name) values (295,'LOGS'); -insert into help_keyword (help_keyword_id,name) values (296,'RECOVER'); -insert into help_keyword (help_keyword_id,name) values (297,'DISCARD'); -insert into help_keyword (help_keyword_id,name) values (298,'HEAP'); -insert into help_keyword (help_keyword_id,name) values (299,'RETURNED_SQLSTATE'); -insert into help_keyword (help_keyword_id,name) values (300,'EXCHANGE'); -insert into help_keyword (help_keyword_id,name) values (301,'SOUNDS'); -insert into help_keyword (help_keyword_id,name) values (302,'BETWEEN'); -insert into help_keyword (help_keyword_id,name) values (303,'MULTILINESTRINGFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (304,'REPAIR'); -insert into help_keyword (help_keyword_id,name) values (305,'PACK_KEYS'); -insert into help_keyword (help_keyword_id,name) values (306,'FAST'); -insert into help_keyword (help_keyword_id,name) values (307,'VALUES'); -insert into help_keyword (help_keyword_id,name) values (308,'CALL'); -insert into help_keyword (help_keyword_id,name) values (309,'GET'); -insert into help_keyword (help_keyword_id,name) values (310,'LOOP'); -insert into help_keyword (help_keyword_id,name) values (311,'VARCHARACTER'); -insert into help_keyword (help_keyword_id,name) values (312,'BEFORE'); -insert into help_keyword (help_keyword_id,name) values (313,'TRUNCATE'); -insert into help_keyword (help_keyword_id,name) values (314,'SHOW'); -insert into help_keyword (help_keyword_id,name) values (315,'ALL'); -insert into help_keyword (help_keyword_id,name) values (316,'REDUNDANT'); -insert into help_keyword (help_keyword_id,name) values (317,'USER_RESOURCES'); -insert into help_keyword (help_keyword_id,name) values (318,'PARTIAL'); -insert into help_keyword (help_keyword_id,name) values (319,'BINLOG'); -insert into help_keyword (help_keyword_id,name) values (320,'END'); -insert into help_keyword (help_keyword_id,name) values (321,'SECOND'); -insert into help_keyword (help_keyword_id,name) values (322,'AND'); -insert into help_keyword (help_keyword_id,name) values (323,'FLOAT8'); -insert into help_keyword (help_keyword_id,name) values (324,'PREV'); -insert into help_keyword (help_keyword_id,name) values (325,'HOUR'); -insert into help_keyword (help_keyword_id,name) values (326,'SELECT'); -insert into help_keyword (help_keyword_id,name) values (327,'DATABASES'); -insert into help_keyword (help_keyword_id,name) values (328,'OR'); -insert into help_keyword (help_keyword_id,name) values (329,'IDENTIFIED'); -insert into help_keyword (help_keyword_id,name) values (330,'WRAPPER'); -insert into help_keyword (help_keyword_id,name) values (331,'MASTER_SSL_CIPHER'); -insert into help_keyword (help_keyword_id,name) values (332,'SQL_SLAVE_SKIP_COUNTER'); -insert into help_keyword (help_keyword_id,name) values (333,'BOTH'); -insert into help_keyword (help_keyword_id,name) values (334,'BOOL'); -insert into help_keyword (help_keyword_id,name) values (335,'YEAR'); -insert into help_keyword (help_keyword_id,name) values (336,'MASTER_PORT'); -insert into help_keyword (help_keyword_id,name) values (337,'CONCURRENT'); -insert into help_keyword (help_keyword_id,name) values (338,'HELP'); -insert into help_keyword (help_keyword_id,name) values (339,'UNIQUE'); -insert into help_keyword (help_keyword_id,name) values (340,'TRIGGERS'); -insert into help_keyword (help_keyword_id,name) values (341,'PROCESS'); -insert into help_keyword (help_keyword_id,name) values (342,'OPTIONS'); -insert into help_keyword (help_keyword_id,name) values (343,'RESIGNAL'); -insert into help_keyword (help_keyword_id,name) values (344,'CONSISTENT'); -insert into help_keyword (help_keyword_id,name) values (345,'MASTER_SSL'); -insert into help_keyword (help_keyword_id,name) values (346,'DATE_ADD'); -insert into help_keyword (help_keyword_id,name) values (347,'MAX_CONNECTIONS_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (348,'LIKE'); -insert into help_keyword (help_keyword_id,name) values (349,'PLUGIN'); -insert into help_keyword (help_keyword_id,name) values (350,'FETCH'); -insert into help_keyword (help_keyword_id,name) values (351,'IN'); -insert into help_keyword (help_keyword_id,name) values (352,'COLUMN'); -insert into help_keyword (help_keyword_id,name) values (353,'DIAGNOSTICS'); -insert into help_keyword (help_keyword_id,name) values (354,'DUMPFILE'); -insert into help_keyword (help_keyword_id,name) values (355,'USAGE'); -insert into help_keyword (help_keyword_id,name) values (356,'EXECUTE'); -insert into help_keyword (help_keyword_id,name) values (357,'MEMORY'); -insert into help_keyword (help_keyword_id,name) values (358,'CEIL'); -insert into help_keyword (help_keyword_id,name) values (359,'QUERY'); -insert into help_keyword (help_keyword_id,name) values (360,'MASTER_HOST'); -insert into help_keyword (help_keyword_id,name) values (361,'LINES'); -insert into help_keyword (help_keyword_id,name) values (362,'PLUGIN_DIR'); -insert into help_keyword (help_keyword_id,name) values (363,'SQL_THREAD'); -insert into help_keyword (help_keyword_id,name) values (364,'SERVER'); -insert into help_keyword (help_keyword_id,name) values (365,'MAX_QUERIES_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (366,'MASTER_SSL_CERT'); -insert into help_keyword (help_keyword_id,name) values (367,'MULTIPOLYGONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (368,'TRANSACTION'); -insert into help_keyword (help_keyword_id,name) values (369,'DAY_MINUTE'); -insert into help_keyword (help_keyword_id,name) values (370,'STDDEV'); -insert into help_keyword (help_keyword_id,name) values (371,'DATE_SUB'); -insert into help_keyword (help_keyword_id,name) values (372,'REBUILD'); -insert into help_keyword (help_keyword_id,name) values (373,'GEOMETRYFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (374,'INT1'); -insert into help_keyword (help_keyword_id,name) values (375,'RENAME'); -insert into help_keyword (help_keyword_id,name) values (376,'PARSER'); -insert into help_keyword (help_keyword_id,name) values (377,'RIGHT'); -insert into help_keyword (help_keyword_id,name) values (378,'ALTER'); -insert into help_keyword (help_keyword_id,name) values (379,'MAX_ROWS'); -insert into help_keyword (help_keyword_id,name) values (380,'SOCKET'); -insert into help_keyword (help_keyword_id,name) values (381,'STRAIGHT_JOIN'); -insert into help_keyword (help_keyword_id,name) values (382,'NATURAL'); -insert into help_keyword (help_keyword_id,name) values (383,'VARIABLES'); -insert into help_keyword (help_keyword_id,name) values (384,'ESCAPED'); -insert into help_keyword (help_keyword_id,name) values (385,'SHA1'); -insert into help_keyword (help_keyword_id,name) values (386,'KEY_BLOCK_SIZE'); -insert into help_keyword (help_keyword_id,name) values (387,'PASSWORD'); -insert into help_keyword (help_keyword_id,name) values (388,'OFFSET'); -insert into help_keyword (help_keyword_id,name) values (389,'CHAR'); -insert into help_keyword (help_keyword_id,name) values (390,'NEXT'); -insert into help_keyword (help_keyword_id,name) values (391,'ERRORS'); -insert into help_keyword (help_keyword_id,name) values (392,'SQL_LOG_BIN'); -insert into help_keyword (help_keyword_id,name) values (393,'TEMPORARY'); -insert into help_keyword (help_keyword_id,name) values (394,'COMMITTED'); -insert into help_keyword (help_keyword_id,name) values (395,'SQL_SMALL_RESULT'); -insert into help_keyword (help_keyword_id,name) values (396,'UPGRADE'); -insert into help_keyword (help_keyword_id,name) values (397,'XA'); -insert into help_keyword (help_keyword_id,name) values (398,'BEGIN'); -insert into help_keyword (help_keyword_id,name) values (399,'DELAY_KEY_WRITE'); -insert into help_keyword (help_keyword_id,name) values (400,'PROFILE'); -insert into help_keyword (help_keyword_id,name) values (401,'MEDIUM'); -insert into help_keyword (help_keyword_id,name) values (402,'INTERVAL'); -insert into help_keyword (help_keyword_id,name) values (403,'SSL'); -insert into help_keyword (help_keyword_id,name) values (404,'DAY_HOUR'); -insert into help_keyword (help_keyword_id,name) values (405,'NAME'); -insert into help_keyword (help_keyword_id,name) values (406,'REFERENCES'); -insert into help_keyword (help_keyword_id,name) values (407,'AES_ENCRYPT'); -insert into help_keyword (help_keyword_id,name) values (408,'STORAGE'); -insert into help_keyword (help_keyword_id,name) values (409,'ISOLATION'); -insert into help_keyword (help_keyword_id,name) values (410,'CEILING'); -insert into help_keyword (help_keyword_id,name) values (411,'EVERY'); -insert into help_keyword (help_keyword_id,name) values (412,'INT8'); -insert into help_keyword (help_keyword_id,name) values (413,'AUTHORS'); -insert into help_keyword (help_keyword_id,name) values (414,'RESTRICT'); -insert into help_keyword (help_keyword_id,name) values (415,'UNCOMMITTED'); -insert into help_keyword (help_keyword_id,name) values (416,'LINESTRINGFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (417,'IS'); -insert into help_keyword (help_keyword_id,name) values (418,'NOT'); -insert into help_keyword (help_keyword_id,name) values (419,'ANALYSE'); -insert into help_keyword (help_keyword_id,name) values (420,'DATAFILE'); -insert into help_keyword (help_keyword_id,name) values (421,'DES_KEY_FILE'); -insert into help_keyword (help_keyword_id,name) values (422,'SIGNAL'); -insert into help_keyword (help_keyword_id,name) values (423,'COMPRESSED'); -insert into help_keyword (help_keyword_id,name) values (424,'START'); -insert into help_keyword (help_keyword_id,name) values (425,'PLUGINS'); -insert into help_keyword (help_keyword_id,name) values (426,'SAVEPOINT'); -insert into help_keyword (help_keyword_id,name) values (427,'IF'); -insert into help_keyword (help_keyword_id,name) values (428,'ROWS'); -insert into help_keyword (help_keyword_id,name) values (429,'PRIMARY'); -insert into help_keyword (help_keyword_id,name) values (430,'PURGE'); -insert into help_keyword (help_keyword_id,name) values (431,'LAST'); -insert into help_keyword (help_keyword_id,name) values (432,'USER'); -insert into help_keyword (help_keyword_id,name) values (433,'EXIT'); -insert into help_keyword (help_keyword_id,name) values (434,'KEYS'); -insert into help_keyword (help_keyword_id,name) values (435,'LIMIT'); -insert into help_keyword (help_keyword_id,name) values (436,'KEY'); -insert into help_keyword (help_keyword_id,name) values (437,'MERGE'); -insert into help_keyword (help_keyword_id,name) values (438,'UNTIL'); -insert into help_keyword (help_keyword_id,name) values (439,'SQL_NO_CACHE'); -insert into help_keyword (help_keyword_id,name) values (440,'DELAYED'); -insert into help_keyword (help_keyword_id,name) values (441,'CONSTRAINT_SCHEMA'); -insert into help_keyword (help_keyword_id,name) values (442,'ANALYZE'); -insert into help_keyword (help_keyword_id,name) values (443,'CONSTRAINT'); -insert into help_keyword (help_keyword_id,name) values (444,'SERIAL'); -insert into help_keyword (help_keyword_id,name) values (445,'ACTION'); -insert into help_keyword (help_keyword_id,name) values (446,'WRITE'); -insert into help_keyword (help_keyword_id,name) values (447,'INITIAL_SIZE'); -insert into help_keyword (help_keyword_id,name) values (448,'SESSION'); -insert into help_keyword (help_keyword_id,name) values (449,'DATABASE'); -insert into help_keyword (help_keyword_id,name) values (450,'NULL'); -insert into help_keyword (help_keyword_id,name) values (451,'POWER'); -insert into help_keyword (help_keyword_id,name) values (452,'USE_FRM'); -insert into help_keyword (help_keyword_id,name) values (453,'TERMINATED'); -insert into help_keyword (help_keyword_id,name) values (454,'SLAVE'); -insert into help_keyword (help_keyword_id,name) values (455,'NVARCHAR'); -insert into help_keyword (help_keyword_id,name) values (456,'ASC'); -insert into help_keyword (help_keyword_id,name) values (457,'RETURN'); -insert into help_keyword (help_keyword_id,name) values (458,'OPTIONALLY'); -insert into help_keyword (help_keyword_id,name) values (459,'ENABLE'); -insert into help_keyword (help_keyword_id,name) values (460,'DIRECTORY'); -insert into help_keyword (help_keyword_id,name) values (461,'MAX_USER_CONNECTIONS'); -insert into help_keyword (help_keyword_id,name) values (462,'WHILE'); -insert into help_keyword (help_keyword_id,name) values (463,'LOCAL'); -insert into help_keyword (help_keyword_id,name) values (464,'DISTINCT'); -insert into help_keyword (help_keyword_id,name) values (465,'AES_DECRYPT'); -insert into help_keyword (help_keyword_id,name) values (466,'MASTER_SSL_KEY'); -insert into help_keyword (help_keyword_id,name) values (467,'NONE'); -insert into help_keyword (help_keyword_id,name) values (468,'TABLES'); -insert into help_keyword (help_keyword_id,name) values (469,'<>'); -insert into help_keyword (help_keyword_id,name) values (470,'EXPORT'); -insert into help_keyword (help_keyword_id,name) values (471,'RLIKE'); -insert into help_keyword (help_keyword_id,name) values (472,'TRIGGER'); -insert into help_keyword (help_keyword_id,name) values (473,'COLLATION'); -insert into help_keyword (help_keyword_id,name) values (474,'SHUTDOWN'); -insert into help_keyword (help_keyword_id,name) values (475,'HIGH_PRIORITY'); -insert into help_keyword (help_keyword_id,name) values (476,'BTREE'); -insert into help_keyword (help_keyword_id,name) values (477,'FIRST'); -insert into help_keyword (help_keyword_id,name) values (478,'COALESCE'); -insert into help_keyword (help_keyword_id,name) values (479,'WAIT'); -insert into help_keyword (help_keyword_id,name) values (480,'CATALOG_NAME'); -insert into help_keyword (help_keyword_id,name) values (481,'MASTER'); -insert into help_keyword (help_keyword_id,name) values (482,'FIXED'); -insert into help_keyword (help_keyword_id,name) values (483,'MULTIPOLYGONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (484,'ROW_FORMAT'); -insert into help_relation (help_topic_id,help_keyword_id) values (0,0); -insert into help_relation (help_topic_id,help_keyword_id) values (447,0); -insert into help_relation (help_topic_id,help_keyword_id) values (249,1); -insert into help_relation (help_topic_id,help_keyword_id) values (126,2); -insert into help_relation (help_topic_id,help_keyword_id) values (238,3); -insert into help_relation (help_topic_id,help_keyword_id) values (269,4); -insert into help_relation (help_topic_id,help_keyword_id) values (332,4); -insert into help_relation (help_topic_id,help_keyword_id) values (483,4); -insert into help_relation (help_topic_id,help_keyword_id) values (310,5); -insert into help_relation (help_topic_id,help_keyword_id) values (475,6); -insert into help_relation (help_topic_id,help_keyword_id) values (310,6); -insert into help_relation (help_topic_id,help_keyword_id) values (58,7); -insert into help_relation (help_topic_id,help_keyword_id) values (310,8); -insert into help_relation (help_topic_id,help_keyword_id) values (361,9); -insert into help_relation (help_topic_id,help_keyword_id) values (229,10); -insert into help_relation (help_topic_id,help_keyword_id) values (340,11); -insert into help_relation (help_topic_id,help_keyword_id) values (238,11); -insert into help_relation (help_topic_id,help_keyword_id) values (493,11); -insert into help_relation (help_topic_id,help_keyword_id) values (441,12); -insert into help_relation (help_topic_id,help_keyword_id) values (275,12); -insert into help_relation (help_topic_id,help_keyword_id) values (247,12); -insert into help_relation (help_topic_id,help_keyword_id) values (483,12); -insert into help_relation (help_topic_id,help_keyword_id) values (511,12); -insert into help_relation (help_topic_id,help_keyword_id) values (475,13); -insert into help_relation (help_topic_id,help_keyword_id) values (310,13); -insert into help_relation (help_topic_id,help_keyword_id) values (340,14); -insert into help_relation (help_topic_id,help_keyword_id) values (125,15); -insert into help_relation (help_topic_id,help_keyword_id) values (309,16); -insert into help_relation (help_topic_id,help_keyword_id) values (447,16); -insert into help_relation (help_topic_id,help_keyword_id) values (13,17); -insert into help_relation (help_topic_id,help_keyword_id) values (334,17); -insert into help_relation (help_topic_id,help_keyword_id) values (441,17); -insert into help_relation (help_topic_id,help_keyword_id) values (62,17); -insert into help_relation (help_topic_id,help_keyword_id) values (264,18); -insert into help_relation (help_topic_id,help_keyword_id) values (58,18); -insert into help_relation (help_topic_id,help_keyword_id) values (203,19); -insert into help_relation (help_topic_id,help_keyword_id) values (508,20); -insert into help_relation (help_topic_id,help_keyword_id) values (269,20); -insert into help_relation (help_topic_id,help_keyword_id) values (200,20); -insert into help_relation (help_topic_id,help_keyword_id) values (317,20); -insert into help_relation (help_topic_id,help_keyword_id) values (386,20); -insert into help_relation (help_topic_id,help_keyword_id) values (361,21); -insert into help_relation (help_topic_id,help_keyword_id) values (447,22); -insert into help_relation (help_topic_id,help_keyword_id) values (518,23); -insert into help_relation (help_topic_id,help_keyword_id) values (281,23); -insert into help_relation (help_topic_id,help_keyword_id) values (384,23); -insert into help_relation (help_topic_id,help_keyword_id) values (411,23); -insert into help_relation (help_topic_id,help_keyword_id) values (6,23); -insert into help_relation (help_topic_id,help_keyword_id) values (222,23); -insert into help_relation (help_topic_id,help_keyword_id) values (400,23); -insert into help_relation (help_topic_id,help_keyword_id) values (481,23); -insert into help_relation (help_topic_id,help_keyword_id) values (279,23); -insert into help_relation (help_topic_id,help_keyword_id) values (51,23); -insert into help_relation (help_topic_id,help_keyword_id) values (145,23); -insert into help_relation (help_topic_id,help_keyword_id) values (360,23); -insert into help_relation (help_topic_id,help_keyword_id) values (218,23); -insert into help_relation (help_topic_id,help_keyword_id) values (428,23); -insert into help_relation (help_topic_id,help_keyword_id) values (511,23); -insert into help_relation (help_topic_id,help_keyword_id) values (319,24); -insert into help_relation (help_topic_id,help_keyword_id) values (226,25); -insert into help_relation (help_topic_id,help_keyword_id) values (69,25); -insert into help_relation (help_topic_id,help_keyword_id) values (95,25); -insert into help_relation (help_topic_id,help_keyword_id) values (202,26); -insert into help_relation (help_topic_id,help_keyword_id) values (47,27); -insert into help_relation (help_topic_id,help_keyword_id) values (317,28); -insert into help_relation (help_topic_id,help_keyword_id) values (110,29); -insert into help_relation (help_topic_id,help_keyword_id) values (25,30); -insert into help_relation (help_topic_id,help_keyword_id) values (247,31); -insert into help_relation (help_topic_id,help_keyword_id) values (441,32); -insert into help_relation (help_topic_id,help_keyword_id) values (247,32); -insert into help_relation (help_topic_id,help_keyword_id) values (202,33); -insert into help_relation (help_topic_id,help_keyword_id) values (110,34); -insert into help_relation (help_topic_id,help_keyword_id) values (361,35); -insert into help_relation (help_topic_id,help_keyword_id) values (24,36); -insert into help_relation (help_topic_id,help_keyword_id) values (384,36); -insert into help_relation (help_topic_id,help_keyword_id) values (493,36); -insert into help_relation (help_topic_id,help_keyword_id) values (25,37); -insert into help_relation (help_topic_id,help_keyword_id) values (51,37); -insert into help_relation (help_topic_id,help_keyword_id) values (447,37); -insert into help_relation (help_topic_id,help_keyword_id) values (114,37); -insert into help_relation (help_topic_id,help_keyword_id) values (511,37); -insert into help_relation (help_topic_id,help_keyword_id) values (247,38); -insert into help_relation (help_topic_id,help_keyword_id) values (223,39); -insert into help_relation (help_topic_id,help_keyword_id) values (247,39); -insert into help_relation (help_topic_id,help_keyword_id) values (511,39); -insert into help_relation (help_topic_id,help_keyword_id) values (441,40); -insert into help_relation (help_topic_id,help_keyword_id) values (275,40); -insert into help_relation (help_topic_id,help_keyword_id) values (164,40); -insert into help_relation (help_topic_id,help_keyword_id) values (247,40); -insert into help_relation (help_topic_id,help_keyword_id) values (503,40); -insert into help_relation (help_topic_id,help_keyword_id) values (264,41); -insert into help_relation (help_topic_id,help_keyword_id) values (332,42); -insert into help_relation (help_topic_id,help_keyword_id) values (32,42); -insert into help_relation (help_topic_id,help_keyword_id) values (247,42); -insert into help_relation (help_topic_id,help_keyword_id) values (48,42); -insert into help_relation (help_topic_id,help_keyword_id) values (110,42); -insert into help_relation (help_topic_id,help_keyword_id) values (447,42); -insert into help_relation (help_topic_id,help_keyword_id) values (483,42); -insert into help_relation (help_topic_id,help_keyword_id) values (305,42); -insert into help_relation (help_topic_id,help_keyword_id) values (448,42); -insert into help_relation (help_topic_id,help_keyword_id) values (511,42); -insert into help_relation (help_topic_id,help_keyword_id) values (517,43); -insert into help_relation (help_topic_id,help_keyword_id) values (247,43); -insert into help_relation (help_topic_id,help_keyword_id) values (202,44); -insert into help_relation (help_topic_id,help_keyword_id) values (0,45); -insert into help_relation (help_topic_id,help_keyword_id) values (269,45); -insert into help_relation (help_topic_id,help_keyword_id) values (332,45); -insert into help_relation (help_topic_id,help_keyword_id) values (32,45); -insert into help_relation (help_topic_id,help_keyword_id) values (247,45); -insert into help_relation (help_topic_id,help_keyword_id) values (317,45); -insert into help_relation (help_topic_id,help_keyword_id) values (447,45); -insert into help_relation (help_topic_id,help_keyword_id) values (483,45); -insert into help_relation (help_topic_id,help_keyword_id) values (511,45); -insert into help_relation (help_topic_id,help_keyword_id) values (249,46); -insert into help_relation (help_topic_id,help_keyword_id) values (247,46); -insert into help_relation (help_topic_id,help_keyword_id) values (115,46); -insert into help_relation (help_topic_id,help_keyword_id) values (483,46); -insert into help_relation (help_topic_id,help_keyword_id) values (202,47); -insert into help_relation (help_topic_id,help_keyword_id) values (447,48); -insert into help_relation (help_topic_id,help_keyword_id) values (419,49); -insert into help_relation (help_topic_id,help_keyword_id) values (58,49); -insert into help_relation (help_topic_id,help_keyword_id) values (448,50); -insert into help_relation (help_topic_id,help_keyword_id) values (508,51); -insert into help_relation (help_topic_id,help_keyword_id) values (200,51); -insert into help_relation (help_topic_id,help_keyword_id) values (171,51); -insert into help_relation (help_topic_id,help_keyword_id) values (361,52); -insert into help_relation (help_topic_id,help_keyword_id) values (517,53); -insert into help_relation (help_topic_id,help_keyword_id) values (32,53); -insert into help_relation (help_topic_id,help_keyword_id) values (247,53); -insert into help_relation (help_topic_id,help_keyword_id) values (475,54); -insert into help_relation (help_topic_id,help_keyword_id) values (0,54); -insert into help_relation (help_topic_id,help_keyword_id) values (517,54); -insert into help_relation (help_topic_id,help_keyword_id) values (310,54); -insert into help_relation (help_topic_id,help_keyword_id) values (508,55); -insert into help_relation (help_topic_id,help_keyword_id) values (200,55); -insert into help_relation (help_topic_id,help_keyword_id) values (171,55); -insert into help_relation (help_topic_id,help_keyword_id) values (97,56); -insert into help_relation (help_topic_id,help_keyword_id) values (247,56); -insert into help_relation (help_topic_id,help_keyword_id) values (33,57); -insert into help_relation (help_topic_id,help_keyword_id) values (62,57); -insert into help_relation (help_topic_id,help_keyword_id) values (361,58); -insert into help_relation (help_topic_id,help_keyword_id) values (110,59); -insert into help_relation (help_topic_id,help_keyword_id) values (107,60); -insert into help_relation (help_topic_id,help_keyword_id) values (35,60); -insert into help_relation (help_topic_id,help_keyword_id) values (0,60); -insert into help_relation (help_topic_id,help_keyword_id) values (508,61); -insert into help_relation (help_topic_id,help_keyword_id) values (200,61); -insert into help_relation (help_topic_id,help_keyword_id) values (171,61); -insert into help_relation (help_topic_id,help_keyword_id) values (32,62); -insert into help_relation (help_topic_id,help_keyword_id) values (48,62); -insert into help_relation (help_topic_id,help_keyword_id) values (62,62); -insert into help_relation (help_topic_id,help_keyword_id) values (106,63); -insert into help_relation (help_topic_id,help_keyword_id) values (136,63); -insert into help_relation (help_topic_id,help_keyword_id) values (110,63); -insert into help_relation (help_topic_id,help_keyword_id) values (114,64); -insert into help_relation (help_topic_id,help_keyword_id) values (511,64); -insert into help_relation (help_topic_id,help_keyword_id) values (475,65); -insert into help_relation (help_topic_id,help_keyword_id) values (310,65); -insert into help_relation (help_topic_id,help_keyword_id) values (411,65); -insert into help_relation (help_topic_id,help_keyword_id) values (193,65); -insert into help_relation (help_topic_id,help_keyword_id) values (110,66); -insert into help_relation (help_topic_id,help_keyword_id) values (447,67); -insert into help_relation (help_topic_id,help_keyword_id) values (0,68); -insert into help_relation (help_topic_id,help_keyword_id) values (332,68); -insert into help_relation (help_topic_id,help_keyword_id) values (447,68); -insert into help_relation (help_topic_id,help_keyword_id) values (317,68); -insert into help_relation (help_topic_id,help_keyword_id) values (48,68); -insert into help_relation (help_topic_id,help_keyword_id) values (483,68); -insert into help_relation (help_topic_id,help_keyword_id) values (511,68); -insert into help_relation (help_topic_id,help_keyword_id) values (297,69); -insert into help_relation (help_topic_id,help_keyword_id) values (245,70); -insert into help_relation (help_topic_id,help_keyword_id) values (223,70); -insert into help_relation (help_topic_id,help_keyword_id) values (32,70); -insert into help_relation (help_topic_id,help_keyword_id) values (125,71); -insert into help_relation (help_topic_id,help_keyword_id) values (110,72); -insert into help_relation (help_topic_id,help_keyword_id) values (107,73); -insert into help_relation (help_topic_id,help_keyword_id) values (247,74); -insert into help_relation (help_topic_id,help_keyword_id) values (54,75); -insert into help_relation (help_topic_id,help_keyword_id) values (255,75); -insert into help_relation (help_topic_id,help_keyword_id) values (207,76); -insert into help_relation (help_topic_id,help_keyword_id) values (238,77); -insert into help_relation (help_topic_id,help_keyword_id) values (0,78); -insert into help_relation (help_topic_id,help_keyword_id) values (26,79); -insert into help_relation (help_topic_id,help_keyword_id) values (149,79); -insert into help_relation (help_topic_id,help_keyword_id) values (125,79); -insert into help_relation (help_topic_id,help_keyword_id) values (149,80); -insert into help_relation (help_topic_id,help_keyword_id) values (509,80); -insert into help_relation (help_topic_id,help_keyword_id) values (361,80); -insert into help_relation (help_topic_id,help_keyword_id) values (361,81); -insert into help_relation (help_topic_id,help_keyword_id) values (511,81); -insert into help_relation (help_topic_id,help_keyword_id) values (475,82); -insert into help_relation (help_topic_id,help_keyword_id) values (310,82); -insert into help_relation (help_topic_id,help_keyword_id) values (202,83); -insert into help_relation (help_topic_id,help_keyword_id) values (517,84); -insert into help_relation (help_topic_id,help_keyword_id) values (447,84); -insert into help_relation (help_topic_id,help_keyword_id) values (317,84); -insert into help_relation (help_topic_id,help_keyword_id) values (48,84); -insert into help_relation (help_topic_id,help_keyword_id) values (475,85); -insert into help_relation (help_topic_id,help_keyword_id) values (310,85); -insert into help_relation (help_topic_id,help_keyword_id) values (508,86); -insert into help_relation (help_topic_id,help_keyword_id) values (200,86); -insert into help_relation (help_topic_id,help_keyword_id) values (171,86); -insert into help_relation (help_topic_id,help_keyword_id) values (413,87); -insert into help_relation (help_topic_id,help_keyword_id) values (269,87); -insert into help_relation (help_topic_id,help_keyword_id) values (447,87); -insert into help_relation (help_topic_id,help_keyword_id) values (317,87); -insert into help_relation (help_topic_id,help_keyword_id) values (247,88); -insert into help_relation (help_topic_id,help_keyword_id) values (143,89); -insert into help_relation (help_topic_id,help_keyword_id) values (107,90); -insert into help_relation (help_topic_id,help_keyword_id) values (202,91); -insert into help_relation (help_topic_id,help_keyword_id) values (426,92); -insert into help_relation (help_topic_id,help_keyword_id) values (329,93); -insert into help_relation (help_topic_id,help_keyword_id) values (340,94); -insert into help_relation (help_topic_id,help_keyword_id) values (509,94); -insert into help_relation (help_topic_id,help_keyword_id) values (493,94); -insert into help_relation (help_topic_id,help_keyword_id) values (12,95); -insert into help_relation (help_topic_id,help_keyword_id) values (481,95); -insert into help_relation (help_topic_id,help_keyword_id) values (441,95); -insert into help_relation (help_topic_id,help_keyword_id) values (234,95); -insert into help_relation (help_topic_id,help_keyword_id) values (182,95); -insert into help_relation (help_topic_id,help_keyword_id) values (447,95); -insert into help_relation (help_topic_id,help_keyword_id) values (103,95); -insert into help_relation (help_topic_id,help_keyword_id) values (169,95); -insert into help_relation (help_topic_id,help_keyword_id) values (522,95); -insert into help_relation (help_topic_id,help_keyword_id) values (359,96); -insert into help_relation (help_topic_id,help_keyword_id) values (59,96); -insert into help_relation (help_topic_id,help_keyword_id) values (483,97); -insert into help_relation (help_topic_id,help_keyword_id) values (511,97); -insert into help_relation (help_topic_id,help_keyword_id) values (309,98); -insert into help_relation (help_topic_id,help_keyword_id) values (213,99); -insert into help_relation (help_topic_id,help_keyword_id) values (247,99); -insert into help_relation (help_topic_id,help_keyword_id) values (426,100); -insert into help_relation (help_topic_id,help_keyword_id) values (301,101); -insert into help_relation (help_topic_id,help_keyword_id) values (230,101); -insert into help_relation (help_topic_id,help_keyword_id) values (427,101); -insert into help_relation (help_topic_id,help_keyword_id) values (404,102); -insert into help_relation (help_topic_id,help_keyword_id) values (49,103); -insert into help_relation (help_topic_id,help_keyword_id) values (36,103); -insert into help_relation (help_topic_id,help_keyword_id) values (20,103); -insert into help_relation (help_topic_id,help_keyword_id) values (108,104); -insert into help_relation (help_topic_id,help_keyword_id) values (317,104); -insert into help_relation (help_topic_id,help_keyword_id) values (521,104); -insert into help_relation (help_topic_id,help_keyword_id) values (168,104); -insert into help_relation (help_topic_id,help_keyword_id) values (441,105); -insert into help_relation (help_topic_id,help_keyword_id) values (402,105); -insert into help_relation (help_topic_id,help_keyword_id) values (420,106); -insert into help_relation (help_topic_id,help_keyword_id) values (62,106); -insert into help_relation (help_topic_id,help_keyword_id) values (249,107); -insert into help_relation (help_topic_id,help_keyword_id) values (202,108); -insert into help_relation (help_topic_id,help_keyword_id) values (342,109); -insert into help_relation (help_topic_id,help_keyword_id) values (279,109); -insert into help_relation (help_topic_id,help_keyword_id) values (310,109); -insert into help_relation (help_topic_id,help_keyword_id) values (411,109); -insert into help_relation (help_topic_id,help_keyword_id) values (360,109); -insert into help_relation (help_topic_id,help_keyword_id) values (6,109); -insert into help_relation (help_topic_id,help_keyword_id) values (400,109); -insert into help_relation (help_topic_id,help_keyword_id) values (441,110); -insert into help_relation (help_topic_id,help_keyword_id) values (451,110); -insert into help_relation (help_topic_id,help_keyword_id) values (63,111); -insert into help_relation (help_topic_id,help_keyword_id) values (340,112); -insert into help_relation (help_topic_id,help_keyword_id) values (509,112); -insert into help_relation (help_topic_id,help_keyword_id) values (493,112); -insert into help_relation (help_topic_id,help_keyword_id) values (309,113); -insert into help_relation (help_topic_id,help_keyword_id) values (276,113); -insert into help_relation (help_topic_id,help_keyword_id) values (66,114); -insert into help_relation (help_topic_id,help_keyword_id) values (354,114); -insert into help_relation (help_topic_id,help_keyword_id) values (269,115); -insert into help_relation (help_topic_id,help_keyword_id) values (342,115); -insert into help_relation (help_topic_id,help_keyword_id) values (247,115); -insert into help_relation (help_topic_id,help_keyword_id) values (366,115); -insert into help_relation (help_topic_id,help_keyword_id) values (115,115); -insert into help_relation (help_topic_id,help_keyword_id) values (317,115); -insert into help_relation (help_topic_id,help_keyword_id) values (386,115); -insert into help_relation (help_topic_id,help_keyword_id) values (511,115); -insert into help_relation (help_topic_id,help_keyword_id) values (511,116); -insert into help_relation (help_topic_id,help_keyword_id) values (245,117); -insert into help_relation (help_topic_id,help_keyword_id) values (180,117); -insert into help_relation (help_topic_id,help_keyword_id) values (323,117); -insert into help_relation (help_topic_id,help_keyword_id) values (515,117); -insert into help_relation (help_topic_id,help_keyword_id) values (323,118); -insert into help_relation (help_topic_id,help_keyword_id) values (511,118); -insert into help_relation (help_topic_id,help_keyword_id) values (508,119); -insert into help_relation (help_topic_id,help_keyword_id) values (200,119); -insert into help_relation (help_topic_id,help_keyword_id) values (283,120); -insert into help_relation (help_topic_id,help_keyword_id) values (325,120); -insert into help_relation (help_topic_id,help_keyword_id) values (146,120); -insert into help_relation (help_topic_id,help_keyword_id) values (85,120); -insert into help_relation (help_topic_id,help_keyword_id) values (508,121); -insert into help_relation (help_topic_id,help_keyword_id) values (200,121); -insert into help_relation (help_topic_id,help_keyword_id) values (171,121); -insert into help_relation (help_topic_id,help_keyword_id) values (482,122); -insert into help_relation (help_topic_id,help_keyword_id) values (71,123); -insert into help_relation (help_topic_id,help_keyword_id) values (475,124); -insert into help_relation (help_topic_id,help_keyword_id) values (310,124); -insert into help_relation (help_topic_id,help_keyword_id) values (72,124); -insert into help_relation (help_topic_id,help_keyword_id) values (527,124); -insert into help_relation (help_topic_id,help_keyword_id) values (120,125); -insert into help_relation (help_topic_id,help_keyword_id) values (184,126); -insert into help_relation (help_topic_id,help_keyword_id) values (329,126); -insert into help_relation (help_topic_id,help_keyword_id) values (269,126); -insert into help_relation (help_topic_id,help_keyword_id) values (342,126); -insert into help_relation (help_topic_id,help_keyword_id) values (332,126); -insert into help_relation (help_topic_id,help_keyword_id) values (508,126); -insert into help_relation (help_topic_id,help_keyword_id) values (200,126); -insert into help_relation (help_topic_id,help_keyword_id) values (261,126); -insert into help_relation (help_topic_id,help_keyword_id) values (115,126); -insert into help_relation (help_topic_id,help_keyword_id) values (317,126); -insert into help_relation (help_topic_id,help_keyword_id) values (511,126); -insert into help_relation (help_topic_id,help_keyword_id) values (441,126); -insert into help_relation (help_topic_id,help_keyword_id) values (247,126); -insert into help_relation (help_topic_id,help_keyword_id) values (48,126); -insert into help_relation (help_topic_id,help_keyword_id) values (340,126); -insert into help_relation (help_topic_id,help_keyword_id) values (517,126); -insert into help_relation (help_topic_id,help_keyword_id) values (101,126); -insert into help_relation (help_topic_id,help_keyword_id) values (447,126); -insert into help_relation (help_topic_id,help_keyword_id) values (252,126); -insert into help_relation (help_topic_id,help_keyword_id) values (483,126); -insert into help_relation (help_topic_id,help_keyword_id) values (110,127); -insert into help_relation (help_topic_id,help_keyword_id) values (393,128); -insert into help_relation (help_topic_id,help_keyword_id) values (74,128); -insert into help_relation (help_topic_id,help_keyword_id) values (125,128); -insert into help_relation (help_topic_id,help_keyword_id) values (202,128); -insert into help_relation (help_topic_id,help_keyword_id) values (441,129); -insert into help_relation (help_topic_id,help_keyword_id) values (431,129); -insert into help_relation (help_topic_id,help_keyword_id) values (451,129); -insert into help_relation (help_topic_id,help_keyword_id) values (121,129); -insert into help_relation (help_topic_id,help_keyword_id) values (37,129); -insert into help_relation (help_topic_id,help_keyword_id) values (182,129); -insert into help_relation (help_topic_id,help_keyword_id) values (337,129); -insert into help_relation (help_topic_id,help_keyword_id) values (118,129); -insert into help_relation (help_topic_id,help_keyword_id) values (247,130); -insert into help_relation (help_topic_id,help_keyword_id) values (114,130); -insert into help_relation (help_topic_id,help_keyword_id) values (511,130); -insert into help_relation (help_topic_id,help_keyword_id) values (107,131); -insert into help_relation (help_topic_id,help_keyword_id) values (475,131); -insert into help_relation (help_topic_id,help_keyword_id) values (310,131); -insert into help_relation (help_topic_id,help_keyword_id) values (247,131); -insert into help_relation (help_topic_id,help_keyword_id) values (114,131); -insert into help_relation (help_topic_id,help_keyword_id) values (361,132); -insert into help_relation (help_topic_id,help_keyword_id) values (0,133); -insert into help_relation (help_topic_id,help_keyword_id) values (226,134); -insert into help_relation (help_topic_id,help_keyword_id) values (291,135); -insert into help_relation (help_topic_id,help_keyword_id) values (361,136); -insert into help_relation (help_topic_id,help_keyword_id) values (247,137); -insert into help_relation (help_topic_id,help_keyword_id) values (419,138); -insert into help_relation (help_topic_id,help_keyword_id) values (110,139); -insert into help_relation (help_topic_id,help_keyword_id) values (506,140); -insert into help_relation (help_topic_id,help_keyword_id) values (140,141); -insert into help_relation (help_topic_id,help_keyword_id) values (404,142); -insert into help_relation (help_topic_id,help_keyword_id) values (136,143); -insert into help_relation (help_topic_id,help_keyword_id) values (110,143); -insert into help_relation (help_topic_id,help_keyword_id) values (511,144); -insert into help_relation (help_topic_id,help_keyword_id) values (49,145); -insert into help_relation (help_topic_id,help_keyword_id) values (36,145); -insert into help_relation (help_topic_id,help_keyword_id) values (384,146); -insert into help_relation (help_topic_id,help_keyword_id) values (291,147); -insert into help_relation (help_topic_id,help_keyword_id) values (426,147); -insert into help_relation (help_topic_id,help_keyword_id) values (49,148); -insert into help_relation (help_topic_id,help_keyword_id) values (36,148); -insert into help_relation (help_topic_id,help_keyword_id) values (110,149); -insert into help_relation (help_topic_id,help_keyword_id) values (247,150); -insert into help_relation (help_topic_id,help_keyword_id) values (420,151); -insert into help_relation (help_topic_id,help_keyword_id) values (226,152); -insert into help_relation (help_topic_id,help_keyword_id) values (441,152); -insert into help_relation (help_topic_id,help_keyword_id) values (506,152); -insert into help_relation (help_topic_id,help_keyword_id) values (32,152); -insert into help_relation (help_topic_id,help_keyword_id) values (69,152); -insert into help_relation (help_topic_id,help_keyword_id) values (447,152); -insert into help_relation (help_topic_id,help_keyword_id) values (340,153); -insert into help_relation (help_topic_id,help_keyword_id) values (238,153); -insert into help_relation (help_topic_id,help_keyword_id) values (25,153); -insert into help_relation (help_topic_id,help_keyword_id) values (493,153); -insert into help_relation (help_topic_id,help_keyword_id) values (62,153); -insert into help_relation (help_topic_id,help_keyword_id) values (0,154); -insert into help_relation (help_topic_id,help_keyword_id) values (20,155); -insert into help_relation (help_topic_id,help_keyword_id) values (202,156); -insert into help_relation (help_topic_id,help_keyword_id) values (247,157); -insert into help_relation (help_topic_id,help_keyword_id) values (371,158); -insert into help_relation (help_topic_id,help_keyword_id) values (441,159); -insert into help_relation (help_topic_id,help_keyword_id) values (420,159); -insert into help_relation (help_topic_id,help_keyword_id) values (180,159); -insert into help_relation (help_topic_id,help_keyword_id) values (356,159); -insert into help_relation (help_topic_id,help_keyword_id) values (447,159); -insert into help_relation (help_topic_id,help_keyword_id) values (484,159); -insert into help_relation (help_topic_id,help_keyword_id) values (441,160); -insert into help_relation (help_topic_id,help_keyword_id) values (427,160); -insert into help_relation (help_topic_id,help_keyword_id) values (247,161); -insert into help_relation (help_topic_id,help_keyword_id) values (58,162); -insert into help_relation (help_topic_id,help_keyword_id) values (356,163); -insert into help_relation (help_topic_id,help_keyword_id) values (171,164); -insert into help_relation (help_topic_id,help_keyword_id) values (483,165); -insert into help_relation (help_topic_id,help_keyword_id) values (299,166); -insert into help_relation (help_topic_id,help_keyword_id) values (441,166); -insert into help_relation (help_topic_id,help_keyword_id) values (431,166); -insert into help_relation (help_topic_id,help_keyword_id) values (281,166); -insert into help_relation (help_topic_id,help_keyword_id) values (58,166); -insert into help_relation (help_topic_id,help_keyword_id) values (169,166); -insert into help_relation (help_topic_id,help_keyword_id) values (481,166); -insert into help_relation (help_topic_id,help_keyword_id) values (210,166); -insert into help_relation (help_topic_id,help_keyword_id) values (372,166); -insert into help_relation (help_topic_id,help_keyword_id) values (218,166); -insert into help_relation (help_topic_id,help_keyword_id) values (382,166); -insert into help_relation (help_topic_id,help_keyword_id) values (58,167); -insert into help_relation (help_topic_id,help_keyword_id) values (171,168); -insert into help_relation (help_topic_id,help_keyword_id) values (441,169); -insert into help_relation (help_topic_id,help_keyword_id) values (483,169); -insert into help_relation (help_topic_id,help_keyword_id) values (138,170); -insert into help_relation (help_topic_id,help_keyword_id) values (247,171); -insert into help_relation (help_topic_id,help_keyword_id) values (247,172); -insert into help_relation (help_topic_id,help_keyword_id) values (511,172); -insert into help_relation (help_topic_id,help_keyword_id) values (107,173); -insert into help_relation (help_topic_id,help_keyword_id) values (518,173); -insert into help_relation (help_topic_id,help_keyword_id) values (38,173); -insert into help_relation (help_topic_id,help_keyword_id) values (511,173); -insert into help_relation (help_topic_id,help_keyword_id) values (97,174); -insert into help_relation (help_topic_id,help_keyword_id) values (350,175); -insert into help_relation (help_topic_id,help_keyword_id) values (107,176); -insert into help_relation (help_topic_id,help_keyword_id) values (518,176); -insert into help_relation (help_topic_id,help_keyword_id) values (222,176); -insert into help_relation (help_topic_id,help_keyword_id) values (511,176); -insert into help_relation (help_topic_id,help_keyword_id) values (505,177); -insert into help_relation (help_topic_id,help_keyword_id) values (279,177); -insert into help_relation (help_topic_id,help_keyword_id) values (91,177); -insert into help_relation (help_topic_id,help_keyword_id) values (51,178); -insert into help_relation (help_topic_id,help_keyword_id) values (114,178); -insert into help_relation (help_topic_id,help_keyword_id) values (511,178); -insert into help_relation (help_topic_id,help_keyword_id) values (238,179); -insert into help_relation (help_topic_id,help_keyword_id) values (332,180); -insert into help_relation (help_topic_id,help_keyword_id) values (483,180); -insert into help_relation (help_topic_id,help_keyword_id) values (104,181); -insert into help_relation (help_topic_id,help_keyword_id) values (32,182); -insert into help_relation (help_topic_id,help_keyword_id) values (447,182); -insert into help_relation (help_topic_id,help_keyword_id) values (48,182); -insert into help_relation (help_topic_id,help_keyword_id) values (511,182); -insert into help_relation (help_topic_id,help_keyword_id) values (448,182); -insert into help_relation (help_topic_id,help_keyword_id) values (361,183); -insert into help_relation (help_topic_id,help_keyword_id) values (0,184); -insert into help_relation (help_topic_id,help_keyword_id) values (50,184); -insert into help_relation (help_topic_id,help_keyword_id) values (32,184); -insert into help_relation (help_topic_id,help_keyword_id) values (508,185); -insert into help_relation (help_topic_id,help_keyword_id) values (200,185); -insert into help_relation (help_topic_id,help_keyword_id) values (171,185); -insert into help_relation (help_topic_id,help_keyword_id) values (138,186); -insert into help_relation (help_topic_id,help_keyword_id) values (136,187); -insert into help_relation (help_topic_id,help_keyword_id) values (110,187); -insert into help_relation (help_topic_id,help_keyword_id) values (419,188); -insert into help_relation (help_topic_id,help_keyword_id) values (264,188); -insert into help_relation (help_topic_id,help_keyword_id) values (371,188); -insert into help_relation (help_topic_id,help_keyword_id) values (125,188); -insert into help_relation (help_topic_id,help_keyword_id) values (276,188); -insert into help_relation (help_topic_id,help_keyword_id) values (350,188); -insert into help_relation (help_topic_id,help_keyword_id) values (327,188); -insert into help_relation (help_topic_id,help_keyword_id) values (89,189); -insert into help_relation (help_topic_id,help_keyword_id) values (58,189); -insert into help_relation (help_topic_id,help_keyword_id) values (125,189); -insert into help_relation (help_topic_id,help_keyword_id) values (479,190); -insert into help_relation (help_topic_id,help_keyword_id) values (441,191); -insert into help_relation (help_topic_id,help_keyword_id) values (426,192); -insert into help_relation (help_topic_id,help_keyword_id) values (517,193); -insert into help_relation (help_topic_id,help_keyword_id) values (249,193); -insert into help_relation (help_topic_id,help_keyword_id) values (247,193); -insert into help_relation (help_topic_id,help_keyword_id) values (511,193); -insert into help_relation (help_topic_id,help_keyword_id) values (413,194); -insert into help_relation (help_topic_id,help_keyword_id) values (60,194); -insert into help_relation (help_topic_id,help_keyword_id) values (85,194); -insert into help_relation (help_topic_id,help_keyword_id) values (339,195); -insert into help_relation (help_topic_id,help_keyword_id) values (441,195); -insert into help_relation (help_topic_id,help_keyword_id) values (508,196); -insert into help_relation (help_topic_id,help_keyword_id) values (200,196); -insert into help_relation (help_topic_id,help_keyword_id) values (171,196); -insert into help_relation (help_topic_id,help_keyword_id) values (340,197); -insert into help_relation (help_topic_id,help_keyword_id) values (493,197); -insert into help_relation (help_topic_id,help_keyword_id) values (441,198); -insert into help_relation (help_topic_id,help_keyword_id) values (92,198); -insert into help_relation (help_topic_id,help_keyword_id) values (506,199); -insert into help_relation (help_topic_id,help_keyword_id) values (340,200); -insert into help_relation (help_topic_id,help_keyword_id) values (493,200); -insert into help_relation (help_topic_id,help_keyword_id) values (508,201); -insert into help_relation (help_topic_id,help_keyword_id) values (200,201); -insert into help_relation (help_topic_id,help_keyword_id) values (171,201); -insert into help_relation (help_topic_id,help_keyword_id) values (420,202); -insert into help_relation (help_topic_id,help_keyword_id) values (356,202); -insert into help_relation (help_topic_id,help_keyword_id) values (484,202); -insert into help_relation (help_topic_id,help_keyword_id) values (366,202); -insert into help_relation (help_topic_id,help_keyword_id) values (413,203); -insert into help_relation (help_topic_id,help_keyword_id) values (483,203); -insert into help_relation (help_topic_id,help_keyword_id) values (447,204); -insert into help_relation (help_topic_id,help_keyword_id) values (125,205); -insert into help_relation (help_topic_id,help_keyword_id) values (457,205); -insert into help_relation (help_topic_id,help_keyword_id) values (247,206); -insert into help_relation (help_topic_id,help_keyword_id) values (342,207); -insert into help_relation (help_topic_id,help_keyword_id) values (247,207); -insert into help_relation (help_topic_id,help_keyword_id) values (115,207); -insert into help_relation (help_topic_id,help_keyword_id) values (467,208); -insert into help_relation (help_topic_id,help_keyword_id) values (513,209); -insert into help_relation (help_topic_id,help_keyword_id) values (329,210); -insert into help_relation (help_topic_id,help_keyword_id) values (238,210); -insert into help_relation (help_topic_id,help_keyword_id) values (101,210); -insert into help_relation (help_topic_id,help_keyword_id) values (442,210); -insert into help_relation (help_topic_id,help_keyword_id) values (337,210); -insert into help_relation (help_topic_id,help_keyword_id) values (502,211); -insert into help_relation (help_topic_id,help_keyword_id) values (49,212); -insert into help_relation (help_topic_id,help_keyword_id) values (36,212); -insert into help_relation (help_topic_id,help_keyword_id) values (447,213); -insert into help_relation (help_topic_id,help_keyword_id) values (0,214); -insert into help_relation (help_topic_id,help_keyword_id) values (25,214); -insert into help_relation (help_topic_id,help_keyword_id) values (447,214); -insert into help_relation (help_topic_id,help_keyword_id) values (483,215); -insert into help_relation (help_topic_id,help_keyword_id) values (110,216); -insert into help_relation (help_topic_id,help_keyword_id) values (340,217); -insert into help_relation (help_topic_id,help_keyword_id) values (136,218); -insert into help_relation (help_topic_id,help_keyword_id) values (441,219); -insert into help_relation (help_topic_id,help_keyword_id) values (362,219); -insert into help_relation (help_topic_id,help_keyword_id) values (0,220); -insert into help_relation (help_topic_id,help_keyword_id) values (508,221); -insert into help_relation (help_topic_id,help_keyword_id) values (200,221); -insert into help_relation (help_topic_id,help_keyword_id) values (171,221); -insert into help_relation (help_topic_id,help_keyword_id) values (469,222); -insert into help_relation (help_topic_id,help_keyword_id) values (426,223); -insert into help_relation (help_topic_id,help_keyword_id) values (120,224); -insert into help_relation (help_topic_id,help_keyword_id) values (140,225); -insert into help_relation (help_topic_id,help_keyword_id) values (309,226); -insert into help_relation (help_topic_id,help_keyword_id) values (247,226); -insert into help_relation (help_topic_id,help_keyword_id) values (114,226); -insert into help_relation (help_topic_id,help_keyword_id) values (110,226); -insert into help_relation (help_topic_id,help_keyword_id) values (511,226); -insert into help_relation (help_topic_id,help_keyword_id) values (511,227); -insert into help_relation (help_topic_id,help_keyword_id) values (392,228); -insert into help_relation (help_topic_id,help_keyword_id) values (247,229); -insert into help_relation (help_topic_id,help_keyword_id) values (483,229); -insert into help_relation (help_topic_id,help_keyword_id) values (475,230); -insert into help_relation (help_topic_id,help_keyword_id) values (310,230); -insert into help_relation (help_topic_id,help_keyword_id) values (511,230); -insert into help_relation (help_topic_id,help_keyword_id) values (162,231); -insert into help_relation (help_topic_id,help_keyword_id) values (447,232); -insert into help_relation (help_topic_id,help_keyword_id) values (269,233); -insert into help_relation (help_topic_id,help_keyword_id) values (25,233); -insert into help_relation (help_topic_id,help_keyword_id) values (332,233); -insert into help_relation (help_topic_id,help_keyword_id) values (32,233); -insert into help_relation (help_topic_id,help_keyword_id) values (317,233); -insert into help_relation (help_topic_id,help_keyword_id) values (48,233); -insert into help_relation (help_topic_id,help_keyword_id) values (483,233); -insert into help_relation (help_topic_id,help_keyword_id) values (110,234); -insert into help_relation (help_topic_id,help_keyword_id) values (107,235); -insert into help_relation (help_topic_id,help_keyword_id) values (441,236); -insert into help_relation (help_topic_id,help_keyword_id) values (342,236); -insert into help_relation (help_topic_id,help_keyword_id) values (416,236); -insert into help_relation (help_topic_id,help_keyword_id) values (360,236); -insert into help_relation (help_topic_id,help_keyword_id) values (115,236); -insert into help_relation (help_topic_id,help_keyword_id) values (58,237); -insert into help_relation (help_topic_id,help_keyword_id) values (399,238); -insert into help_relation (help_topic_id,help_keyword_id) values (155,239); -insert into help_relation (help_topic_id,help_keyword_id) values (510,240); -insert into help_relation (help_topic_id,help_keyword_id) values (441,241); -insert into help_relation (help_topic_id,help_keyword_id) values (0,241); -insert into help_relation (help_topic_id,help_keyword_id) values (247,241); -insert into help_relation (help_topic_id,help_keyword_id) values (413,241); -insert into help_relation (help_topic_id,help_keyword_id) values (51,241); -insert into help_relation (help_topic_id,help_keyword_id) values (60,241); -insert into help_relation (help_topic_id,help_keyword_id) values (38,241); -insert into help_relation (help_topic_id,help_keyword_id) values (417,241); -insert into help_relation (help_topic_id,help_keyword_id) values (114,241); -insert into help_relation (help_topic_id,help_keyword_id) values (511,241); -insert into help_relation (help_topic_id,help_keyword_id) values (227,242); -insert into help_relation (help_topic_id,help_keyword_id) values (475,243); -insert into help_relation (help_topic_id,help_keyword_id) values (310,243); -insert into help_relation (help_topic_id,help_keyword_id) values (361,244); -insert into help_relation (help_topic_id,help_keyword_id) values (511,245); -insert into help_relation (help_topic_id,help_keyword_id) values (245,246); -insert into help_relation (help_topic_id,help_keyword_id) values (140,246); -insert into help_relation (help_topic_id,help_keyword_id) values (153,247); -insert into help_relation (help_topic_id,help_keyword_id) values (0,248); -insert into help_relation (help_topic_id,help_keyword_id) values (441,249); -insert into help_relation (help_topic_id,help_keyword_id) values (4,249); -insert into help_relation (help_topic_id,help_keyword_id) values (143,250); -insert into help_relation (help_topic_id,help_keyword_id) values (229,250); -insert into help_relation (help_topic_id,help_keyword_id) values (107,251); -insert into help_relation (help_topic_id,help_keyword_id) values (379,251); -insert into help_relation (help_topic_id,help_keyword_id) values (447,251); -insert into help_relation (help_topic_id,help_keyword_id) values (486,252); -insert into help_relation (help_topic_id,help_keyword_id) values (420,253); -insert into help_relation (help_topic_id,help_keyword_id) values (361,254); -insert into help_relation (help_topic_id,help_keyword_id) values (361,255); -insert into help_relation (help_topic_id,help_keyword_id) values (419,256); -insert into help_relation (help_topic_id,help_keyword_id) values (264,256); -insert into help_relation (help_topic_id,help_keyword_id) values (371,256); -insert into help_relation (help_topic_id,help_keyword_id) values (276,256); -insert into help_relation (help_topic_id,help_keyword_id) values (350,256); -insert into help_relation (help_topic_id,help_keyword_id) values (327,256); -insert into help_relation (help_topic_id,help_keyword_id) values (110,257); -insert into help_relation (help_topic_id,help_keyword_id) values (361,258); -insert into help_relation (help_topic_id,help_keyword_id) values (249,259); -insert into help_relation (help_topic_id,help_keyword_id) values (361,260); -insert into help_relation (help_topic_id,help_keyword_id) values (207,261); -insert into help_relation (help_topic_id,help_keyword_id) values (184,262); -insert into help_relation (help_topic_id,help_keyword_id) values (441,262); -insert into help_relation (help_topic_id,help_keyword_id) values (342,262); -insert into help_relation (help_topic_id,help_keyword_id) values (229,262); -insert into help_relation (help_topic_id,help_keyword_id) values (332,262); -insert into help_relation (help_topic_id,help_keyword_id) values (247,262); -insert into help_relation (help_topic_id,help_keyword_id) values (143,262); -insert into help_relation (help_topic_id,help_keyword_id) values (115,262); -insert into help_relation (help_topic_id,help_keyword_id) values (447,262); -insert into help_relation (help_topic_id,help_keyword_id) values (483,262); -insert into help_relation (help_topic_id,help_keyword_id) values (361,263); -insert into help_relation (help_topic_id,help_keyword_id) values (508,264); -insert into help_relation (help_topic_id,help_keyword_id) values (200,264); -insert into help_relation (help_topic_id,help_keyword_id) values (171,264); -insert into help_relation (help_topic_id,help_keyword_id) values (441,265); -insert into help_relation (help_topic_id,help_keyword_id) values (245,265); -insert into help_relation (help_topic_id,help_keyword_id) values (64,265); -insert into help_relation (help_topic_id,help_keyword_id) values (247,265); -insert into help_relation (help_topic_id,help_keyword_id) values (323,265); -insert into help_relation (help_topic_id,help_keyword_id) values (424,265); -insert into help_relation (help_topic_id,help_keyword_id) values (515,265); -insert into help_relation (help_topic_id,help_keyword_id) values (400,265); -insert into help_relation (help_topic_id,help_keyword_id) values (154,265); -insert into help_relation (help_topic_id,help_keyword_id) values (223,265); -insert into help_relation (help_topic_id,help_keyword_id) values (213,265); -insert into help_relation (help_topic_id,help_keyword_id) values (38,265); -insert into help_relation (help_topic_id,help_keyword_id) values (118,265); -insert into help_relation (help_topic_id,help_keyword_id) values (511,265); -insert into help_relation (help_topic_id,help_keyword_id) values (107,266); -insert into help_relation (help_topic_id,help_keyword_id) values (518,266); -insert into help_relation (help_topic_id,help_keyword_id) values (441,266); -insert into help_relation (help_topic_id,help_keyword_id) values (451,266); -insert into help_relation (help_topic_id,help_keyword_id) values (247,266); -insert into help_relation (help_topic_id,help_keyword_id) values (222,266); -insert into help_relation (help_topic_id,help_keyword_id) values (511,266); -insert into help_relation (help_topic_id,help_keyword_id) values (247,267); -insert into help_relation (help_topic_id,help_keyword_id) values (517,268); -insert into help_relation (help_topic_id,help_keyword_id) values (279,268); -insert into help_relation (help_topic_id,help_keyword_id) values (247,268); -insert into help_relation (help_topic_id,help_keyword_id) values (400,268); -insert into help_relation (help_topic_id,help_keyword_id) values (361,269); -insert into help_relation (help_topic_id,help_keyword_id) values (447,270); -insert into help_relation (help_topic_id,help_keyword_id) values (414,271); -insert into help_relation (help_topic_id,help_keyword_id) values (247,272); -insert into help_relation (help_topic_id,help_keyword_id) values (173,273); -insert into help_relation (help_topic_id,help_keyword_id) values (511,274); -insert into help_relation (help_topic_id,help_keyword_id) values (309,275); -insert into help_relation (help_topic_id,help_keyword_id) values (361,276); -insert into help_relation (help_topic_id,help_keyword_id) values (447,277); -insert into help_relation (help_topic_id,help_keyword_id) values (447,278); -insert into help_relation (help_topic_id,help_keyword_id) values (140,278); -insert into help_relation (help_topic_id,help_keyword_id) values (448,278); -insert into help_relation (help_topic_id,help_keyword_id) values (421,279); -insert into help_relation (help_topic_id,help_keyword_id) values (201,279); -insert into help_relation (help_topic_id,help_keyword_id) values (125,279); -insert into help_relation (help_topic_id,help_keyword_id) values (371,280); -insert into help_relation (help_topic_id,help_keyword_id) values (309,281); -insert into help_relation (help_topic_id,help_keyword_id) values (299,282); -insert into help_relation (help_topic_id,help_keyword_id) values (522,282); -insert into help_relation (help_topic_id,help_keyword_id) values (484,283); -insert into help_relation (help_topic_id,help_keyword_id) values (388,284); -insert into help_relation (help_topic_id,help_keyword_id) values (340,285); -insert into help_relation (help_topic_id,help_keyword_id) values (107,286); -insert into help_relation (help_topic_id,help_keyword_id) values (379,286); -insert into help_relation (help_topic_id,help_keyword_id) values (180,287); -insert into help_relation (help_topic_id,help_keyword_id) values (85,287); -insert into help_relation (help_topic_id,help_keyword_id) values (505,288); -insert into help_relation (help_topic_id,help_keyword_id) values (107,288); -insert into help_relation (help_topic_id,help_keyword_id) values (342,288); -insert into help_relation (help_topic_id,help_keyword_id) values (58,288); -insert into help_relation (help_topic_id,help_keyword_id) values (169,288); -insert into help_relation (help_topic_id,help_keyword_id) values (154,288); -insert into help_relation (help_topic_id,help_keyword_id) values (416,288); -insert into help_relation (help_topic_id,help_keyword_id) values (372,288); -insert into help_relation (help_topic_id,help_keyword_id) values (114,288); -insert into help_relation (help_topic_id,help_keyword_id) values (305,288); -insert into help_relation (help_topic_id,help_keyword_id) values (12,288); -insert into help_relation (help_topic_id,help_keyword_id) values (441,288); -insert into help_relation (help_topic_id,help_keyword_id) values (16,288); -insert into help_relation (help_topic_id,help_keyword_id) values (247,288); -insert into help_relation (help_topic_id,help_keyword_id) values (249,288); -insert into help_relation (help_topic_id,help_keyword_id) values (210,288); -insert into help_relation (help_topic_id,help_keyword_id) values (310,288); -insert into help_relation (help_topic_id,help_keyword_id) values (38,288); -insert into help_relation (help_topic_id,help_keyword_id) values (193,288); -insert into help_relation (help_topic_id,help_keyword_id) values (140,289); -insert into help_relation (help_topic_id,help_keyword_id) values (107,290); -insert into help_relation (help_topic_id,help_keyword_id) values (110,291); -insert into help_relation (help_topic_id,help_keyword_id) values (127,292); -insert into help_relation (help_topic_id,help_keyword_id) values (441,293); -insert into help_relation (help_topic_id,help_keyword_id) values (503,293); -insert into help_relation (help_topic_id,help_keyword_id) values (310,294); -insert into help_relation (help_topic_id,help_keyword_id) values (26,295); -insert into help_relation (help_topic_id,help_keyword_id) values (441,295); -insert into help_relation (help_topic_id,help_keyword_id) values (149,295); -insert into help_relation (help_topic_id,help_keyword_id) values (493,296); -insert into help_relation (help_topic_id,help_keyword_id) values (511,297); -insert into help_relation (help_topic_id,help_keyword_id) values (247,298); -insert into help_relation (help_topic_id,help_keyword_id) values (171,299); -insert into help_relation (help_topic_id,help_keyword_id) values (511,300); -insert into help_relation (help_topic_id,help_keyword_id) values (458,301); -insert into help_relation (help_topic_id,help_keyword_id) values (82,302); -insert into help_relation (help_topic_id,help_keyword_id) values (318,303); -insert into help_relation (help_topic_id,help_keyword_id) values (245,304); -insert into help_relation (help_topic_id,help_keyword_id) values (511,304); -insert into help_relation (help_topic_id,help_keyword_id) values (247,305); -insert into help_relation (help_topic_id,help_keyword_id) values (223,306); -insert into help_relation (help_topic_id,help_keyword_id) values (269,307); -insert into help_relation (help_topic_id,help_keyword_id) values (317,307); -insert into help_relation (help_topic_id,help_keyword_id) values (436,308); -insert into help_relation (help_topic_id,help_keyword_id) values (171,309); -insert into help_relation (help_topic_id,help_keyword_id) values (186,310); -insert into help_relation (help_topic_id,help_keyword_id) values (143,311); -insert into help_relation (help_topic_id,help_keyword_id) values (149,312); -insert into help_relation (help_topic_id,help_keyword_id) values (424,313); -insert into help_relation (help_topic_id,help_keyword_id) values (511,313); -insert into help_relation (help_topic_id,help_keyword_id) values (106,314); -insert into help_relation (help_topic_id,help_keyword_id) values (299,314); -insert into help_relation (help_topic_id,help_keyword_id) values (184,314); -insert into help_relation (help_topic_id,help_keyword_id) values (301,314); -insert into help_relation (help_topic_id,help_keyword_id) values (431,314); -insert into help_relation (help_topic_id,help_keyword_id) values (4,314); -insert into help_relation (help_topic_id,help_keyword_id) values (334,314); -insert into help_relation (help_topic_id,help_keyword_id) values (154,314); -insert into help_relation (help_topic_id,help_keyword_id) values (7,314); -insert into help_relation (help_topic_id,help_keyword_id) values (402,314); -insert into help_relation (help_topic_id,help_keyword_id) values (337,314); -insert into help_relation (help_topic_id,help_keyword_id) values (118,314); -insert into help_relation (help_topic_id,help_keyword_id) values (12,314); -insert into help_relation (help_topic_id,help_keyword_id) values (441,314); -insert into help_relation (help_topic_id,help_keyword_id) values (275,314); -insert into help_relation (help_topic_id,help_keyword_id) values (442,314); -insert into help_relation (help_topic_id,help_keyword_id) values (47,314); -insert into help_relation (help_topic_id,help_keyword_id) values (121,314); -insert into help_relation (help_topic_id,help_keyword_id) values (18,314); -insert into help_relation (help_topic_id,help_keyword_id) values (339,314); -insert into help_relation (help_topic_id,help_keyword_id) values (164,314); -insert into help_relation (help_topic_id,help_keyword_id) values (193,314); -insert into help_relation (help_topic_id,help_keyword_id) values (226,314); -insert into help_relation (help_topic_id,help_keyword_id) values (23,314); -insert into help_relation (help_topic_id,help_keyword_id) values (451,314); -insert into help_relation (help_topic_id,help_keyword_id) values (92,314); -insert into help_relation (help_topic_id,help_keyword_id) values (522,314); -insert into help_relation (help_topic_id,help_keyword_id) values (258,314); -insert into help_relation (help_topic_id,help_keyword_id) values (26,314); -insert into help_relation (help_topic_id,help_keyword_id) values (416,314); -insert into help_relation (help_topic_id,help_keyword_id) values (525,314); -insert into help_relation (help_topic_id,help_keyword_id) values (417,314); -insert into help_relation (help_topic_id,help_keyword_id) values (95,314); -insert into help_relation (help_topic_id,help_keyword_id) values (37,314); -insert into help_relation (help_topic_id,help_keyword_id) values (210,314); -insert into help_relation (help_topic_id,help_keyword_id) values (182,314); -insert into help_relation (help_topic_id,help_keyword_id) values (427,314); -insert into help_relation (help_topic_id,help_keyword_id) values (69,314); -insert into help_relation (help_topic_id,help_keyword_id) values (362,314); -insert into help_relation (help_topic_id,help_keyword_id) values (503,314); -insert into help_relation (help_topic_id,help_keyword_id) values (283,315); -insert into help_relation (help_topic_id,help_keyword_id) values (414,315); -insert into help_relation (help_topic_id,help_keyword_id) values (136,315); -insert into help_relation (help_topic_id,help_keyword_id) values (447,315); -insert into help_relation (help_topic_id,help_keyword_id) values (110,315); -insert into help_relation (help_topic_id,help_keyword_id) values (247,316); -insert into help_relation (help_topic_id,help_keyword_id) values (180,317); -insert into help_relation (help_topic_id,help_keyword_id) values (247,318); -insert into help_relation (help_topic_id,help_keyword_id) values (69,319); -insert into help_relation (help_topic_id,help_keyword_id) values (443,319); -insert into help_relation (help_topic_id,help_keyword_id) values (36,320); -insert into help_relation (help_topic_id,help_keyword_id) values (49,320); -insert into help_relation (help_topic_id,help_keyword_id) values (181,320); -insert into help_relation (help_topic_id,help_keyword_id) values (20,320); -insert into help_relation (help_topic_id,help_keyword_id) values (493,320); -insert into help_relation (help_topic_id,help_keyword_id) values (186,320); -insert into help_relation (help_topic_id,help_keyword_id) values (126,320); -insert into help_relation (help_topic_id,help_keyword_id) values (527,320); -insert into help_relation (help_topic_id,help_keyword_id) values (202,321); -insert into help_relation (help_topic_id,help_keyword_id) values (82,322); -insert into help_relation (help_topic_id,help_keyword_id) values (175,322); -insert into help_relation (help_topic_id,help_keyword_id) values (419,323); -insert into help_relation (help_topic_id,help_keyword_id) values (62,324); -insert into help_relation (help_topic_id,help_keyword_id) values (202,325); -insert into help_relation (help_topic_id,help_keyword_id) values (269,326); -insert into help_relation (help_topic_id,help_keyword_id) values (447,326); -insert into help_relation (help_topic_id,help_keyword_id) values (317,326); -insert into help_relation (help_topic_id,help_keyword_id) values (168,326); -insert into help_relation (help_topic_id,help_keyword_id) values (140,326); -insert into help_relation (help_topic_id,help_keyword_id) values (441,327); -insert into help_relation (help_topic_id,help_keyword_id) values (92,327); -insert into help_relation (help_topic_id,help_keyword_id) values (78,328); -insert into help_relation (help_topic_id,help_keyword_id) values (332,329); -insert into help_relation (help_topic_id,help_keyword_id) values (110,329); -insert into help_relation (help_topic_id,help_keyword_id) values (305,329); -insert into help_relation (help_topic_id,help_keyword_id) values (249,330); -insert into help_relation (help_topic_id,help_keyword_id) values (361,331); -insert into help_relation (help_topic_id,help_keyword_id) values (101,332); -insert into help_relation (help_topic_id,help_keyword_id) values (506,333); -insert into help_relation (help_topic_id,help_keyword_id) values (65,334); -insert into help_relation (help_topic_id,help_keyword_id) values (276,334); -insert into help_relation (help_topic_id,help_keyword_id) values (202,335); -insert into help_relation (help_topic_id,help_keyword_id) values (361,336); -insert into help_relation (help_topic_id,help_keyword_id) values (332,337); -insert into help_relation (help_topic_id,help_keyword_id) values (483,337); -insert into help_relation (help_topic_id,help_keyword_id) values (464,338); -insert into help_relation (help_topic_id,help_keyword_id) values (67,338); -insert into help_relation (help_topic_id,help_keyword_id) values (511,339); -insert into help_relation (help_topic_id,help_keyword_id) values (18,340); -insert into help_relation (help_topic_id,help_keyword_id) values (441,340); -insert into help_relation (help_topic_id,help_keyword_id) values (110,341); -insert into help_relation (help_topic_id,help_keyword_id) values (199,342); -insert into help_relation (help_topic_id,help_keyword_id) values (249,342); -insert into help_relation (help_topic_id,help_keyword_id) values (200,343); -insert into help_relation (help_topic_id,help_keyword_id) values (340,344); -insert into help_relation (help_topic_id,help_keyword_id) values (493,344); -insert into help_relation (help_topic_id,help_keyword_id) values (361,345); -insert into help_relation (help_topic_id,help_keyword_id) values (202,346); -insert into help_relation (help_topic_id,help_keyword_id) values (110,347); -insert into help_relation (help_topic_id,help_keyword_id) values (441,348); -insert into help_relation (help_topic_id,help_keyword_id) values (458,348); -insert into help_relation (help_topic_id,help_keyword_id) values (441,349); -insert into help_relation (help_topic_id,help_keyword_id) values (162,349); -insert into help_relation (help_topic_id,help_keyword_id) values (482,349); -insert into help_relation (help_topic_id,help_keyword_id) values (206,350); -insert into help_relation (help_topic_id,help_keyword_id) values (226,351); -insert into help_relation (help_topic_id,help_keyword_id) values (309,351); -insert into help_relation (help_topic_id,help_keyword_id) values (69,351); -insert into help_relation (help_topic_id,help_keyword_id) values (447,351); -insert into help_relation (help_topic_id,help_keyword_id) values (511,352); -insert into help_relation (help_topic_id,help_keyword_id) values (171,353); -insert into help_relation (help_topic_id,help_keyword_id) values (447,354); -insert into help_relation (help_topic_id,help_keyword_id) values (110,355); -insert into help_relation (help_topic_id,help_keyword_id) values (50,356); -insert into help_relation (help_topic_id,help_keyword_id) values (110,356); -insert into help_relation (help_topic_id,help_keyword_id) values (447,357); -insert into help_relation (help_topic_id,help_keyword_id) values (470,358); -insert into help_relation (help_topic_id,help_keyword_id) values (309,359); -insert into help_relation (help_topic_id,help_keyword_id) values (97,359); -insert into help_relation (help_topic_id,help_keyword_id) values (85,359); -insert into help_relation (help_topic_id,help_keyword_id) values (361,360); -insert into help_relation (help_topic_id,help_keyword_id) values (332,361); -insert into help_relation (help_topic_id,help_keyword_id) values (483,361); -insert into help_relation (help_topic_id,help_keyword_id) values (426,362); -insert into help_relation (help_topic_id,help_keyword_id) values (291,363); -insert into help_relation (help_topic_id,help_keyword_id) values (426,363); -insert into help_relation (help_topic_id,help_keyword_id) values (199,364); -insert into help_relation (help_topic_id,help_keyword_id) values (249,364); -insert into help_relation (help_topic_id,help_keyword_id) values (6,364); -insert into help_relation (help_topic_id,help_keyword_id) values (110,365); -insert into help_relation (help_topic_id,help_keyword_id) values (361,366); -insert into help_relation (help_topic_id,help_keyword_id) values (70,367); -insert into help_relation (help_topic_id,help_keyword_id) values (340,368); -insert into help_relation (help_topic_id,help_keyword_id) values (238,368); -insert into help_relation (help_topic_id,help_keyword_id) values (202,369); -insert into help_relation (help_topic_id,help_keyword_id) values (219,370); -insert into help_relation (help_topic_id,help_keyword_id) values (202,371); -insert into help_relation (help_topic_id,help_keyword_id) values (511,372); -insert into help_relation (help_topic_id,help_keyword_id) values (81,373); -insert into help_relation (help_topic_id,help_keyword_id) values (276,374); -insert into help_relation (help_topic_id,help_keyword_id) values (475,375); -insert into help_relation (help_topic_id,help_keyword_id) values (64,375); -insert into help_relation (help_topic_id,help_keyword_id) values (377,375); -insert into help_relation (help_topic_id,help_keyword_id) values (511,375); -insert into help_relation (help_topic_id,help_keyword_id) values (247,376); -insert into help_relation (help_topic_id,help_keyword_id) values (114,376); -insert into help_relation (help_topic_id,help_keyword_id) values (511,376); -insert into help_relation (help_topic_id,help_keyword_id) values (0,377); -insert into help_relation (help_topic_id,help_keyword_id) values (518,378); -insert into help_relation (help_topic_id,help_keyword_id) values (475,378); -insert into help_relation (help_topic_id,help_keyword_id) values (234,378); -insert into help_relation (help_topic_id,help_keyword_id) values (91,378); -insert into help_relation (help_topic_id,help_keyword_id) values (110,378); -insert into help_relation (help_topic_id,help_keyword_id) values (199,378); -insert into help_relation (help_topic_id,help_keyword_id) values (379,378); -insert into help_relation (help_topic_id,help_keyword_id) values (38,378); -insert into help_relation (help_topic_id,help_keyword_id) values (115,378); -insert into help_relation (help_topic_id,help_keyword_id) values (469,378); -insert into help_relation (help_topic_id,help_keyword_id) values (382,378); -insert into help_relation (help_topic_id,help_keyword_id) values (511,378); -insert into help_relation (help_topic_id,help_keyword_id) values (247,379); -insert into help_relation (help_topic_id,help_keyword_id) values (249,380); -insert into help_relation (help_topic_id,help_keyword_id) values (0,381); -insert into help_relation (help_topic_id,help_keyword_id) values (447,381); -insert into help_relation (help_topic_id,help_keyword_id) values (0,382); -insert into help_relation (help_topic_id,help_keyword_id) values (441,383); -insert into help_relation (help_topic_id,help_keyword_id) values (442,383); -insert into help_relation (help_topic_id,help_keyword_id) values (483,384); -insert into help_relation (help_topic_id,help_keyword_id) values (486,385); -insert into help_relation (help_topic_id,help_keyword_id) values (247,386); -insert into help_relation (help_topic_id,help_keyword_id) values (249,387); -insert into help_relation (help_topic_id,help_keyword_id) values (252,387); -insert into help_relation (help_topic_id,help_keyword_id) values (469,387); -insert into help_relation (help_topic_id,help_keyword_id) values (110,387); -insert into help_relation (help_topic_id,help_keyword_id) values (305,387); -insert into help_relation (help_topic_id,help_keyword_id) values (426,387); -insert into help_relation (help_topic_id,help_keyword_id) values (447,388); -insert into help_relation (help_topic_id,help_keyword_id) values (513,389); -insert into help_relation (help_topic_id,help_keyword_id) values (125,389); -insert into help_relation (help_topic_id,help_keyword_id) values (62,390); -insert into help_relation (help_topic_id,help_keyword_id) values (301,391); -insert into help_relation (help_topic_id,help_keyword_id) values (441,391); -insert into help_relation (help_topic_id,help_keyword_id) values (261,392); -insert into help_relation (help_topic_id,help_keyword_id) values (400,393); -insert into help_relation (help_topic_id,help_keyword_id) values (238,394); -insert into help_relation (help_topic_id,help_keyword_id) values (447,395); -insert into help_relation (help_topic_id,help_keyword_id) values (223,396); -insert into help_relation (help_topic_id,help_keyword_id) values (115,396); -insert into help_relation (help_topic_id,help_keyword_id) values (493,397); -insert into help_relation (help_topic_id,help_keyword_id) values (340,398); -insert into help_relation (help_topic_id,help_keyword_id) values (181,398); -insert into help_relation (help_topic_id,help_keyword_id) values (493,398); -insert into help_relation (help_topic_id,help_keyword_id) values (247,399); -insert into help_relation (help_topic_id,help_keyword_id) values (258,400); -insert into help_relation (help_topic_id,help_keyword_id) values (223,401); -insert into help_relation (help_topic_id,help_keyword_id) values (310,402); -insert into help_relation (help_topic_id,help_keyword_id) values (202,402); -insert into help_relation (help_topic_id,help_keyword_id) values (110,403); -insert into help_relation (help_topic_id,help_keyword_id) values (202,404); -insert into help_relation (help_topic_id,help_keyword_id) values (115,405); -insert into help_relation (help_topic_id,help_keyword_id) values (517,406); -insert into help_relation (help_topic_id,help_keyword_id) values (247,406); -insert into help_relation (help_topic_id,help_keyword_id) values (110,406); -insert into help_relation (help_topic_id,help_keyword_id) values (496,407); -insert into help_relation (help_topic_id,help_keyword_id) values (402,408); -insert into help_relation (help_topic_id,help_keyword_id) values (238,409); -insert into help_relation (help_topic_id,help_keyword_id) values (501,410); -insert into help_relation (help_topic_id,help_keyword_id) values (310,411); -insert into help_relation (help_topic_id,help_keyword_id) values (327,412); -insert into help_relation (help_topic_id,help_keyword_id) values (7,413); -insert into help_relation (help_topic_id,help_keyword_id) values (441,413); -insert into help_relation (help_topic_id,help_keyword_id) values (517,414); -insert into help_relation (help_topic_id,help_keyword_id) values (279,414); -insert into help_relation (help_topic_id,help_keyword_id) values (400,414); -insert into help_relation (help_topic_id,help_keyword_id) values (238,415); -insert into help_relation (help_topic_id,help_keyword_id) values (292,416); -insert into help_relation (help_topic_id,help_keyword_id) values (308,417); -insert into help_relation (help_topic_id,help_keyword_id) values (112,417); -insert into help_relation (help_topic_id,help_keyword_id) values (241,417); -insert into help_relation (help_topic_id,help_keyword_id) values (198,417); -insert into help_relation (help_topic_id,help_keyword_id) values (308,418); -insert into help_relation (help_topic_id,help_keyword_id) values (112,418); -insert into help_relation (help_topic_id,help_keyword_id) values (342,418); -insert into help_relation (help_topic_id,help_keyword_id) values (310,418); -insert into help_relation (help_topic_id,help_keyword_id) values (418,418); -insert into help_relation (help_topic_id,help_keyword_id) values (103,419); -insert into help_relation (help_topic_id,help_keyword_id) values (107,420); -insert into help_relation (help_topic_id,help_keyword_id) values (518,420); -insert into help_relation (help_topic_id,help_keyword_id) values (180,421); -insert into help_relation (help_topic_id,help_keyword_id) values (508,422); -insert into help_relation (help_topic_id,help_keyword_id) values (247,423); -insert into help_relation (help_topic_id,help_keyword_id) values (340,424); -insert into help_relation (help_topic_id,help_keyword_id) values (493,424); -insert into help_relation (help_topic_id,help_keyword_id) values (426,424); -insert into help_relation (help_topic_id,help_keyword_id) values (23,425); -insert into help_relation (help_topic_id,help_keyword_id) values (509,426); -insert into help_relation (help_topic_id,help_keyword_id) values (254,427); -insert into help_relation (help_topic_id,help_keyword_id) values (342,427); -insert into help_relation (help_topic_id,help_keyword_id) values (411,427); -insert into help_relation (help_topic_id,help_keyword_id) values (6,427); -insert into help_relation (help_topic_id,help_keyword_id) values (400,427); -insert into help_relation (help_topic_id,help_keyword_id) values (20,427); -insert into help_relation (help_topic_id,help_keyword_id) values (279,427); -insert into help_relation (help_topic_id,help_keyword_id) values (310,427); -insert into help_relation (help_topic_id,help_keyword_id) values (360,427); -insert into help_relation (help_topic_id,help_keyword_id) values (332,428); -insert into help_relation (help_topic_id,help_keyword_id) values (511,429); -insert into help_relation (help_topic_id,help_keyword_id) values (149,430); -insert into help_relation (help_topic_id,help_keyword_id) values (62,431); -insert into help_relation (help_topic_id,help_keyword_id) values (249,432); -insert into help_relation (help_topic_id,help_keyword_id) values (377,432); -insert into help_relation (help_topic_id,help_keyword_id) values (469,432); -insert into help_relation (help_topic_id,help_keyword_id) values (428,432); -insert into help_relation (help_topic_id,help_keyword_id) values (305,432); -insert into help_relation (help_topic_id,help_keyword_id) values (426,432); -insert into help_relation (help_topic_id,help_keyword_id) values (420,433); -insert into help_relation (help_topic_id,help_keyword_id) values (441,434); -insert into help_relation (help_topic_id,help_keyword_id) values (417,434); -insert into help_relation (help_topic_id,help_keyword_id) values (511,434); -insert into help_relation (help_topic_id,help_keyword_id) values (226,435); -insert into help_relation (help_topic_id,help_keyword_id) values (32,435); -insert into help_relation (help_topic_id,help_keyword_id) values (69,435); -insert into help_relation (help_topic_id,help_keyword_id) values (447,435); -insert into help_relation (help_topic_id,help_keyword_id) values (48,435); -insert into help_relation (help_topic_id,help_keyword_id) values (62,435); -insert into help_relation (help_topic_id,help_keyword_id) values (517,436); -insert into help_relation (help_topic_id,help_keyword_id) values (38,436); -insert into help_relation (help_topic_id,help_keyword_id) values (317,436); -insert into help_relation (help_topic_id,help_keyword_id) values (247,436); -insert into help_relation (help_topic_id,help_keyword_id) values (511,436); -insert into help_relation (help_topic_id,help_keyword_id) values (247,437); -insert into help_relation (help_topic_id,help_keyword_id) values (126,438); -insert into help_relation (help_topic_id,help_keyword_id) values (447,439); -insert into help_relation (help_topic_id,help_keyword_id) values (269,440); -insert into help_relation (help_topic_id,help_keyword_id) values (317,440); -insert into help_relation (help_topic_id,help_keyword_id) values (521,440); -insert into help_relation (help_topic_id,help_keyword_id) values (508,441); -insert into help_relation (help_topic_id,help_keyword_id) values (200,441); -insert into help_relation (help_topic_id,help_keyword_id) values (171,441); -insert into help_relation (help_topic_id,help_keyword_id) values (515,442); -insert into help_relation (help_topic_id,help_keyword_id) values (511,442); -insert into help_relation (help_topic_id,help_keyword_id) values (247,443); -insert into help_relation (help_topic_id,help_keyword_id) values (511,443); -insert into help_relation (help_topic_id,help_keyword_id) values (247,444); -insert into help_relation (help_topic_id,help_keyword_id) values (386,444); -insert into help_relation (help_topic_id,help_keyword_id) values (517,445); -insert into help_relation (help_topic_id,help_keyword_id) values (247,445); -insert into help_relation (help_topic_id,help_keyword_id) values (340,446); -insert into help_relation (help_topic_id,help_keyword_id) values (238,446); -insert into help_relation (help_topic_id,help_keyword_id) values (25,446); -insert into help_relation (help_topic_id,help_keyword_id) values (493,446); -insert into help_relation (help_topic_id,help_keyword_id) values (107,447); -insert into help_relation (help_topic_id,help_keyword_id) values (518,447); -insert into help_relation (help_topic_id,help_keyword_id) values (329,448); -insert into help_relation (help_topic_id,help_keyword_id) values (238,448); -insert into help_relation (help_topic_id,help_keyword_id) values (442,448); -insert into help_relation (help_topic_id,help_keyword_id) values (337,448); -insert into help_relation (help_topic_id,help_keyword_id) values (441,449); -insert into help_relation (help_topic_id,help_keyword_id) values (249,449); -insert into help_relation (help_topic_id,help_keyword_id) values (342,449); -insert into help_relation (help_topic_id,help_keyword_id) values (416,449); -insert into help_relation (help_topic_id,help_keyword_id) values (360,449); -insert into help_relation (help_topic_id,help_keyword_id) values (115,449); -insert into help_relation (help_topic_id,help_keyword_id) values (308,450); -insert into help_relation (help_topic_id,help_keyword_id) values (517,450); -insert into help_relation (help_topic_id,help_keyword_id) values (198,450); -insert into help_relation (help_topic_id,help_keyword_id) values (256,451); -insert into help_relation (help_topic_id,help_keyword_id) values (245,452); -insert into help_relation (help_topic_id,help_keyword_id) values (483,453); -insert into help_relation (help_topic_id,help_keyword_id) values (339,454); -insert into help_relation (help_topic_id,help_keyword_id) values (283,454); -insert into help_relation (help_topic_id,help_keyword_id) values (475,454); -insert into help_relation (help_topic_id,help_keyword_id) values (310,454); -insert into help_relation (help_topic_id,help_keyword_id) values (121,454); -insert into help_relation (help_topic_id,help_keyword_id) values (291,454); -insert into help_relation (help_topic_id,help_keyword_id) values (426,454); -insert into help_relation (help_topic_id,help_keyword_id) values (143,455); -insert into help_relation (help_topic_id,help_keyword_id) values (447,456); -insert into help_relation (help_topic_id,help_keyword_id) values (448,456); -insert into help_relation (help_topic_id,help_keyword_id) values (260,457); -insert into help_relation (help_topic_id,help_keyword_id) values (483,458); -insert into help_relation (help_topic_id,help_keyword_id) values (475,459); -insert into help_relation (help_topic_id,help_keyword_id) values (310,459); -insert into help_relation (help_topic_id,help_keyword_id) values (511,459); -insert into help_relation (help_topic_id,help_keyword_id) values (247,460); -insert into help_relation (help_topic_id,help_keyword_id) values (115,460); -insert into help_relation (help_topic_id,help_keyword_id) values (110,461); -insert into help_relation (help_topic_id,help_keyword_id) values (527,462); -insert into help_relation (help_topic_id,help_keyword_id) values (245,463); -insert into help_relation (help_topic_id,help_keyword_id) values (180,463); -insert into help_relation (help_topic_id,help_keyword_id) values (25,463); -insert into help_relation (help_topic_id,help_keyword_id) values (332,463); -insert into help_relation (help_topic_id,help_keyword_id) values (323,463); -insert into help_relation (help_topic_id,help_keyword_id) values (483,463); -insert into help_relation (help_topic_id,help_keyword_id) values (515,463); -insert into help_relation (help_topic_id,help_keyword_id) values (268,464); -insert into help_relation (help_topic_id,help_keyword_id) values (57,464); -insert into help_relation (help_topic_id,help_keyword_id) values (460,464); -insert into help_relation (help_topic_id,help_keyword_id) values (407,464); -insert into help_relation (help_topic_id,help_keyword_id) values (230,464); -insert into help_relation (help_topic_id,help_keyword_id) values (414,464); -insert into help_relation (help_topic_id,help_keyword_id) values (447,464); -insert into help_relation (help_topic_id,help_keyword_id) values (448,464); -insert into help_relation (help_topic_id,help_keyword_id) values (262,465); -insert into help_relation (help_topic_id,help_keyword_id) values (361,466); -insert into help_relation (help_topic_id,help_keyword_id) values (110,467); -insert into help_relation (help_topic_id,help_keyword_id) values (334,468); -insert into help_relation (help_topic_id,help_keyword_id) values (441,468); -insert into help_relation (help_topic_id,help_keyword_id) values (164,468); -insert into help_relation (help_topic_id,help_keyword_id) values (25,468); -insert into help_relation (help_topic_id,help_keyword_id) values (526,469); -insert into help_relation (help_topic_id,help_keyword_id) values (180,470); -insert into help_relation (help_topic_id,help_keyword_id) values (19,471); -insert into help_relation (help_topic_id,help_keyword_id) values (441,472); -insert into help_relation (help_topic_id,help_keyword_id) values (16,472); -insert into help_relation (help_topic_id,help_keyword_id) values (145,472); -insert into help_relation (help_topic_id,help_keyword_id) values (441,473); -insert into help_relation (help_topic_id,help_keyword_id) values (525,473); -insert into help_relation (help_topic_id,help_keyword_id) values (110,474); -insert into help_relation (help_topic_id,help_keyword_id) values (447,475); -insert into help_relation (help_topic_id,help_keyword_id) values (317,475); -insert into help_relation (help_topic_id,help_keyword_id) values (114,476); -insert into help_relation (help_topic_id,help_keyword_id) values (247,477); -insert into help_relation (help_topic_id,help_keyword_id) values (62,477); -insert into help_relation (help_topic_id,help_keyword_id) values (511,477); -insert into help_relation (help_topic_id,help_keyword_id) values (511,478); -insert into help_relation (help_topic_id,help_keyword_id) values (107,479); -insert into help_relation (help_topic_id,help_keyword_id) values (518,479); -insert into help_relation (help_topic_id,help_keyword_id) values (508,480); -insert into help_relation (help_topic_id,help_keyword_id) values (200,480); -insert into help_relation (help_topic_id,help_keyword_id) values (171,480); -insert into help_relation (help_topic_id,help_keyword_id) values (26,481); -insert into help_relation (help_topic_id,help_keyword_id) values (37,481); -insert into help_relation (help_topic_id,help_keyword_id) values (149,481); -insert into help_relation (help_topic_id,help_keyword_id) values (361,481); -insert into help_relation (help_topic_id,help_keyword_id) values (146,481); -insert into help_relation (help_topic_id,help_keyword_id) values (371,482); -insert into help_relation (help_topic_id,help_keyword_id) values (247,482); -insert into help_relation (help_topic_id,help_keyword_id) values (365,483); -insert into help_relation (help_topic_id,help_keyword_id) values (247,484); +COMMIT; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/invoke-with-relative-paths.pl percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/invoke-with-relative-paths.pl --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/invoke-with-relative-paths.pl 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/invoke-with-relative-paths.pl 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,95 @@ +#! /usr/bin/perl +# +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA +# + +# +# Take the given GCC command line and run it with all absolute paths +# changed to relative paths. This makes sure that no part of the build +# path leaks into the .o files, which it normally would through the +# contents of __FILE__. (Debug information is also affected, but that +# is already fixed through -fdebug-prefix-map=.) +# +# A more elegant solution would be -ffile-prefix-map=, but this is +# not currently supported in GCC; see +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268. +# + +use strict; +use warnings; +use Cwd; + +my $cwd = getcwd(); + +my @newarg = (); +for my $i (0..$#ARGV) { + my $arg = $ARGV[$i]; + if ($arg =~ /-I(.+)$/) { + $arg = '-I' . relativize($1, $cwd); + } elsif ($arg =~ /^\//) { + $arg = relativize($arg, $cwd); + } + push @newarg, $arg; +} + +exec(@newarg); + +# /a/b/c/foo from /a/b/d = ../c/foo +sub relativize { + my ($dir1, $dir2) = @_; + + if ($dir1 !~ /^\//) { + # Not an absolute path. + return $dir1; + } + + if (! -e $dir1) { +# print STDERR "Unknown file/directory $dir1.\n"; + return $dir1; + } + # Resolve symlinks and such, because getcwd() does. + $dir1 = Cwd::abs_path($dir1); + + if ($dir1 =~ /^\/(lib|tmp|usr)/) { + # Not related to our source code. + return $dir1; + } + + if ($dir1 eq $dir2) { + return "."; + } + + my (@dir1_components) = split /\//, $dir1; + my (@dir2_components) = split /\//, $dir2; + + # Remove common leading components. + while (scalar @dir1_components > 0 && scalar @dir2_components > 0 && + $dir1_components[0] eq $dir2_components[0]) { + shift @dir1_components; + shift @dir2_components; + } + + my $ret = ""; + for my $i (0..$#dir2_components) { + $ret .= '../'; + } + $ret .= join('/', @dir1_components); + + # print STDERR "[$dir1] from [$dir2] => [$ret]\n"; + + return $ret; +} + diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqlaccess.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqlaccess.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqlaccess.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqlaccess.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ -#!/usr/bin/perl +#!@PERL_PATH@ -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -477,15 +477,22 @@ # ***************************** # Read configuration-file MySQLaccess::Debug::Print(1, "Reading configuration file..."); - if (-f "./$script_conf") { - require "./$script_conf"; - } - elsif (-f "@sysconfdir@/$script_conf") { + if (-f "@sysconfdir@/$script_conf") { + print "Configuration file '$script_conf' is found in '@sysconfdir@/'\n"; require "@sysconfdir@/$script_conf"; } elsif (-f "/etc/$script_conf") { + print "Configuration file '$script_conf' is found in '/etc/'\n"; require "/etc/$script_conf"; } + elsif (-f "./$script_conf") { + print "\nERROR! Configuration file '$script_conf' is found in the current "; + print "directory.\nThe permissible locations for this file are either "; + print "@sysconfdir@/ or /etc/\n"; + print "Please move it to one of these locations and retry.\n\n"; + exit 0; + } + # **************************** # Read in all parameters diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_config.pl.in percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_config.pl.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_config.pl.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_config.pl.in 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ -#!/usr/bin/perl +#!@PERL_PATH@ # -*- cperl -*- # -# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_convert_table_format.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_convert_table_format.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_convert_table_format.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_convert_table_format.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,5 @@ -#!/usr/bin/perl -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. -# Use is subject to license terms. +#!@PERL_PATH@ +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqld_multi.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqld_multi.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqld_multi.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqld_multi.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ -#!/usr/bin/perl +#!@PERL_PATH@ -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqld_safe.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqld_safe.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqld_safe.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqld_safe.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!@SHELL_PATH@ # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB # This file is public domain and comes with NO WARRANTY of any kind # @@ -82,9 +82,12 @@ fi cat <> "$err_log" ;; + file) + if [ -w / -o "$USER" = "root" ]; then + true + else + echo "$msg" >> "$err_log" + fi + ;; syslog) logger -t "$syslog_tag_mysqld_safe" -p "$priority" "$*" ;; *) echo "Internal program error (non-fatal):" \ @@ -167,7 +177,13 @@ eval_log_error () { local cmd="$1" case $logging in - file) cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" ;; + file) + if [ -w / -o "$USER" = "root" ]; then + cmd="$cmd > /dev/null 2>&1" + else + cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" + fi + ;; syslog) # mysqld often prefixes its messages with a timestamp, which is # redundant when logging to syslog (which adds its own timestamp) @@ -238,7 +254,7 @@ # If sequence number is not equal to -1, wsrep-recover co-ordinates aren't used. # lp:1112724 # So, directly pass whatever is obtained from grastate.dat - if [ $seqno -ne -1 ];then + if [ ! -z $seqno ] && [ $seqno -ne -1 ]; then log_notice "Skipping wsrep-recover for $uuid:$seqno pair" log_notice "Assigning $uuid:$seqno to wsrep_start_position" wsrep_start_position_opt="--wsrep_start_position=$uuid:$seqno" @@ -305,14 +321,19 @@ # the parameter after "=", or the whole $arg if no match val=`echo "$arg" | sed -e 's;^--[^=]*=;;'` # what's before "=", or the whole $arg if no match - optname=`echo "$arg" | sed -e 's/^\(--[^=]*\)=.*$/\1/'` + optname=`echo "$arg" | sed -e 's;^\(--[^=]*\)=.*$;\1;'` # replace "_" by "-" ; mysqld_safe must accept "_" like mysqld does. optname_subst=`echo "$optname" | sed 's/_/-/g'` - arg=`echo $arg | sed "s/^$optname/$optname_subst/"` + arg=`echo $arg | sed "s;^$optname;$optname_subst;"` case "$arg" in # these get passed explicitly to mysqld --basedir=*) MY_BASEDIR_VERSION="$val" ;; - --datadir=*) DATADIR="$val" ;; + --datadir=*) + case $val in + /) DATADIR=$val ;; + *) DATADIR="`echo $val | sed 's;/*$;;'`" ;; + esac + ;; --pid-file=*) pid_file="$val" ;; --plugin-dir=*) PLUGIN_DIR="$val" ;; --user=*) user="$val"; SET_USER=1 ;; @@ -325,8 +346,14 @@ # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! --core-file-size=*) core_file_size="$val" ;; - --ledir=*) ledir="$val" ;; - --malloc-lib=*) + --ledir=*) + if [ -z "$pick_args" ]; then + log_error "--ledir option can only be used as command line option, found in config file" + exit 1 + fi + ledir="$val" + ;; + --malloc-lib=*) set_malloc_lib "$val" load_jemalloc=0 ;; @@ -394,10 +421,11 @@ lib_to_add="$1" lib_to_add=$(readlink -f $lib_to_add) log_notice "Adding '$lib_to_add' to LD_PRELOAD for mysqld" + real_basedir=$(readlink -f ${MY_BASEDIR_VERSION}) # Check if the library is in the reduced number of standard system directories case "$lib_to_add" in - /usr/lib64/* | /usr/lib/* | ${MY_BASEDIR_VERSION}/lib/*) + /usr/lib64/* | /usr/lib/* | ${MY_BASEDIR_VERSION}/lib/* | ${real_basedir}/lib/*) ;; *) log_error "ld_preload libraries can only be loaded from system directories (/usr/lib64, /usr/lib, ${MY_BASEDIR_VERSION}/lib)" @@ -528,7 +556,15 @@ relpkgdata='@pkgdatadir@' fi -MY_PWD=`pwd` +case "$0" in + /*) + MY_PWD='@prefix@' + ;; + *) + MY_PWD=`dirname $0` + MY_PWD=`dirname $MY_PWD` + ;; +esac # Check for the directories we would expect from a binary release install if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION" then @@ -636,7 +672,7 @@ args= SET_USER=2 -parse_arguments `$print_defaults $defaults --loose-verbose mysqld server` +parse_arguments `$print_defaults $defaults --loose-verbose mysqld server | sed 's/\s//g'` if test $SET_USER -eq 2 then SET_USER=0 @@ -742,14 +778,7 @@ fi # Log to err_log file - log_notice "Logging to '$err_log'." logging=file - - 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 - else if [ -n "$syslog_tag" ] then @@ -762,6 +791,48 @@ logging=syslog fi +logdir=`dirname "$err_log"` +# Change the err log to the right user, if possible and it is in use +if [ $logging = "file" -o $logging = "both" ]; then + if [ ! -e "$err_log" -a ! -h "$err_log" ]; then + if test -w / -o "$USER" = "root"; then + case $logdir in + /var/log) + ( + umask 0137 + set -o noclobber + > "$err_log" && chown $user "$err_log" + ) ;; + *) ;; + esac + else + ( + umask 0137 + set -o noclobber + > "$err_log" + ) + fi + fi + + if [ -f "$err_log" -o -p "$err_log" ]; then # Log to err_log file + log_notice "Logging to '$err_log'." + elif [ "x$user" = "xroot" ]; then # running as root, mysqld can create log file; continue + echo "Logging to '$err_log'." >&2 + else + case $logdir in + # We can't create $err_log, however mysqld can; continue + /tmp|/var/tmp|/var/log/mysql|$DATADIR) + echo "Logging to '$err_log'." >&2 + ;; + # We can't create $err_log and don't know if mysqld can; error out + *) + log_error "error: log-error set to '$err_log', however file does not exist. Create writable for user '$user'." + exit 1 + ;; + esac + fi +fi + USER_OPTION="" if test -w / -o "$USER" = "root" then @@ -769,11 +840,6 @@ then USER_OPTION="--user=$user" fi - # Change the err log to the right user, if it is in use - if [ $want_syslog -eq 0 -a ! -h "$err_log" ]; then - touch "$err_log" - chown $user "$err_log" - fi if test -n "$open_files" then ulimit -n $open_files @@ -786,14 +852,16 @@ fi safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} -# Make sure that directory for $safe_mysql_unix_port exists +# Check that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port` if [ ! -d $mysql_unix_port_dir ] then - if [ ! -h $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 + install -d -m 0755 -o $user $mysql_unix_port_dir + else + log_error "Directory '$mysql_unix_port_dir' for UNIX socket file does not exist." + exit 1 fi fi @@ -1103,11 +1171,31 @@ eval_log_error "$cmd $wsrep_start_position_opt --wsrep_cluster_address=$url $nohup_redir" fi + # hypothetical: log was renamed but not + # flushed yet. we'd recreate it with + # wrong owner next time we log, so set + # it up correctly while we can! + 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 - fi # it up correctly while we can! + if test -w / -o "$USER" = "root"; then + logdir=`dirname "$err_log"` + case $logdir in + /var/log) + ( + umask 0137 + set -o noclobber + > "$err_log" && chown $user "$err_log" + ) ;; + *) ;; + esac + else + ( + umask 0137 + set -o noclobber + > "$err_log" + ) + fi + fi end_time=`date +%M%S` diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqldumpslow.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqldumpslow.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqldumpslow.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqldumpslow.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ -#!/usr/bin/perl +#!@PERL_PATH@ -# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2016, Percona Inc. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, Percona Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_find_rows.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_find_rows.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_find_rows.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_find_rows.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,5 @@ -#!/usr/bin/perl -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. -# Use is subject to license terms. +#!@PERL_PATH@ +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_fix_extensions.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_fix_extensions.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_fix_extensions.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_fix_extensions.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,6 @@ -#!/usr/bin/perl +#!@PERL_PATH@ -# Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. -# Use is subject to license terms. +# Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqlhotcopy.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqlhotcopy.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysqlhotcopy.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysqlhotcopy.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ -#!/usr/bin/perl +#!@PERL_PATH@ -# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_install_db.pl.in percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_install_db.pl.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_install_db.pl.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_install_db.pl.in 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ -#!/usr/bin/perl +#!@PERL_PATH@ # -*- cperl -*- # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_secure_installation.pl.in percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_secure_installation.pl.in --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_secure_installation.pl.in 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_secure_installation.pl.in 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ -#!/usr/bin/perl +#!@PERL_PATH@ # -*- cperl -*- # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_secure_installation.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_secure_installation.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_secure_installation.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_secure_installation.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2002, 2012, 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 @@ -33,6 +33,20 @@ esac } +validate_reply () { + ret=0 + if [ -z "$1" ]; then + reply=y + return $ret + fi + case $1 in + y|Y|yes|Yes|YES) reply=y ;; + n|N|no|No|NO) reply=n ;; + *) ret=1 ;; + esac + return $ret +} + prepare() { touch $config $command chmod 600 $config $command @@ -284,15 +298,18 @@ echo "root user without the proper authorisation." echo -if [ $hadpass -eq 0 ]; then - echo $echo_n "Set root password? [Y/n] $echo_c" -else - echo "You already have a root password set, so you can safely answer 'n'." - echo - echo $echo_n "Change the root password? [Y/n] $echo_c" -fi +while true ; do + if [ $hadpass -eq 0 ]; then + echo $echo_n "Set root password? [Y/n] $echo_c" + else + echo "You already have a root password set, so you can safely answer 'n'." + echo + echo $echo_n "Change the root password? [Y/n] $echo_c" + fi + read reply + validate_reply $reply && break +done -read reply if [ "$reply" = "n" ]; then echo " ... skipping." else @@ -316,9 +333,11 @@ echo "production environment." echo -echo $echo_n "Remove anonymous users? [Y/n] $echo_c" - -read reply +while true ; do + echo $echo_n "Remove anonymous users? [Y/n] $echo_c" + read reply + validate_reply $reply && break +done if [ "$reply" = "n" ]; then echo " ... skipping." else @@ -334,9 +353,11 @@ echo "Normally, root should only be allowed to connect from 'localhost'. This" echo "ensures that someone cannot guess at the root password from the network." echo - -echo $echo_n "Disallow root login remotely? [Y/n] $echo_c" -read reply +while true ; do + echo $echo_n "Disallow root login remotely? [Y/n] $echo_c" + read reply + validate_reply $reply && break +done if [ "$reply" = "n" ]; then echo " ... skipping." else @@ -354,8 +375,12 @@ echo "before moving into a production environment." echo -echo $echo_n "Remove test database and access to it? [Y/n] $echo_c" -read reply +while true ; do + echo $echo_n "Remove test database and access to it? [Y/n] $echo_c" + read reply + validate_reply $reply && break +done + if [ "$reply" = "n" ]; then echo " ... skipping." else @@ -372,8 +397,12 @@ echo "will take effect immediately." echo -echo $echo_n "Reload privilege tables now? [Y/n] $echo_c" -read reply +while true ; do + echo $echo_n "Reload privilege tables now? [Y/n] $echo_c" + read reply + validate_reply $reply && break +done + if [ "$reply" = "n" ]; then echo " ... skipping." else diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_setpermission.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_setpermission.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_setpermission.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_setpermission.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,8 +1,7 @@ -#!/usr/bin/perl +#!@PERL_PATH@ ## Emacs, this is -*- perl -*- mode? :-) -# Copyright (c) 2000, 2014 Oracle and/or its affiliates. All rights reserved. -# Use is subject to license terms. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_zap.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_zap.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/mysql_zap.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/mysql_zap.sh 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,5 @@ -#!/usr/bin/perl -# Copyright (c) 2000, 2014 Oracle and/or its affiliates. All rights reserved. -# Use is subject to license terms. +#!@PERL_PATH@ +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_common.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_common.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_common.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_common.sh 2017-10-19 04:25:29.000000000 +0000 @@ -30,6 +30,22 @@ case "$1" in '--address') readonly WSREP_SST_OPT_ADDR="$2" + # + # Break address string into host:port/path parts + # + if echo $WSREP_SST_OPT_ADDR | grep -qe '^\[.*\]' + then + # IPv6 notation + readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR/\]*/\]} + readonly WSREP_SST_OPT_HOST_UNESCAPED=$(echo $WSREP_SST_OPT_HOST | \ + cut -d '[' -f 2 | cut -d ']' -f 1) + else + # "traditional" notation + readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*} + fi + readonly WSREP_SST_OPT_PORT=$(echo $WSREP_SST_OPT_ADDR | \ + cut -d ']' -f 2 | cut -s -d ':' -f 2 | cut -d '/' -f 1) + readonly WSREP_SST_OPT_PATH=${WSREP_SST_OPT_ADDR#*/} shift ;; '--bypass') @@ -160,7 +176,7 @@ { # echo everything to stderr so that it gets into common error log # deliberately made to look different from the rest of the log - local readonly tst="$(date +%Y%m%d\ %H:%M:%S.%N | cut -b -21)" + local readonly tst="$(date +%Y-%m-%d\ %H:%M:%S)" echo "WSREP_SST: $* ($tst)" >&2 } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_mysqldump.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_mysqldump.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_mysqldump.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_mysqldump.sh 2017-10-19 04:25:29.000000000 +0000 @@ -27,6 +27,7 @@ [ "$1" = "127.0.0.1" ] && return 0 [ "$1" = "localhost" ] && return 0 + [ "$1" = "[::1]" ] && return 0 [ "$1" = "$(hostname -s)" ] && return 0 [ "$1" = "$(hostname -f)" ] && return 0 [ "$1" = "$(hostname -d)" ] && return 0 @@ -105,8 +106,8 @@ SET_START_POSITION="SET GLOBAL wsrep_start_position='$WSREP_SST_OPT_GTID';" MYSQL="$MYSQL_CLIENT --defaults-extra-file=$WSREP_SST_OPT_CONF "\ -"$AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ -"--disable-reconnect --connect_timeout=10" +"$AUTH -h${WSREP_SST_OPT_HOST_UNESCAPED:-$WSREP_SST_OPT_HOST} "\ +"-P$WSREP_SST_OPT_PORT --disable-reconnect --connect_timeout=10" # need to disable logging when loading the dump # reason is that dump contains ALTER TABLE for log tables, and diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_rsync.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_rsync.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_rsync.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_rsync.sh 2017-10-19 04:25:29.000000000 +0000 @@ -57,6 +57,11 @@ local rsync_pid=$2 local rsync_port=$3 + if ! which lsof > /dev/null; then + wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed." + exit 2 # ENOENT + fi + local port_info=$(lsof -i :$rsync_port -Pn 2>/dev/null | \ grep "(LISTEN)") local is_rsync=$(echo $port_info | \ @@ -201,7 +206,8 @@ [ "$OS" == "Linux" ] && count=$(grep -c processor /proc/cpuinfo) [ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ] && count=$(sysctl -n hw.ncpu) - find . -maxdepth 1 -mindepth 1 -type d -print0 | xargs -I{} -0 -P $count \ + find . -maxdepth 1 -mindepth 1 -type d -not -name "lost+found" \ + -print0 | xargs -I{} -0 -P $count \ rsync --owner --group --perms --links --specials \ --ignore-times --inplace --recursive --delete --quiet \ $WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \ @@ -244,25 +250,24 @@ fi rm -rf "$RSYNC_PID" - ADDR=$WSREP_SST_OPT_ADDR - RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }') - if [ -z "$RSYNC_PORT" ] - then - RSYNC_PORT=4444 - ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT" - fi - trap "exit 32" HUP PIPE trap "exit 3" INT TERM ABRT trap cleanup_joiner EXIT RSYNC_CONF="$WSREP_SST_OPT_DATA/$MODULE.conf" + if [ -n "${MYSQL_TMP_DIR:-}" ] ; then + SILENT="log file = $MYSQL_TMP_DIR/rsyncd.log" + else + SILENT="" + fi + cat << EOF > "$RSYNC_CONF" pid file = $RSYNC_PID use chroot = no read only = no timeout = 300 +$SILENT [$MODULE] path = $WSREP_SST_OPT_DATA [$MODULE-log_dir] @@ -272,6 +277,7 @@ # rm -rf "$DATA"/ib_logfile* # we don't want old logs around # listen at all interfaces (for firewalled setups) + readonly RSYNC_PORT=${WSREP_SST_OPT_PORT:-4444} rsync --daemon --no-detach --port $RSYNC_PORT --config "$RSYNC_CONF" & RSYNC_REAL_PID=$! @@ -280,7 +286,7 @@ sleep 0.2 done - echo "ready $ADDR/$MODULE" + echo "ready $WSREP_SST_OPT_HOST:$RSYNC_PORT/$MODULE" # wait for SST to complete by monitoring magic file while [ ! -r "$MAGIC_FILE" ] && check_pid "$RSYNC_PID" && \ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_xtrabackup.sh.moved percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_xtrabackup.sh.moved --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_xtrabackup.sh.moved 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_xtrabackup.sh.moved 1970-01-01 00:00:00.000000000 +0000 @@ -1,705 +0,0 @@ -#!/bin/bash -ue -# Copyright (C) 2013 Percona Inc -# -# This 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; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston -# MA 02110-1301 USA. - -# Optional dependencies and options documented here: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html -# Make sure to read that before proceeding! - - - - -. $(dirname $0)/wsrep_sst_common - -ealgo="" -ekey="" -ekeyfile="" -encrypt=0 -nproc=1 -ecode=0 -XTRABACKUP_PID="" -SST_PORT="" -REMOTEIP="" -tcert="" -tpem="" -sockopt="" -progress="" -ttime=0 -totime=0 -lsn="" -incremental=0 -ecmd="" -rlimit="" - -sfmt="tar" -strmcmd="" -tfmt="" -tcmd="" -rebuild=0 -rebuildcmd="" -payload=0 -pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' " -pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " -uextra=0 - -if which pv &>/dev/null && pv --help | grep -q FORMAT;then - pvopts+=$pvformat -fi -pcmd="pv $pvopts" -declare -a RC - -INNOBACKUPEX_BIN=innobackupex -readonly AUTH=(${WSREP_SST_OPT_AUTH//:/ }) -DATA="${WSREP_SST_OPT_DATA}" -INFO_FILE="xtrabackup_galera_info" -IST_FILE="xtrabackup_ist" -MAGIC_FILE="${DATA}/${INFO_FILE}" - -# Setting the path for ss and ip -export PATH="/usr/sbin:/sbin:$PATH" - -timeit(){ - local stage=$1 - shift - local cmd="$@" - local x1 x2 took extcode - - if [[ $ttime -eq 1 ]];then - x1=$(date +%s) - wsrep_log_info "Evaluating $cmd" - eval "$cmd" - extcode=$? - x2=$(date +%s) - took=$(( x2-x1 )) - wsrep_log_info "NOTE: $stage took $took seconds" - totime=$(( totime+took )) - else - wsrep_log_info "Evaluating $cmd" - eval "$cmd" - extcode=$? - fi - return $extcode -} - -get_keys() -{ - if [[ $encrypt -eq 2 ]];then - return - fi - - if [[ $encrypt -eq 0 ]];then - if my_print_defaults -c $WSREP_SST_OPT_CONF xtrabackup | grep -q encrypt;then - wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html " - fi - return - fi - - if [[ $sfmt == 'tar' ]];then - wsrep_log_info "NOTE: Xtrabackup-based encryption - encrypt=1 - cannot be enabled with tar format" - encrypt=0 - return - fi - - wsrep_log_info "Xtrabackup based encryption enabled in my.cnf - Supported only from Xtrabackup 2.1.4" - - if [[ -z $ealgo ]];then - wsrep_log_error "FATAL: Encryption algorithm empty from my.cnf, bailing out" - exit 3 - fi - - if [[ -z $ekey && ! -r $ekeyfile ]];then - wsrep_log_error "FATAL: Either key or keyfile must be readable" - exit 3 - fi - - if [[ -z $ekey ]];then - ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key-file=$ekeyfile" - else - ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key=$ekey" - fi - - if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then - ecmd+=" -d" - fi -} - -get_transfer() -{ - if [[ -z $SST_PORT ]];then - TSST_PORT=4444 - else - TSST_PORT=$SST_PORT - fi - - if [[ $tfmt == 'nc' ]];then - if [[ ! -x `which nc` ]];then - wsrep_log_error "nc(netcat) not found in path: $PATH" - exit 2 - fi - wsrep_log_info "Using netcat as streamer" - if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then - tcmd="nc -dl ${TSST_PORT}" - else - tcmd="nc ${REMOTEIP} ${TSST_PORT}" - fi - else - tfmt='socat' - wsrep_log_info "Using socat as streamer" - if [[ ! -x `which socat` ]];then - wsrep_log_error "socat not found in path: $PATH" - exit 2 - fi - - if [[ $encrypt -eq 2 ]] && ! socat -V | grep -q OPENSSL;then - wsrep_log_info "NOTE: socat is not openssl enabled, falling back to plain transfer" - encrypt=0 - fi - - if [[ $encrypt -eq 2 ]];then - wsrep_log_info "Using openssl based encryption with socat" - if [[ -z $tpem || -z $tcert ]];then - wsrep_log_error "Both PEM and CRT files required" - exit 22 - fi - if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then - wsrep_log_info "Decrypting with PEM $tpem, CA: $tcert" - tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,cafile=${tcert}${sockopt} stdio" - else - wsrep_log_info "Encrypting with PEM $tpem, CA: $tcert" - tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,cafile=${tcert}${sockopt}" - fi - else - if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then - tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio" - else - tcmd="socat -u stdio TCP:${REMOTEIP}:${TSST_PORT}${sockopt}" - fi - fi - fi - -} - -parse_cnf() -{ - local group=$1 - local var=$2 - reval=$(my_print_defaults -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2-) - if [[ -z $reval ]];then - [[ -n $3 ]] && reval=$3 - fi - echo $reval -} - -get_footprint() -{ - pushd $WSREP_SST_OPT_DATA 1>/dev/null - payload=$(du --block-size=1 -c **/*.ibd **/*.MYI **/*.MYI ibdata1 | awk 'END { print $1 }') - if my_print_defaults -c $WSREP_SST_OPT_CONF xtrabackup | grep -q -- "--compress";then - # QuickLZ has around 50% compression ratio - # When compression/compaction used, the progress is only an approximate. - payload=$(( payload*1/2 )) - fi - popd 1>/dev/null - pcmd+=" -s $payload" - adjust_progress -} - -adjust_progress() -{ - if [[ -n $progress && $progress != '1' ]];then - if [[ -e $progress ]];then - pcmd+=" 2>>$progress" - else - pcmd+=" 2>$progress" - fi - elif [[ -z $progress && -n $rlimit ]];then - # When rlimit is non-zero - pcmd="pv -q" - fi - - if [[ -n $rlimit && "$WSREP_SST_OPT_ROLE" == "donor" ]];then - wsrep_log_info "Rate-limiting SST to $rlimit" - pcmd+=" -L \$rlimit" - fi -} - -read_cnf() -{ - sfmt=$(parse_cnf sst streamfmt "tar") - tfmt=$(parse_cnf sst transferfmt "socat") - tcert=$(parse_cnf sst tca "") - tpem=$(parse_cnf sst tcert "") - encrypt=$(parse_cnf sst encrypt 0) - sockopt=$(parse_cnf sst sockopt "") - progress=$(parse_cnf sst progress "") - rebuild=$(parse_cnf sst rebuild 0) - ttime=$(parse_cnf sst time 0) - incremental=$(parse_cnf sst incremental 0) - ealgo=$(parse_cnf xtrabackup encrypt "") - ekey=$(parse_cnf xtrabackup encrypt-key "") - ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "") - - # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html - if [[ -z $ealgo ]];then - ealgo=$(parse_cnf sst encrypt-algo "") - ekey=$(parse_cnf sst encrypt-key "") - ekeyfile=$(parse_cnf sst encrypt-key-file "") - fi - rlimit=$(parse_cnf sst rlimit "") - uextra=$(parse_cnf sst use_extra 0) -} - -get_stream() -{ - if [[ $sfmt == 'xbstream' ]];then - wsrep_log_info "Streaming with xbstream" - if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then - strmcmd="xbstream -x" - else - strmcmd="xbstream -c \${INFO_FILE} \${IST_FILE}" - fi - else - sfmt="tar" - wsrep_log_info "Streaming with tar" - if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then - strmcmd="tar xfi - --recursive-unlink -h" - else - strmcmd="tar cf - \${INFO_FILE} \${IST_FILE}" - fi - - fi -} - -get_proc() -{ - set +e - nproc=$(grep -c processor /proc/cpuinfo) - [[ -z $nproc || $nproc -eq 0 ]] && nproc=1 - set -e -} - -sig_joiner_cleanup() -{ - wsrep_log_error "Removing $MAGIC_FILE file due to signal" - rm -f "$MAGIC_FILE" -} - -cleanup_joiner() -{ - # Since this is invoked just after exit NNN - local estatus=$? - if [[ $estatus -ne 0 ]];then - wsrep_log_error "Cleanup after exit with status:$estatus" - fi - if [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then - wsrep_log_info "Removing the sst_in_progress file" - wsrep_cleanup_progress_file - fi - if [[ -n $progress && -p $progress ]];then - wsrep_log_info "Cleaning up fifo file $progress" - rm $progress - fi -} - -check_pid() -{ - local pid_file="$1" - [ -r "$pid_file" ] && ps -p $(cat "$pid_file") >/dev/null 2>&1 -} - -cleanup_donor() -{ - # Since this is invoked just after exit NNN - local estatus=$? - if [[ $estatus -ne 0 ]];then - wsrep_log_error "Cleanup after exit with status:$estatus" - fi - - if [[ -n $XTRABACKUP_PID ]];then - if check_pid $XTRABACKUP_PID - then - wsrep_log_error "xtrabackup process is still running. Killing... " - kill_xtrabackup - fi - - rm -f $XTRABACKUP_PID - fi - rm -f ${DATA}/${IST_FILE} - - if [[ -n $progress && -p $progress ]];then - wsrep_log_info "Cleaning up fifo file $progress" - rm $progress - fi -} - -kill_xtrabackup() -{ - local PID=$(cat $XTRABACKUP_PID) - [ -n "$PID" -a "0" != "$PID" ] && kill $PID && (kill $PID && kill -9 $PID) || : - rm -f "$XTRABACKUP_PID" -} - -setup_ports() -{ - if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then - SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }') - REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }') - lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }') - else - SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') - fi -} - -# waits ~10 seconds for nc to open the port and then reports ready -# (regardless of timeout) -wait_for_listen() -{ - local PORT=$1 - local ADDR=$2 - local MODULE=$3 - for i in {1..50} - do - ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break - sleep 0.2 - done - if [[ $incremental -eq 1 ]];then - echo "ready ${ADDR}/${MODULE}/$lsn" - else - echo "ready ${ADDR}/${MODULE}" - fi -} - -check_extra() -{ - if [[ $uextra -eq 1 ]];then - if my_print_defaults -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--thread-handling=" | grep -q 'pool-of-threads';then - local eport=$(my_print_defaults -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--extra-port=" | cut -d= -f2) - if [[ -n $eport ]];then - # Xtrabackup works only locally. - # Hence, setting host to 127.0.0.1 unconditionally. - wsrep_log_info "SST through extra_port $eport" - INNOEXTRA+=" --host=127.0.0.1 --port=$eport " - else - wsrep_log_error "Extra port $eport null, failing" - exit 1 - fi - else - wsrep_log_info "Thread pool not set, ignore the option use_extra" - fi - fi -} - -if [[ ! -x `which innobackupex` ]];then - wsrep_log_error "innobackupex not in path: $PATH" - exit 2 -fi - -rm -f "${MAGIC_FILE}" - -if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then - wsrep_log_error "Invalid role ${WSREP_SST_OPT_ROLE}" - exit 22 -fi - -read_cnf -setup_ports -get_stream -get_transfer - -INNOEXTRA="" -INNOAPPLY="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log" -INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} \$INNOEXTRA --galera-info --stream=\$sfmt \${TMPDIR} 2>\${DATA}/innobackup.backup.log" - -if [ "$WSREP_SST_OPT_ROLE" = "donor" ] -then - trap cleanup_donor EXIT - - if [ $WSREP_SST_OPT_BYPASS -eq 0 ] - then - TMPDIR="${TMPDIR:-/tmp}" - - if [ "${AUTH[0]}" != "(null)" ]; then - INNOEXTRA+=" --user=${AUTH[0]}" - fi - - if [ ${#AUTH[*]} -eq 2 ]; then - INNOEXTRA+=" --password=${AUTH[1]}" - elif [ "${AUTH[0]}" != "(null)" ]; then - # Empty password, used for testing, debugging etc. - INNOEXTRA+=" --password=" - fi - - get_keys - if [[ $encrypt -eq 1 ]];then - if [[ -n $ekey ]];then - INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey " - else - INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile " - fi - fi - - if [[ -n $lsn ]];then - INNOEXTRA+=" --incremental --incremental-lsn=$lsn " - fi - - check_extra - - wsrep_log_info "Streaming the backup to joiner at ${REMOTEIP} ${SST_PORT}" - - if [[ -n $progress ]];then - get_footprint - tcmd="$pcmd | $tcmd" - elif [[ -n $rlimit ]];then - adjust_progress - tcmd="$pcmd | $tcmd" - fi - - set +e - timeit "Donor-Transfer" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )" - set -e - - if [ ${RC[0]} -ne 0 ]; then - wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \ - "Check ${DATA}/innobackup.backup.log" - exit 22 - elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then - wsrep_log_error "$tcmd finished with error: ${RC[1]}" - exit 22 - fi - - # innobackupex implicitly writes PID to fixed location in ${TMPDIR} - XTRABACKUP_PID="${TMPDIR}/xtrabackup_pid" - - - else # BYPASS FOR IST - - wsrep_log_info "Bypassing the SST for IST" - STATE="${WSREP_SST_OPT_GTID}" - echo "continue" # now server can resume updating data - echo "${STATE}" > "${MAGIC_FILE}" - echo "1" > "${DATA}/${IST_FILE}" - get_keys - pushd ${DATA} 1>/dev/null - set +e - if [[ $encrypt -eq 1 ]];then - tcmd=" $ecmd | $tcmd" - fi - timeit "Donor-IST-Unencrypted-transfer" "$strmcmd | $tcmd; RC=( "\${PIPESTATUS[@]}" )" - set -e - popd 1>/dev/null - - for ecode in "${RC[@]}";do - if [[ $ecode -ne 0 ]];then - wsrep_log_error "Error while streaming data to joiner node: " \ - "exit codes: ${RC[@]}" - exit 1 - fi - done - fi - - echo "done ${WSREP_SST_OPT_GTID}" - wsrep_log_info "Total time on donor: $totime seconds" - -elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ] -then - [[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE" - touch $SST_PROGRESS_FILE - - if [[ ! -e ${DATA}/ibdata1 ]];then - incremental=0 - fi - - if [[ $incremental -eq 1 ]];then - wsrep_log_info "Incremental SST enabled" - #lsn=$(/pxc/bin/mysqld --defaults-file=$WSREP_SST_OPT_CONF --basedir=/pxc --wsrep-recover 2>&1 | grep -o 'log sequence number .*' | cut -d " " -f 4 | head -1) - lsn=$(grep to_lsn xtrabackup_checkpoints | cut -d= -f2 | tr -d ' ') - wsrep_log_info "Recovered LSN: $lsn" - fi - - sencrypted=1 - nthreads=1 - - MODULE="xtrabackup_sst" - - # May need xtrabackup_checkpoints later on - rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info ${DATA}/xtrabackup_logfile - - ADDR=${WSREP_SST_OPT_ADDR} - if [ -z "${SST_PORT}" ] - then - SST_PORT=4444 - ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" - fi - - wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} & - - trap sig_joiner_cleanup HUP PIPE INT TERM - trap cleanup_joiner EXIT - - if [[ -n $progress ]];then - adjust_progress - tcmd+=" | $pcmd" - fi - - if [[ $incremental -eq 1 ]];then - BDATA=$DATA - DATA=$(mktemp -d) - MAGIC_FILE="${DATA}/${INFO_FILE}" - fi - - get_keys - set +e - if [[ $encrypt -eq 1 && $sencrypted -eq 1 ]];then - strmcmd=" $ecmd | $strmcmd" - fi - - pushd ${DATA} 1>/dev/null - timeit "Joiner-Recv-Unencrypted" "$tcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )" - popd 1>/dev/null - - set -e - - if [[ $sfmt == 'xbstream' ]];then - # Special handling till lp:1193240 is fixed" - if [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then - wsrep_log_error "Xbstream failed" - wsrep_log_error "Data directory ${DATA} may not be empty: lp:1193240" \ - "Manual intervention required in that case" - exit 32 - fi - fi - - wait %% # join for wait_for_listen thread - - for ecode in "${RC[@]}";do - if [[ $ecode -ne 0 ]];then - wsrep_log_error "Error while getting data from donor node: " \ - "exit codes: ${RC[@]}" - exit 32 - fi - done - - if [ ! -r "${MAGIC_FILE}" ] - then - # this message should cause joiner to abort - wsrep_log_error "xtrabackup process ended without creating '${MAGIC_FILE}'" - wsrep_log_info "Contents of datadir" - wsrep_log_info "$(ls -l ${DATA}/**/*)" - exit 32 - fi - - if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null - then - wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." - exit 32 - fi - - if [ ! -r "${DATA}/${IST_FILE}" ] - then - wsrep_log_info "Proceeding with SST" - wsrep_log_info "Removing existing ib_logfile files" - if [[ $incremental -ne 1 ]];then - rm -f ${DATA}/ib_logfile* - else - rm -f ${BDATA}/ib_logfile* - fi - - get_proc - - # Rebuild indexes for compact backups - if grep -q 'compact = 1' ${DATA}/xtrabackup_checkpoints;then - wsrep_log_info "Index compaction detected" - rebuild=1 - fi - - if [[ $rebuild -eq 1 ]];then - nthreads=$(parse_cnf xtrabackup rebuild-threads $nproc) - wsrep_log_info "Rebuilding during prepare with $nthreads threads" - rebuildcmd="--rebuild-indexes --rebuild-threads=$nthreads" - fi - - if test -n "$(find ${DATA} -maxdepth 1 -type f -name '*.qp' -print -quit)";then - - wsrep_log_info "Compressed qpress files found" - - if [[ ! -x `which qpress` ]];then - wsrep_log_error "qpress not found in path: $PATH" - exit 22 - fi - - if [[ -n $progress ]] && pv --help | grep -q 'line-mode';then - count=$(find ${DATA} -type f -name '*.qp' | wc -l) - count=$(( count*2 )) - if pv --help | grep -q FORMAT;then - pvopts="-f -s $count -l -N Decompression -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'" - else - pvopts="-f -s $count -l -N Decompression" - fi - pcmd="pv $pvopts" - adjust_progress - dcmd="$pcmd | xargs -n 2 qpress -T${nproc}d" - else - dcmd="xargs -n 2 qpress -T${nproc}d" - fi - - wsrep_log_info "Removing existing ibdata1 file" - rm -f ${DATA}/ibdata1 - - # Decompress the qpress files - wsrep_log_info "Decompression with $nproc threads" - timeit "Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd" - extcode=$? - - if [[ $extcode -eq 0 ]];then - wsrep_log_info "Removing qpress files after decompression" - find ${DATA} -type f -name '*.qp' -delete - if [[ $? -ne 0 ]];then - wsrep_log_error "Something went wrong with deletion of qpress files. Investigate" - fi - else - wsrep_log_error "Decompression failed. Exit code: $extcode" - exit 22 - fi - fi - - if [[ $incremental -eq 1 ]];then - # Added --ibbackup=xtrabackup_55 because it fails otherwise citing connection issues. - INNOAPPLY="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} \ - --ibbackup=xtrabackup_55 --apply-log $rebuildcmd --redo-only $BDATA --incremental-dir=${DATA} &>>${BDATA}/innobackup.prepare.log" - fi - - wsrep_log_info "Preparing the backup at ${DATA}" - timeit "Xtrabackup prepare stage" "$INNOAPPLY" - - if [[ $incremental -eq 1 ]];then - wsrep_log_info "Cleaning up ${DATA} after incremental SST" - [[ -d ${DATA} ]] && rm -rf ${DATA} - DATA=$BDATA - fi - - if [ $? -ne 0 ]; - then - wsrep_log_error "${INNOBACKUPEX_BIN} finished with errors. Check ${DATA}/innobackup.prepare.log" - exit 22 - fi - else - wsrep_log_info "${IST_FILE} received from donor: Running IST" - fi - - cat "${MAGIC_FILE}" # output UUID:seqno - wsrep_log_info "Total time on joiner: $totime seconds" -fi - -exit 0 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_xtrabackup-v2.sh percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_xtrabackup-v2.sh --- percona-xtradb-cluster-5.6-5.6.34-26.19/scripts/wsrep_sst_xtrabackup-v2.sh 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/scripts/wsrep_sst_xtrabackup-v2.sh 2017-10-19 04:25:29.000000000 +0000 @@ -31,13 +31,13 @@ ecode=0 ssyslog="" ssystag="" -XTRABACKUP_PID="" SST_PORT="" REMOTEIP="" tca="" tcert="" tkey="" sockopt="" +ncsockopt="" progress="" ttime=0 totime=0 @@ -60,13 +60,19 @@ payload=0 pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' " pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " -STATDIR="" + uextra=0 disver="" -tmpopts="" +# Root directory for temporary files. This directory (and everything in it) +# will be removed upon exit. +tmpdirbase="" + +# tmpdir used as target-dir for xtrabackup by the donor itmpdir="" -xtmpdir="" + +# tmpdir used by the joiner +STATDIR="" scomp="" sdecomp="" @@ -91,8 +97,16 @@ DATA="${WSREP_SST_OPT_DATA}" INFO_FILE="xtrabackup_galera_info" IST_FILE="xtrabackup_ist" + +# This is the full path to the galera GTID info +# This is emitted by XtraBackup (for SST) or passed to us (for IST) MAGIC_FILE="${DATA}/${INFO_FILE}" +# Used to send a file containing info about the SST +# Extend this if you want to send additional information +# from the donor to the joiner +SST_INFO_FILE="sst_info" + # Setting the path for ss and ip export PATH="/usr/sbin:/sbin:$PATH" @@ -273,12 +287,13 @@ wsrep_log_info "Using netcat as streamer" if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then if nc -h 2>&1 | grep -q ncat; then - tcmd="nc -l ${TSST_PORT}" + tcmd="nc $ncsockopt -l ${TSST_PORT}" else - tcmd="nc -dl ${TSST_PORT}" + tcmd="nc $ncsockopt -dl ${TSST_PORT}" fi else - tcmd="nc ${REMOTEIP} ${TSST_PORT}" + # netcat doesn't understand [] around IPv6 address + tcmd="nc ${REMOTEIP//[\[\]]/} ${TSST_PORT}" fi else tfmt='socat' @@ -325,6 +340,11 @@ fi fi + # prepend a comma if it's not already there + if [[ -n "${sockopt}" ]] && [[ "${sockopt}" != ","* ]]; then + sockopt=",${sockopt}" + fi + if [[ $encrypt -eq 2 ]]; then wsrep_log_warning "**** WARNING **** encrypt=2 is deprecated and will be removed in a future release" wsrep_log_info "Using openssl based encryption with socat: with crt and ca" @@ -447,6 +467,7 @@ tkey=$(parse_cnf sst tkey "") encrypt=$(parse_cnf sst encrypt 0) sockopt=$(parse_cnf sst sockopt "") + ncsockopt=$(parse_cnf sst ncsockopt "") progress=$(parse_cnf sst progress "") rebuild=$(parse_cnf sst rebuild 0) ttime=$(parse_cnf sst time 0) @@ -479,6 +500,8 @@ ssl_key=$(parse_cnf mysqld ssl-key "") fi + ssl_dhparams=$(parse_cnf sst ssl-dhparams "") + rlimit=$(parse_cnf sst rlimit "") uextra=$(parse_cnf sst use-extra 0) iopts=$(parse_cnf sst inno-backup-opts "") @@ -494,8 +517,37 @@ ssyslog=1 fi fi + + # Pull out the buffer pool size to be used by PXB + # and set it in use-memory (if not specified in inno-apply-opts) + # + # Is the use-memory option already specified in inno-apply-opts? + if ! [[ "$iapts" =~ --use-memory= ]]; then + bufferpoolsize=$(parse_cnf xtrabackup use-memory "") + if [[ -z "$bufferpoolsize" ]]; then + bufferpoolsize=$(parse_cnf mysqld innodb-buffer-pool-size "") + fi + if [[ -z "$bufferpoolsize" ]]; then + bufferpoolsize=$(parse_cnf mysqld innodb_buffer_pool_size "") + fi + if [[ -n "$bufferpoolsize" ]]; then + iapts="$iapts --use-memory=$bufferpoolsize" + fi + fi + + # Retry the connection 30 times (at 1-second intervals) + if [[ ! "$sockopt" =~ retry= ]]; then + sockopt+=",retry=30" + fi + } +# +# Fills in strmcmd, which holds the command used for streaming +# +# Note: +# This code creates a command that uses FILE_TO_STREAM +# get_stream() { if [[ $sfmt == 'xbstream' ]];then @@ -503,7 +555,7 @@ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then strmcmd="xbstream -x" else - strmcmd="xbstream -c \${INFO_FILE}" + strmcmd="xbstream -c \${FILE_TO_STREAM}" fi else sfmt="tar" @@ -511,7 +563,7 @@ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then strmcmd="tar xfi - " else - strmcmd="tar cf - \${INFO_FILE} " + strmcmd="tar cf - \${FILE_TO_STREAM} " fi fi @@ -545,8 +597,8 @@ wsrep_log_info "Cleaning up fifo file $progress" rm $progress fi - if [[ -n ${STATDIR:-} ]];then - [[ -d $STATDIR ]] && rm -rf $STATDIR + if [[ -n "${tmpdirbase}" ]]; then + [[ -d "${tmpdirbase}" ]] && rm -rf "${tmpdirbase}" || true fi # Final cleanup @@ -567,12 +619,6 @@ exit $estatus } -check_pid() -{ - local pid_file="$1" - [ -r "$pid_file" ] && ps -p $(cat "$pid_file") >/dev/null 2>&1 -} - cleanup_donor() { # Since this is invoked just after exit NNN @@ -581,14 +627,6 @@ wsrep_log_error "Cleanup after exit with status:$estatus" fi - if [[ -n ${XTRABACKUP_PID:-} ]];then - if check_pid $XTRABACKUP_PID - then - wsrep_log_error "xtrabackup process is still running. Killing... " - kill_xtrabackup - fi - - fi rm -f ${DATA}/${IST_FILE} || true if [[ -n $progress && -p $progress ]];then @@ -598,12 +636,8 @@ wsrep_log_info "Cleaning up temporary directories" - if [[ -n $xtmpdir ]];then - [[ -d $xtmpdir ]] && rm -rf $xtmpdir || true - fi - - if [[ -n $itmpdir ]];then - [[ -d $itmpdir ]] && rm -rf $itmpdir || true + if [[ -n "${tmpdirbase}" ]]; then + [[ -d "${tmpdirbase}" ]] && rm -rf "${tmpdirbase}" || true fi # Final cleanup @@ -625,39 +659,33 @@ } -kill_xtrabackup() -{ - local PID=$(cat $XTRABACKUP_PID) - [ -n "$PID" -a "0" != "$PID" ] && kill $PID && (kill $PID && kill -9 $PID) || : - wsrep_log_info "Removing xtrabackup pid file $XTRABACKUP_PID" - rm -f "$XTRABACKUP_PID" || true -} - setup_ports() { if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then - SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }') - REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }') - lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }') - sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }') + SST_PORT=$WSREP_SST_OPT_PORT + REMOTEIP=$WSREP_SST_OPT_HOST + lsn=$(echo $WSREP_SST_OPT_PATH | awk -F '[/]' '{ print $2 }') + sst_ver=$(echo $WSREP_SST_OPT_PATH | awk -F '[/]' '{ print $3 }') else - SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') + SST_PORT=$WSREP_SST_OPT_PORT fi } -# waits ~10 seconds for nc to open the port and then reports ready +# waits ~1 minute for nc/socat to open the port and then reports ready # (regardless of timeout) wait_for_listen() { - local PORT=$1 - local ADDR=$2 + local HOST=$1 + local PORT=$2 local MODULE=$3 - for i in {1..50} + + for i in {1..300} do ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break sleep 0.2 done - echo "ready ${ADDR}/${MODULE}//$sst_ver" + + echo "ready ${HOST}:${PORT}/${MODULE}//$sst_ver" } check_extra() @@ -738,6 +766,13 @@ } +# +# Send data from the donor to the joiner +# +# Parameters: +# 1 : dir - the base directory (paths are based on this) +# 2 : msg - descriptive message +# send_donor() { local dir=$1 @@ -783,7 +818,7 @@ # Compares two version strings # The first parameter is the version to be checked # The second parameter is the minimum version required -# Returns 1 (failure) if $1 >= $2, 0 (success) otherwise +# Returns 0 (success) if $1 >= $2, 1 (failure) otherwise check_for_version() { local local_version_str="$( normalize_version $1 )" @@ -796,6 +831,84 @@ fi } +# +# Initiailizes the tmpdir +# Reads the info from the config file and creates the tmpdir as needed. +# +# Sets the $tmpdirbase variable to the root of the temporary directory +# to be used by SST. This directory will be removed upon exiting the script. +# +initialize_tmpdir() +{ + local tmpdir_path="" + + tmpdir_path=$(parse_cnf sst tmpdir "") + if [[ -z "${tmpdir_path}" ]]; then + tmpdir_path=$(parse_cnf xtrabackup tmpdir "") + fi + if [[ -z "${tmpdir_path}" ]]; then + tmpdir_path=$(parse_cnf mysqld tmpdir "") + fi + if [[ -n "${tmpdir_path}" ]]; then + if [[ ! -d "${tmpdir_path}" ]]; then + wsrep_log_error "Cannot find the directory, ${tmpdir_path}, the tmpdir must exist before startup." + exit 2 + fi + if [[ ! -r "${tmpdir_path}" ]]; then + wsrep_log_error "The temporary directory, ${tmpdir_path}, is not readable. Please check the directory permissions." + exit 22 + fi + if [[ ! -w "${tmpdir_path}" ]]; then + wsrep_log_error "The temporary directory, ${tmpdir_path}, is not writable. Please check the directory permissions." + exit 22 + fi + fi + + if [[ -z "${tmpdir_path}" ]]; then + tmpdir_path=$(mktemp -dt pxc_sst_XXXXXXXX) + else + tmpdir_path=$(mktemp -p "${tmpdir_path}" -dt pxc_sst_XXXXXXXX) + fi + + # This directory (and everything in it), will be removed upon exit + tmpdirbase=$tmpdir_path +} + + +# +# Parses the passed in config file and returns the option in the +# specified group. +# +# 1st param: source_path : path the the source file +# 2nd param: group : name of the config file section, e.g. mysqld +# 3rd param: var : name of the variable in the section, e.g. server-id +# 4th param: - : default value for the param +# +parse_sst_info() +{ + local source_path=$1 + local group=$2 + local var=$3 + local reval="" + + # print the default settings for given group using my_print_default. + # normalize the variable names specified in cnf file (user can use _ or - + # for example log-bin or log_bin) then grep for needed variable + # finally get the variable value (if variables has been specified + # multiple time use the last value only) + + reval=$($MY_PRINT_DEFAULTS -c "$source_path" $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1) + + # use default if we haven't found a value + if [[ -z $reval ]]; then + [[ -n $4 ]] && reval=$4 + fi + + echo $reval +} + + + if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then wsrep_log_error "innobackupex not in path: $PATH" @@ -817,6 +930,8 @@ exit 2 fi +# Get our MySQL version +MYSQL_VERSION=$($(dirname $0)/mysqld --version 2>&1 | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1) rm -f "${MAGIC_FILE}" @@ -855,20 +970,25 @@ logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@" } + wsrep_log_warning() + { + logger -p daemon.warn -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@" + } + wsrep_log_info() { logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@" } INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply " - INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $impts --datadir=${DATA} --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move " - INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)" + INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $impts --datadir=${DATA} --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move " + INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $iopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)" fi else INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log" - INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $impts --datadir=${DATA} --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log" - INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log" + INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $impts --datadir=${DATA} --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log" + INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $iopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log" fi get_stream @@ -878,6 +998,25 @@ then trap cleanup_donor EXIT + initialize_tmpdir + + # main temp directory for SST (non-XB) related files + donor_tmpdir=$(mktemp -p "${tmpdirbase}" -dt donor_tmp_XXXXXXXX) + + # Create the SST info file + # This file contains SST information that is passed from the + # donor to the joiner. + # + # Add more parameters to the file here as needed + # This file has the same format as a cnf file. + # + sst_info_file_path="${donor_tmpdir}/${SST_INFO_FILE}" + echo "[sst]" > "$sst_info_file_path" + echo "galera-gtid=$WSREP_SST_OPT_GTID" >> "$sst_info_file_path" + echo "binlog-name=$(basename "$WSREP_SST_OPT_BINLOG")" >> "$sst_info_file_path" + echo "mysql-version=$MYSQL_VERSION" >> "$sst_info_file_path" + + if [ $WSREP_SST_OPT_BYPASS -eq 0 ] then usrst=0 @@ -887,14 +1026,8 @@ exit 93 fi - if [[ -z $(parse_cnf mysqld tmpdir "") && -z $(parse_cnf xtrabackup tmpdir "") ]];then - xtmpdir=$(mktemp -d) - tmpopts=" --tmpdir=$xtmpdir " - wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory" - fi - - itmpdir=$(mktemp -d) - wsrep_log_info "Using $itmpdir as innobackupex temporary directory" + # main temp directory for xtrabackup (target-dir) + itmpdir=$(mktemp -p "${tmpdirbase}" -dt donor_xb_XXXXXXXX) if [[ -n "${WSREP_SST_OPT_USER:-}" && "$WSREP_SST_OPT_USER" != "(null)" ]]; then INNOEXTRA+=" --user=$WSREP_SST_OPT_USER" @@ -911,10 +1044,6 @@ get_keys check_extra - wsrep_log_info "Streaming GTID file before SST" - - echo "${WSREP_SST_OPT_GTID}" > "${MAGIC_FILE}" - ttcmd="$tcmd" if [[ $encrypt -eq 1 ]];then @@ -927,7 +1056,11 @@ tcmd=" $scomp | $tcmd " fi - send_donor $DATA "${stagemsg}-gtid" + # Before the real SST,send the sst-info + wsrep_log_info "Streaming SST meta-info file before SST" + + FILE_TO_STREAM=$SST_INFO_FILE + send_donor "$donor_tmpdir" "${stagemsg}-sst-info" # Restore the transport commmand to its original state tcmd="$ttcmd" @@ -967,16 +1100,11 @@ exit 22 fi - # innobackupex implicitly writes PID to fixed location in $xtmpdir - XTRABACKUP_PID="$xtmpdir/xtrabackup_pid" - - else # BYPASS FOR IST wsrep_log_info "Bypassing the SST for IST" echo "continue" # now server can resume updating data - echo "${WSREP_SST_OPT_GTID}" > "${MAGIC_FILE}" - echo "1" > "${DATA}/${IST_FILE}" + echo "1" > "${donor_tmpdir}/${IST_FILE}" get_keys if [[ $encrypt -eq 1 ]];then if [[ -n $scomp ]];then @@ -989,7 +1117,8 @@ fi strmcmd+=" \${IST_FILE}" - send_donor $DATA "${stagemsg}-IST" + FILE_TO_STREAM=$SST_INFO_FILE + send_donor "$donor_tmpdir" "${stagemsg}-IST" fi @@ -1017,14 +1146,7 @@ # May need xtrabackup_checkpoints later on rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info ${DATA}/xtrabackup_logfile - ADDR=${WSREP_SST_OPT_ADDR} - if [ -z "${SST_PORT}" ] - then - SST_PORT=4444 - ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" - fi - - wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} & + wait_for_listen ${WSREP_SST_OPT_HOST} ${WSREP_SST_OPT_PORT:-4444} ${MODULE} & trap sig_joiner_cleanup HUP PIPE INT TERM trap cleanup_joiner EXIT @@ -1045,10 +1167,65 @@ strmcmd=" $sdecomp | $strmcmd" fi - STATDIR=$(mktemp -d) - MAGIC_FILE="${STATDIR}/${INFO_FILE}" - recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1 + initialize_tmpdir + STATDIR=$(mktemp -p "${tmpdirbase}" -dt joiner_XXXXXXXX) + + sst_file_info_path="${STATDIR}/${SST_INFO_FILE}" + + recv_joiner $STATDIR "${stagemsg}-sst-info" $stimeout -1 + # + # Determine which file was received, the GTID or the SST_INFO + # + if [[ -r "${STATDIR}/${SST_INFO_FILE}" ]]; then + # + # Extract information from the sst-info file that was just received + # + MAGIC_FILE="${STATDIR}/${INFO_FILE}" + echo $(parse_sst_info "$sst_file_info_path" sst galera-gtid "") > "$MAGIC_FILE" + + DONOR_BINLOGNAME=$(parse_sst_info "$sst_file_info_path" sst binlog-name "") + DONOR_MYSQL_VERSION=$(parse_sst_info "$sst_file_info_path" sst mysql-version "") + + elif [[ -r "${STATDIR}/${INFO_FILE}" ]]; then + # + # For compatibility, we have received the gtid file + # + MAGIC_FILE="${STATDIR}/${INFO_FILE}" + + DONOR_BINLOGNAME="" + DONOR_MYSQL_VERSION="" + + else + wsrep_log_error "Did not receive expected file from donor: '${SST_INFO_FILE}' or '${INFO_FILE}'" + exit 32 + fi + + if [[ -n "$DONOR_MYSQL_VERSION" ]]; then + local_version_str="" + donor_version_str="" + + # Truncate the version numbers (we want the major.minor version like "5.6", not "5.6.35-...") + local_version_str=$(expr match "$MYSQL_VERSION" '\([0-9]\+\.[0-9]\+\)') + donor_version_str=$(expr match "$DONOR_MYSQL_VERSION" '\([0-9]\+\.[0-9]\+\)') + + # Is this node's pxc version < donor's pxc version? + if ! check_for_version $local_version_str $donor_version_str; then + wsrep_log_error "FATAL: PXC is receiving an SST from a node with a higher version." + wsrep_log_error "This node's PXC version is $local_version_str. The donor's PXC version is $donor_version_str." + wsrep_log_error "Upgrade this node before joining the cluster." + exit 2 + fi + + # Is the donor's pxc version < this node's pxc version? + if ! check_for_version $donor_version_str $local_version_str; then + wsrep_log_warning "WARNING: PXC is receiving an SST from a node with a lower version." + wsrep_log_warning "This node's PXC version is $local_version_str. The donor's PXC version is $donor_version_str." + wsrep_log_warning "Run mysql_upgrade in non-cluster (standalone mode) to upgrade." + wsrep_log_warning "Check the upgrade process here:" + wsrep_log_warning " https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/upgrade_guide.html" + fi + fi if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null then @@ -1072,15 +1249,17 @@ wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories" find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -regex $cpat -prune -o -exec rm -rfv {} 1>&2 \+ + # Clean the binlog dir (if it's explicitly specified) + # By default it'll be in the datadir tempdir=$(parse_cnf mysqld log-bin "") - if [[ -n ${tempdir:-} ]];then - binlog_dir=$(dirname $tempdir) - binlog_file=$(basename $tempdir) - if [[ -n ${binlog_dir:-} && $binlog_dir != '.' && $binlog_dir != $DATA ]];then + if [[ -n "$tempdir" ]]; then + binlog_dir=$(dirname "$tempdir") + binlog_file=$(basename "$tempdir") + if [[ -n ${binlog_dir:-} && "$binlog_dir" != '.' && "$binlog_dir" != "$DATA" ]];then pattern="$binlog_dir/$binlog_file\.[0-9]+$" wsrep_log_info "Cleaning the binlog directory $binlog_dir as well" find $binlog_dir -maxdepth 1 -type f -regex $pattern -exec rm -fv {} 1>&2 \+ || true - rm $binlog_dir/*.index || true + rm -f $binlog_dir/*.index || true fi fi @@ -1156,17 +1335,30 @@ fi - if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then + if [[ -n "$WSREP_SST_OPT_BINLOG" && -n "$DONOR_BINLOGNAME" ]]; then - BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG) - BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG) + binlog_dir=$(dirname "$WSREP_SST_OPT_BINLOG") + binlog_file=$(basename "$WSREP_SST_OPT_BINLOG") + donor_binlog_file=$DONOR_BINLOGNAME + + # rename the donor binlog to the name of the binlogs on the joiner + if [[ "$binlog_file" != "$donor_binlog_file" ]]; then + pushd "$DATA" &>/dev/null + for f in $donor_binlog_file.*; do + if [[ ! -e "$f" ]]; then continue; fi + f_new=$(echo $f | sed "s/$donor_binlog_file/$binlog_file/") + mv "$f" "$f_new" 2>/dev/null || true + done + popd &> /dev/null + fi # To avoid comparing data directory and BINLOG_DIRNAME - mv $DATA/${BINLOG_FILENAME}.* $BINLOG_DIRNAME/ 2>/dev/null || true + mv $DATA/${binlog_file}.* "$binlog_dir"/ 2>/dev/null || true - pushd $BINLOG_DIRNAME &>/dev/null - for bfiles in $(ls -1 ${BINLOG_FILENAME}.*);do - echo ${BINLOG_DIRNAME}/${bfiles} >> ${BINLOG_FILENAME}.index + pushd "$binlog_dir" &>/dev/null + for bfiles in $binlog_file.*; do + if [[ ! -e "$bfiles" ]]; then continue; fi + echo ${binlog_dir}/${bfiles} >> ${binlog_file}.index done popd &> /dev/null diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/binlog.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/binlog.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/binlog.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/binlog.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -92,6 +92,11 @@ static int binlog_clone_consistent_snapshot(handlerton *hton, THD *thd, THD *from_thd); +// The last published global binlog position +static char binlog_global_snapshot_file[FN_REFLEN]; +static ulonglong binlog_global_snapshot_position; + +// Binlog position variables for SHOW STATUS static char binlog_snapshot_file[FN_REFLEN]; static ulonglong binlog_snapshot_position; @@ -1230,6 +1235,9 @@ gtid_before_write_cache(thd, cache_data)) goto err; +#ifdef WITH_WSREP + if (WSREP_ON && thd->slave_thread) thd->wsrep_replicate_GTID= true; +#endif /* WITH_WSREP */ ret= mysql_bin_log.commit(thd, true); err: @@ -1537,7 +1545,12 @@ { DBUG_ENTER("binlog_rollback"); int error= 0; +#ifdef WITH_WSREP + if (thd->lex->sql_command == SQLCOM_ROLLBACK_TO_SAVEPOINT && + thd->wsrep_conflict_state != ABORTING) +#else if (thd->lex->sql_command == SQLCOM_ROLLBACK_TO_SAVEPOINT) +#endif error= mysql_bin_log.rollback(thd, all); DBUG_RETURN(error); } @@ -1730,7 +1743,12 @@ the caches since this function is called as part of the engine rollback. */ +#ifdef WITH_WSREP + if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT || + thd->wsrep_conflict_state == ABORTING) +#else if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT) +#endif /* WITH_WSREP */ { /* Reset binlog_snapshot_% variables for the current connection so that the @@ -2676,7 +2694,8 @@ if (inited) { inited= 0; - close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT); + close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT, true /*need_lock_log=true*/, + true /*need_lock_index=true*/); mysql_mutex_destroy(&LOCK_log); mysql_mutex_destroy(&LOCK_index); mysql_mutex_destroy(&LOCK_commit); @@ -2714,8 +2733,13 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg, const char *log_name, bool need_lock_index) { + bool error= false; File index_file_nr= -1; - DBUG_ASSERT(!my_b_inited(&index_file)); + + if (need_lock_index) + mysql_mutex_lock(&LOCK_index); + else + mysql_mutex_assert_owner(&LOCK_index); /* First open of this class instance @@ -2723,6 +2747,10 @@ Add new entries to the end of it. */ myf opt= MY_UNPACK_FILENAME; + + if (my_b_inited(&index_file)) + goto end; + if (!index_file_name_arg) { index_file_name_arg= log_name; // Use same basename for index file @@ -2734,7 +2762,8 @@ if (set_crash_safe_index_file_name(index_file_name_arg)) { sql_print_error("MYSQL_BIN_LOG::set_crash_safe_index_file_name failed."); - return TRUE; + error= true; + goto end; } /* @@ -2748,7 +2777,8 @@ { sql_print_error("MYSQL_BIN_LOG::open_index_file failed to " "move crash_safe_index_file to index file."); - return TRUE; + error= true; + goto end; } if ((index_file_nr= mysql_file_open(m_key_file_log_index, @@ -2770,7 +2800,8 @@ */ if (index_file_nr >= 0) mysql_file_close(index_file_nr, MYF(0)); - return TRUE; + error= true; + goto end; } #ifdef HAVE_REPLICATION @@ -2784,17 +2815,20 @@ if (set_purge_index_file_name(index_file_name_arg) || open_purge_index_file(FALSE) || - purge_index_entry(NULL, NULL, need_lock_index) || + purge_index_entry(NULL, NULL, false) || close_purge_index_file() || DBUG_EVALUATE_IF("fault_injection_recovering_index", 1, 0)) { sql_print_error("MYSQL_BIN_LOG::open_index_file failed to sync the index " "file."); - return TRUE; + error= TRUE; + goto end; } #endif - - return FALSE; +end: + if (need_lock_index) + mysql_mutex_unlock(&LOCK_index); + return error; } @@ -3356,11 +3390,11 @@ enum cache_type io_cache_type_arg, ulong max_size_arg, bool null_created_arg, + bool need_lock_log, bool need_lock_index, bool need_sid_lock, Format_description_log_event *extra_description_event) { - File file= -1; // lock_index must be acquired *before* sid_lock. DBUG_ASSERT(need_sid_lock || !need_lock_index); @@ -3572,13 +3606,7 @@ purge_index_entry(NULL, NULL, need_lock_index); close_purge_index_file(); #endif - if (file >= 0) - mysql_file_close(file, MYF(0)); - end_io_cache(&log_file); - end_io_cache(&index_file); - my_free(name); - name= NULL; - log_state= LOG_CLOSED; + if (binlog_error_action == ABORT_SERVER) { exec_binlog_error_action_abort("Either disk is full or file system is read " @@ -3586,10 +3614,14 @@ " server."); } else + { sql_print_error("Could not use %s for logging (error %d). " "Turning logging off for the whole duration of the MySQL " "server process. To turn it on again: fix the cause, " - "shutdown the MySQL server and restart it.", name, errno); + "shutdown the MySQL server and restart it.", + (new_name) ? new_name : name, errno); + close(LOG_CLOSE_INDEX, need_lock_log, need_lock_index); + } DBUG_RETURN(1); } @@ -3873,6 +3905,12 @@ else mysql_mutex_assert_owner(&LOCK_index); + if (!my_b_inited(&index_file)) + { + error= LOG_INFO_IO; + goto end; + } + // extend relative paths for log_name to be searched if (log_name) { @@ -3965,6 +4003,11 @@ else mysql_mutex_assert_owner(&LOCK_index); + if (!my_b_inited(&index_file)) + { + error= LOG_INFO_IO; + goto err; + } /* As the file is flushed, we can't get an error here */ my_b_seek(&index_file, linfo->index_file_offset); @@ -4049,7 +4092,8 @@ /* Save variables so that we can reopen the log */ save_name=name; name=0; // Protect against free - close(LOG_CLOSE_TO_BE_OPENED); + close(LOG_CLOSE_TO_BE_OPENED, false/*need_lock_log=false*/, + false/*need_lock_index=false*/); /* First delete all old log files and then update the index file. @@ -4102,7 +4146,9 @@ } /* Start logging with a new file */ - close(LOG_CLOSE_INDEX | LOG_CLOSE_TO_BE_OPENED); + close(LOG_CLOSE_INDEX | LOG_CLOSE_TO_BE_OPENED, + false/*need_lock_log=false*/, + false/*need_lock_index=false*/); if ((error= my_delete_allow_opened(index_file_name, MYF(0)))) // Reset (open will update) { if (my_errno == ENOENT) @@ -4148,6 +4194,7 @@ if (!open_index_file(index_file_name, 0, false/*need_lock_index=false*/)) if ((error= open_binlog(save_name, 0, io_cache_type, max_size, false, + false/*need_lock_log=false*/, false/*need_lock_index=false*/, false/*need_sid_lock=false*/, NULL))) @@ -5273,7 +5320,9 @@ old_name=name; name=0; // Don't free name - close(LOG_CLOSE_TO_BE_OPENED | LOG_CLOSE_INDEX); + close(LOG_CLOSE_TO_BE_OPENED | LOG_CLOSE_INDEX, + false/*need_lock_log=false*/, + false/*need_lock_index=false*/); if (checksum_alg_reset != BINLOG_CHECKSUM_ALG_UNDEF) { @@ -5304,6 +5353,7 @@ file_to_open= new_name_ptr; error= open_binlog(old_name, new_name_ptr, io_cache_type, max_size, true/*null_created_arg=true*/, + false/*need_lock_log=false*/, false/*need_lock_index=false*/, true/*need_sid_lock=true*/, extra_description_event); @@ -5336,7 +5386,6 @@ - switch server to protected/readonly mode - ... */ - close(LOG_CLOSE_INDEX); if (binlog_error_action == ABORT_SERVER) { exec_binlog_error_action_abort("Either disk is full or file system is" @@ -5350,12 +5399,15 @@ "again: fix the cause, shutdown the MySQL " "server and restart it.", new_name_ptr, errno); + close(LOG_CLOSE_INDEX, false /*need_lock_log=false*/, + false/*need_lock_index=false*/); } mysql_mutex_unlock(&LOCK_index); if (need_lock_log) mysql_mutex_unlock(&LOCK_log); + DEBUG_SYNC(current_thd, "after_disable_binlog"); DBUG_RETURN(error); } @@ -5794,6 +5846,7 @@ { error= new_file_without_locking(NULL); *check_purge= true; + publish_coordinates_for_global_status(); } DBUG_RETURN(error); } @@ -6415,15 +6468,28 @@ at once after close. - LOG_CLOSE_STOP_EVENT : write a 'stop' event to the log + @param need_lock_log If true, this function acquires LOCK_log; + otherwise the caller should already have acquired it. + + @param need_lock_index If true, this function acquires LOCK_index; + otherwise the caller should already have acquired it. + @note One can do an open on the object at once after doing a close. The internal structures are not freed until cleanup() is called */ -void MYSQL_BIN_LOG::close(uint exiting) +void MYSQL_BIN_LOG::close(uint exiting, bool need_lock_log, + bool need_lock_index) { // One can't set log_type here! DBUG_ENTER("MYSQL_BIN_LOG::close"); DBUG_PRINT("enter",("exiting: %d", (int) exiting)); + + if (need_lock_log) + mysql_mutex_lock(&LOCK_log); + else + mysql_mutex_assert_owner(&LOCK_log); + if (log_state == LOG_OPENED) { #ifdef HAVE_REPLICATION @@ -6466,6 +6532,11 @@ called a not complete close earlier and the index file is still open. */ + if (need_lock_index) + mysql_mutex_lock(&LOCK_index); + else + mysql_mutex_assert_owner(&LOCK_index); + if ((exiting & LOG_CLOSE_INDEX) && my_b_inited(&index_file)) { end_io_cache(&index_file); @@ -6477,9 +6548,17 @@ errno, my_strerror(errbuf, sizeof(errbuf), errno)); } } + + if (need_lock_index) + mysql_mutex_unlock(&LOCK_index); + log_state= (exiting & LOG_CLOSE_TO_BE_OPENED) ? LOG_TO_BE_OPENED : LOG_CLOSED; my_free(name); name= NULL; + + if (need_lock_log) + mysql_mutex_unlock(&LOCK_log); + DBUG_VOID_RETURN; } @@ -6544,6 +6623,7 @@ { /* generate a new binlog to mask a corrupted one */ open_binlog(opt_name, 0, WRITE_CACHE, max_binlog_size, false, + true/*need_lock_log=true*/, true/*need_lock_index=true*/, true/*need_sid_lock=true*/, NULL); @@ -6897,6 +6977,28 @@ binlog_prot_acquired= true; } +#ifdef WITH_WSREP + /* Action below will log an empty group of GTID. + This is done when the real action fails to generate any meaningful result on + executing slave. + Let's understand with an example: + * Topology master <-> slave + * Some action is performed on slave which put it out-of-sync from master. + * Master then execute same action. Slave may choose to ignore error arising + from execution of these actions using slave_skip_errors configuration but + the GTID sequence increment still need to register on slave to keep it in + sync with master. So a dummy trx of this form is created. Galera + eco-system too will capture this dummy trx and will execute it for + internal replication to keep GTID sequence consistent across + the cluster. */ + if (WSREP_ON && thd->wsrep_replicate_GTID && + wsrep_replicate_GTID(thd)) + { + /* GTID replication failed */ + DBUG_RETURN(RESULT_ABORTED); + } +#endif /* WITH_WSREP */ + rc= ordered_commit(thd, all); if (binlog_prot_acquired) @@ -7411,7 +7513,8 @@ "the cause, shutdown the MySQL server and restart it.", errmsg); } - close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT); + close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT, false/*need_lock_log=false*/, + true/*need_lock_index=true*/); if (need_lock_log) mysql_mutex_unlock(&LOCK_log); DEBUG_SYNC(thd, "after_binlog_closed_due_to_error"); @@ -7493,12 +7596,6 @@ } DBUG_RETURN(rcode); } - - if (thd->wsrep_certify_empty_trx) - { - wsrep_run_wsrep_commit(thd, wsrep_hton, true); - wsrep_post_commit(thd, true); - } #endif /* WITH_WSREP */ /* @@ -7606,6 +7703,8 @@ handle_binlog_flush_or_sync_error(thd, false /* need_lock_log */); } + publish_coordinates_for_global_status(); + /* Stage #2: Syncing binary log file to disk */ @@ -7881,41 +7980,24 @@ */ static void set_binlog_snapshot_file(const char *src) { + mysql_mutex_assert_owner(&LOCK_status); + int dir_len = dirname_length(src); strmake(binlog_snapshot_file, src + dir_len, sizeof(binlog_snapshot_file) - 1); } -/* - Copy out current values of status variables, for SHOW STATUS or - information_schema.global_status. - This is called only under LOCK_status, so we can fill in a static array. -*/ -void MYSQL_BIN_LOG::set_status_variables(THD *thd) +/** Copy the current binlog coordinates to the variables used for the +not-in-consistent-snapshot case of SHOW STATUS */ +void MYSQL_BIN_LOG::publish_coordinates_for_global_status(void) const { - binlog_cache_mngr *cache_mngr; - - if (thd && opt_bin_log) - cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); - else - cache_mngr= 0; - - bool have_snapshot= (cache_mngr && - cache_mngr->binlog_info.log_file_name[0] != '\0'); - mysql_mutex_lock(&LOCK_log); - if (!have_snapshot) - { - set_binlog_snapshot_file(log_file_name); - binlog_snapshot_position= my_b_tell(&log_file); - } - mysql_mutex_unlock(&LOCK_log); + mysql_mutex_assert_owner(&LOCK_log); - if (have_snapshot) - { - set_binlog_snapshot_file(cache_mngr->binlog_info.log_file_name); - binlog_snapshot_position= cache_mngr->binlog_info.pos; - } + mysql_mutex_lock(&LOCK_status); + strcpy(binlog_global_snapshot_file, log_file_name); + binlog_global_snapshot_position= my_b_tell(&log_file); + mysql_mutex_unlock(&LOCK_status); } @@ -8170,7 +8252,7 @@ /* Pre-conditions */ #ifdef WITH_WSREP DBUG_ASSERT(is_current_stmt_binlog_format_row() && - (WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open())); + (WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open())); #else DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); #endif /* WITH_WSREP */ @@ -8570,10 +8652,10 @@ binlog by filtering rules. */ #ifdef WITH_WSREP - if ((WSREP_EMULATE_BINLOG(this) || + if ((WSREP_EMULATE_BINLOG_NNULL(this) || (mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG))) && !(WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT && - !binlog_filter->db_ok(db))) + !binlog_filter->db_ok(db))) #else if (mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG) && !(variables.binlog_format == BINLOG_FORMAT_STMT && @@ -8654,8 +8736,10 @@ */ uint non_replicated_tables_count= 0; #ifndef DBUG_OFF - DBUG_PRINT("debug", ("prelocked_mode: %s", - get_locked_tables_mode_name(locked_tables_mode))); + { + DBUG_PRINT("debug", ("prelocked_mode: %s", + get_locked_tables_mode_name(locked_tables_mode))); + } #endif if (WSREP_BINLOG_FORMAT(variables.binlog_format) != BINLOG_FORMAT_ROW && tables) @@ -8926,7 +9010,7 @@ limited to row-logging when binlog_format = STATEMENT */ #ifdef WITH_WSREP - if (!WSREP(this) || wsrep_exec_mode == LOCAL_STATE) + if (!WSREP_NNULL(this) || wsrep_exec_mode == LOCAL_STATE) { #endif /* WITH_WSREP */ my_error((error= ER_BINLOG_STMT_MODE_AND_ROW_ENGINE), MYF(0), ""); @@ -9395,7 +9479,7 @@ { #ifdef WITH_WSREP DBUG_ASSERT(is_current_stmt_binlog_format_row() && - ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()))); + ((WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open()))); #else DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); #endif /* WITH_WSREP */ @@ -9430,7 +9514,7 @@ { #ifdef WITH_WSREP DBUG_ASSERT(is_current_stmt_binlog_format_row() && - ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()))); + ((WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open()))); #else DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); #endif /* WITH_WSREP */ @@ -9502,7 +9586,7 @@ { #ifdef WITH_WSREP DBUG_ASSERT(is_current_stmt_binlog_format_row() && - ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()))); + ((WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open()))); #else DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); #endif /* WITH_WSREP */ @@ -9625,7 +9709,7 @@ flushing anything (e.g., if we have explicitly locked tables). */ #ifdef WITH_WSREP - if (!(WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open())) + if (!(WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open())) #else if (!mysql_bin_log.is_open()) #endif /* WITH_WSREP */ @@ -9923,8 +10007,8 @@ DBUG_PRINT("enter", ("qtype: %s query: '%s'", show_query_type(qtype), query_arg)); #ifdef WITH_WSREP - DBUG_ASSERT(query_arg && (WSREP_EMULATE_BINLOG(this) - || mysql_bin_log.is_open())); + DBUG_ASSERT(query_arg && (WSREP_EMULATE_BINLOG_NNULL(this) + || mysql_bin_log.is_open())); #else DBUG_ASSERT(query_arg && mysql_bin_log.is_open()); #endif /* WITH_WSREP */ @@ -10104,8 +10188,26 @@ static int show_binlog_vars(THD *thd, SHOW_VAR *var, char *buff) { - if (mysql_bin_log.is_open()) - mysql_bin_log.set_status_variables(thd); + mysql_mutex_assert_owner(&LOCK_status); + + const binlog_cache_mngr *cache_mngr + = (thd && opt_bin_log) + ? static_cast(thd_get_ha_data(thd, binlog_hton)) + : NULL; + + const bool have_snapshot= (cache_mngr && + cache_mngr->binlog_info.log_file_name[0] != '\0'); + + if (have_snapshot) + { + set_binlog_snapshot_file(cache_mngr->binlog_info.log_file_name); + binlog_snapshot_position= cache_mngr->binlog_info.pos; + } + else if (mysql_bin_log.is_open()) + { + set_binlog_snapshot_file(binlog_global_snapshot_file); + binlog_snapshot_position= binlog_global_snapshot_position; + } else { binlog_snapshot_file[0]= '\0'; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/binlog.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/binlog.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/binlog.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/binlog.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ #ifndef BINLOG_H_INCLUDED -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -595,6 +595,7 @@ enum cache_type io_cache_type_arg, ulong max_size, bool null_created, + bool need_lock_log, bool need_lock_index, bool need_sid_lock, Format_description_log_event *extra_description_event); bool open_index_file(const char *index_file_name_arg, @@ -669,7 +670,7 @@ int purge_index_entry(THD *thd, ulonglong *decrease_log_space, bool need_lock_index); bool reset_logs(THD* thd); - void close(uint exiting); + void close(uint exiting, bool need_lock_log, bool need_lock_index); // iterating through the log index file int find_log_pos(LOG_INFO* linfo, const char* log_name, @@ -689,7 +690,8 @@ inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);} inline IO_CACHE *get_index_file() { return &index_file;} inline uint32 get_open_count() { return open_count; } - void set_status_variables(THD *thd); +private: + void publish_coordinates_for_global_status(void) const; }; typedef struct st_load_file_info diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/event_data_objects.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/event_data_objects.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/event_data_objects.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/event_data_objects.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1481,9 +1481,16 @@ bool save_tx_read_only= thd->tx_read_only; thd->tx_read_only= false; + ret= Events::drop_event_precheck(thd, dbname); + #ifdef WITH_WSREP LEX* original_saved_lex= thd->lex; - if (WSREP(thd)) { +#endif + if (!ret) + { +#ifdef WITH_WSREP + if (WSREP(thd)) + { // sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX)); // sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack. LEX lex; @@ -1491,13 +1498,18 @@ thd->lex = &lex; WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL); thd->lex= original_saved_lex; - } + } #endif - - ret= Events::drop_event(thd, dbname, name, FALSE); + + ret= Events::drop_event(thd, dbname, name, FALSE); + +#ifdef WITH_WSREP + if (WSREP(thd)) + WSREP_TO_ISOLATION_END; +#endif + } #ifdef WITH_WSREP - WSREP_TO_ISOLATION_END; error: if (thd->lex != original_saved_lex) thd->lex= original_saved_lex; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/events.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/events.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/events.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/events.cc 2017-10-19 04:25:29.000000000 +0000 @@ -306,7 +306,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, bool if_not_exists) { - bool ret; + bool ret= TRUE; bool save_binlog_row_based, event_already_exists; ulong save_binlog_format= thd->variables.binlog_format; DBUG_ENTER("Events::create_event"); @@ -334,6 +334,8 @@ DBUG_RETURN(TRUE); } + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + if (parse_data->do_not_create) DBUG_RETURN(FALSE); /* @@ -412,6 +414,7 @@ thd->set_current_stmt_binlog_format_row(); thd->variables.binlog_format= save_binlog_format; +error: DBUG_RETURN(ret); } @@ -439,7 +442,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname, LEX_STRING *new_name) { - int ret; + int ret= TRUE; bool save_binlog_row_based; ulong save_binlog_format= thd->variables.binlog_format; Event_queue_element *new_element; @@ -484,6 +487,8 @@ } } + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + /* Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for UPDATE EVENT command. @@ -539,11 +544,35 @@ thd->set_current_stmt_binlog_format_row(); thd->variables.binlog_format= save_binlog_format; +error: DBUG_RETURN(ret); } /** + Does the access checking for dropping an event. + + @param[in,out] thd THD + @param[in] dbname Event's schema + + @retval FALSE OK + @retval TRUE Error (reported) +*/ +bool +Events::drop_event_precheck(THD *thd, LEX_STRING dbname) +{ + DBUG_ENTER("Events::drop_event_precheck"); + + if (check_if_system_tables_error()) + DBUG_RETURN(TRUE); + + if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0)) + DBUG_RETURN(TRUE); + + DBUG_RETURN(FALSE); +} + +/** Drops an event @param[in,out] thd THD @@ -563,6 +592,9 @@ and COMMIT/ROLLBACK is not allowed in stored functions and triggers. + @note Call Events::drop_event_precheck before calling this to + perform access checks. + @retval FALSE OK @retval TRUE Error (reported) */ @@ -570,16 +602,10 @@ bool Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) { - int ret; + int ret= TRUE; bool save_binlog_row_based; DBUG_ENTER("Events::drop_event"); - if (check_if_system_tables_error()) - DBUG_RETURN(TRUE); - - if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0)) - DBUG_RETURN(TRUE); - /* Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for DROP EVENT command. @@ -601,10 +627,12 @@ thd->add_to_binlog_accessed_dbs(dbname.str); ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } + /* Restore the state of binlog format */ DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); if (save_binlog_row_based) thd->set_current_stmt_binlog_format_row(); + DBUG_RETURN(ret); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/events.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/events.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/events.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/events.h 2017-10-19 04:25:29.000000000 +0000 @@ -111,6 +111,9 @@ LEX_STRING *new_dbname, LEX_STRING *new_name); static bool + drop_event_precheck(THD *thd, LEX_STRING dbname); + + static bool drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists); static void diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/field.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/field.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/field.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/field.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1165,12 +1165,15 @@ int diff; if ((diff= (int) (field_length - value->length())) > 0) { - bmove_upp((uchar*) value->ptr()+field_length, - (uchar*) value->ptr()+value->length(), - value->length()); - memset(const_cast(value->ptr()), '0', diff); - value->length(field_length); - (void) value->c_ptr_quick(); // Avoid warnings in purify + const bool error= value->realloc(field_length); + if (!error) + { + bmove_upp((uchar*) value->ptr()+field_length, + (uchar*) value->ptr()+value->length(), + value->length()); + memset(const_cast(value->ptr()), '0', diff); + value->length(field_length); + } } } @@ -8112,7 +8115,7 @@ uchar *blob; uint blob_length=get_length(); - if (!blob_length) + if (!blob_length && field_charset->pad_char == 0) memset(to, 0, length); else { @@ -8125,19 +8128,20 @@ */ length-= packlength; pos= to+length; + uint key_length= MY_MIN(blob_length, length); switch (packlength) { case 1: - *pos= (char) blob_length; + *pos= (char) key_length; break; case 2: - mi_int2store(pos, blob_length); + mi_int2store(pos, key_length); break; case 3: - mi_int3store(pos, blob_length); + mi_int3store(pos, key_length); break; case 4: - mi_int4store(pos, blob_length); + mi_int4store(pos, key_length); break; } } @@ -10654,3 +10658,10 @@ set_warning(level, code, cut_increment)) make_truncated_value_warning(thd, level, val, ts_type, field_name); } + +bool Field::is_part_of_actual_key(THD *thd, uint cur_index) +{ + return thd->optimizer_switch_flag(OPTIMIZER_SWITCH_USE_INDEX_EXTENSIONS) ? + part_of_key.is_set(cur_index) : + part_of_key_not_extended.is_set(cur_index); +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/field.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/field.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/field.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/field.h 2017-10-19 04:25:29.000000000 +0000 @@ -501,8 +501,13 @@ /* Field is part of the following keys */ key_map key_start; /* Keys that starts with this field */ key_map part_of_key; /* All keys that includes this field */ - key_map part_of_key_not_clustered;/* ^ but only for non-clustered keys */ key_map part_of_sortkey; /* ^ but only keys usable for sorting */ + /** + All keys that include this field, but not extended by the storage engine to + include primary key columns. + */ + key_map part_of_key_not_extended; + /* We use three additional unireg types for TIMESTAMP to overcome limitation of current binary format of .frm file. We'd like to be able to support @@ -1281,6 +1286,19 @@ */ virtual bool is_updatable() const { return FALSE; } + /** + Check whether field is part of the index taking the index extensions flag + into account. + + @param[in] thd THD object + @param[in] cur_index Index of the key + + @retval true Field is part of the key + @retval false otherwise + + */ + bool is_part_of_actual_key(THD *thd, uint cur_index); + friend int cre_myisam(char * name, register TABLE *form, uint options, ulonglong auto_increment_value); friend class Copy_field; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/filesort.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/filesort.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/filesort.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/filesort.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,6 +66,7 @@ Filesort_info *table_sort); static uint suffix_length(ulong string_length); static SORT_ADDON_FIELD *get_addon_fields(ulong max_length_for_sort_data, + TABLE *const table, Field **ptabfield, uint sortlength, uint *plength); static void unpack_addon_fields(struct st_sort_addon_field *addon_field, @@ -90,6 +91,7 @@ to sorted fields and get its total length in addon_length. */ addon_field= get_addon_fields(max_length_for_sort_data, + table, table->field, sort_length, &addon_length); } if (addon_field) @@ -1953,6 +1955,7 @@ static SORT_ADDON_FIELD * get_addon_fields(ulong max_length_for_sort_data, + TABLE *const table, Field **ptabfield, uint sortlength, uint *plength) { Field **pfield; @@ -1961,7 +1964,7 @@ uint length= 0; uint fields= 0; uint null_fields= 0; - MY_BITMAP *read_set= (*ptabfield)->table->read_set; + MY_BITMAP *read_set= table->read_set; /* If there is a reference to a field in the query add it diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/gen_lex_hash.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/gen_lex_hash.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/gen_lex_hash.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/gen_lex_hash.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - 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 @@ -229,6 +229,21 @@ insert_sql_functions(); } +struct hash_map_cleanup +{ + hash_map_cleanup(char **buffer, int *sz) + : m_buffer(buffer), m_sz(sz) + {} + ~hash_map_cleanup() + { + free(*m_buffer); + *m_buffer= NULL; + *m_sz= 0; + } + char **m_buffer; + int *m_sz; +}; + char *hash_map= 0; int size_hash_map= 0; @@ -307,23 +322,21 @@ void print_find_structs() { - add_structs_to_map(root_by_len,max_len); - set_links(root_by_len,max_len); - print_hash_map("sql_functions_map"); - - free(hash_map); - hash_map= 0; - size_hash_map= 0; + { + hash_map_cleanup cleanup(&hash_map, &size_hash_map); + add_structs_to_map(root_by_len,max_len); + set_links(root_by_len,max_len); + print_hash_map("sql_functions_map"); + } printf("\n"); - add_structs_to_map(root_by_len2,max_len2); - set_links(root_by_len2,max_len2); - print_hash_map("symbols_map"); - - free(hash_map); - hash_map= 0; - size_hash_map= 0; + { + hash_map_cleanup cleanup(&hash_map, &size_hash_map); + add_structs_to_map(root_by_len2,max_len2); + set_links(root_by_len2,max_len2); + print_hash_map("symbols_map"); + } } int check_dup_symbols(SYMBOL *s1, SYMBOL *s2) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/handler.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/handler.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/handler.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/handler.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1674,6 +1674,11 @@ { // cannot happen my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err); error= 1; +#ifdef WITH_WSREP + WSREP_WARN("handlerton rollback failed, thd %lu %lld conf %d SQL %s", + thd->thread_id, thd->query_id, thd->wsrep_conflict_state, + thd->query()); +#endif /* WITH_WSREP */ } status_var_increment(thd->status_var.ha_rollback_count); ha_info_next= ha_info->next(); @@ -2966,6 +2971,11 @@ DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE || m_lock_type != F_UNLCK); DBUG_ASSERT(inited == NONE || (inited == RND && scan)); + if (scan && is_using_prohibited_gap_locks(table, false)) + { + DBUG_RETURN(HA_ERR_LOCK_DEADLOCK); + } + inited= (result= rnd_init(scan)) ? NONE : RND; end_range= NULL; DBUG_RETURN(result); @@ -3088,6 +3098,11 @@ DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE || m_lock_type != F_UNLCK); DBUG_ASSERT(inited == INDEX); + if (is_using_prohibited_gap_locks(table, is_using_full_unique_key( + active_index, keypart_map, find_flag))) + { + DBUG_RETURN(HA_ERR_LOCK_DEADLOCK); + } MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, { result= index_read_map(buf, key, keypart_map, find_flag); }) @@ -3108,6 +3123,10 @@ DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE || m_lock_type != F_UNLCK); DBUG_ASSERT(inited == INDEX); + if (is_using_prohibited_gap_locks(table, false)) + { + DBUG_RETURN(HA_ERR_LOCK_DEADLOCK); + } MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, { result= index_read_last_map(buf, key, keypart_map); }) @@ -3136,6 +3155,12 @@ m_lock_type != F_UNLCK); DBUG_ASSERT(end_range == NULL); + if (is_using_prohibited_gap_locks(table, is_using_full_unique_key( + index, keypart_map, find_flag))) + { + return HA_ERR_LOCK_DEADLOCK; + } + MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, index, 0, { result= index_read_idx_map(buf, index, key, keypart_map, find_flag); }) @@ -3227,6 +3252,11 @@ m_lock_type != F_UNLCK); DBUG_ASSERT(inited == INDEX); + if (is_using_prohibited_gap_locks(table, false)) + { + return HA_ERR_LOCK_DEADLOCK; + } + MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, { result= index_first(buf); }) @@ -3238,6 +3268,24 @@ return result; } +bool handler::is_using_full_key(key_part_map keypart_map, + uint actual_key_parts) +{ + return (keypart_map == HA_WHOLE_KEY) || + (keypart_map == ((key_part_map(1) << actual_key_parts) + - 1)); +} + +bool handler::is_using_full_unique_key(uint index, + key_part_map keypart_map, + enum ha_rkey_function find_flag) const +{ + return (is_using_full_key(keypart_map, + table->key_info[index].actual_key_parts) + && find_flag == HA_READ_KEY_EXACT + && (index == table->s->primary_key + || (table->key_info[index].flags & HA_NOSAME))); +} /** Reads the last row via index. @@ -3257,6 +3305,11 @@ m_lock_type != F_UNLCK); DBUG_ASSERT(inited == INDEX); + if (is_using_prohibited_gap_locks(table, false)) + { + return HA_ERR_LOCK_DEADLOCK; + } + MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, { result= index_last(buf); }) @@ -7385,6 +7438,60 @@ return cmp; } +/** + Change the offsets of all the fields in a key range. + + @param range the key range + @param key_part the first key part + @param diff how much to change the offsets with +*/ +static inline void +move_key_field_offsets(const key_range *range, const KEY_PART_INFO *key_part, + my_ptrdiff_t diff) +{ + for (size_t len= 0; len < range->length; + len+= key_part->store_length, ++key_part) + key_part->field->move_field_offset(diff); +} + +/** + Check if the key in the given buffer (which is not necessarily + TABLE::record[0]) is within range. Called by the storage engine to + avoid reading too many rows. + + @param buf the buffer that holds the key + @retval -1 if the key is within the range + @retval 0 if the key is equal to the end_range key, and + key_compare_result_on_equal is 0 + @retval 1 if the key is outside the range +*/ +int handler::compare_key_in_buffer(const uchar *buf) const +{ + DBUG_ASSERT(end_range != NULL); + + /* + End range on descending scans is only checked with ICP for now, and then we + check it with compare_key_icp() instead of this function. + */ + DBUG_ASSERT(range_scan_direction == RANGE_SCAN_ASC); + + // Make the fields in the key point into the buffer instead of record[0]. + const my_ptrdiff_t diff= buf - table->record[0]; + if (diff != 0) + move_key_field_offsets(end_range, range_key_part, diff); + + // Compare the key in buf against end_range. + int cmp= key_cmp(range_key_part, end_range->key, end_range->length); + if (cmp == 0) + cmp= key_compare_result_on_equal; + + // Reset the field offsets. + if (diff != 0) + move_key_field_offsets(end_range, range_key_part, -diff); + + return cmp; +} + int handler::index_read_idx_map(uchar * buf, uint index, const uchar * key, key_part_map keypart_map, enum ha_rkey_function find_flag) @@ -8153,6 +8260,12 @@ DBUG_VOID_RETURN; } + if (thd->wsrep_ws_handle.trx_id != WSREP_UNDEFINED_TRX_ID) + { + WSREP_DEBUG("fake trx id skipped: %llu", + (unsigned long long) thd->wsrep_ws_handle.trx_id); + DBUG_VOID_RETURN; + } handlerton *hton= installed_htons[DB_TYPE_INNODB]; if (hton && hton->wsrep_fake_trx_id) { @@ -8166,6 +8279,37 @@ DBUG_VOID_RETURN; } #endif /* WITH_WSREP */ + +bool handler::is_using_prohibited_gap_locks(TABLE* table, + bool using_full_primary_key) const +{ + THD* thd = table->in_use; + thr_lock_type lock_type = table->reginfo.lock_type; + + if (!using_full_primary_key + && has_transactions() + && !has_gap_locks() + && thd_tx_isolation(thd) >= ISO_REPEATABLE_READ + && !thd->rli_slave + && (thd->lex->table_count >= 2 || thd->in_multi_stmt_transaction_mode()) + && (lock_type >= TL_WRITE_ALLOW_WRITE || + lock_type == TL_READ_WITH_SHARED_LOCKS || + lock_type == TL_READ_NO_INSERT || + (lock_type != TL_IGNORE && thd->lex->sql_command != SQLCOM_SELECT))) + { + my_printf_error(ER_UNKNOWN_ERROR, + "Using Gap Lock without full unique key in multi-table " + "or multi-statement transactions is not " + "allowed. You need to either rewrite queries to use " + "all unique key columns in WHERE equal conditions, or " + "rewrite to single-table, single-statement " + "transaction. Query: %s", + MYF(0), thd->query()); + return true; + } + return false; +} + #ifdef TRANS_LOG_MGM_EXAMPLE_CODE /* Example of transaction log management functions based on assumption that logs diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/handler.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/handler.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/handler.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/handler.h 2017-10-19 04:25:29.000000000 +0000 @@ -2,7 +2,7 @@ #define HANDLER_INCLUDED /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -34,6 +34,7 @@ #include #include #include +#include "xa.h" class Alter_info; @@ -504,13 +505,6 @@ }; -typedef ulonglong my_xid; // this line is the same as in log_event.h -#define MYSQL_XID_PREFIX "MySQLXid" -#define MYSQL_XID_PREFIX_LEN 8 // must be a multiple of 8 -#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id)) -#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid)) - -#define XIDDATASIZE MYSQL_XIDDATASIZE #define MAXGTRIDSIZE 64 #define MAXBQUALSIZE 64 @@ -521,78 +515,6 @@ class Join_plan; }; -/** - struct xid_t is binary compatible with the XID structure as - in the X/Open CAE Specification, Distributed Transaction Processing: - The XA Specification, X/Open Company Ltd., 1991. - http://www.opengroup.org/bookstore/catalog/c193.htm - - @see MYSQL_XID in mysql/plugin.h -*/ -struct xid_t { - long formatID; - long gtrid_length; - long bqual_length; - char data[XIDDATASIZE]; // not \0-terminated ! - - xid_t() {} /* Remove gcc warning */ - bool eq(struct xid_t *xid) - { return eq(xid->gtrid_length, xid->bqual_length, xid->data); } - bool eq(long g, long b, const char *d) - { return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); } - void set(struct xid_t *xid) - { memcpy(this, xid, xid->length()); } - void set(long f, const char *g, long gl, const char *b, long bl) - { - formatID= f; - memcpy(data, g, gtrid_length= gl); - memcpy(data+gl, b, bqual_length= bl); - } - void set(ulonglong xid) - { - my_xid tmp; - formatID= 1; - set(MYSQL_XID_PREFIX_LEN, 0, MYSQL_XID_PREFIX); - memcpy(data+MYSQL_XID_PREFIX_LEN, &server_id, sizeof(server_id)); - tmp= xid; - memcpy(data+MYSQL_XID_OFFSET, &tmp, sizeof(tmp)); - gtrid_length=MYSQL_XID_GTRID_LEN; - } - void set(long g, long b, const char *d) - { - formatID= 1; - gtrid_length= g; - bqual_length= b; - memcpy(data, d, g+b); - } - bool is_null() { return formatID == -1; } - void null() { formatID= -1; } - my_xid quick_get_my_xid() - { - my_xid tmp; - memcpy(&tmp, data+MYSQL_XID_OFFSET, sizeof(tmp)); - return tmp; - } - my_xid get_my_xid() - { - return gtrid_length == MYSQL_XID_GTRID_LEN && bqual_length == 0 && - !memcmp(data, MYSQL_XID_PREFIX, MYSQL_XID_PREFIX_LEN) ? - quick_get_my_xid() : 0; - } - uint length() - { - return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+ - gtrid_length+bqual_length; - } - uchar *key() - { - return (uchar *)>rid_length; - } - uint key_length() - { - return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length; - } -}; typedef struct xid_t XID; /* for recover() handlerton call */ @@ -813,6 +735,12 @@ HA_CREATE_ZIP_DICT_NAME_TOO_LONG, /*!< zip dict name is too long */ HA_CREATE_ZIP_DICT_DATA_TOO_LONG, /*!< zip dict data is too long */ HA_CREATE_ZIP_DICT_READ_ONLY, /*!< cannot create in read-only mode */ + HA_CREATE_ZIP_DICT_FAKE_CHANGES, /*!< fake changes enabled */ + HA_CREATE_ZIP_DICT_OUT_OF_MEMORY, /*!< out of memory */ + HA_CREATE_ZIP_DICT_OUT_OF_FILE_SPACE, + /*!< out of disk space */ + HA_CREATE_ZIP_DICT_TOO_MANY_CONCURRENT_TRXS, + /*!< too many concurrent transactions */ HA_CREATE_ZIP_DICT_UNKNOWN_ERROR /*!< unknown error during zip_dict creation */ }; @@ -825,6 +753,12 @@ exist */ HA_DROP_ZIP_DICT_IS_REFERENCED, /*!< zip dict is in use */ HA_DROP_ZIP_DICT_READ_ONLY, /*!< cannot drop in read-only mode */ + HA_DROP_ZIP_DICT_FAKE_CHANGES, /*!< fake changes enabled */ + HA_DROP_ZIP_DICT_OUT_OF_MEMORY, /*!< out of memory */ + HA_DROP_ZIP_DICT_OUT_OF_FILE_SPACE, + /*!< out of disk space */ + HA_DROP_ZIP_DICT_TOO_MANY_CONCURRENT_TRXS, + /*!< too many concurrent transactions */ HA_DROP_ZIP_DICT_UNKNOWN_ERROR /*!< unknown error during zip_dict removal */ }; @@ -1116,6 +1050,11 @@ */ #define HTON_SUPPORTS_CLUSTERED_KEYS (1 << 13) +/** + Engine supports compressed columns. +*/ +#define HTON_SUPPORTS_COMPRESSED_COLUMNS (1 << 14) + enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, ISO_REPEATABLE_READ, ISO_SERIALIZABLE}; @@ -2258,7 +2197,7 @@ virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; } - bool has_transactions() + bool has_transactions() const { return (ha_table_flags() & HA_NO_TRANSACTIONS) == 0; } virtual uint extra_rec_buf_length() const { return 0; } @@ -2440,7 +2379,18 @@ return prepare_index_key_scan(key, key_len); } + /** + Query storage engine to see if it supports gap locks on this table. + */ + virtual bool has_gap_locks() const { return false; } + protected: + static bool is_using_full_key(key_part_map keypart_map, uint actual_key_parts); + bool is_using_full_unique_key(uint active_index, + key_part_map keypart_map, + enum ha_rkey_function find_flag) const; + bool is_using_prohibited_gap_locks(TABLE* table, + bool using_full_primary_key) const; /** Notify storage engine about imminent index read with key length. @@ -2469,6 +2419,7 @@ enum_range_scan_direction direction); int compare_key(key_range *range); int compare_key_icp(const key_range *range) const; + int compare_key_in_buffer(const uchar *buf) const; virtual int ft_init() { return HA_ERR_WRONG_COMMAND; } void ft_end() { ft_handler=NULL; } virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key) @@ -2553,6 +2504,20 @@ by another transaction, the engine may try an optimistic read of the last committed row value under the cursor. */ + /** + Copy a cached row. + This is currently implemented only in innodb for supporting + HA_EXTRA_KEYREAD_PRESERVE_FIELDS. + Used when copying a row from the record priority queue to + the return buffer. For some engines, like InnoDB, only + marked columns must be copied,to preserve non-read columns. + + @param[out] to_rec Buffer to copy to. + @param[in] from_rec Buffer to copy from. + @param[in] rec_length Record length + */ + virtual void copy_cached_row(uchar *to_rec, const uchar *from_rec, uint rec_length) + { memcpy(to_rec, from_rec, rec_length); } virtual void try_semi_consistent_read(bool) {} virtual void unlock_row() {} virtual int start_stmt(THD *thd, thr_lock_type lock_type) {return 0;} @@ -3430,8 +3395,11 @@ compression dictionary info (name and data). If the handler does not support compression dictionaries this method should be left empty (not overloaded). + + @param part_name Full table name (including partition part). + Optional. */ - virtual void update_field_defs_with_zip_dict_info() { } + virtual void update_field_defs_with_zip_dict_info(const char* part_name) {} public: /* Read-free replication interface */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/ha_partition.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/ha_partition.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/ha_partition.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/ha_partition.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -136,7 +136,8 @@ partition_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN | HTON_TEMPORARY_NOT_SUPPORTED | - HTON_SUPPORTS_CLUSTERED_KEYS; + HTON_SUPPORTS_CLUSTERED_KEYS | + HTON_SUPPORTS_COMPRESSED_COLUMNS; #ifdef HAVE_PSI_INTERFACE init_partition_psi_keys(); #endif @@ -1093,6 +1094,31 @@ DBUG_RETURN(error); } +/** This function reads zip dict-related info from partition handlers. +It may do nothing if individual handlers do not support COMPRESSED_COLUMNS. + +@param part_name Must be always NULL. +*/ +void ha_partition::update_field_defs_with_zip_dict_info(const char* part_name) +{ + DBUG_ENTER("ha_partition::update_field_defs_with_zip_dict_info"); + DBUG_ASSERT(part_name == NULL); + char full_name[FN_REFLEN]; + create_partition_name(full_name, table_share->path.str, m_name_buffer_ptr, + NORMAL_PART_NAME, FALSE); + + /* + As table structure is the same for all partitions, + we can use the first partition for this function. + */ + DBUG_ASSERT(m_file); + DBUG_ASSERT(m_file[0]); + + m_file[0]->update_field_defs_with_zip_dict_info(full_name); + + DBUG_VOID_RETURN; +} + #define OPTIMIZE_PARTS 1 #define ANALYZE_PARTS 2 @@ -5693,6 +5719,19 @@ DBUG_RETURN(handle_unordered_next(table->record[0], eq_range)); } +bool ha_partition::has_gap_locks() const +{ + handler **file; + DBUG_ENTER("ha_partition::has_gap_locks"); + + file= m_file; + do + { + if (!(*file)->has_gap_locks()) + DBUG_RETURN(FALSE); + } while (*(++file)); + DBUG_RETURN(TRUE); +} /* Common routine to set up index scans @@ -5728,10 +5767,21 @@ get_partition_set(table,buf,active_index,&m_start_key,&m_part_spec); else { - m_part_spec.start_part= 0; - m_part_spec.end_part= m_tot_parts - 1; + m_part_spec.start_part= + bitmap_get_first_set(&m_part_info->read_partitions); + m_part_spec.end_part= m_part_spec.start_part; + + uint i= m_part_spec.end_part; + while (i != MY_BIT_NONE) + { + i= bitmap_get_next_set(&m_part_info->read_partitions, i); + if (i != MY_BIT_NONE) + m_part_spec.end_part= i; + } } - if (m_part_spec.start_part > m_part_spec.end_part) + if (m_part_spec.start_part == MY_BIT_NONE || + m_part_spec.end_part == MY_BIT_NONE || + m_part_spec.start_part > m_part_spec.end_part) { /* We discovered a partition set but the set was empty so we report @@ -6124,7 +6174,10 @@ uchar *rec_buffer= key_buffer + m_rec_offset; part_id= uint2korr(key_buffer); - memcpy(buf, rec_buffer, m_rec_length); + /* Do column copy to avoid overwriting of non read columns + specific to table with innodb engine */ + handler *file= m_file[part_id]; + file->copy_cached_row(buf, rec_buffer, m_rec_length); m_last_part= part_id; m_top_entry= part_id; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/ha_partition.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/ha_partition.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/ha_partition.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/ha_partition.h 2017-10-19 04:25:29.000000000 +0000 @@ -337,6 +337,14 @@ size_t pack_frm_len); virtual int drop_partitions(const char *path); virtual int rename_partitions(const char *path); + + /** This function reads zip dict-related info from partition handlers. + It may do nothing if individual handlers do not support COMPRESSED_COLUMNS. + + @param part_name Must be always NULL. + */ + virtual void update_field_defs_with_zip_dict_info(const char* part_name); + bool get_no_parts(const char *name, uint *num_parts) { DBUG_ENTER("ha_partition::get_no_parts"); @@ -619,6 +627,8 @@ bool eq_range, bool sorted); virtual int read_range_next(); + virtual bool has_gap_locks() const; + private: bool init_record_priority_queue(); void destroy_record_priority_queue(); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2444,6 +2444,9 @@ item_equal(0), no_const_subst(0), have_privileges(0), any_privileges(0) { + if (f->table->pos_in_table_list != NULL) + context= &(f->table->pos_in_table_list->select_lex->context); + set_field(f); /* field_name and table_name should not point to garbage @@ -3556,12 +3559,11 @@ value.time= *tm; value.time.time_type= time_type; + decimals= tm->second_part ? DATETIME_MAX_DECIMALS : 0; if (check_datetime_range(&value.time)) { - make_truncated_value_warning(ErrConvString(&value.time, - MY_MIN(decimals, - DATETIME_MAX_DECIMALS)), + make_truncated_value_warning(ErrConvString(&value.time, decimals), time_type); set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR); } @@ -3569,7 +3571,6 @@ state= TIME_VALUE; maybe_null= 0; max_length= max_length_arg; - decimals= 0; DBUG_VOID_RETURN; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_func.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_func.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_func.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_func.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3974,7 +3974,24 @@ } #ifdef HAVE_REPLICATION longlong pos = (ulong)args[1]->val_int(); - longlong timeout = (arg_count==3) ? args[2]->val_int() : 0 ; + double timeout = (arg_count == 3) ? args[2]->val_real() : 0; + if (timeout < 0) + { + if (thd->is_strict_mode()) + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), "MASTER_POS_WAIT."); + } + else + { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + ER(ER_WRONG_ARGUMENTS), + "MASTER_POS_WAIT."); + null_value= 1; + } + return 0; + } + if (active_mi == NULL || (event_count = active_mi->rli->wait_for_pos(thd, log_name, pos, timeout)) == -2) { @@ -4000,7 +4017,24 @@ } #if defined(HAVE_REPLICATION) - longlong timeout = (arg_count== 2) ? args[1]->val_int() : 0; + double timeout = (arg_count == 2) ? args[1]->val_real() : 0; + if (timeout < 0) + { + if (thd->is_strict_mode()) + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), "WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS."); + } + else + { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_ARGUMENTS, + ER(ER_WRONG_ARGUMENTS), + "WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS."); + null_value= 1; + } + return 0; + } + if (active_mi && active_mi->rli) { if ((event_count = active_mi->rli->wait_for_gtid_set(thd, gtid, timeout)) @@ -6251,7 +6285,16 @@ } -void Item_func_match::init_search(bool no_order) +/** + Initialize searching within full-text index. + + @param thd Thread handler + @param no_order set if FT should not be sorted + + @returns false if success, true if error +*/ + +bool Item_func_match::init_search(THD *thd, bool no_order) { DBUG_ENTER("Item_func_match::init_search"); @@ -6260,7 +6303,7 @@ with fix_field */ if (!fixed) - DBUG_VOID_RETURN; + DBUG_RETURN(false); /* Check if init_search() has been called before */ if (ft_handler) @@ -6273,16 +6316,19 @@ */ if (join_key) table->file->ft_handler= ft_handler; - DBUG_VOID_RETURN; + DBUG_RETURN(false); } if (key == NO_SUCH_KEY) { List fields; - fields.push_back(new Item_string(" ",1, cmp_collation.collation)); + if (fields.push_back(new Item_string(" ",1, cmp_collation.collation))) + DBUG_RETURN(true); for (uint i=1; i < arg_count; i++) fields.push_back(args[i]); concat_ws=new Item_func_concat_ws(fields); + if (concat_ws == NULL) + DBUG_RETURN(true); /* Above function used only to get value and do not need fix_fields for it: Item_string - basic constant @@ -6295,10 +6341,13 @@ if (master) { join_key=master->join_key=join_key|master->join_key; - master->init_search(no_order); + if (master->init_search(thd, no_order)) + DBUG_RETURN(true); + ft_handler=master->ft_handler; join_key=master->join_key; - DBUG_VOID_RETURN; + + DBUG_RETURN(false); } String *ft_tmp= 0; @@ -6322,10 +6371,13 @@ flags|=FT_SORTED; ft_handler=table->file->ft_init_ext(flags, key, ft_tmp); + if (thd->is_error()) + DBUG_RETURN(true); + if (join_key) table->file->ft_handler=ft_handler; - DBUG_VOID_RETURN; + DBUG_RETURN(false); } /** diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_func.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_func.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_func.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_func.h 2017-10-19 04:25:29.000000000 +0000 @@ -1895,7 +1895,7 @@ virtual void print(String *str, enum_query_type query_type); bool fix_index(); - void init_search(bool no_order); + bool init_search(THD *thd, bool no_order); /** Get number of matching rows from FT handler. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_strfunc.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_strfunc.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_strfunc.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_strfunc.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4346,6 +4346,17 @@ *to= '\''; ret: + if (new_length > current_thd->variables.max_allowed_packet) + { + push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN, + ER_WARN_ALLOWED_PACKET_OVERFLOWED, + ER_THD(current_thd, ER_WARN_ALLOWED_PACKET_OVERFLOWED), + func_name(), + current_thd->variables.max_allowed_packet); + null_value= true; + return NULL; + } + tmp_value.length(new_length); tmp_value.set_charset(collation.collation); null_value= 0; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_subselect.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_subselect.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_subselect.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_subselect.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights +/* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify @@ -3565,6 +3565,7 @@ free_tmp_table(thd, tmp_table); delete result; result= NULL; + thd->raise_error_printf(ER_INTERNAL_ERROR, "Failed to create MyISAM temporary table for query processing, key too large"); DBUG_RETURN(TRUE); } result= tmp_result_sink; @@ -3723,12 +3724,15 @@ { DBUG_ENTER("subselect_hash_sj_engine::cleanup"); is_materialized= false; - result->cleanup(); /* Resets the temp table as well. */ + + if (result) + result->cleanup(); /* Resets the temp table as well. */ THD * const thd= item->unit->thd; DEBUG_SYNC(thd, "before_index_end_in_subselect"); - if (tab->table->file->inited) + if (tab && tab->table->file->inited) tab->table->file->ha_index_end(); // Close the scan over the index - free_tmp_table(thd, tab->table); + if (tab) + free_tmp_table(thd, tab->table); tab= NULL; materialize_engine->cleanup(); DBUG_VOID_RETURN; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_xmlfunc.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_xmlfunc.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/item_xmlfunc.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/item_xmlfunc.cc 2017-10-19 04:25:29.000000000 +0000 @@ -2724,9 +2724,9 @@ node.parent= data->parent; // Set parent for the new node to old parent data->parent= numnodes; // Remember current node as new parent - DBUG_ASSERT(data->level <= MAX_LEVEL); + DBUG_ASSERT(data->level < MAX_LEVEL); data->pos[data->level]= numnodes; - if (data->level < MAX_LEVEL) + if (data->level < MAX_LEVEL - 1) node.level= data->level++; else return MY_XML_ERROR; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/lock.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/lock.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/lock.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/lock.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1148,7 +1148,11 @@ int rcode; WSREP_DEBUG("running implicit desync for node"); rcode = wsrep->desync(wsrep); - if (rcode != WSREP_OK) + if (rcode == WSREP_TRX_FAIL && strcmp(wsrep_cluster_status, "Primary") != 0) + { + WSREP_DEBUG("desync failed while non-Primary, ignoring failure"); + } + else if (rcode != WSREP_OK) { WSREP_WARN("FTWRL desync failed %d for schema: %s, query: %s", rcode, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd)); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/log.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/log.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/log.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/log.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2009, 2013, Monty Program Ab Copyright (C) 2012 Percona Inc. @@ -2169,7 +2169,7 @@ thd->profiling.print_current(&log_file); #endif if ((thd->variables.log_slow_verbosity & (1ULL << SLOG_V_INNODB)) - && thd->innodb_was_used) + && thd->innodb_trx_id) { char buf[20]; snprintf(buf, 20, "%llX", thd->innodb_trx_id); @@ -3388,14 +3388,20 @@ Hence we clear the previous errors and push one critical error message to clients. */ - thd->clear_error(); - /* - Adding ME_NOREFRESH flag will ensure that the error is sent to both - client and to the server error log as well. - */ - my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(ME_NOREFRESH + ME_FATALERROR), - err_string); - thd->protocol->end_statement(); + if (thd) + { + if (thd->is_error()) + thd->clear_error(); + /* + Adding ME_NOREFRESH flag will ensure that the error is sent to both + client and to the server error log as well. + */ + my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(ME_NOREFRESH + ME_FATALERROR), + err_string); + thd->protocol->end_statement(); + } + else + sql_print_error("%s",err_string); abort(); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/log_event.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/log_event.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/log_event.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/log_event.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,6 +62,9 @@ #include "rpl_utility.h" #include "sql_digest.h" +#ifndef EMBEDDED_LIBRARY +#include "sql_connect.h" //update_global_user_stats +#endif using std::min; using std::max; @@ -7018,9 +7021,13 @@ thd->backup_binlog_lock.release_protection(thd); if (rli->is_parallel_exec()) + { + bool real_event= server_id && !is_artificial_event(); + time_t ts= when.tv_sec + static_cast(exec_time); rli->reset_notified_checkpoint(0, - server_id ? when.tv_sec + (time_t) exec_time : 0, + real_event ? &ts : NULL, true/*need_data_lock=true*/); + } /* Reset thd->variables.option_bits and sql_mode etc, because this could be the signal of @@ -7434,23 +7441,6 @@ if (thd->variables.gtid_next.type == GTID_GROUP && thd->owned_gtid.sidno != 0) { -#ifdef WITH_WSREP - /* Action below will log an empty group of GTID. - This is done when the real action fails to generate any meaningful result on - executing slave. - Let's understand with an example: - * Topology master <-> slave - * Some action is performed on slave which put it out-of-sync from master. - * Master then execute same action. Slave may choose to ignore error arising - from execution of these actions using slave_skip_errors configuration but - the GTID sequence increment still need to register on slave to keep it in - sync with master. So a dummy trx of this form is created. Galera - eco-system too will capture this dummy trx and will execute it for - internal replication to keep GTID sequence consistent across - the cluster. */ - ha_wsrep_fake_trx_id(thd); - thd->wsrep_certify_empty_trx= true; -#endif // GTID logging and cleanup runs regardless of the current res error |= gtid_empty_group_log_and_cleanup(thd); } @@ -9666,8 +9656,7 @@ DBUG_PRINT("info",("m_table_id: %llu m_flags: %d m_width: %lu data_size: %lu", m_table_id.id(), m_flags, m_width, (ulong) data_size)); - // Allocate one extra byte, in case we have to do uint3korr! - m_rows_buf= (uchar*) my_malloc(data_size + 1, MYF(MY_WME)); // didrik + m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME)); if (likely((bool)m_rows_buf)) { #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) @@ -9794,9 +9783,8 @@ ulong const new_alloc= block_size * ((cur_size + length + block_size - 1) / block_size); - // Allocate one extra byte, in case we have to do uint3korr! uchar* const new_buf= - (uchar*)my_realloc((uchar*)m_rows_buf, (uint) new_alloc + 1, + (uchar*)my_realloc((uchar*)m_rows_buf, (uint) new_alloc, MYF(MY_ALLOW_ZERO_PTR|MY_WME)); if (unlikely(!new_buf)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); @@ -11635,6 +11623,9 @@ error= (this->*do_apply_row_ptr)(rli); + if (!error) + thd->updated_row_count++; + if (handle_idempotent_and_ignored_errors(rli, &error)) break; @@ -11643,6 +11634,14 @@ } while (!error && (m_curr_row != m_rows_end)); + if (unlikely(opt_userstat)) + { + thd->update_stats(false); +#ifndef EMBEDDED_LIBRARY + update_global_user_stats(thd, true, time(NULL)); +#endif + } + AFTER_MAIN_EXEC_ROW_LOOP: if (saved_m_curr_row != m_curr_row && !table->file->has_transactions()) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/mysqld.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/mysqld.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/mysqld.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/mysqld.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify @@ -88,7 +88,11 @@ #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #include "../storage/perfschema/pfs_server.h" +#else +#include "lf.h" +int dummy_variable_to_pull_in_lf_hash_functions= LF_HASH_OVERHEAD; #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + #include #include #include @@ -919,7 +923,6 @@ { DBUG_PRINT("info", ("add_global_thread %p", thd)); mysql_mutex_assert_owner(&LOCK_thread_count); - DBUG_ASSERT(!shutdown_in_progress); const bool have_thread= global_thread_list->find(thd) != global_thread_list->end(); if (!have_thread) @@ -1035,6 +1038,10 @@ thd->db, thd->db_length, thd->charset()); + /* + Starts a new stage in performance schema, if compiled in and enabled. + Also sets THD::proc_info (used by SHOW PROCESSLIST, column STATE) + */ THD_STAGE_INFO(thd, stage_init); } @@ -1049,20 +1056,17 @@ void init_net_server_extension(THD *thd) { -#ifdef HAVE_PSI_INTERFACE /* Start with a clean state for connection events. */ thd->m_idle_psi= NULL; thd->m_statement_psi= NULL; thd->m_server_idle= false; + /* Hook up the NET_SERVER callback in the net layer. */ thd->m_net_server_extension.m_user_data= thd; thd->m_net_server_extension.m_before_header= net_before_header_psi; thd->m_net_server_extension.m_after_header= net_after_header_psi; /* Activate this private extension for the mysqld server. */ thd->net.extension= & thd->m_net_server_extension; -#else - thd->net.extension= NULL; -#endif } #endif /* EMBEDDED_LIBRARY */ @@ -1318,7 +1322,7 @@ #ifdef HAVE_OPENSSL #include -#ifndef HAVE_YASSL +#if !defined(HAVE_YASSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L) typedef struct CRYPTO_dynlock_value { mysql_rwlock_t lock; @@ -1926,7 +1930,8 @@ wsrep->disconnect(wsrep); WSREP_INFO("Service disconnected."); wsrep_close_threads(thd); /* this won't close all threads */ - sleep(1); /* so give some time to exit for those which can */ + WSREP_INFO("Waiting to close threads......"); + sleep(5); /* so give some time to exit for those which can */ WSREP_INFO("Some threads may fail to exit."); } #endif // WITH_WSREP @@ -2171,7 +2176,7 @@ mysql_mutex_destroy(&LOCK_connection_count); #ifdef HAVE_OPENSSL mysql_mutex_destroy(&LOCK_des_key_file); -#ifndef HAVE_YASSL +#if !defined(HAVE_YASSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L) for (int i= 0; i < CRYPTO_num_locks(); ++i) mysql_rwlock_destroy(&openssl_stdlocks[i].lock); OPENSSL_free(openssl_stdlocks); @@ -3185,7 +3190,7 @@ } #endif /* WITH_WSREP */ // Clean up errors now, before possibly waiting for a new connection. -#ifndef EMBEDDED_LIBRARY +#if !defined(EMBEDDED_LIBRARY) && (OPENSSL_VERSION_NUMBER < 0x10100000L) ERR_remove_state(0); #endif @@ -4707,7 +4712,7 @@ #ifdef HAVE_OPENSSL mysql_mutex_init(key_LOCK_des_key_file, &LOCK_des_key_file, MY_MUTEX_INIT_FAST); -#ifndef HAVE_YASSL +#if !defined(HAVE_YASSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L) openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() * sizeof(openssl_lock_t)); for (int i= 0; i < CRYPTO_num_locks(); ++i) @@ -4779,7 +4784,8 @@ } -#if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL) +#if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL) && \ + (OPENSSL_VERSION_NUMBER < 0x10100000L) static unsigned long openssl_id_function() { return (unsigned long) pthread_self(); @@ -4851,7 +4857,7 @@ static int init_ssl() { #ifdef HAVE_OPENSSL -#ifndef HAVE_YASSL +#if !defined(HAVE_YASSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L) CRYPTO_malloc_init(); #endif ssl_start(); @@ -4869,7 +4875,9 @@ opt_ssl_crl, opt_ssl_crlpath, ssl_ctx_flags); DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd)); +#if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_remove_state(0); +#endif if (!ssl_acceptor_fd) { sql_print_warning("Failed to setup SSL"); @@ -5695,6 +5703,7 @@ const_cast(gtid_state->get_logged_gtids())); if (mysql_bin_log.open_binlog(opt_bin_logname, 0, WRITE_CACHE, max_binlog_size, false, + true/*need_lock_log=true*/, true/*need_lock_index=true*/, true/*need_sid_lock=true*/, NULL)) @@ -6330,6 +6339,7 @@ orig_argc= argc; orig_argv= argv; my_getopt_use_args_separator= TRUE; + my_defaults_read_login_file= FALSE; if (load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv)) return 1; my_getopt_use_args_separator= FALSE; @@ -11638,3 +11648,33 @@ #endif /* HAVE_PSI_INTERFACE */ +/* Detecting if being compiled with -fsanitize=address option */ + +/* GCC has __SANITIZE_ADDRESS__ macro defined to 1 in this case */ +#ifdef __GNUC__ + #if __SANITIZE_ADDRESS__ == 1 + #define UNDER_ADDRESS_SANITIZER + #endif +#endif + +/* Clang exposes __has_feature(address_sanitizer) */ +#ifdef __clang__ + #if __has_feature(address_sanitizer) + #define UNDER_ADDRESS_SANITIZER + #endif +#endif + +/* + As some MTR test cases check OOM, it is necessary to instruct address + sanitizer to not terminate the process when an allocation of a very + large memory block is requested and return NULL as expected. This can + be done by setting 'allocator_may_return_null' ASan option to 1. +*/ +#ifdef UNDER_ADDRESS_SANITIZER + +extern "C" const char *__asan_default_options() +{ + return "allocator_may_return_null=1"; +} + +#endif diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/mysqld.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/mysqld.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/mysqld.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/mysqld.h 2017-10-19 04:25:29.000000000 +0000 @@ -794,6 +794,8 @@ void free_global_client_stats(void); void free_global_thread_stats(void); +void refresh_concurrent_conn_stats(); + /* TODO: Replace this with an inline function. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/net_serv.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/net_serv.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/net_serv.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/net_serv.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -157,15 +157,13 @@ #endif DBUG_RETURN(1); } - pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1); + pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1); /* - We must allocate some extra bytes for the end 0 and to be able to - read big compressed blocks + 1 safety byte since uint3korr() in - net_read_packet() may actually read 4 bytes depending on build flags and - platform. + We must allocate some extra bytes for the end 0 and to be able to + read big compressed blocks in net_read_packet(). */ if (!(buff= (uchar*) my_realloc((char*) net->buff, pkt_length + - NET_HEADER_SIZE + COMP_HEADER_SIZE + 1, + NET_HEADER_SIZE + COMP_HEADER_SIZE, MYF(MY_WME)))) { /* @todo: 1 and 2 codes are identical. */ @@ -820,12 +818,11 @@ if (net->compress) { /* - The following uint3korr() may read 4 bytes, so make sure we don't - read unallocated or uninitialized memory. The right-hand expression - must match the size of the buffer allocated in net_realloc(). + The right-hand expression must match the size of the buffer + allocated in net_realloc(). */ DBUG_ASSERT(net->where_b + NET_HEADER_SIZE + sizeof(uint32) <= - net->max_packet + NET_HEADER_SIZE + COMP_HEADER_SIZE + 1); + net->max_packet + NET_HEADER_SIZE + COMP_HEADER_SIZE); /* If the packet is compressed then complen > 0 and contains the diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/opt_range.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/opt_range.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/opt_range.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/opt_range.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights * reserved. This program is free software; you can redistribute it and/or modify @@ -10902,8 +10902,14 @@ will use ha_index_prev() to read data, we need to let the handler know where to end the scan in order to avoid that the ICP implemention continues to read past the range boundary. + + An addition for MyRocks: + MyRocks needs to know both start of the range and end of the range + in order to use its bloom filters. This is useful regardless of whether + ICP is usable (e.g. it is used for index-only scans which do not use + ICP). Because of that, we remove the following: + // // if (file->pushed_idx_cond) */ - if (file->pushed_idx_cond) { if (!eqrange_all_keyparts) { @@ -11631,7 +11637,7 @@ part of 'cur_index' */ if (bitmap_is_set(table->read_set, cur_field->field_index) && - !cur_field->part_of_key_not_clustered.is_set(cur_index)) + !cur_field->is_part_of_actual_key(thd, cur_index)) { cause= "not_covering"; goto next_index; // Field was not part of key @@ -11831,7 +11837,7 @@ key_part_range[1]= last_part; /* Check if cur_part is referenced in the WHERE clause. */ - if (join->conds->walk(&Item::find_item_in_field_list_processor, 0, + if (join->conds->walk(&Item::find_item_in_field_list_processor, 1, (uchar*) key_part_range)) { cause= "keypart_reference_from_where_clause"; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/opt_sum.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/opt_sum.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/opt_sum.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/opt_sum.cc 2017-10-19 04:25:29.000000000 +0000 @@ -362,8 +362,7 @@ !((Item_sum_count*) item)->get_arg(0)->maybe_null) // 4 { Item_func_match* fts_item= static_cast(conds); - fts_item->init_search(true); - if (thd->is_error()) + if (fts_item->init_search(thd, true)) break; count= fts_item->get_count(); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/partition_info.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/partition_info.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/partition_info.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/partition_info.cc 2017-10-19 04:25:29.000000000 +0000 @@ -3127,6 +3127,30 @@ DBUG_PRINT("info", ("parser: %s", str)); DBUG_VOID_RETURN; } + +bool has_external_data_or_index_dir(partition_info &pi) +{ + List_iterator part_it(pi.partitions); + for (partition_element *part= part_it++; part; part= part_it++) + { + if (part->data_file_name != NULL || part->index_file_name != NULL) + { + return true; + } + List_iterator subpart_it(part->subpartitions); + for (const partition_element *subpart= subpart_it++; + subpart; + subpart= subpart_it++) + { + if (subpart->data_file_name != NULL || subpart->index_file_name != NULL) + { + return true; + } + } + } + return false; +} + #else /* WITH_PARTITION_STORAGE_ENGINE */ /* For builds without partitioning we need to define these functions diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/partition_info.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/partition_info.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/partition_info.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/partition_info.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef PARTITION_INFO_INCLUDED #define PARTITION_INFO_INCLUDED -/* 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 @@ -404,4 +404,15 @@ part_iter->get_next= get_next_partition_id_range; } +/** + Predicate which returns true if any partition or subpartition uses + an external data directory or external index directory. + + @param pi partitioning information + @retval true if any partition or subpartition has an external + data directory or external index directory. + @retval false otherwise + */ +bool has_external_data_or_index_dir(partition_info &pi); + #endif /* PARTITION_INFO_INCLUDED */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/records.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/records.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/records.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/records.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -627,10 +627,9 @@ rec_cache_size= info->cache_records*info->reclength; info->rec_cache_size= info->cache_records*info->ref_length; - // We have to allocate one more byte to use uint3korr (see comments for it) if (info->cache_records <= 2 || !(info->cache=(uchar*) my_malloc_lock(rec_cache_size+info->cache_records* - info->struct_length+1, + info->struct_length, MYF(0)))) { *info= info_copy; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_gtid_cache.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_gtid_cache.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_gtid_cache.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_gtid_cache.cc 2017-10-19 04:25:29.000000000 +0000 @@ -152,8 +152,12 @@ Replace sidno with wsrep_sidno if transaction went through wsrep commit */ - if (WSREP(thd) && thd->wsrep_trx_meta.gtid.seqno != -1) + if (WSREP(thd) && thd->wsrep_trx_meta.gtid.seqno != -1 && + !thd->wsrep_skip_wsrep_GTID) { + WSREP_DEBUG("using wsrep_sidno, seqno %llu %s", + (unsigned long long) thd->wsrep_trx_meta.gtid.seqno, + thd->query()); automatic_gtid.sidno= wsrep_sidno; } else diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_gtid_execution.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_gtid_execution.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_gtid_execution.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_gtid_execution.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -325,6 +325,7 @@ enum_sql_command sql_command= thd->lex->sql_command; if (sql_command == SQLCOM_COMMIT || sql_command == SQLCOM_BEGIN || sql_command == SQLCOM_ROLLBACK || + sql_command == SQLCOM_CHANGE_DB || ((sql_command == SQLCOM_SELECT || (sql_command == SQLCOM_SET_OPTION && !thd->lex->is_set_password_sql)) && !thd->lex->uses_stored_routines())) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_master.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_master.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_master.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_master.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -845,6 +845,7 @@ char *log_file_name = linfo.log_file_name; char search_file_name[FN_REFLEN], *name; + bool is_index_file_reopened_on_binlog_disable= false; ulong ev_offset; bool using_gtid_protocol= slave_gtid_executed != NULL; bool searching_first_gtid= using_gtid_protocol; @@ -1935,18 +1936,65 @@ if (goto_next_binlog) { + DBUG_EXECUTE_IF("waiting_for_disable_binlog", + { + const char act[]= "now " + "signal dump_thread_reached_wait_point " + "wait_for continue_dump_thread no_clear_event"; + DBUG_ASSERT(!debug_sync_set_action(current_thd, + STRING_WITH_LEN(act))); + };); + // clear flag because we open a new binlog binlog_has_previous_gtids_log_event= false; THD_STAGE_INFO(thd, stage_finished_reading_one_binlog_switching_to_next_binlog); - switch (mysql_bin_log.find_next_log(&linfo, 1)) { - case 0: - break; - default: + /* + When moving to next binlog, always check if binlog is enabled or not. + There can be critical errors like for example out of memory scenarios + which prevent mysqld server from writing to binlog. In those cases + server refers to binlog_error_action variable and takes the appropriate + action. If users choose to ignore the error then binary log will be + disabled and server will continue to do its work. In such cases dump + thread which is trying to move to the next log will fail as binlog index + file and binlog file are already closed and their corresponding caches + are also cleared. + + Hence first check if binary log is enabled or not. If enabled look for + the next binary log in the index file. If it is disabled open the index + file once again and check if there any more binary logs that needs to be + sent. Keep reading binary log files until find_next_log returns empty. + If there is an error during open index file or we sent all binary logs + then ER_MASTER_FATAL_ERROR_READING_BINLOG is raised. + */ + mysql_bin_log.lock_index(); + if (!mysql_bin_log.is_open()) + { + if (mysql_bin_log.open_index_file(mysql_bin_log.get_index_fname(), + linfo.log_file_name,FALSE)) + { + errmsg = "Binary log is not open and failed to open index file to " + "retrieve next file."; + my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; + mysql_bin_log.unlock_index(); + GOTO_ERR; + } + is_index_file_reopened_on_binlog_disable= true; + } + if (mysql_bin_log.find_next_log(&linfo, 0)) + { + DBUG_EXECUTE_IF("waiting_for_disable_binlog", + { + const char act[]= "now signal consumed_binlog"; + DBUG_ASSERT(!debug_sync_set_action(current_thd, + STRING_WITH_LEN(act))); + };); errmsg = "could not find next log"; my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; + mysql_bin_log.unlock_index(); GOTO_ERR; } + mysql_bin_log.unlock_index(); end_io_cache(&log); mysql_file_close(file, MYF(MY_WME)); @@ -2037,6 +2085,9 @@ error_text[sizeof(error_text) - 1]= '\0'; } end_io_cache(&log); + if (is_index_file_reopened_on_binlog_disable) + mysql_bin_log.close(LOG_CLOSE_INDEX, true/*need_lock_log=true*/, + true/*need_lock_index=true*/); if (has_transmit_started) (void) RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags)); /* @@ -2196,7 +2247,17 @@ ER(ER_FLUSH_MASTER_BINLOG_CLOSED), MYF(ME_BELL+ME_WAITTANG)); return 1; } - +#ifdef WITH_WSREP + if (WSREP(thd) && gtid_mode > 0) + { + /* RESET MASTER will initialize GTID sequence, and that would happen locally + in this node, so better reject it + */ + my_message(ER_NOT_ALLOWED_COMMAND, + "RESET MASTER not allowed when node is in cluster", MYF(0)); + return 1; + } +#endif if (mysql_bin_log.reset_logs(thd)) return 1; (void) RUN_HOOK(binlog_transmit, after_reset_master, (thd, 0 /* flags */)); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_record.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_record.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_record.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_record.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -487,11 +487,30 @@ */ DBUG_PRINT_BITSET("debug", "cols: %s", cols); + /** + Save a reference to the original write set bitmaps. + We will need this to restore the bitmaps at the end. + */ + MY_BITMAP *old_write_set= table->write_set; + /** + Just to be sure that tmp_set is currently not in use as + the read_set already. + */ + DBUG_ASSERT(table->write_set != &table->tmp_set); + /* set the temporary write_set */ + table->column_bitmaps_set_no_signal(table->read_set, + &table->tmp_set); + /** + Set table->write_set bits for all the columns as they + will be checked in set_default() function. + */ + bitmap_set_all(table->write_set); + for (Field **field_ptr= table->field; *field_ptr; ++field_ptr) { - if ((uint) (field_ptr - table->field) >= cols->n_bits || - !bitmap_is_set(cols, field_ptr - table->field)) - { + uint field_index= (uint) (field_ptr - table->field); + if (field_index >= cols->n_bits || !bitmap_is_set(cols, field_index)) + { Field *const f= *field_ptr; if ((f->flags & NO_DEFAULT_VALUE_FLAG) && (f->real_type() != MYSQL_TYPE_ENUM)) @@ -503,9 +522,17 @@ ER(ER_NO_DEFAULT_FOR_FIELD), f->field_name); } + else if (f->has_insert_default_function()) + { + f->set_default(); + } } } + /* set the write_set back to original*/ + table->column_bitmaps_set_no_signal(table->read_set, + old_write_set); + DBUG_RETURN(0); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -222,10 +222,12 @@ @param shift number of bits to shift by Worker due to the current checkpoint change. @param new_ts new seconds_behind_master timestamp value - unless zero. Zero could be due to FD event. + unless NULL. NULL could be due to FD event + or fake rotate event. @param need_data_lock False if caller has locked @c data_lock */ -void Relay_log_info::reset_notified_checkpoint(ulong shift, time_t new_ts, +void Relay_log_info::reset_notified_checkpoint(ulong shift, + const time_t *const new_ts, bool need_data_lock) { /* @@ -277,7 +279,7 @@ mysql_mutex_lock(&data_lock); else mysql_mutex_assert_owner(&data_lock); - last_master_timestamp= new_ts; + last_master_timestamp= *new_ts; if (need_data_lock) mysql_mutex_unlock(&data_lock); } @@ -628,7 +630,7 @@ @param[in] log_name log name to wait for, @param[in] log_pos position to wait for, @param[in] timeout @c timeout in seconds before giving up waiting. - @c timeout is longlong whereas it should be ulong; but this is + @c timeout is double whereas it should be ulong; but this is to catch if the user submitted a negative timeout. @retval -2 improper arguments (log_pos<0) @@ -642,7 +644,7 @@ int Relay_log_info::wait_for_pos(THD* thd, String* log_name, longlong log_pos, - longlong timeout) + double timeout) { int event_count = 0; ulong init_abort_pos_wait; @@ -657,7 +659,7 @@ DBUG_PRINT("enter",("log_name: '%s' log_pos: %lu timeout: %lu", log_name->c_ptr_safe(), (ulong) log_pos, (ulong) timeout)); - set_timespec(abstime,timeout); + set_timespec_nsec(abstime, (ulonglong) timeout * 1000000000ULL); mysql_mutex_lock(&data_lock); thd->ENTER_COND(&data_cond, &data_lock, &stage_waiting_for_the_slave_thread_to_advance_position, @@ -839,7 +841,7 @@ /Alfranio */ int Relay_log_info::wait_for_gtid_set(THD* thd, String* gtid, - longlong timeout) + double timeout) { int event_count = 0; ulong init_abort_pos_wait; @@ -851,10 +853,10 @@ if (!inited) DBUG_RETURN(-2); - DBUG_PRINT("info", ("Waiting for %s timeout %lld", gtid->c_ptr_safe(), + DBUG_PRINT("info", ("Waiting for %s timeout %f", gtid->c_ptr_safe(), timeout)); - set_timespec(abstime, timeout); + set_timespec_nsec(abstime, (ulonglong) timeout * 1000000000ULL); mysql_mutex_lock(&data_lock); thd->ENTER_COND(&data_cond, &data_lock, &stage_waiting_for_the_slave_thread_to_advance_position, @@ -1110,6 +1112,8 @@ const char** errmsg) { int error=0; + const char *ln; + char name_buf[FN_REFLEN]; DBUG_ENTER("Relay_log_info::purge_relay_logs"); bool binlog_prot_acquired= false; @@ -1138,7 +1142,7 @@ mysql_mutex_assert_not_owner(&data_lock); if (thd->backup_binlog_lock.acquire_protection(thd, MDL_EXPLICIT, timeout)) - return 1; + DBUG_RETURN(1); binlog_prot_acquired= true; } @@ -1149,18 +1153,58 @@ if (!inited) { DBUG_PRINT("info", ("inited == 0")); + if (error_on_rli_init_info) + { + ln= relay_log.generate_name(opt_relay_logname, "-relay-bin", + 1, name_buf); + if (relay_log.open_index_file(opt_relaylog_index_name, ln, TRUE)) + { + sql_print_error("Unable to purge relay log files. Failed to open relay " + "log index file:%s.", relay_log.get_index_fname()); - if (binlog_prot_acquired) + if (binlog_prot_acquired) + { + DBUG_PRINT("debug", ("Releasing binlog protection lock")); + thd->backup_binlog_lock.release_protection(thd); + } + DBUG_RETURN(1); + } + mysql_mutex_lock(&mi->data_lock); + if (relay_log.open_binlog(ln, 0, SEQ_READ_APPEND, + (max_relay_log_size ? max_relay_log_size : + max_binlog_size), true, + true/*need_lock_log=true*/, + true/*need_lock_index=true*/, + true/*need_sid_lock=true*/, + mi->get_mi_description_event())) + { + sql_print_error("Unable to purge relay log files. Failed to open relay " + "log file:%s.", relay_log.get_log_fname()); + mysql_mutex_unlock(&mi->data_lock); + if (binlog_prot_acquired) + { + DBUG_PRINT("debug", ("Releasing binlog protection lock")); + thd->backup_binlog_lock.release_protection(thd); + } + DBUG_RETURN(1); + } + mysql_mutex_unlock(&mi->data_lock); + } + else { - DBUG_PRINT("debug", ("Releasing binlog protection lock")); - thd->backup_binlog_lock.release_protection(thd); + if (binlog_prot_acquired) + { + DBUG_PRINT("debug", ("Releasing binlog protection lock")); + thd->backup_binlog_lock.release_protection(thd); + } + DBUG_RETURN(0); } - - DBUG_RETURN(0); } - - DBUG_ASSERT(slave_running == 0); - DBUG_ASSERT(mi->slave_running == 0); + else + { + DBUG_ASSERT(slave_running == 0); + DBUG_ASSERT(mi->slave_running == 0); + } slave_skip_counter= 0; mysql_mutex_lock(&data_lock); @@ -1201,6 +1245,11 @@ group_relay_log_pos, false/*need_data_lock=false*/, errmsg, 0); + if (!inited && error_on_rli_init_info) + relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT, + true/*need_lock_log=true*/, + true/*need_lock_index=true*/); + err: #ifndef DBUG_OFF char buf[22]; @@ -1874,6 +1923,7 @@ if (relay_log.open_binlog(ln, 0, SEQ_READ_APPEND, (max_relay_log_size ? max_relay_log_size : max_binlog_size), true, + true/*need_lock_log=true*/, true/*need_lock_index=true*/, true/*need_sid_lock=true*/, mi->get_mi_description_event())) @@ -1986,7 +2036,9 @@ error_on_rli_init_info= true; if (msg) sql_print_error("%s.", msg); - relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT); + relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT, + true/*need_lock_log=true*/, + true/*need_lock_index=true*/); DBUG_RETURN(error); } @@ -2007,7 +2059,9 @@ cur_log_fd= -1; } inited = 0; - relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT); + relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT, + true/*need_lock_log=true*/, + true/*need_lock_index=true*/); relay_log.harvest_bytes_written(&log_space_total); /* Delete the slave's temporary tables from memory. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -413,8 +413,8 @@ bool need_data_lock); int wait_for_pos(THD* thd, String* log_name, longlong log_pos, - longlong timeout); - int wait_for_gtid_set(THD* thd, String* gtid, longlong timeout); + double timeout); + int wait_for_gtid_set(THD* thd, String* gtid, double timeout); void close_temporary_tables(); /* Check if UNTIL condition is satisfied. See slave.cc for more. */ @@ -650,7 +650,8 @@ Coordinator notifies Workers about this event. Coordinator and Workers maintain a bitmap of executed group that is reset with a new checkpoint. */ - void reset_notified_checkpoint(ulong, time_t, bool); + void reset_notified_checkpoint(ulong, const time_t *const new_ts, + bool); /** Called when gaps execution is ended so it is crash-safe diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli_pdb.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli_pdb.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli_pdb.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli_pdb.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1437,16 +1437,12 @@ void* circular_buffer_queue::head_queue() { - uchar *ret= NULL; if (entry == size) { DBUG_ASSERT(len == 0); + return NULL; } - else - { - get_dynamic(&Q, (uchar*) ret, entry); - } - return (void*) ret; + return dynamic_array_ptr(&Q, entry); } /** @@ -1876,26 +1872,27 @@ ulonglong new_pend_size; PSI_stage_info old_stage; - DBUG_ASSERT(thd == current_thd); - if (ev_size > rli->mts_pending_jobs_size_max) - { - char llbuff[22]; - llstr(rli->get_event_relay_log_pos(), llbuff); - my_error(ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX, MYF(0), - ((Log_event*) (job_item->data))->get_type_str(), - rli->get_event_relay_log_name(), llbuff, ev_size, - rli->mts_pending_jobs_size_max); - /* Waiting in slave_stop_workers() avoidance */ - rli->mts_group_status= Relay_log_info::MTS_KILLED_GROUP; - return ret; - } - mysql_mutex_lock(&rli->pending_jobs_lock); new_pend_size= rli->mts_pending_jobs_size + ev_size; - // C waits basing on *data* sizes in the queues - while (new_pend_size > rli->mts_pending_jobs_size_max) + bool big_event= (ev_size > rli->mts_pending_jobs_size_max); + /* + C waits basing on *data* sizes in the queues. + If it is a big event (event size is greater than + slave_pending_jobs_size_max but less than slave_max_allowed_packet), + it will wait for all the jobs in the workers's queue to be + completed. If it is normal event (event size is less than + slave_pending_jobs_size_max), then it will wait for + enough empty memory to keep the event in one of the workers's + queue. + NOTE: Receiver thread (I/O thread) is taking care of restricting + the event size to slave_max_allowed_packet. If an event from + the master is bigger than this value, IO thread will be stopped + with error ER_NET_PACKET_TOO_LARGE. + */ + while ( (!big_event && new_pend_size > rli->mts_pending_jobs_size_max) + || (big_event && rli->mts_pending_jobs_size != 0 )) { rli->mts_wq_oversize= TRUE; rli->wq_size_waits_cnt++; // waiting due to the total size diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli_pdb.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli_pdb.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_rli_pdb.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_rli_pdb.h 2017-10-19 04:25:29.000000000 +0000 @@ -200,6 +200,7 @@ checkpoint_relay_log_pos= 0; checkpoint_seqno= (uint) -1; done= 0; + ts= 0; #ifndef DBUG_OFF notified= false; #endif diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_slave.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_slave.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/rpl_slave.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/rpl_slave.cc 2017-10-19 04:25:29.000000000 +0000 @@ -2026,7 +2026,9 @@ DBUG_EXECUTE_IF("dbug.before_get_MASTER_UUID", { - const char act[]= "now wait_for signal.get_master_uuid"; + const char act[] + = "now signal in_get_master_version_and_clock " + "wait_for signal.get_master_uuid"; DBUG_ASSERT(opt_debug_sync_timeout > 0); DBUG_ASSERT(!debug_sync_set_action(current_thd, STRING_WITH_LEN(act))); @@ -2285,7 +2287,7 @@ DBUG_EXECUTE_IF("dbug.before_get_UNIX_TIMESTAMP", { const char act[]= - "now " + "now signal in_get_master_version_and_clock " "wait_for signal.get_unix_timestamp"; DBUG_ASSERT(opt_debug_sync_timeout > 0); DBUG_ASSERT(!debug_sync_set_action(current_thd, @@ -2306,6 +2308,8 @@ mysql_mutex_lock(&mi->data_lock); mi->clock_diff_with_master= (long) (time((time_t*) 0) - strtoul(master_row[0], 0, 10)); + DBUG_EXECUTE_IF("dbug.mts.force_clock_diff_eq_0", + mi->clock_diff_with_master= 0;); mysql_mutex_unlock(&mi->data_lock); } else if (check_io_slave_killed(mi->info_thd, mi, NULL)) @@ -2345,7 +2349,7 @@ DBUG_EXECUTE_IF("dbug.before_get_SERVER_ID", { const char act[]= - "now " + "now signal in_get_master_version_and_clock " "wait_for signal.get_server_id"; DBUG_ASSERT(opt_debug_sync_timeout > 0); DBUG_ASSERT(!debug_sync_set_action(current_thd, @@ -3173,13 +3177,23 @@ protocol->store(mi->get_user(), &my_charset_bin); protocol->store((uint32) mi->port); protocol->store((uint32) mi->connect_retry); - protocol->store(mi->get_master_log_name(), &my_charset_bin); + const char * const master_log_file= + mi->get_master_log_name(); + protocol->store(master_log_file, &my_charset_bin); protocol->store((ulonglong) mi->get_master_log_pos()); protocol->store(mi->rli->get_group_relay_log_name() + dirname_length(mi->rli->get_group_relay_log_name()), &my_charset_bin); protocol->store((ulonglong) mi->rli->get_group_relay_log_pos()); - protocol->store(mi->rli->get_group_master_log_name(), &my_charset_bin); + const char * const relay_master_log_file= + mi->rli->get_group_master_log_name(); +#ifndef DBUG_OFF + const size_t master_log_file_len= strlen(master_log_file); + const size_t relay_master_log_file_len= strlen(relay_master_log_file); +#endif + DBUG_ASSERT((relay_master_log_file_len == master_log_file_len) + || !relay_master_log_file_len || !master_log_file_len); + protocol->store(relay_master_log_file, &my_charset_bin); protocol->store(mi->slave_running == MYSQL_SLAVE_RUN_CONNECT ? "Yes" : (mi->slave_running == MYSQL_SLAVE_RUN_NOT_CONNECT ? "Connecting" : "No"), &my_charset_bin); @@ -4506,11 +4520,17 @@ If it is an artificial event, or a relay log event (IO thread generated event) or ev->when is set to 0, or a FD from master, or a heartbeat event with server_id '0' then we don't update the last_master_timestamp. - */ - if (!(rli->is_parallel_exec() || - ev->is_artificial_event() || ev->is_relay_log_event() || - ev->when.tv_sec == 0 || ev->get_type_code() == FORMAT_DESCRIPTION_EVENT || - ev->server_id == 0)) + + In case of parallel execution last_master_timestamp is only updated when + an event is taken out of GAQ. Thus when last_master_timestamp is 0 we need + to initialize it with a timestamp from the first event to be executed in + parallel. + */ + if ((!rli->is_parallel_exec() || rli->last_master_timestamp == 0) && + !(ev->is_artificial_event() || ev->is_relay_log_event() || + ev->when.tv_sec == 0 || + ev->get_type_code() == FORMAT_DESCRIPTION_EVENT || + ev->server_id == 0)) { rli->last_master_timestamp= ev->when.tv_sec + (time_t) ev->exec_time; DBUG_ASSERT(rli->last_master_timestamp >= 0); @@ -4605,6 +4625,16 @@ DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); } };); + DBUG_EXECUTE_IF("dbug.calculate_sbm_after_fake_rotate_log_event", + { + if (ev->get_type_code() == ROTATE_EVENT && ev->is_artificial_event()) + { + const char act[]= "now signal signal.reached wait_for signal.done_sbm_calculation"; + DBUG_ASSERT(opt_debug_sync_timeout > 0); + DBUG_ASSERT(!debug_sync_set_action(thd, + STRING_WITH_LEN(act))); + } + };); /* Format_description_log_event should not be deleted because it will be used to read info about the relay log's format; it will be deleted when @@ -4883,11 +4913,14 @@ pthread_detach_this_thread(); thd->thread_stack= (char*) &thd; // remember where our stack is mi->clear_error(); + mi->slave_running = 1; if (init_slave_thread(thd, SLAVE_THD_IO)) { mysql_cond_broadcast(&mi->start_cond); mysql_mutex_unlock(&mi->run_lock); - sql_print_error("Failed during slave I/O thread initialization"); + mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, + ER_THD(thd, ER_SLAVE_FATAL_ERROR), + "Failed during slave I/O thread initialization"); goto err; } @@ -4896,7 +4929,6 @@ thd_added= true; mysql_mutex_unlock(&LOCK_thread_count); - mi->slave_running = 1; mi->abort_slave = 0; mysql_mutex_unlock(&mi->run_lock); mysql_cond_broadcast(&mi->start_cond); @@ -4951,9 +4983,14 @@ };); DBUG_EXECUTE_IF("dbug.calculate_sbm_after_previous_gtid_log_event", { - /* Fake that thread started 3 mints ago */ + /* Fake that thread started 3 minutes ago */ thd->start_time.tv_sec-=180; };); + DBUG_EXECUTE_IF("dbug.calculate_sbm_after_fake_rotate_log_event", + { + /* Fake that thread started 3 minutes ago */ + thd->start_time.tv_sec-=180; + };); mysql_mutex_lock(&mi->run_lock); mi->slave_running= MYSQL_SLAVE_RUN_CONNECT; mysql_mutex_unlock(&mi->run_lock); @@ -5301,7 +5338,9 @@ mysql_mutex_unlock(&mi->run_lock); DBUG_LEAVE; // Must match DBUG_ENTER() my_thread_end(); +#if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_remove_state(0); +#endif pthread_exit(0); return(0); // Avoid compiler warnings } @@ -5492,7 +5531,9 @@ } my_thread_end(); +#if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_remove_state(0); +#endif pthread_exit(0); DBUG_RETURN(0); } @@ -5840,6 +5881,7 @@ bool error= FALSE; struct timespec curr_clock; bool binlog_prot_acquired= false; + time_t ts=0; DBUG_ENTER("checkpoint_routine"); @@ -5849,16 +5891,33 @@ if (!rli->gaq->count_done(rli)) DBUG_RETURN(FALSE); } + DBUG_EXECUTE_IF("mts_checkpoint", + { + const char act[]= + "now signal mts_checkpoint_start"; + DBUG_ASSERT(!debug_sync_set_action(rli->info_thd, + STRING_WITH_LEN(act))); + };); #endif +#ifndef DBUG_OFF /* rli->checkpoint_group can have two possible values due to two possible status of the last (being scheduled) group. */ - DBUG_ASSERT(!rli->gaq->full() || - ((rli->checkpoint_seqno == rli->checkpoint_group -1 && - rli->mts_group_status == Relay_log_info::MTS_IN_GROUP) || - rli->checkpoint_seqno == rli->checkpoint_group)); + const bool precondition= !rli->gaq->full() || + ((rli->checkpoint_seqno == rli->checkpoint_group -1 && + rli->mts_group_status == Relay_log_info::MTS_IN_GROUP) || + rli->checkpoint_seqno == rli->checkpoint_group); + if (!precondition) + { + fprintf(stderr, "rli->gaq->full() = %d\n", rli->gaq->full()); + fprintf(stderr, "rli->checkpoint_seqno = %u\n", rli->checkpoint_seqno); + fprintf(stderr, "rli->checkpoint_group = %u\n", rli->checkpoint_group); + fprintf(stderr, "rli->mts_group_status = %d\n", rli->mts_group_status); + DBUG_ASSERT(precondition); + } +#endif /* Currently, the checkpoint routine is being called by the SQL Thread. @@ -5976,8 +6035,10 @@ cnt is zero. This value means that the checkpoint information will be completely reset. */ - rli->reset_notified_checkpoint(cnt, rli->gaq->lwm.ts, need_data_lock); - + ts= rli->gaq->empty() + ? 0 + : reinterpret_cast(rli->gaq->head_queue())->ts; + rli->reset_notified_checkpoint(cnt, &ts, need_data_lock); /* end-of "Coordinator::"commit_positions" */ end: @@ -5991,6 +6052,13 @@ #ifndef DBUG_OFF if (DBUG_EVALUATE_IF("check_slave_debug_group", 1, 0)) DBUG_SUICIDE(); + DBUG_EXECUTE_IF("mts_checkpoint", + { + const char act[]= + "now signal mts_checkpoint_end"; + DBUG_ASSERT(!debug_sync_set_action(rli->info_thd, + STRING_WITH_LEN(act))); + };); #endif set_timespec_nsec(rli->last_clock, 0); @@ -6234,10 +6302,8 @@ if (!*mts_inited) return; - else if (rli->slave_parallel_workers == 0) - goto end; - if (thd->killed == THD::NOT_KILLED) + if (rli->slave_parallel_workers != 0 && thd->killed == THD::NOT_KILLED) (void) mts_checkpoint_routine(rli, 0, false, true/*need_data_lock=true*/); // TODO:consider to propagate an error out of the function for (i= rli->workers.elements - 1; i >= 0; i--) @@ -6247,7 +6313,7 @@ delete_dynamic_element(&rli->workers, i); delete w; } - if (log_warnings > 1) + if (rli->slave_parallel_workers != 0 && log_warnings > 1) sql_print_information("Total MTS session statistics: " "events processed = %llu; " "worker queues filled over overrun level = %lu; " @@ -6261,7 +6327,6 @@ DBUG_ASSERT(rli->pending_jobs == 0); DBUG_ASSERT(rli->mts_pending_jobs_size == 0); -end: rli->mts_group_status= Relay_log_info::MTS_NOT_IN_GROUP; destroy_hash_workers(rli); delete rli->gaq; @@ -6735,7 +6800,9 @@ DBUG_LEAVE; // Must match DBUG_ENTER() my_thread_end(); +#if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_remove_state(0); +#endif pthread_exit(0); return 0; // Avoid compiler warnings } @@ -8258,9 +8325,6 @@ */ (void) mts_checkpoint_routine(rli, period, false, true/*need_data_lock=true*/); // TODO: ALFRANIO ERROR mysql_mutex_lock(log_lock); - // More to the empty relay-log all assigned events done so reset it. - if (rli->gaq->empty()) - rli->last_master_timestamp= 0; if (DBUG_EVALUATE_IF("check_slave_debug_group", 1, 0)) period= 10000000ULL; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/set_var.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/set_var.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/set_var.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/set_var.cc 2017-10-19 04:25:29.000000000 +0000 @@ -551,6 +551,9 @@ @param THD Thread id @param var_list List of variables to update + @param free_joins Whether to free subselect joins if any. They are + freed by default, except for SET STATEMENT ... FOR ... + processing @retval 0 ok @@ -560,7 +563,7 @@ -1 ERROR, message not sent */ -int sql_set_variables(THD *thd, List *var_list) +int sql_set_variables(THD *thd, List *var_list, bool free_joins) { int error; List_iterator_fast it(*var_list); @@ -580,7 +583,8 @@ } err: - free_underlaid_joins(thd, &thd->lex->select_lex); + if (free_joins) + free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(error); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/set_var.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/set_var.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/set_var.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/set_var.h 2017-10-19 04:25:29.000000000 +0000 @@ -360,7 +360,10 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type); sys_var *find_sys_var(THD *thd, const char *str, uint length=0); -int sql_set_variables(THD *thd, List *var_list); + +MY_ATTRIBUTE((warn_unused_result)) +int sql_set_variables(THD *thd, List *var_list, + bool free_joins = true); bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sp.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sp.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sp.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sp.cc 2017-10-19 04:25:29.000000000 +0000 @@ -373,7 +373,7 @@ my_vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - if (code) + if (code == ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2) my_message(code, buf, MYF(0)); else my_error(ER_CANNOT_LOAD_FROM_TABLE_V2, MYF(0), "mysql", "proc"); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sp_instr.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sp_instr.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sp_instr.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sp_instr.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ #include "sql_prepare.h" // reinit_stmt_before_use #include "transaction.h" // trans_commit_stmt #include "sql_audit.h" +#include "debug_sync.h" // DEBUG_SYNC #include @@ -397,6 +398,8 @@ } else { + DEBUG_SYNC(thd, "sp_before_exec_core"); + rc= exec_core(thd, nextp); DBUG_PRINT("info",("exec_core returned: %d", rc)); } @@ -423,14 +426,50 @@ thd->rollback_item_tree_changes(); /* - Update the state of the active arena if no errors on - open_tables stage. + Change state of current arena according to outcome of execution. + + When entering this function, state is STMT_INITIALIZED_FOR_SP if this is + the first execution, otherwise it is STMT_EXECUTED. + + When an error occurs during opening tables, no execution takes place and + no state change will take place. + + When a re-prepare error is raised, the next execution will re-prepare the + statement. To make sure that items are created in the statement mem_root, + change state to STMT_INITIALIZED_FOR_SP. + + In other cases, the state should become (or remain) STMT_EXECUTED. + See Query_arena->state definition for explanation. + + Some special handling of CREATE TABLE .... SELECT in an SP is required. The + state is always set to STMT_INITIALIZED_FOR_SP in such a case. + + Why is this necessary? A useful pointer would be to note how + PREPARE/EXECUTE uses functions like select_like_stmt_test to implement + CREATE TABLE .... SELECT. The SELECT part of the DDL is resolved first. + Then there is an attempt to create the table. So in the execution phase, + if "table exists" error occurs or flush table preceeds the execute, the + item tree of the select is re-created and followed by an attempt to create + the table. + + But SP uses mysql_execute_command (which is used by the conventional + execute) after doing a parse. This creates a problem for SP since it + tries to preserve the item tree from the previous execution. */ - if (!rc || !thd->is_error() || - (thd->get_stmt_da()->sql_errno() != ER_CANT_REOPEN_TABLE && - thd->get_stmt_da()->sql_errno() != ER_NO_SUCH_TABLE && - thd->get_stmt_da()->sql_errno() != ER_UPDATE_TABLE_USED)) + bool reprepare_error= + rc && thd->is_error() + && thd->get_stmt_da()->sql_errno() == ER_NEED_REPREPARE; + bool is_create_table_select= + thd->lex && thd->lex->sql_command == SQLCOM_CREATE_TABLE && + thd->lex->select_lex.item_list.elements > 0; + + if (reprepare_error || is_create_table_select) + thd->stmt_arena->state= Query_arena::STMT_INITIALIZED_FOR_SP; + else if (!rc || !thd->is_error() || + (thd->get_stmt_da()->sql_errno() != ER_CANT_REOPEN_TABLE && + thd->get_stmt_da()->sql_errno() != ER_NO_SUCH_TABLE && + thd->get_stmt_da()->sql_errno() != ER_UPDATE_TABLE_USED)) thd->stmt_arena->state= Query_arena::STMT_EXECUTED; /* @@ -494,7 +533,7 @@ initiated. Also set the statement query arena to the lex mem_root. */ MEM_ROOT *execution_mem_root= thd->mem_root; - Query_arena parse_arena(&m_lex_mem_root, STMT_INITIALIZED_FOR_SP); + Query_arena parse_arena(&m_lex_mem_root, thd->stmt_arena->state); thd->mem_root= &m_lex_mem_root; thd->stmt_arena->set_query_arena(&parse_arena); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_acl.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_acl.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_acl.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_acl.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. -sql_authenticate +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. @@ -61,6 +61,11 @@ #include #endif +#ifndef DBUG_OFF +#define HASH_STRING_WITH_QUOTE \ + "$5$BVZy9O>'a+2MH]_?$fpWyabcdiHjfCVqId/quykZzjaA7adpkcen/uiQrtmOK4p4" +#endif + using std::min; using std::max; @@ -188,9 +193,416 @@ } }; +static const +TABLE_FIELD_TYPE mysql_user_table_fields[MYSQL_USER_FIELD_COUNT] = { + { + { C_STRING_WITH_LEN("Host") }, + { C_STRING_WITH_LEN("char(60)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("User") }, + { C_STRING_WITH_LEN("char(16)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Password") }, + { C_STRING_WITH_LEN("char(41)") }, + { C_STRING_WITH_LEN("latin1") } + }, + { + { C_STRING_WITH_LEN("Select_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Insert_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Update_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Delete_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Create_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Drop_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Reload_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Shutdown_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Process_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("File_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Grant_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("References_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Index_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Alter_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Show_db_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Super_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Create_tmp_table_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Lock_tables_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Execute_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Repl_slave_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Repl_client_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Create_view_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Show_view_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Create_routine_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Alter_routine_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Create_user_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Event_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Trigger_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Create_tablespace_priv") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("ssl_type") }, + { C_STRING_WITH_LEN("enum('','ANY','X509','SPECIFIED')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("ssl_cipher") }, + { C_STRING_WITH_LEN("blob") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("x509_issuer") }, + { C_STRING_WITH_LEN("blob") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("x509_subject") }, + { C_STRING_WITH_LEN("blob") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("max_questions") }, + { C_STRING_WITH_LEN("int(11)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("max_updates") }, + { C_STRING_WITH_LEN("int(11)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("max_connections") }, + { C_STRING_WITH_LEN("int(11)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("max_user_connections") }, + { C_STRING_WITH_LEN("int(11)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("plugin") }, + { C_STRING_WITH_LEN("char(64)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("authentication_string") }, + { C_STRING_WITH_LEN("text") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("password_expired") }, + { C_STRING_WITH_LEN("enum('N','Y')") }, + { C_STRING_WITH_LEN("utf8") } + } +}; + +static const +TABLE_FIELD_TYPE mysql_proxies_priv_table_fields[MYSQL_PROXIES_PRIV_FIELD_COUNT] = { + { + { C_STRING_WITH_LEN("Host") }, + { C_STRING_WITH_LEN("char(60)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("User") }, + { C_STRING_WITH_LEN("char(16)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Proxied_host") }, + { C_STRING_WITH_LEN("char(60)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Proxied_user") }, + { C_STRING_WITH_LEN("char(16)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("With_grant") }, + { C_STRING_WITH_LEN("tinyint(1)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Grantor") }, + { C_STRING_WITH_LEN("char(77)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Timestamp") }, + { C_STRING_WITH_LEN("timestamp") }, + {NULL, 0} + } +}; + +static const +TABLE_FIELD_TYPE mysql_procs_priv_table_fields[MYSQL_PROCS_PRIV_FIELD_COUNT] = { + { + { C_STRING_WITH_LEN("Host") }, + { C_STRING_WITH_LEN("char(60)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Db") }, + { C_STRING_WITH_LEN("char(64)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("User") }, + { C_STRING_WITH_LEN("char(16)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Routine_name") }, + { C_STRING_WITH_LEN("char(64)") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Routine_type") }, + { C_STRING_WITH_LEN("enum('FUNCTION','PROCEDURE')") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Grantor") }, + { C_STRING_WITH_LEN("char(77)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Proc_priv") }, + { C_STRING_WITH_LEN("set('Execute','Alter Routine','Grant')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Timestamp") }, + { C_STRING_WITH_LEN("timestamp") }, + {NULL, 0} + } +}; + +static const +TABLE_FIELD_TYPE mysql_columns_priv_table_fields[MYSQL_COLUMNS_PRIV_FIELD_COUNT] = { + { + { C_STRING_WITH_LEN("Host") }, + { C_STRING_WITH_LEN("char(60)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Db") }, + { C_STRING_WITH_LEN("char(64)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("User") }, + { C_STRING_WITH_LEN("char(16)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Table_name") }, + { C_STRING_WITH_LEN("char(64)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Column_name") }, + { C_STRING_WITH_LEN("char(64)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Timestamp") }, + { C_STRING_WITH_LEN("timestamp") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Column_priv") }, + { C_STRING_WITH_LEN("set('Select','Insert','Update','References')") }, + { C_STRING_WITH_LEN("utf8") } + } +}; + +static const +TABLE_FIELD_TYPE mysql_tables_priv_table_fields[MYSQL_TABLES_PRIV_FIELD_COUNT] = { + { + { C_STRING_WITH_LEN("Host") }, + { C_STRING_WITH_LEN("char(60)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Db") }, + { C_STRING_WITH_LEN("char(64)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("User") }, + { C_STRING_WITH_LEN("char(16)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Table_name") }, + { C_STRING_WITH_LEN("char(64)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Grantor") }, + { C_STRING_WITH_LEN("char(77)") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Timestamp") }, + { C_STRING_WITH_LEN("timestamp") }, + {NULL, 0} + }, + { + { C_STRING_WITH_LEN("Table_priv") }, + { C_STRING_WITH_LEN("set('Select','Insert','Update','Delete','Create'," + "'Drop','Grant','References','Index','Alter'," + "'Create View','Show view','Trigger')") }, + { C_STRING_WITH_LEN("utf8") } + }, + { + { C_STRING_WITH_LEN("Column_priv") }, + { C_STRING_WITH_LEN("set('Select','Insert','Update','References')") }, + { C_STRING_WITH_LEN("utf8") } + } +}; + + const TABLE_FIELD_DEF mysql_db_table_def= {MYSQL_DB_FIELD_COUNT, mysql_db_table_fields}; +const TABLE_FIELD_DEF + mysql_user_table_def= {MYSQL_USER_FIELD_COUNT, mysql_user_table_fields}; + +const TABLE_FIELD_DEF + mysql_proxies_priv_table_def= {MYSQL_PROXIES_PRIV_FIELD_COUNT, + mysql_proxies_priv_table_fields}; + +const TABLE_FIELD_DEF + mysql_procs_priv_table_def= {MYSQL_PROCS_PRIV_FIELD_COUNT, + mysql_procs_priv_table_fields}; + +const TABLE_FIELD_DEF + mysql_columns_priv_table_def= {MYSQL_COLUMNS_PRIV_FIELD_COUNT, + mysql_columns_priv_table_fields}; + +const TABLE_FIELD_DEF + mysql_tables_priv_table_def= {MYSQL_TABLES_PRIV_FIELD_COUNT, + mysql_tables_priv_table_fields}; + static LEX_STRING native_password_plugin_name= { C_STRING_WITH_LEN("mysql_native_password") }; @@ -635,6 +1047,35 @@ return (uchar*) entry->key; } + +/** + Class to validate the flawlessness of ACL table + before performing ACL operations. +*/ +class Acl_table_intact : public Table_check_intact +{ +protected: + void report_error(uint code, const char *fmt, ...) + { + va_list args; + va_start(args, fmt); + + if (code == 0) + error_log_print(WARNING_LEVEL, fmt, args); + else if (code == ER_CANNOT_LOAD_FROM_TABLE_V2) + { + char *db_name, *table_name; + db_name= va_arg(args, char *); + table_name= va_arg(args, char *); + my_error(code, MYF(ME_NOREFRESH), db_name, table_name); + } + else + my_printv_error(code, ER(code), MYF(ME_NOREFRESH), args); + + va_end(args); + } +}; + #define IP_ADDR_STRLEN (3 + 1 + 3 + 1 + 3 + 1 + 3) #define ACL_KEY_LENGTH (IP_ADDR_STRLEN + 1 + NAME_LEN + \ 1 + USERNAME_LENGTH + 1) @@ -667,6 +1108,33 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables); static my_bool grant_load(THD *thd, TABLE_LIST *tables); static inline void get_grantor(THD *thd, char* grantor); + +/** + Escapes special characters in the unescaped string, taking into account + the current character set and sql mode. + + @param thd [in] The thd structure. + @param to [out] Escaped string output buffer. + @param from [in] String to escape. + @param length [in] String to escape length. + + @return Result value. + @retval != (ulong)-1 Succeeded. Number of bytes written to the output + buffer without the '\0' character. + @retval (ulong)-1 Failed. +*/ + +inline ulong escape_string_mysql(THD *thd, char *to, const char *from, + ulong length) +{ + if (!(thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)) + return (uint)escape_string_for_mysql(system_charset_info, to, 0, from, + length); + else + return (uint)escape_quotes_for_mysql(system_charset_info, to, 0, from, + length); +} + /* Enumeration of various ACL's and Hashes used in handle_grant_struct() */ @@ -2448,13 +2916,15 @@ { TABLE_LIST tables; TABLE *table; + Acl_table_intact table_intact; /* Buffer should be extended when password length is extended. */ - char buff[512]; + char buff[2048]; ulong query_length=0; bool save_binlog_row_based; uchar user_key[MAX_KEY_LENGTH]; char *plugin_temp= NULL; bool plugin_empty; + char *new_escaped_password= NULL; uint new_password_len= (uint) strlen(new_password); bool result= 1; enum mysql_user_table_field password_field= MYSQL_USER_FIELD_PASSWORD; @@ -2503,6 +2973,9 @@ if (!(table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT))) DBUG_RETURN(1); + if (table_intact.check(table, &mysql_user_table_def)) + DBUG_RETURN(1); + if (!table->key_info) { my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str, @@ -2751,10 +3224,29 @@ acl_cache->clear(1); // Clear locked hostname cache mysql_mutex_unlock(&acl_cache->lock); result= 0; + /* + Before writing the query to binlog, correctly escape the password + string so that the slave can parse it correctly. + */ + + new_escaped_password= (char *)alloc_root(thd->mem_root, (new_password_len*2+1)); + if (!new_escaped_password) + { + my_error(ER_OUTOFMEMORY, MYF(ME_FATALERROR), 0); + result= 1; + goto end; + } + + DBUG_EXECUTE_IF("force_hash_string_with_quote", + strcpy(new_password, HASH_STRING_WITH_QUOTE); + ); + + escape_string_mysql(thd, new_escaped_password, new_password, new_password_len); + query_length= sprintf(buff, "SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'", acl_user->user ? acl_user->user : "", acl_user->host.get_host() ? acl_user->host.get_host() : "", - new_password); + new_escaped_password); result= write_bin_log(thd, true, buff, query_length, table->file->has_transactions()); end: @@ -3095,9 +3587,14 @@ char what= (revoke_grant) ? 'N' : 'Y'; uchar user_key[MAX_KEY_LENGTH]; LEX *lex= thd->lex; + Acl_table_intact table_intact; DBUG_ENTER("replace_user_table"); mysql_mutex_assert_owner(&acl_cache->lock); + + if (table_intact.check(table, &mysql_user_table_def)) + goto end; + if (acl_is_utility_user(combo->user.str, combo->host.str, NULL)) { my_error(ER_NONEXISTING_GRANT, MYF(0), combo->user.str, combo->host.str); @@ -3332,7 +3829,7 @@ * An empty password is considered to be of mysql_native type. */ - if (combo->plugin.str == NULL || combo->plugin.str == '\0') + if (combo->plugin.str == NULL || combo->plugin.str[0] == '\0') { if (combo->uses_identified_by_password_clause) { @@ -3637,6 +4134,7 @@ int error; char what= (revoke_grant) ? 'N' : 'Y'; uchar user_key[MAX_KEY_LENGTH]; + Acl_table_intact table_intact; DBUG_ENTER("replace_db_table"); if (!initialized) @@ -3645,6 +4143,9 @@ DBUG_RETURN(-1); } + if (table_intact.check(table, &mysql_db_table_def)) + DBUG_RETURN(-1); + /* Check if there is such a user in user table in memory? */ if (!find_acl_user(combo.host.str,combo.user.str, FALSE)) { @@ -3785,6 +4286,7 @@ uchar user_key[MAX_KEY_LENGTH]; ACL_PROXY_USER new_grant; char grantor[USER_HOST_BUFF_SIZE]; + Acl_table_intact table_intact; DBUG_ENTER("replace_proxies_priv_table"); @@ -3794,6 +4296,9 @@ DBUG_RETURN(-1); } + if (table_intact.check(table, &mysql_proxies_priv_table_def)) + DBUG_RETURN(-1); + /* Check if there is such a user in user table in memory? */ if (!find_acl_user(user->host.str,user->user.str, FALSE)) { @@ -4195,8 +4700,13 @@ int result=0; uchar key[MAX_KEY_LENGTH]; uint key_prefix_length; + KEY_PART_INFO *key_part; + Acl_table_intact table_intact; DBUG_ENTER("replace_column_table"); + if (table_intact.check(table, &mysql_columns_priv_table_def)) + DBUG_RETURN(-1); + if (!table->key_info) { my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str, @@ -4204,7 +4714,7 @@ DBUG_RETURN(-1); } - KEY_PART_INFO *key_part= table->key_info->key_part; + key_part= table->key_info->key_part; table->use_all_columns(); table->field[0]->store(combo.host.str,combo.host.length, @@ -4418,8 +4928,12 @@ int error=0; ulong store_table_rights, store_col_rights; uchar user_key[MAX_KEY_LENGTH]; + Acl_table_intact table_intact; DBUG_ENTER("replace_table_table"); + if (table_intact.check(table, &mysql_tables_priv_table_def)) + DBUG_RETURN(-1); + get_grantor(thd, grantor); /* The following should always succeed as new users are created before @@ -4542,6 +5056,7 @@ int old_row_exists= 1; int error=0; ulong store_proc_rights; + Acl_table_intact table_intact; DBUG_ENTER("replace_routine_table"); if (!initialized) @@ -4550,6 +5065,9 @@ DBUG_RETURN(-1); } + if (table_intact.check(table, &mysql_procs_priv_table_def)) + DBUG_RETURN(-1); + get_grantor(thd, grantor); /* New users are created before this function is called. @@ -5948,7 +6466,7 @@ of other queries). For simple queries first_not_own_table is 0. */ for (i= 0, tl= tables; - i < number && tl != first_not_own_table; + tl != 0 && i < number && tl != first_not_own_table; tl= tl->next_global, i++) { /* @@ -7765,6 +8283,7 @@ int result= 0; int found; int ret; + Acl_table_intact table_intact; DBUG_ENTER("handle_grant_data"); /* Handle special utility user */ @@ -7784,6 +8303,12 @@ } } /* Handle user table. */ + if (table_intact.check(tables[0].table, &mysql_user_table_def)) + { + result= -1; + goto end; + } + if ((found= handle_grant_table(tables, 0, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch the in-memory array. */ @@ -7808,6 +8333,12 @@ } /* Handle db table. */ + if (table_intact.check(tables[1].table, &mysql_db_table_def)) + { + result= -1; + goto end; + } + if ((found= handle_grant_table(tables, 1, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch the in-memory array. */ @@ -7832,6 +8363,12 @@ } /* Handle stored routines table. */ + if (table_intact.check(tables[4].table, &mysql_procs_priv_table_def)) + { + result= -1; + goto end; + } + if ((found= handle_grant_table(tables, 4, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch in-memory array. */ @@ -7872,6 +8409,12 @@ } /* Handle tables table. */ + if (table_intact.check(tables[2].table, &mysql_tables_priv_table_def)) + { + result= -1; + goto end; + } + if ((found= handle_grant_table(tables, 2, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch columns and in-memory array. */ @@ -7888,6 +8431,12 @@ } /* Handle columns table. */ + if (table_intact.check(tables[3].table, &mysql_columns_priv_table_def)) + { + result= -1; + goto end; + } + if ((found= handle_grant_table(tables, 3, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch the in-memory array. */ @@ -7908,6 +8457,12 @@ /* Handle proxies_priv table. */ if (tables[5].table) { + if (table_intact.check(tables[5].table, &mysql_proxies_priv_table_def)) + { + result= -1; + goto end; + } + if ((found= handle_grant_table(tables, 5, drop, user_from, user_to)) < 0) { /* Handle of table failed, don't touch the in-memory array. */ @@ -8356,6 +8911,7 @@ TABLE *table; bool some_passwords_expired= false; bool save_binlog_row_based; + Acl_table_intact table_intact; DBUG_ENTER("mysql_user_password_expire"); if (!initialized) @@ -8385,6 +8941,9 @@ if (!(table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT))) DBUG_RETURN(true); + if (table_intact.check(table, &mysql_user_table_def)) + DBUG_RETURN(true); + if (!table->key_info) { my_error(ER_TABLE_CORRUPT, MYF(0), table->s->db.str, @@ -10532,6 +11091,9 @@ { static char empty_string[1]= { '\0' }; char *begin= *buffer; + uchar *pos= (uchar *)begin; + size_t required_length= 9; + if (*max_bytes_available == 0) return NULL; @@ -10552,6 +11114,29 @@ return empty_string; } + /* Make sure we have enough bytes available for net_field_length_ll */ + { + DBUG_EXECUTE_IF("buffer_too_short_3", + *pos= 252; *max_bytes_available= 2; + ); + DBUG_EXECUTE_IF("buffer_too_short_4", + *pos= 253; *max_bytes_available= 3; + ); + DBUG_EXECUTE_IF("buffer_too_short_9", + *pos= 254; *max_bytes_available= 8; + ); + + if (*pos <= 251) + required_length= 1; + if (*pos == 252) + required_length= 3; + if (*pos == 253) + required_length= 4; + + if (*max_bytes_available < required_length) + return NULL; + } + *string_length= (size_t)net_field_length_ll((uchar **)buffer); DBUG_EXECUTE_IF("sha256_password_scramble_too_long", @@ -10559,6 +11144,9 @@ ); size_t len_len= (size_t)(*buffer - begin); + + DBUG_ASSERT((*max_bytes_available >= len_len) && + (len_len == required_length)); if (*string_length > *max_bytes_available - len_len) return NULL; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_acl.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_acl.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_acl.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_acl.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef SQL_ACL_INCLUDED #define SQL_ACL_INCLUDED -/* 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 @@ -226,6 +226,56 @@ MYSQL_USER_FIELD_COUNT }; +enum mysql_proxies_priv_table_feild +{ + MYSQL_PROXIES_PRIV_FIELD_HOST = 0, + MYSQL_PROXIES_PRIV_FIELD_USER, + MYSQL_PROXIES_PRIV_FIELD_PROXIED_HOST, + MYSQL_PROXIES_PRIV_FIELD_PROXIED_USER, + MYSQL_PROXIES_PRIV_FIELD_WITH_GRANT, + MYSQL_PROXIES_PRIV_FIELD_GRANTOR, + MYSQL_PROXIES_PRIV_FIELD_TIMESTAMP, + MYSQL_PROXIES_PRIV_FIELD_COUNT +}; + +enum mysql_procs_priv_table_field +{ + MYSQL_PROCS_PRIV_FIELD_HOST = 0, + MYSQL_PROCS_PRIV_FIELD_DB, + MYSQL_PROCS_PRIV_FIELD_USER, + MYSQL_PROCS_PRIV_FIELD_ROUTINE_NAME, + MYSQL_PROCS_PRIV_FIELD_ROUTINE_TYPE, + MYSQL_PROCS_PRIV_FIELD_GRANTOR, + MYSQL_PROCS_PRIV_FIELD_PROC_PRIV, + MYSQL_PROCS_PRIV_FIELD_TIMESTAMP, + MYSQL_PROCS_PRIV_FIELD_COUNT +}; + +enum mysql_columns_priv_table_field +{ + MYSQL_COLUMNS_PRIV_FIELD_HOST = 0, + MYSQL_COLUMNS_PRIV_FIELD_DB, + MYSQL_COLUMNS_PRIV_FIELD_USER, + MYSQL_COLUMNS_PRIV_FIELD_TABLE_NAME, + MYSQL_COLUMNS_PRIV_FIELD_COLUMN_NAME, + MYSQL_COLUMNS_PRIV_FIELD_TIMESTAMP, + MYSQL_COLUMNS_PRIV_FIELD_COLUMN_PRIV, + MYSQL_COLUMNS_PRIV_FIELD_COUNT +}; + +enum mysql_tables_priv_table_field +{ + MYSQL_TABLES_PRIV_FIELD_HOST = 0, + MYSQL_TABLES_PRIV_FIELD_DB, + MYSQL_TABLES_PRIV_FIELD_USER, + MYSQL_TABLES_PRIV_FIELD_TABLE_NAME, + MYSQL_TABLES_PRIV_FIELD_GRANTOR, + MYSQL_TABLES_PRIV_FIELD_TIMESTAMP, + MYSQL_TABLES_PRIV_FIELD_TABLE_PRIV, + MYSQL_TABLES_PRIV_FIELD_COLUMN_PRIV, + MYSQL_TABLES_PRIV_FIELD_COUNT +}; + extern const TABLE_FIELD_DEF mysql_db_table_def; extern bool mysql_user_table_is_in_short_password_format; extern my_bool disconnect_on_expired_password; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_admin.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_admin.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_admin.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_admin.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1065,6 +1065,10 @@ if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, FALSE, UINT_MAX, FALSE)) goto error; + + DBUG_EXECUTE_IF("sql_cmd.before_toi_begin.log_command", + { sql_print_information("In Sql_cmd_analyze_table::execute()");}); + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); thd->set_slow_log_for_admin_command(); res= mysql_admin_table(thd, first_table, &thd->lex->check_opt, @@ -1096,6 +1100,10 @@ if (check_table_access(thd, SELECT_ACL, first_table, TRUE, UINT_MAX, FALSE)) goto error; /* purecov: inspected */ + + DBUG_EXECUTE_IF("sql_cmd.before_toi_begin.log_command", + { sql_print_information("In Sql_cmd_check_table::execute()");}); + thd->enable_slow_log= opt_log_slow_admin_statements; res= mysql_admin_table(thd, first_table, &thd->lex->check_opt, "check", @@ -1119,6 +1127,10 @@ if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, FALSE, UINT_MAX, FALSE)) goto error; /* purecov: inspected */ + + DBUG_EXECUTE_IF("sql_cmd.before_toi_begin.log_command", + { sql_print_information("In Sql_cmd_optimize_table::execute()");}); + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); thd->set_slow_log_for_admin_command(); res= (specialflag & SPECIAL_NO_NEW_FUNC) ? @@ -1151,6 +1163,10 @@ if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, FALSE, UINT_MAX, FALSE)) goto error; /* purecov: inspected */ + + DBUG_EXECUTE_IF("sql_cmd.before_toi_begin.log_command", + { sql_print_information("In Sql_cmd_repair_table::execute()");}); + WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); thd->set_slow_log_for_admin_command(); res= mysql_admin_table(thd, first_table, &thd->lex->check_opt, "repair", diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_alter.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_alter.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_alter.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_alter.cc 2017-10-19 04:25:29.000000000 +0000 @@ -87,6 +87,24 @@ return false; } +/** + Checks if there are any columns with COLUMN_FORMAT COMRPESSED + attribute among field definitions in create_list. + + @retval false there are no compressed columns + @retval true there is at least one compressed column +*/ +bool Alter_info::has_compressed_columns() const +{ + List_iterator it( + const_cast&>(create_list)); + const Create_field* sql_field; + while ((sql_field= it++)) + if (sql_field->column_format() == COLUMN_FORMAT_TYPE_COMPRESSED) + return true; + return false; +} + Alter_table_ctx::Alter_table_ctx() : datetime_field(NULL), error_if_not_empty(false), diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_alter.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_alter.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_alter.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_alter.h 2017-10-19 04:25:29.000000000 +0000 @@ -255,6 +255,15 @@ bool set_requested_lock(const LEX_STRING *str); + /** + Checks if there are any columns with COLUMN_FORMAT COMRPESSED + attribute among field definitions in create_list. + + @retval false there are no compressed columns + @retval true there is at least one compressed column + */ + bool has_compressed_columns() const; + private: Alter_info &operator=(const Alter_info &rhs); // not implemented Alter_info(const Alter_info &rhs); // not implemented diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_base.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_base.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_base.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_base.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1587,11 +1587,11 @@ close_temporary(t, 1, 1); } thd->temporary_tables= 0; + mysql_mutex_unlock(&thd->LOCK_temporary_tables); + if (thd->slave_thread) modify_slave_open_temp_tables(thd, -slave_open_temp_tables); - mysql_mutex_unlock(&thd->LOCK_temporary_tables); - DBUG_RETURN(FALSE); } /* We are about to generate DROP TEMPORARY TABLE statements for all @@ -1622,12 +1622,11 @@ memcpy(buf_trans, stub, stub_len); memcpy(buf_non_trans, stub, stub_len); - mysql_mutex_lock(&thd->LOCK_temporary_tables); - /* Insertion sort of temp tables by pseudo_thread_id to build ordered list of sublists of equal pseudo_thread_id */ + mysql_mutex_lock(&thd->LOCK_temporary_tables); for (prev_table= thd->temporary_tables, table= prev_table->next; table; @@ -1672,7 +1671,7 @@ /* scan sorted tmps to generate sequence of DROP */ for (table= thd->temporary_tables; table; table= next) { - if (is_user_table(table)) + if (is_user_table(table) && table->should_binlog_drop_if_temp()) { bool save_thread_specific_used= thd->thread_specific_used; my_thread_id save_pseudo_thread_id= thd->variables.pseudo_thread_id; @@ -1693,7 +1692,11 @@ table= next) { /* Separate transactional from non-transactional temp tables */ - if (table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) + if (!table->should_binlog_drop_if_temp()) + { + /* Nothing, do not binlog this one */ + } + else if (table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) { found_trans_table= true; /* @@ -1798,14 +1801,14 @@ close_temporary(table, 1, 1); } } + thd->temporary_tables=0; + mysql_mutex_unlock(&thd->LOCK_temporary_tables); + if (!was_quote_show) thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */ - thd->temporary_tables=0; if (thd->slave_thread) modify_slave_open_temp_tables(thd, -slave_open_temp_tables); - mysql_mutex_unlock(&thd->LOCK_temporary_tables); - DBUG_RETURN(error); } @@ -6450,6 +6453,8 @@ if (add_to_temporary_tables_list) { + tmp_table->set_binlog_drop_if_temp(!thd->is_current_stmt_binlog_disabled() + && !thd->is_current_stmt_binlog_format_row()); /* growing temp list at the head */ mysql_mutex_lock(&thd->LOCK_temporary_tables); tmp_table->next= thd->temporary_tables; @@ -6755,7 +6760,10 @@ Use own arena for Prepared Statements or data will be freed after PREPARE. */ - Prepared_stmt_arena_holder ps_arena_holder(thd, register_tree_change); + Prepared_stmt_arena_holder ps_arena_holder( + thd, + register_tree_change && + thd->stmt_arena->is_stmt_prepare_or_first_stmt_execute()); /* create_item() may, or may not create a new Item, depending on @@ -9563,17 +9571,19 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order) { - if (select_lex->ftfunc_list->elements) - { - List_iterator li(*(select_lex->ftfunc_list)); - Item_func_match *ifm; - DBUG_PRINT("info",("Performing FULLTEXT search")); - THD_STAGE_INFO(thd, stage_fulltext_initialization); + DBUG_ASSERT(select_lex->has_ft_funcs()); - while ((ifm=li++)) - ifm->init_search(no_order); + List_iterator li(*(select_lex->ftfunc_list)); + DBUG_PRINT("info",("Performing FULLTEXT search")); + THD_STAGE_INFO(thd, stage_fulltext_initialization); + + Item_func_match *ifm; + while ((ifm= li++)) + { + if (ifm->init_search(thd, no_order)) + return true; } - return 0; + return false; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_cache.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_cache.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_cache.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_cache.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify @@ -4096,13 +4096,10 @@ if (tables_used->uses_materialization()) { /* - Currently all result tables are MyISAM or HEAP. MyISAM allows caching - unless table is under in a concurrent insert (which never could - happen to a derived table). HEAP always allows caching. + Skip the derived table itself, but process its underlying tables and + other tables that follow. */ - DBUG_ASSERT(table->s->db_type() == heap_hton || - table->s->db_type() == myisam_hton); - DBUG_RETURN(0); + continue; } /* diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_class.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_class.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_class.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_class.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,6 +72,8 @@ #include "sql_timer.h" // thd_timer_end +ulong kill_idle_transaction_timeout= 0; + /* The following is used to initialise Table_ident with a internal table name @@ -380,15 +382,13 @@ thd_new_connection_setup - @note Must be called with LOCK_thread_count locked. - @param thd THD object @param stack_start Start of stack for connection */ void thd_new_connection_setup(THD *thd, char *stack_start) { DBUG_ENTER("thd_new_connection_setup"); - mysql_mutex_assert_owner(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); #ifdef HAVE_PSI_INTERFACE thd_set_psi(thd, PSI_THREAD_CALL(new_thread) @@ -642,21 +642,26 @@ extern "C" void thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, mysql_mutex_t *mutex, - const PSI_stage_info *stage, PSI_stage_info *old_stage) + const PSI_stage_info *stage, PSI_stage_info *old_stage, + const char *src_function, const char *src_file, + int src_line) { if (!thd) thd= current_thd; - return thd->ENTER_COND(cond, mutex, stage, old_stage); + return thd->enter_cond(cond, mutex, stage, old_stage, + src_function, src_file, src_line); } extern "C" -void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage) +void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage, + const char *src_function, const char *src_file, + int src_line) { if (!thd) thd= current_thd; - thd->EXIT_COND(stage); + thd->exit_cond(stage, src_function, src_file, src_line); return; } @@ -1205,7 +1210,6 @@ wsrep_po_in_trans(FALSE), wsrep_apply_format(0), wsrep_apply_toi(false), - wsrep_certify_empty_trx(false), wsrep_sst_donor(false), #endif m_parser_state(NULL), @@ -1328,6 +1332,8 @@ wsrep_mysql_replicated = 0; wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED; wsrep_affected_rows = 0; + wsrep_replicate_GTID = false; + wsrep_skip_wsrep_GTID = false; #endif /* Call to init() below requires fully initialized Open_tables_state. */ reset_open_tables_state(); @@ -1611,8 +1617,15 @@ thd->lex->current_select == 0 if lex structure is not inited (not query command (COM_QUERY)) */ +#ifdef WITH_WSREP + if (lex->current_select && + lex->current_select->no_error && !is_fatal_error && + (!(wsrep_conflict_state == ABORTED || + wsrep_conflict_state == MUST_ABORT))) +#else if (lex->current_select && lex->current_select->no_error && !is_fatal_error) +#endif { DBUG_PRINT("error", ("Error converted to warning: current_select: no_error %d " @@ -1743,10 +1756,11 @@ wsrep_consistency_check = NO_CONSISTENCY_CHECK; wsrep_mysql_replicated = 0; wsrep_TOI_pre_queries.clear(); - wsrep_certify_empty_trx= false; wsrep_sst_donor= false; wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED; wsrep_affected_rows = 0; + wsrep_replicate_GTID = false; + wsrep_skip_wsrep_GTID = false; #endif binlog_row_event_extra_data= 0; @@ -2403,13 +2417,13 @@ if (!thd_table->needs_reopen()) #ifdef WITH_WSREP { - signalled|= mysql_lock_abort_for_thread(this, thd_table); - if (this && WSREP(this) && wsrep_thd_is_BF((void *)this, FALSE)) - { - WSREP_DEBUG("remove_table_from_cache: %llu", - (unsigned long long) this->real_id); - wsrep_abort_thd((void *)this, (void *)in_use, FALSE); - } + signalled|= mysql_lock_abort_for_thread(this, thd_table); + if (WSREP_NNULL(this) && wsrep_thd_is_BF((void *)this, FALSE)) + { + WSREP_DEBUG("remove_table_from_cache: %llu", + (unsigned long long) this->real_id); + wsrep_abort_thd((void *)this, (void *)in_use, FALSE); + } } #else signalled|= mysql_lock_abort_for_thread(this, thd_table); @@ -5068,7 +5082,8 @@ tmp_tables_disk_used= 0; tmp_tables_size= 0; innodb_was_used= FALSE; - innodb_trx_id= 0; + if (!(server_status & SERVER_STATUS_IN_TRANS)) + innodb_trx_id= 0; innodb_io_reads= 0; innodb_io_read= 0; innodb_io_reads_wait_timer= 0; @@ -5227,6 +5242,7 @@ void THD::inc_status_created_tmp_tables() { status_var_increment(status_var.created_tmp_tables); + query_plan_flags|= QPLAN_TMP_TABLE; #ifdef HAVE_PSI_STATEMENT_INTERFACE PSI_STATEMENT_CALL(inc_statement_created_tmp_tables)(m_statement_psi, 1); #endif @@ -5359,13 +5375,6 @@ void THD::set_query_id(query_id_t new_query_id) { mysql_mutex_lock(&LOCK_thd_data); -#ifndef DBUG_OFF - if (variables.query_exec_id != 0 && - lex->sql_command != SQLCOM_SET_OPTION) - { - new_query_id= variables.query_exec_id; - } -#endif query_id= new_query_id; mysql_mutex_unlock(&LOCK_thd_data); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_class.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_class.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_class.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_class.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify @@ -56,6 +56,8 @@ #define FLAGSTR(V,F) ((V)&(F)?#F" ":"") +extern ulong kill_idle_transaction_timeout; + /** The meat of thd_proc_info(THD*, char*), a macro that packs the last three calling-info parameters. @@ -76,7 +78,17 @@ const char *calling_func, const char *calling_file, const unsigned int calling_line); - +extern "C" +void thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, mysql_mutex_t *mutex, + const PSI_stage_info *stage, PSI_stage_info *old_stage, + const char *src_function, const char *src_file, + int src_line); + +extern "C" +void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage, + const char *src_function, const char *src_file, + int src_line); + #define THD_STAGE_INFO(thd, stage) \ (thd)->enter_stage(& stage, NULL, __func__, __FILE__, __LINE__) @@ -91,6 +103,7 @@ char *db; size_t db_length; struct timeval user_time; + longlong row_count_func; }; #endif class Reprepare_observer; @@ -621,7 +634,6 @@ #ifndef DBUG_OFF ulonglong query_exec_time; double query_exec_time_double; - ulong query_exec_id; #endif #ifdef WITH_WSREP my_bool wsrep_on; @@ -824,6 +836,19 @@ STMT_CONVENTIONAL_EXECUTION= 3, STMT_EXECUTED= 4, STMT_ERROR= -1 }; + /* + State and state changes in SP: + 1) When state is STMT_INITIALIZED_FOR_SP, objects in the item tree are + created on the statement memroot. This is enforced through + ps_arena_holder checking the state. + 2) After the first execute (call p1()), this state should change to + STMT_EXECUTED. Objects will be created on the execution memroot and will + be destroyed at the end of each execution. + 3) In case an ER_NEED_REPREPARE error occurs, state should be changed to + STMT_INITIALIZED_FOR_SP and objects will again be created on the + statement memroot. At the end of this execution, state should change to + STMT_EXECUTED. + */ enum_state state; /* We build without RTTI, so dynamic_cast can't be used. */ @@ -1673,7 +1698,7 @@ 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. + declared below and defined in binlog.cc as well. */ enum enum_locked_tables_mode @@ -2545,6 +2570,16 @@ /* Do not set socket timeouts for wait_timeout (used with threadpool) */ bool skip_wait_timeout; + + inline ulong get_wait_timeout(void) const + { + if (in_active_multi_stmt_transaction() + && kill_idle_transaction_timeout > 0 + && kill_idle_transaction_timeout < variables.net_wait_timeout) + return kill_idle_transaction_timeout; + return variables.net_wait_timeout; + } + /** Used by fill_status() to avoid acquiring LOCK_status mutex twice when this function is called recursively (e.g. queries @@ -3531,9 +3566,13 @@ void* wsrep_apply_format; bool wsrep_apply_toi; /* applier processing in TOI */ wsrep_gtid_t wsrep_sync_wait_gtid; - bool wsrep_certify_empty_trx; bool wsrep_sst_donor; ulong wsrep_affected_rows; + bool wsrep_replicate_GTID; + /* DROP TEMPORARY TABLE is not replicated. Avoid logging this with + Galera GTID. */ + bool wsrep_skip_wsrep_GTID; + #endif /* WITH_WSREP */ /** Internal parser state. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_cmd.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_cmd.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_cmd.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_cmd.h 2017-10-19 04:25:29.000000000 +0000 @@ -105,6 +105,10 @@ /* When a command is added here, be sure it's also added in mysqld.cc in "struct show_var_st status_vars[]= {" ... + + Also for PXC, if the command is replicated to other nodes as a + DDL (no-writeset replication), add a testcase to + galera_wsrep_ddl_access_checking.test */ /* This should be the last !!! */ SQLCOM_END diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_connect.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_connect.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_connect.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_connect.cc 2017-10-19 04:25:29.000000000 +0000 @@ -72,9 +72,6 @@ static int increment_connection_count(THD* thd, bool use_lock); #endif -// Uses the THD to update the global stats by user name and client IP -void update_global_user_stats(THD* thd, bool create_user, time_t now); - HASH global_user_stats; HASH global_client_stats; HASH global_thread_stats; @@ -659,6 +656,54 @@ mysql_mutex_unlock(&LOCK_global_user_client_stats); } +static void clear_stats_concurrent_connections(HASH* stats) +{ + for (ulong idx= 0; idx < stats->records; idx++) + { + USER_STATS* const user_stats= + reinterpret_cast(my_hash_element(stats, idx)); + user_stats->concurrent_connections= 0; + } +} + +static void inc_stats_concurrent_conn(HASH* stats, + const char* user_string, int cnt) +{ + USER_STATS* const user_stats= + reinterpret_cast(my_hash_search(stats, + reinterpret_cast(user_string), + strlen(user_string))); + if (user_stats) + user_stats->concurrent_connections+= cnt; +} + +/** + Update number of concurrent connections for user_stats and client_stats + based on account resource limits +*/ +void refresh_concurrent_conn_stats() +{ + mysql_mutex_lock(&LOCK_user_conn); + + mysql_mutex_lock(&LOCK_global_user_client_stats); + clear_stats_concurrent_connections(&global_user_stats); + clear_stats_concurrent_connections(&global_client_stats); + mysql_mutex_unlock(&LOCK_global_user_client_stats); + + for (ulong idx= 0; idx < hash_user_connections.records; idx++) + { + const struct user_conn* const uc= + reinterpret_cast( + my_hash_element(&hash_user_connections, idx)); + mysql_mutex_lock(&LOCK_global_user_client_stats); + inc_stats_concurrent_conn(&global_user_stats, uc->user, uc->connections); + inc_stats_concurrent_conn(&global_client_stats, uc->host, uc->connections); + mysql_mutex_unlock(&LOCK_global_user_client_stats); + } + + mysql_mutex_unlock(&LOCK_user_conn); +} + /* check if user has already too many connections @@ -873,6 +918,10 @@ DBUG_VOID_RETURN; } +void refresh_concurrent_conn_stats() +{ +} + #endif /* NO_EMBEDDED_ACCESS_CHECKS */ /* @@ -992,7 +1041,7 @@ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client", global_system_variables.character_set_client->csname); return true; - } + } thd->variables.character_set_client= global_system_variables.character_set_client; thd->variables.collation_connection= @@ -1293,6 +1342,7 @@ my_net_set_write_timeout(net, connect_timeout); error= check_connection(thd); + MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd); thd->protocol->end_statement(); if (error) @@ -1473,7 +1523,6 @@ bool rc; lex_start(thd); rc= login_connection(thd); - MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd); if (rc) return rc; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_connect.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_connect.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_connect.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_connect.h 2017-10-19 04:25:29.000000000 +0000 @@ -22,6 +22,7 @@ class THD; typedef struct st_lex_user LEX_USER; typedef struct user_conn USER_CONN; +typedef struct user_resources USER_RESOURCES; void init_max_user_conn(void); void free_max_user_conn(void); @@ -49,5 +50,6 @@ int get_or_create_user_conn(THD *thd, const char *user, const char *host, const USER_RESOURCES *mqh); int check_for_max_user_connections(THD *thd, const USER_CONN *uc); - +// Uses the THD to update the global stats by user name and client IP +void update_global_user_stats(THD* thd, bool create_user, time_t now); #endif /* SQL_CONNECT_INCLUDED */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_delete.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_delete.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_delete.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_delete.cc 2017-10-19 04:25:29.000000000 +0000 @@ -322,6 +322,10 @@ table->file->print_error(error, MYF(0)); goto exit_without_my_ok; } + + if (select_lex->has_ft_funcs() && init_ftfuncs(thd, select_lex, 1)) + goto exit_without_my_ok; + if (usable_index==MAX_KEY || (select && select->quick)) error= init_read_record(&info, thd, table, select, 1, 1, FALSE); else @@ -329,7 +333,7 @@ if (error) goto exit_without_my_ok; - init_ftfuncs(thd, select_lex, 1); + THD_STAGE_INFO(thd, stage_updating); if (table->triggers && @@ -767,7 +771,9 @@ table->file->ref_length, MEM_STRIP_BUF_SIZE); } - init_ftfuncs(thd, thd->lex->current_select, 1); + if (thd->lex->current_select->has_ft_funcs() && init_ftfuncs(thd, thd->lex->current_select, 1)) + DBUG_RETURN(true); + DBUG_RETURN(thd->is_fatal_error != 0); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_digest.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_digest.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_digest.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_digest.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -595,6 +595,18 @@ state->m_last_id_index= (int)digest_storage->m_byte_count; break; } + case 0: + { + if (digest_storage->m_byte_count < SIZE_OF_A_TOKEN) + break; + unsigned int temp_tok; + read_token(digest_storage, + digest_storage->m_byte_count-SIZE_OF_A_TOKEN, + & temp_tok); + if (temp_tok == ';') + digest_storage->m_byte_count-= SIZE_OF_A_TOKEN; + break; + } default: { /* Add this token to digest storage. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_executor.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_executor.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_executor.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_executor.cc 2017-10-19 04:25:29.000000000 +0000 @@ -116,7 +116,7 @@ if (prepare_result(&columns_list)) DBUG_VOID_RETURN; - if (select_lex->materialized_table_count) + if (select_lex->materialized_table_count && select_lex->has_ft_funcs()) init_ftfuncs(thd, select_lex, order); if (!tables_list && (tables || !select_lex->with_sum_func)) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_insert.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_insert.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_insert.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_insert.cc 2017-10-19 04:25:29.000000000 +0000 @@ -4297,6 +4297,10 @@ if (error) return error; + create_table->table->set_binlog_drop_if_temp( + !thd->is_current_stmt_binlog_disabled() + && !thd->is_current_stmt_binlog_format_row()); + TABLE const *const table = *tables; if (thd->is_current_stmt_binlog_format_row() && !table->s->tmp_table) @@ -4495,15 +4499,17 @@ */ if (!table->s->tmp_table) { -#ifndef DBUG_OFF + +#ifdef WITH_WSREP + /* If commit fails, we should be able to reset the OK status. */ thd->get_stmt_da()->set_overwrite_status(true); -#endif +#endif /* WITH_WSREP */ + trans_commit_stmt(thd); trans_commit_implicit(thd); -#ifndef DBUG_OFF - thd->get_stmt_da()->set_overwrite_status(false); -#endif + #ifdef WITH_WSREP + thd->get_stmt_da()->set_overwrite_status(false); mysql_mutex_lock(&thd->LOCK_wsrep_thd); if (thd->wsrep_conflict_state != NO_CONFLICT) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_lex.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_lex.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_lex.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_lex.cc 2017-10-19 04:25:29.000000000 +0000 @@ -429,6 +429,7 @@ lex->view_list.empty(); lex->prepared_stmt_params.empty(); lex->auxiliary_table_list.empty(); + DBUG_ASSERT(!lex->unit.cleaned); lex->unit.next= lex->unit.master= lex->unit.link_next= 0; lex->unit.prev= lex->unit.link_prev= 0; lex->unit.slave= lex->unit.global_parameters= lex->current_select= diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_lex.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_lex.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_lex.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_lex.h 2017-10-19 04:25:29.000000000 +0000 @@ -902,6 +902,11 @@ { return &link_next; } + + /// @return true if query block references full-text functions + bool has_ft_funcs() const + { return ftfunc_list->elements > 0; } + void invalidate(); void mark_as_dependent(st_select_lex *last); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_load.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_load.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_load.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_load.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -307,6 +307,24 @@ set_fields, MARK_COLUMNS_WRITE, 0, 0) || check_that_all_fields_are_given_values(thd, table, table_list)) DBUG_RETURN(TRUE); + + /* + Special updatability test is needed because fields_vars may contain + a mix of column references and user variables. + */ + Item *item; + List_iterator it(fields_vars); + while ((item= it++)) + { + if ((item->type() == Item::FIELD_ITEM || + item->type() == Item::REF_ITEM) && + item->field_for_view_update() == NULL) + { + my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), item->item_name.ptr()); + DBUG_RETURN(true); + } + } + /* Fix the expressions in SET clause */ if (setup_fields(thd, Ref_ptr_array(), set_values, MARK_COLUMNS_READ, 0, 0)) DBUG_RETURN(TRUE); @@ -1413,8 +1431,8 @@ 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(MY_WME)))) - error= true; /* purecov: inspected */ + if (!(buffer=(uchar*) my_malloc(buff_length+1,MYF(0)))) + error=1; /* purecov: inspected */ else { end_of_buff=buffer+buff_length; @@ -1607,50 +1625,37 @@ } } #ifdef USE_MB - 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; - } + if (my_mbcharlen(read_charset, chr) > 1 && + to + my_mbcharlen(read_charset, chr) <= end_of_buff) + { + uchar* p= to; + int ml, i; + *to++ = chr; - if (ml > 1 && - to + ml <= end_of_buff) - { - uchar* p= to; - *to++ = chr; + ml= my_mbcharlen(read_charset, chr); - for (uint i= 1; i < ml; i++) + for (i= 1; i < ml; i++) + { + chr= GET; + if (chr == my_b_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; + /* + Need to back up the bytes already ready from illformed + multi-byte char + */ + to-= i; + goto found_eof; } - if (my_ismbchar(read_charset, + *to++ = chr; + } + if (my_ismbchar(read_charset, (const char *)p, (const char *)to)) - 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; - } + continue; + for (i= 0; i < ml; i++) + PUSH(*--to); + chr= GET; + } #endif *to++ = (uchar) chr; } @@ -1899,15 +1904,7 @@ for (chr= GET; my_tospace(chr) != delim && chr != my_b_EOF;) { #ifdef USE_MB - uint ml= my_mbcharlen(read_charset, chr); - if (ml == 0) - { - chr= my_b_EOF; - val->length(0); - return chr; - } - - if (ml > 1) + if (my_mbcharlen(read_charset, chr) > 1) { DBUG_PRINT("read_xml",("multi byte")); int i, ml= my_mbcharlen(read_charset, chr); @@ -2048,6 +2045,15 @@ case '>': /* end tag - read tag value */ in_tag= false; + /* Skip all whitespaces */ + while (' ' == (chr= my_tospace(GET))) + { + } + /* + Push the first non-whitespace char back to Stack. This char would be + read in the upcoming call to read_value() + */ + PUSH(chr); chr= read_value('<', &value); if(chr == my_b_EOF) goto found_eof; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_optimizer.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_optimizer.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_optimizer.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_optimizer.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -100,6 +100,7 @@ table_map *cached_eq_ref_tables, table_map *eq_ref_tables); +static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab); /** global select optimisation. @@ -763,9 +764,10 @@ /* Perform FULLTEXT search before all regular searches */ if (!(select_options & SELECT_DESCRIBE) && - !select_lex->materialized_table_count) + !select_lex->materialized_table_count && select_lex->has_ft_funcs()) { - init_ftfuncs(thd, select_lex, order); + if (init_ftfuncs(thd, select_lex, order)) + DBUG_RETURN(1); optimize_fts_query(); } @@ -1675,6 +1677,9 @@ COND_EQUAL cond_equal; cond_equal.upper_levels= inherited; + if (check_stack_overrun(thd, STACK_MIN_SIZE, NULL)) + return cond; + if (cond->type() == Item::COND_ITEM) { List eq_list; @@ -4212,40 +4217,39 @@ } -/* - Check if given expression uses only table fields covered by the given index +/** + Check if given expression only uses fields covered by index #keyno in the + table tbl. The expression can use any fields in any other tables. - SYNOPSIS - uses_index_fields_only() - item Expression to check - tbl The table having the index - keyno The index number - other_tbls_ok TRUE <=> Fields of other non-const tables are allowed + The expression is guaranteed not to be AND or OR - those constructs are + handled outside of this function. - DESCRIPTION - Check if given expression only uses fields covered by index #keyno in the - table tbl. The expression can use any fields in any other tables. - - The expression is guaranteed not to be AND or OR - those constructs are - handled outside of this function. + Restrict some function types from being pushed down to storage engine: + a) Don't push down the triggered conditions. Nested outer joins execution + code may need to evaluate a condition several times (both triggered and + untriggered). + b) Stored functions contain a statement that might start new operations (like + DML statements) from within the storage engine. This does not work against + all SEs. + c) Subqueries might contain nested subqueries and involve more tables. + + @param item Expression to check + @param tbl The table having the index + @param keyno The index number + @param other_tbls_ok TRUE <=> Fields of other non-const tables are allowed - RETURN - TRUE Yes - FALSE No + @return false if No, true if Yes */ bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno, bool other_tbls_ok) { + // Restrictions b and c. + if (item->has_stored_program() || item->has_subquery()) + return false; + if (item->const_item()) - { - /* - const_item() might not return correct value if the item tree - contains a subquery. If this is the case we do not include this - part of the condition. - */ - return !item->has_subquery(); - } + return true; const Item::Type item_type= item->type(); @@ -4256,21 +4260,14 @@ const Item_func::Functype func_type= item_func->functype(); /* - Avoid some function types from being pushed down to storage engine: - - Don't push down the triggered conditions. Nested outer joins - execution code may need to evaluate a condition several times - (both triggered and untriggered). - TODO: Consider cloning the triggered condition and using the - copies for: - 1. push the first copy down, to have most restrictive - index condition possible. - 2. Put the second copy into tab->m_condition. - - Stored functions contain a statement that might start new operations - against the storage engine. This does not work against all storage - engines. + Restriction a. + TODO: Consider cloning the triggered condition and using the copies + for: + 1. push the first copy down, to have most restrictive index condition + possible. + 2. Put the second copy into tab->m_condition. */ - if (func_type == Item_func::TRIG_COND_FUNC || - func_type == Item_func::FUNC_SP) + if (func_type == Item_func::TRIG_COND_FUNC) return false; /* This is a function, apply condition recursively to arguments */ @@ -7688,45 +7685,8 @@ bool use_quick_range=0; Item *tmp; - /* - Heuristic: Switch from 'ref' to 'range' access if 'range' - access can utilize more keyparts than 'ref' access. Conditions - for doing switching: - - 1) Current decision is to use 'ref' access - 2) 'ref' access depends on a constant, not a value read from a - table earlier in the join sequence. - - Rationale: if 'ref' depends on a value from another table, - the join condition is not used to limit the rows read by - 'range' access (that would require dynamic range - 'Range - checked for each record'). In other words, if 'ref' depends - on a value from another table, we have a query with - conditions of the form - - this_table.idx_col1 = other_table.col AND <<- used by 'ref' - this_table.idx_col1 OP AND <<- used by 'range' - this_table.idx_col2 OP AND ... <<- used by 'range' - - and an index on (idx_col1,idx_col2,...). But the fact that - 'range' access uses more keyparts does not mean that it is - more selective than 'ref' access because these access types - utilize different parts of the query condition. We - therefore trust the cost based choice made by - best_access_path() instead of forcing a heuristic choice - here. - 3) Range access is possible, and it is less costly than - table/index scan - 4) 'ref' access and 'range' access uses the same index - 5) 'range' access uses more keyparts than 'ref' access - - @todo: This decision should rather be made in best_access_path() - */ - if (tab->type == JT_REF && // 1) - !tab->ref.depend_map && // 2) - tab->quick && // 3) - (uint) tab->ref.key == tab->quick->index && // 4) - tab->ref.key_length < tab->quick->max_used_key_length) // 5) + /// See if you need to switch to range access + if (tab->type == JT_REF && can_switch_from_ref_to_range(thd, tab)) { Opt_trace_object wrapper(trace); Opt_trace_object (trace, "access_type_changed"). @@ -8229,6 +8189,99 @@ return true; } +/** + Heuristic: Switch from 'ref' to 'range' access if 'range' access can utilize + more keyparts than 'ref' access. Conditions for doing switching: + + 1) 'ref' access depends on a constant, not a value read from a table earlier + in the join sequence. + + Rationale: if 'ref' depends on a value from another table, the join condition + is not used to limit the rows read by 'range' access (that would require + dynamic range - 'Range checked for each record'). In other words, if 'ref' + depends on a value from another table, we have a query with conditions of + the form + this_table.idx_col1 = other_table.col AND <<- used by 'ref' + this_table.idx_col1 OP AND <<- used by 'range' + this_table.idx_col2 OP AND ... <<- used by 'range' + + and an index on (idx_col1,idx_col2,...). But the fact that 'range' access + uses more keyparts does not mean that it is more selective than 'ref' access + because these access types utilize different parts of the query condition. We + therefore trust the cost based choice made by best_access_path() instead of + forcing a heuristic choice here. + + 2) Range access is possible, and it is less costly than table/index scan. + + 3a) 'ref' access and 'range' access uses the same index. + 3b) 'range' access uses more keyparts than 'ref' access + + OR + + 4) Ref has borrowed the index estimate from range and created a cost + estimate (See Optimize_table_order::find_best_ref). This will be a + problem if range built it's row estimate using a larger number of key + parts than ref. In such a case, shift to range access over the same + index. So run the range optimizer with that index as the only choice. + (Condition 5 is not relevant here since it has been tested in + find_best_ref.) + + @param thd THD To re-run range optimizer. + @param tab JOIN_TAB To check the above conditions. + + @return true Range is better than ref + @return false Ref is better or switch isn't possible + + @todo: This decision should rather be made in best_access_path() +*/ +static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab) +{ + if (!tab->ref.depend_map && // 1) + tab->quick) // 2) + { + if ((uint) tab->ref.key == tab->quick->index && // 3a) + tab->ref.key_length < tab->quick->max_used_key_length) // 3b) + return true; + else if (tab->dodgy_ref_cost) // 4) + { + int error; + SQL_SELECT *select; + JOIN *join= tab->join; + select= make_select(tab->table, join->found_const_table_map, + join->found_const_table_map, + *tab->on_expr_ref ? *tab->on_expr_ref : join->conds, + 1, &error); + + if (select) + { + Opt_trace_context * const trace= &thd->opt_trace; + Opt_trace_object trace_wrapper(trace); + Opt_trace_array + trace_setup_cond(trace, + "rerunning_range_optimizer_for_single_index"); + + key_map new_ref_key_map; + new_ref_key_map.set_bit(tab->position->key->key); + bool retcode= false; + if (select->test_quick_select(thd, new_ref_key_map, 0, + (join->select_options & + OPTION_FOUND_ROWS ? HA_POS_ERROR : + join->unit->select_limit_cnt), + false, // don't force quick range + ORDER::ORDER_NOT_RELEVANT) > 0) + { + delete tab->quick; + tab->quick= select->quick; + retcode= true; + } + select->quick= 0; + delete select; + return retcode; + } + } + } + return false; +} /** Check if an expression in ORDER BY or GROUP BY is a duplicate of a diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_parse.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_parse.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_parse.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_parse.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,9 @@ #include "sql_insert.h" // mysql_insert #include "sql_update.h" // mysql_update, mysql_multi_update #include "sql_partition.h" // struct partition_info +#ifdef WITH_PARTITION_STORAGE_ENGINE +#include "partition_info.h" // has_external_data_or_index_dir +#endif /* WITH_PARTITION_STORAGE_ENGINE */ #include "sql_db.h" // mysql_change_db, mysql_create_db, // mysql_rm_db, mysql_upgrade_db, // mysql_alter_db, @@ -143,9 +146,6 @@ static inline ulonglong get_query_exec_time(THD *thd, ulonglong cur_utime); -// Uses the THD to update the global stats by user name and client IP -void update_global_user_stats(THD* thd, bool create_user, time_t now); - const char *any_db="*any*"; // Special symbol for check_access const LEX_STRING command_name[]={ @@ -1015,7 +1015,7 @@ number of seconds has passed. */ if(!thd->skip_wait_timeout) - my_net_set_read_timeout(net, thd->variables.net_wait_timeout); + my_net_set_read_timeout(net, thd->get_wait_timeout()); /* XXX: this code is here only to clear possible errors of init_connect. @@ -1257,14 +1257,18 @@ (lex->sql_command == SQLCOM_CREATE_TABLE) && (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE); + const my_bool create_real_tables= + (lex->sql_command == SQLCOM_CREATE_TABLE) && + !(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE); + const my_bool drop_temp_tables= (lex->sql_command == SQLCOM_DROP_TABLE) && lex->drop_temporary; const my_bool update_real_tables= - some_non_temp_table_to_be_updated(thd, all_tables) && - !(create_temp_tables || drop_temp_tables); - + ((create_real_tables || + some_non_temp_table_to_be_updated(thd, all_tables)) && + !(create_temp_tables || drop_temp_tables)); const my_bool create_or_drop_databases= (lex->sql_command == SQLCOM_CREATE_DB) || @@ -1499,17 +1503,47 @@ thd->clear_slow_extended(); thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */ thd->set_time(); - if (!thd->is_valid_time()) + if (thd->is_valid_time() == false) { /* - If the time has got past 2038 we need to shut this server down - We do this by making sure every command is a shutdown and we - have enough privileges to shut the server down - - TODO: remove this when we have full 64 bit my_time_t support + If the time has gone past 2038 we need to shutdown the server. But + there is possibility of getting invalid time value on some platforms. + For example, gettimeofday() might return incorrect value on solaris + platform. Hence validating the current time with 5 iterations before + initiating the normal server shutdown process because of time getting + past 2038. */ - thd->security_ctx->master_access|= SHUTDOWN_ACL; - command= COM_SHUTDOWN; + const int max_tries= 5; + sql_print_warning("Current time has got past year 2038. Validating current " + "time with %d iterations before initiating the normal " + "server shutdown process.", max_tries); + + int tries= 0; + while (++tries <= max_tries) + { + thd->set_time(); + if (thd->is_valid_time() == true) + { + sql_print_warning("Iteration %d: Obtained valid current time from " + "system", tries); + break; + } + sql_print_warning("Iteration %d: Current time obtained from system is " + "greater than 2038", tries); + } + if (tries > max_tries) + { + /* + If the time has got past 2038 we need to shut this server down. + We do this by making sure every command is a shutdown and we + have enough privileges to shut the server down + + TODO: remove this when we have full 64 bit my_time_t support + */ + sql_print_error("This MySQL server doesn't support dates later than 2038"); + thd->security_ctx->master_access|= SHUTDOWN_ACL; + command= COM_SHUTDOWN; + } } thd->set_query_id(next_query_id()); inc_thread_running(); @@ -1770,6 +1804,7 @@ /* PSI begin */ thd->m_digest= & thd->m_digest_state; + thd->m_digest->reset(thd->m_token_array, max_digest_length); thd->m_statement_psi= MYSQL_START_STATEMENT(&thd->m_statement_state, com_statement_info[command].m_key, @@ -2195,6 +2230,7 @@ thd->reset_query(); thd->set_command(COM_SLEEP); + thd->proc_info= 0; /* Performance Schema Interface instrumentation, end */ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da()); @@ -2882,7 +2918,7 @@ @return FALSE in case of success, TRUE in case of error. */ -static bool lock_binlog_for_backup(THD *thd) +bool lock_binlog_for_backup(THD *thd) { DBUG_ENTER("lock_binlog_for_backup"); @@ -3300,7 +3336,7 @@ if (lex->set_statement && !lex->var_list.is_empty()) { per_query_variables_backup= copy_system_variables(thd, thd->m_enable_plugins); - if ((res= sql_set_variables(thd, &lex->var_list))) + if ((res= sql_set_variables(thd, &lex->var_list, false))) { /* We encountered some sort of error, but no message was sent. @@ -3321,9 +3357,7 @@ { system_status_var old_status_var= thd->status_var; thd->initial_status_var= &old_status_var; -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (!(res= select_precheck(thd, lex, all_tables, first_table))) res= execute_sqlcom_select(thd, all_tables); @@ -3356,23 +3390,19 @@ case SQLCOM_SHOW_PLUGINS: case SQLCOM_SHOW_FIELDS: case SQLCOM_SHOW_KEYS: -#ifndef WITH_WSREP case SQLCOM_SHOW_VARIABLES: case SQLCOM_SHOW_CHARSETS: case SQLCOM_SHOW_COLLATIONS: case SQLCOM_SHOW_STORAGE_ENGINES: case SQLCOM_SHOW_PROFILE: -#endif /* WITH_WSREP */ case SQLCOM_SELECT: + { #ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; - case SQLCOM_SHOW_VARIABLES: - case SQLCOM_SHOW_CHARSETS: - case SQLCOM_SHOW_COLLATIONS: - case SQLCOM_SHOW_STORAGE_ENGINES: - case SQLCOM_SHOW_PROFILE: + if (lex->sql_command == SQLCOM_SELECT) + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ) + else + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW) #endif /* WITH_WSREP */ - { thd->status_var.last_query_cost= 0.0; thd->status_var.last_query_partial_plans= 0; @@ -3567,6 +3597,7 @@ } case SQLCOM_SHOW_BINLOG_EVENTS: { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (check_global_access(thd, REPL_SLAVE_ACL)) goto error; res = mysql_show_binlog_events(thd); @@ -3682,7 +3713,6 @@ copy. */ Alter_info alter_info(lex->alter_info, thd->mem_root); - if (thd->is_fatal_error) { /* If out of memory when creating a copy of alter_info. */ @@ -3690,6 +3720,15 @@ goto end_with_restore_list; } + if (((lex->create_info.used_fields & HA_CREATE_USED_DATADIR) != 0 || + (lex->create_info.used_fields & HA_CREATE_USED_INDEXDIR) != 0) && + check_access(thd, FILE_ACL, any_db, NULL, NULL, FALSE, FALSE)) + { + res= 1; + my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "FILE"); + goto end_with_restore_list; + } + if ((res= create_table_precheck(thd, select_tables, create_table))) goto end_with_restore_list; @@ -3727,6 +3766,12 @@ #ifdef WITH_PARTITION_STORAGE_ENGINE { partition_info *part_info= thd->lex->part_info; + if (part_info != NULL && has_external_data_or_index_dir(*part_info) && + check_access(thd, FILE_ACL, any_db, NULL, NULL, FALSE, FALSE)) + { + res= -1; + goto end_with_restore_list; + } if (part_info && !(part_info= thd->lex->part_info->get_clone(true))) { res= -1; @@ -4040,6 +4085,7 @@ { if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL)) goto error; + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); res = show_binlogs(thd); break; } @@ -4053,9 +4099,7 @@ goto error; #else { -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); /* Access check: @@ -4119,9 +4163,7 @@ case SQLCOM_CHECKSUM: { DBUG_ASSERT(first_table == all_tables && first_table != 0); -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ); if (check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE)) @@ -4131,11 +4173,8 @@ break; } case SQLCOM_UPDATE: -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && - wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -#endif /* WITH_WSREP */ { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE); ha_rows found= 0, updated= 0; DBUG_ASSERT(first_table == all_tables && first_table != 0); if (update_precheck(thd, all_tables)) @@ -4174,10 +4213,7 @@ /* if we switched from normal update, rights are checked */ if (up_result != 2) { -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && - wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE); if ((res= multi_update_precheck(thd, all_tables))) break; } @@ -4254,10 +4290,6 @@ break; } case SQLCOM_REPLACE: -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && - wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error; -#endif /* WITH_WSREP */ #ifndef DBUG_OFF if (mysql_bin_log.is_open()) { @@ -4292,11 +4324,8 @@ } #endif case SQLCOM_INSERT: -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && - wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error; -#endif /* WITH_WSREP */ { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE); DBUG_ASSERT(first_table == all_tables && first_table != 0); /* @@ -4342,11 +4371,8 @@ } case SQLCOM_REPLACE_SELECT: case SQLCOM_INSERT_SELECT: -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && - wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error; -#endif /* WITH_WSREP */ { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE); select_insert *sel_result; DBUG_ASSERT(first_table == all_tables && first_table != 0); if ((res= insert_precheck(thd, all_tables))) @@ -4444,11 +4470,8 @@ break; } case SQLCOM_DELETE: -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && - wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -#endif /* WITH_WSREP */ { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE); DBUG_ASSERT(first_table == all_tables && first_table != 0); if ((res= delete_precheck(thd, all_tables))) break; @@ -4463,11 +4486,8 @@ break; } case SQLCOM_DELETE_MULTI: -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && - wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -#endif /* WITH_WSREP */ { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE); DBUG_ASSERT(first_table == all_tables && first_table != 0); TABLE_LIST *aux_tables= thd->lex->auxiliary_table_list.first; uint del_table_count; @@ -4534,51 +4554,6 @@ goto error; /* purecov: inspected */ } #ifdef WITH_WSREP - /* DROP TABLE drops the table from database. - DROP TABLE is valid even if table is temporary but given that temporary - tables are not replicated it doesn't make sense to drop temporary table. - (CREATE TEMPORARY TABLE is blocked as temporary tables are localized to - the connection that created it which in replication case would be applier - thread. No user-thread will be able to access it.) - - Check if table is temporary if found skip it. - - Exception: drop table ; - This involves mix of temporary and non-temporary table. - Algorithm will identify such case create a fake temporary table and - that will allow mix statement to succeed. */ - - bool involves_temporary = false; - bool involves_non_temporary = false; - - /* Check for mix of temp/non-temp only if drop statement is confusing. - DROP TEMPORARY is meant only for TEMPORARY so skip check in this case. */ - for (TABLE_LIST *table= all_tables; - table && !lex->drop_temporary; - table= table->next_global) - { - if (find_temporary_table(thd, table)) - involves_temporary = true; - else - involves_non_temporary = true; - } - - /* We take a 2 pass approach because: - 1. We don't know involvement of mix till we are done with complete list scan - 2. logic to find is less costly than logic to create and append query. */ - for (TABLE_LIST *table= all_tables; - table && (involves_non_temporary && involves_temporary); - table= table->next_global) - { - if (find_temporary_table(thd, table)) - { - thd->wsrep_TOI_pre_queries.push_back(new String()); - String* query = thd->wsrep_TOI_pre_queries.back(); - query->length(0); - (void) store_create_info(thd, table, query, NULL, TRUE); - } - } - for (TABLE_LIST *table= all_tables; table; table= table->next_global) { if (!lex->drop_temporary && @@ -4589,11 +4564,6 @@ break; } } - - for (uint i = 0; i < thd->wsrep_TOI_pre_queries.size(); ++i) - delete thd->wsrep_TOI_pre_queries[i]; - thd->wsrep_TOI_pre_queries.clear(); - THD::wsrep_queries().swap(thd->wsrep_TOI_pre_queries); #endif /* WITH_WSREP */ /* DDL and binlog write order are protected by metadata locks. */ res= mysql_rm_table(thd, first_table, lex->drop_if_exists, @@ -4967,9 +4937,7 @@ { DBUG_EXECUTE_IF("4x_server_emul", my_error(ER_UNKNOWN_ERROR, MYF(0)); goto error;); -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (check_and_convert_db_name(&lex->name, TRUE) != IDENT_NAME_OK) break; res= mysqld_show_create_db(thd, lex->name.str, &lex->create_info); @@ -4992,16 +4960,17 @@ if (res) break; - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) switch (lex->sql_command) { case SQLCOM_CREATE_EVENT: { bool if_not_exists= (lex->create_info.options & HA_LEX_CREATE_IF_NOT_EXISTS); + /* WSREP_TO_ISOLATION_BEGIN is inside of Events::create_event */ res= Events::create_event(thd, lex->event_parse_data, if_not_exists); break; } case SQLCOM_ALTER_EVENT: + /* WSREP_TO_ISOLATION_BEGIN is inside of Events::update_event */ res= Events::update_event(thd, lex->event_parse_data, lex->spname ? &lex->spname->m_db : NULL, lex->spname ? &lex->spname->m_name : NULL); @@ -5023,14 +4992,16 @@ /* lex->unit.cleanup() is called outside, no need to call it here */ break; case SQLCOM_SHOW_CREATE_EVENT: -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); res= Events::show_create_event(thd, lex->spname->m_db, lex->spname->m_name); break; case SQLCOM_DROP_EVENT: + if (Events::drop_event_precheck(thd, lex->spname->m_db)) + break; + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + if (!(res= Events::drop_event(thd, lex->spname->m_db, lex->spname->m_name, lex->drop_if_exists))) @@ -5423,6 +5394,7 @@ if (!strcmp(thd->security_ctx->priv_user, grant_user->user.str) || !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 0)) { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); res = mysql_show_grants(thd, grant_user); } break; @@ -5981,18 +5953,14 @@ } case SQLCOM_SHOW_CREATE_PROC: { -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (sp_show_create_routine(thd, SP_TYPE_PROCEDURE, lex->spname)) goto error; break; } case SQLCOM_SHOW_CREATE_FUNC: { -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (sp_show_create_routine(thd, SP_TYPE_FUNCTION, lex->spname)) goto error; break; @@ -6005,9 +5973,7 @@ enum_sp_type sp_type= (lex->sql_command == SQLCOM_SHOW_PROC_CODE) ? SP_TYPE_PROCEDURE : SP_TYPE_FUNCTION; -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (sp_cache_routine(thd, sp_type, lex->spname, false, &sp)) goto error; if (!sp || sp->show_routine_code(thd)) @@ -6032,9 +5998,7 @@ goto error; } -#ifdef WITH_WSREP - if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -#endif /* WITH_WSREP */ + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); if (show_create_trigger(thd, lex->spname)) goto error; /* Error has been already logged. */ @@ -6046,7 +6010,7 @@ Note: SQLCOM_CREATE_VIEW also handles 'ALTER VIEW' commands as specified through the thd->lex->create_view_mode flag. */ - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + /* WSREP_TO_ISOLATION_BEGIN is inside of mysql_create_view */ res= mysql_create_view(thd, first_table, thd->lex->create_view_mode); break; } @@ -6062,7 +6026,7 @@ case SQLCOM_CREATE_TRIGGER: { /* Conditionally writes to binlog. */ - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, all_tables) + /* WSREP_TO_ISOLATION_BEGIN is inside of mysql_create_or_drop_trigger */ res= mysql_create_or_drop_trigger(thd, all_tables, 1); break; @@ -6070,7 +6034,7 @@ case SQLCOM_DROP_TRIGGER: { /* Conditionally writes to binlog. */ - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + /* WSREP_TO_ISOLATION_BEGIN is inside of mysql_create_or_drop_trigger */ res= mysql_create_or_drop_trigger(thd, all_tables, 0); break; } @@ -6135,13 +6099,14 @@ my_ok(thd); break; case SQLCOM_INSTALL_PLUGIN: - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + /* WSREP_TO_ISOLATION_BEGIN is inside of mysql_install_plugin */ if (! (res= mysql_install_plugin(thd, &thd->lex->comment, &thd->lex->ident))) my_ok(thd); break; case SQLCOM_UNINSTALL_PLUGIN: - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + /* WSREP_TO_ISOLATION_BEGIN is inside of mysql_uninstall_plugin */ + if (! (res= mysql_uninstall_plugin(thd, &thd->lex->comment))) my_ok(thd); break; @@ -7308,6 +7273,7 @@ DBUG_ENTER("mysql_reset_thd_for_next_command"); DBUG_ASSERT(!thd->sp_runtime_ctx); /* not for substatements of routines */ DBUG_ASSERT(! thd->in_sub_stmt); + DBUG_ASSERT(!thd->query_cache_tls.first_query_block); thd->free_list= 0; thd->select_number= 1; /* diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_parse.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_parse.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_parse.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_parse.h 2017-10-19 04:25:29.000000000 +0000 @@ -227,15 +227,22 @@ if (WSREP(thd) && !thd->lex->no_write_to_binlog \ && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error; +#define WSREP_SYNC_WAIT(thd_, before_) \ + { if (WSREP_CLIENT(thd_) && \ + wsrep_sync_wait(thd_, before_)) goto error; } + #else #define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) -#define WSREP_TO_ISOLATION_END +#define WSREP_TO_ISOLATION_END #define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) +#define WSREP_SYNC_WAIT(thd_, before_) #endif /* WITH_WSREP */ extern "C" bool sqlcom_can_generate_row_events(enum enum_sql_command command); +bool lock_binlog_for_backup(THD *thd); + #endif /* SQL_PARSE_INCLUDED */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_partition_admin.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_partition_admin.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_partition_admin.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_partition_admin.cc 2017-10-19 04:25:29.000000000 +0000 @@ -773,7 +773,7 @@ if (WSREP(thd) && (!thd->is_current_stmt_binlog_format_row() || !find_temporary_table(thd, first_table)) && wsrep_to_isolation_begin( - thd, first_table->db, first_table->table_name, NULL) + thd, first_table->db, first_table->table_name, NULL) ) { WSREP_WARN("ALTER TABLE isolation failure"); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_planner.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_planner.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_planner.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_planner.cc 2017-10-19 04:25:29.000000000 +0000 @@ -482,6 +482,8 @@ key_part_map const_part= 0; /* The or-null keypart in ref-or-null access: */ key_part_map ref_or_null_part= 0; + /// Set dodgy_ref_cost only if that index is chosen for ref access. + bool is_dodgy= false; /* Calculate how many key segments of the current key we can use */ Key_use *const start_key= keyuse; @@ -748,7 +750,10 @@ if (!found_ref && table->quick_keys.is_set(key) && // (1) table->quick_key_parts[key] > max_key_part && // (2) records < (double)table->quick_rows[key]) // (3) + { records= (double)table->quick_rows[key]; + is_dodgy= true; + } tmp= records; } @@ -857,7 +862,10 @@ } } done_with_index: - trace_access_idx.add("chosen", best_key == start_key); + bool chosen= (best_key == start_key); + trace_access_idx.add("chosen", chosen); + if (chosen) + s->dodgy_ref_cost= is_dodgy; } /* for each key */ records= best_records; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_plugin.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_plugin.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_plugin.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_plugin.cc 2017-10-19 04:25:29.000000000 +0000 @@ -453,30 +453,61 @@ } -static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report) +static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, + int report, + bool allow_dl_path) { #ifdef HAVE_DLOPEN char dlpath[FN_REFLEN]; - uint plugin_dir_len, dummy_errors, dlpathlen, i; + uint dummy_errors, dlpathlen, i; struct st_plugin_dl *tmp, plugin_dl; + size_t dl_fname_pos= 0; void *sym; DBUG_ENTER("plugin_dl_add"); DBUG_PRINT("enter", ("dl->str: '%s', dl->length: %d", dl->str, (int) dl->length)); - plugin_dir_len= strlen(opt_plugin_dir); - /* - Ensure that the dll doesn't have a path. - This is done to ensure that only approved libraries from the - plugin directory are used (to make this even remotely secure). - */ - if (check_valid_path(dl->str, dl->length) || - check_string_char_length((LEX_STRING *) dl, "", NAME_CHAR_LEN, - system_charset_info, 1) || - plugin_dir_len + dl->length + 1 >= FN_REFLEN) + + if (allow_dl_path) + dl_fname_pos = dirname_length(dl->str); + + if (!dl_fname_pos) { + size_t plugin_dir_len= strlen(opt_plugin_dir); + /* + Ensure that the dll doesn't have a path. + This is done to ensure that only approved libraries from the + plugin directory are used (to make this even remotely secure). + */ + if (check_valid_path(dl->str, dl->length) || + check_string_char_length((LEX_STRING *) dl, "", NAME_CHAR_LEN, + system_charset_info, 1) || + plugin_dir_len + dl->length + 1 >= FN_REFLEN) + { + report_error(report, ER_UDF_NO_PATHS); + DBUG_RETURN(0); + } + /* Compile dll path */ + dlpathlen= + strxnmov(dlpath, + sizeof(dlpath) - 1, + opt_plugin_dir, + "/", + dl->str, + NullS) - + dlpath; + } + else { - report_error(report, ER_UDF_NO_PATHS); - DBUG_RETURN(0); + if (dl->length + 1 >= sizeof(dlpath)) + { + report_error(report, ER_UDF_NO_PATHS); + DBUG_RETURN(0); + } + strncpy(dlpath, dl->str, sizeof(dlpath) - 1); + dlpathlen= dl->length; } + + (void) unpack_filename(dlpath, dlpath); + /* If this dll is already loaded just increase ref_count. */ if ((tmp= plugin_dl_find(dl))) { @@ -484,11 +515,6 @@ DBUG_RETURN(tmp); } memset(&plugin_dl, 0, sizeof(plugin_dl)); - /* Compile dll path */ - dlpathlen= - strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS) - - dlpath; - (void) unpack_filename(dlpath, dlpath); plugin_dl.ref_count= 1; /* Open new dll handle */ if (!(plugin_dl.handle= dlopen(dlpath, RTLD_NOW))) @@ -844,7 +870,7 @@ */ static bool plugin_add(MEM_ROOT *tmp_root, const LEX_STRING *name, const LEX_STRING *dl, - int *argc, char **argv, int report) + int *argc, char **argv, int report, bool allow_path) { struct st_plugin_int tmp; struct st_mysql_plugin *plugin; @@ -856,7 +882,7 @@ } /* Clear the whole struct to catch future extensions. */ memset(&tmp, 0, sizeof(tmp)); - if (! (tmp.plugin_dl= plugin_dl_add(dl, report))) + if (! (tmp.plugin_dl= plugin_dl_add(dl, report, allow_path))) DBUG_RETURN(TRUE); /* Find plugin by name */ for (plugin= tmp.plugin_dl->plugins; plugin->info; plugin++) @@ -1570,7 +1596,7 @@ LEX_STRING name= {(char *)str_name.ptr(), str_name.length()}; LEX_STRING dl= {(char *)str_dl.ptr(), str_dl.length()}; - if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG)) + if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG, false)) sql_print_warning("Couldn't load plugin named '%s' with soname '%s'.", str_name.c_ptr(), str_dl.c_ptr()); free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE)); @@ -1627,7 +1653,7 @@ dl= name; mysql_mutex_lock(&LOCK_plugin); - if ((plugin_dl= plugin_dl_add(&dl, REPORT_TO_LOG))) + if ((plugin_dl= plugin_dl_add(&dl, REPORT_TO_LOG, true))) { for (plugin= plugin_dl->plugins; plugin->info; plugin++) { @@ -1635,7 +1661,13 @@ name.length= strlen(name.str); free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE)); - if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG)) + if (plugin_add(tmp_root, + &name, + &dl, + argc, + argv, + REPORT_TO_LOG, + true)) goto error; } plugin_dl_del(&dl); // reduce ref count @@ -1645,7 +1677,7 @@ { free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE)); mysql_mutex_lock(&LOCK_plugin); - if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG)) + if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG, true)) goto error; } mysql_mutex_unlock(&LOCK_plugin); @@ -1864,6 +1896,8 @@ if (check_table_access(thd, INSERT_ACL, &tables, FALSE, 1, FALSE)) DBUG_RETURN(TRUE); + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + /* need to open before acquiring LOCK_plugin or it will deadlock */ if (! (table = open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT))) @@ -1900,7 +1934,13 @@ report_error(REPORT_TO_USER, ER_PLUGIN_IS_NOT_LOADED, name->str); goto err; } - error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER); + error= plugin_add(thd->mem_root, + name, + dl, + &argc, + argv, + REPORT_TO_USER, + false); if (argv) free_defaults(argv); mysql_rwlock_unlock(&LOCK_system_variables_hash); @@ -1949,6 +1989,7 @@ tmp->state= PLUGIN_IS_DELETED; reap_needed= true; reap_plugins(); +error: err: mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(TRUE); @@ -1973,6 +2014,8 @@ if (check_table_access(thd, DELETE_ACL, &tables, FALSE, 1, FALSE)) DBUG_RETURN(TRUE); + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + /* need to open before acquiring LOCK_plugin or it will deadlock */ if (! (table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT))) DBUG_RETURN(TRUE); @@ -2107,6 +2150,7 @@ } } DBUG_RETURN(FALSE); +error: err: mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(TRUE); @@ -3118,7 +3162,7 @@ void plugin_thdvar_safe_update(THD *thd, st_mysql_sys_var *var, char **dest, const char *value) { - DBUG_ASSERT(thd == current_thd); + DBUG_ASSERT(current_thd == NULL || thd == current_thd); if (var->flags & PLUGIN_VAR_THDLOCAL) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_prepare.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_prepare.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_prepare.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_prepare.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -110,6 +110,7 @@ #include #else #include +#include "sql_connect.h" //update_global_user_stats #endif #include "lock.h" // MYSQL_OPEN_FORCE_SHARED_MDL #include "opt_trace.h" // Opt_trace_object @@ -121,9 +122,6 @@ using std::max; using std::min; -// Uses the THD to update the global stats by user name and client IP -void update_global_user_stats(THD* thd, bool create_user, time_t now); - /** A result class used to send cursor rows using the binary protocol. */ @@ -649,7 +647,7 @@ else set_zero_time(&tm, MYSQL_TIMESTAMP_DATETIME); param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME, - MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); + MAX_DATETIME_FULL_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); *pos+= length; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_regex.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_regex.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_regex.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_regex.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,138 @@ +/* Copyright (c) 2016, Percona and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef _regex_h_ +#define _regex_h_ + +#include +#include + +#include "my_global.h" +#include "my_pthread.h" +#include "my_regex.h" + +/* + Wrapper class around my_regex that manages concurrent access and the lifetime + of the compiled regex. +*/ +class Regex +{ +private: +#if defined(HAVE_PSI_INTERFACE) + const PSI_rwlock_key& m_key; +#endif + + std::string m_pattern; + my_regex_t m_expr; + bool m_compiled; + + mutable mysql_rwlock_t m_rwlock; + + // No implementations, should never be called. + Regex(const Regex& other); + Regex& operator=(const Regex& other); + + void reset() + { + // assumes object is write locked where necessary + if (m_compiled) + { + m_pattern.clear(); + my_regfree(&m_expr); + m_compiled= false; + } + } + +public: +#if defined(HAVE_PSI_INTERFACE) + Regex(const PSI_rwlock_key& key) : + m_key(key), +#else + Regex() : +#endif + m_pattern(""), + m_compiled(false) + { +#if defined(HAVE_PSI_INTERFACE) + mysql_rwlock_init(m_key, &m_rwlock); +#else + mysql_rwlock_init(nullptr, &m_rwlock); +#endif + } + + ~Regex() + { + reset(); + mysql_rwlock_destroy(&m_rwlock); + } + + bool compiled() const + { + return m_compiled; + } + + const std::string& pattern() const + { + return m_pattern; + } + + // Compile the pattern into an expression + // see regex/my_regex.h for definition of flags + bool compile(const char *pattern, int flags, const CHARSET_INFO *charset) + { + int error= 0; + + mysql_rwlock_wrlock(&m_rwlock); + + reset(); + + if (pattern) + { + m_pattern.assign(pattern); + } + + if (!m_pattern.empty()) + { + error= my_regcomp(&m_expr, + m_pattern.c_str(), + flags, + charset); + m_compiled= !error; + } + + mysql_rwlock_unlock(&m_rwlock); + + return !error; + } + + // See if a string matches at least one pattern + bool match(const std::string& str) const + { + if (!m_compiled) + { + return false; + } + + mysql_rwlock_rdlock(&m_rwlock); + + int found= my_regexec(&m_expr, str.c_str(), 0, nullptr, 0); + + mysql_rwlock_unlock(&m_rwlock); + + return !found; + } +}; + +#endif // _regex_h_ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_resolver.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_resolver.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_resolver.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_resolver.cc 2017-10-19 04:25:29.000000000 +0000 @@ -101,6 +101,7 @@ group_list= ORDER_with_src(group_init, ESC_GROUP_BY); having= having_for_explain= having_init; tables_list= tables_init; + DBUG_ASSERT(!unit_arg->cleaned); select_lex= select_lex_arg; select_lex->join= this; join_list= &select_lex->top_join_list; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_select.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_select.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_select.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_select.cc 2017-10-19 04:25:29.000000000 +0000 @@ -788,8 +788,12 @@ func->clear(); } - if (!(select_options & SELECT_DESCRIBE)) - init_ftfuncs(thd, select_lex, MY_TEST(order)); + if (!(select_options & SELECT_DESCRIBE) && + select_lex->has_ft_funcs()) + { + /* TODO: move the code to JOIN::exec */ + (void)init_ftfuncs(thd, select_lex, MY_TEST(order)); + } DBUG_VOID_RETURN; } @@ -5173,7 +5177,7 @@ select_distinct && !group_list); tmp_table_param.hidden_field_count= tmp_all_fields1.elements - tmp_fields_list1.elements; - + sort_and_group= false; if (!exec_tmp_table->group && !exec_tmp_table->distinct) { // 1st tmp table were materializing join result diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_select.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_select.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_select.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_select.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef SQL_SELECT_INCLUDED #define SQL_SELECT_INCLUDED -/* 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 @@ -769,6 +769,12 @@ /** TRUE <=> remove duplicates on this table. */ bool distinct; + /** + Setting this flag means ref is using lesser number of key parts than range + and it borrows range's row estimate. + */ + bool dodgy_ref_cost; + /** Clean up associated table after query execution, including resources */ void cleanup(); inline bool is_using_loose_index_scan() @@ -968,7 +974,8 @@ ref_array(NULL), send_records(0), having(NULL), - distinct(false) + distinct(false), + dodgy_ref_cost(false) { /** @todo Add constructor to READ_RECORD. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_show.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_show.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_show.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_show.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1413,6 +1413,7 @@ MODE_MYSQL40)) != 0; my_bitmap_map *old_map; int error= 0; + bool omit_compressed_columns_extensions= false; DBUG_ENTER("store_create_info"); DBUG_PRINT("enter",("table: %s", table->s->table_name.str)); @@ -1546,16 +1547,21 @@ packet->append(STRING_WITH_LEN(" /*!50606 COLUMN_FORMAT DYNAMIC */")); break; case COLUMN_FORMAT_TYPE_COMPRESSED: - packet->append(STRING_WITH_LEN(" /*!" - STRINGIFY_ARG(FIRST_SUPPORTED_COMPRESSED_COLUMNS_VERSION) - " COLUMN_FORMAT COMPRESSED")); - if (field->has_associated_compression_dictionary()) + DBUG_EXECUTE_IF("omit_compressed_columns_show_extensions", + omit_compressed_columns_extensions= true; ); + if (!omit_compressed_columns_extensions) { - packet->append(STRING_WITH_LEN(" WITH COMPRESSION_DICTIONARY ")); - append_identifier(thd, packet, field->zip_dict_name.str, - field->zip_dict_name.length); + packet->append(STRING_WITH_LEN(" /*!" + STRINGIFY_ARG(FIRST_SUPPORTED_COMPRESSED_COLUMNS_VERSION) + " COLUMN_FORMAT COMPRESSED")); + if (field->has_associated_compression_dictionary()) + { + packet->append(STRING_WITH_LEN(" WITH COMPRESSION_DICTIONARY ")); + append_identifier(thd, packet, field->zip_dict_name.str, + field->zip_dict_name.length); + } + packet->append(STRING_WITH_LEN(" */")); } - packet->append(STRING_WITH_LEN(" */")); break; default: DBUG_ASSERT(0); @@ -2928,6 +2934,7 @@ if (check_global_access(thd, SUPER_ACL | PROCESS_ACL)) DBUG_RETURN(1); + refresh_concurrent_conn_stats(); // Iterates through all the global stats and sends them to the client. // Pattern matching on the client IP is supported. @@ -2967,6 +2974,7 @@ if (check_global_access(thd, SUPER_ACL | PROCESS_ACL)) DBUG_RETURN(1); + refresh_concurrent_conn_stats(); // Iterates through all the global stats and sends them to the client. // Pattern matching on the client IP is supported. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_table.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_table.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_table.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_table.cc 2017-10-19 04:25:29.000000000 +0000 @@ -89,7 +89,9 @@ const Alter_info *alter_info); static int -mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, +mysql_prepare_create_table(THD *thd, const char *error_schema_name, + const char *error_table_name, + HA_CREATE_INFO *create_info, Alter_info *alter_info, bool tmp_table, uint *db_options, @@ -1872,7 +1874,9 @@ strxmov(shadow_frm_name, shadow_path, reg_ext, NullS); if (flags & WFRM_WRITE_SHADOW) { - if (mysql_prepare_create_table(lpt->thd, lpt->create_info, + if (mysql_prepare_create_table(lpt->thd, lpt->db, + lpt->table_name, + lpt->create_info, lpt->alter_info, /*tmp_table*/ 1, &lpt->db_options, @@ -2133,7 +2137,8 @@ Here we are sure that the tmp table exists and will set the flag based on table transactional type. */ - if (is_temporary_table(table)) + if (is_temporary_table(table) + && table->table->should_binlog_drop_if_temp()) { if (table->table->s->tmp_table == TRANSACTIONAL_TMP_TABLE) have_trans_tmp_table= 1; @@ -2353,13 +2358,16 @@ int non_temp_tables_count= 0; bool foreign_key_error=0; bool non_tmp_error= 0; - bool trans_tmp_table_deleted= 0, non_trans_tmp_table_deleted= 0; + bool trans_tmp_table_delete_to_binlog= false; + bool non_trans_tmp_table_delete_to_binlog= false; bool non_tmp_table_deleted= 0; - bool have_nonexistent_tmp_table= 0; - bool is_drop_tmp_if_exists_with_no_defaultdb= 0; + bool nonexistent_tmp_table_to_binlog= false; + bool is_drop_tmp_with_no_defaultdb= false; String built_query; String built_trans_tmp_query, built_non_trans_tmp_query; String nonexistent_tmp_tables; + bool tmp_table_deleted= false; + bool tmp_table_not_found= false; DBUG_ENTER("mysql_rm_table_no_locks"); if (thd_sql_command(thd) == SQLCOM_DROP_DB @@ -2415,16 +2423,18 @@ built_query.append("DROP TABLE "); } - if (thd->is_current_stmt_binlog_format_row() || if_exists) + /* + If default database doesnot exist in those cases set + 'is_drop_tmp_with_no_defaultdb flag to 'true' so that the + 'DROP TEMPORARY TABLE IF EXISTS' command is logged with a qualified + table name. + */ + is_drop_tmp_with_no_defaultdb= + (thd->is_current_stmt_binlog_format_row() && thd->db != NULL + && check_db_dir_existence(thd->db)); + + if (if_exists) { - /* - If default database doesnot exist in those cases set - 'is_drop_tmp_if_exists_with_no_defaultdb flag to 'true' so that the - 'DROP TEMPORARY TABLE IF EXISTS' command is logged with a qualified - table name. - */ - if (thd->db != NULL && check_db_dir_existence(thd->db)) - is_drop_tmp_if_exists_with_no_defaultdb= true; built_trans_tmp_query.set_charset(system_charset_info); built_trans_tmp_query.append("DROP TEMPORARY TABLE IF EXISTS "); built_non_trans_tmp_query.set_charset(system_charset_info); @@ -2464,6 +2474,9 @@ thd->add_to_binlog_accessed_dbs(table->db); + // Save this before drop_temporary_table resets table->table to NULL + const bool should_binlog_drop_if_temp= + is_temporary_table(table) && table->table->should_binlog_drop_if_temp(); /* drop_temporary_table may return one of the following error codes: . 0 - a temporary table was successfully dropped. @@ -2492,36 +2505,50 @@ */ if (!dont_log_query) { - /* - If there is an error, we don't know the type of the engine - at this point. So, we keep it in the nonexistent_tmp_table list. - */ if (error == 1) - have_nonexistent_tmp_table= true; - else if (is_trans) - trans_tmp_table_deleted= TRUE; + tmp_table_not_found= true; else - non_trans_tmp_table_deleted= TRUE; + tmp_table_deleted= true; - String *built_ptr_query= - (error == 1 ? &nonexistent_tmp_tables : - (is_trans ? &built_trans_tmp_query : &built_non_trans_tmp_query)); - /* - Write the database name if it is not the current one or if - thd->db is NULL or 'IF EXISTS' clause is present in 'DROP TEMPORARY' - query. - */ - if (thd->db == NULL || strcmp(db,thd->db) != 0 - || is_drop_tmp_if_exists_with_no_defaultdb ) + if (should_binlog_drop_if_temp) { - append_identifier(thd, built_ptr_query, db, db_len, - system_charset_info, thd->charset()); - built_ptr_query->append("."); + String *built_ptr_query; + if (error == 1) + { + /* + If there is an error, we don't know the type of the engine + at this point. So, we keep it in the nonexistent_tmp_table list. + */ + built_ptr_query= &nonexistent_tmp_tables; + nonexistent_tmp_table_to_binlog= true; + } + else if (is_trans) + { + built_ptr_query= &built_trans_tmp_query; + trans_tmp_table_delete_to_binlog= true; + } + else + { + built_ptr_query= &built_non_trans_tmp_query; + non_trans_tmp_table_delete_to_binlog= true; + } + /* + Write the database name if it is not the current one or if + thd->db is NULL or 'IF EXISTS' clause is present in 'DROP + TEMPORARY' query. + */ + if (thd->db == NULL || strcmp(db,thd->db) != 0 + || is_drop_tmp_with_no_defaultdb) + { + append_identifier(thd, built_ptr_query, db, db_len, + system_charset_info, thd->charset()); + built_ptr_query->append("."); + } + append_identifier(thd, built_ptr_query, table->table_name, + strlen(table->table_name), system_charset_info, + thd->charset()); + built_ptr_query->append(","); } - append_identifier(thd, built_ptr_query, table->table_name, - strlen(table->table_name), system_charset_info, - thd->charset()); - built_ptr_query->append(","); } /* This means that a temporary table was droped and as such there @@ -2701,8 +2728,7 @@ #endif } DEBUG_SYNC(thd, "rm_table_no_locks_before_binlog"); - thd->thread_specific_used|= (trans_tmp_table_deleted || - non_trans_tmp_table_deleted); + thd->thread_specific_used= thd->thread_specific_used || tmp_table_deleted; error= 0; err: if (wrong_tables.length()) @@ -2715,13 +2741,11 @@ error= 1; } - if (have_nonexistent_tmp_table || non_trans_tmp_table_deleted || - trans_tmp_table_deleted || non_tmp_table_deleted) + if (tmp_table_deleted || tmp_table_not_found || non_tmp_table_deleted) { query_cache_invalidate3(thd, tables, 0); - if (have_nonexistent_tmp_table || non_trans_tmp_table_deleted || - trans_tmp_table_deleted) + if (tmp_table_deleted || tmp_table_not_found) thd->transaction.stmt.mark_dropped_temp_table(); /* @@ -2748,22 +2772,26 @@ */ if (!dont_log_query && mysql_bin_log.is_open()) { - if (non_trans_tmp_table_deleted) + if (non_trans_tmp_table_delete_to_binlog) { /* Add the list of nonexistent tmp tables here only if there is no trans tmp table deleted. */ - if (!trans_tmp_table_deleted && have_nonexistent_tmp_table) + if (!trans_tmp_table_delete_to_binlog + && nonexistent_tmp_table_to_binlog) built_non_trans_tmp_query.append(nonexistent_tmp_tables); /* Chop of the last comma */ built_non_trans_tmp_query.chop(); built_non_trans_tmp_query.append(" /* generated by server */"); +#ifdef WITH_WSREP + thd->wsrep_skip_wsrep_GTID = true; +#endif /* WITH_WSREP */ error |= thd->binlog_query(THD::STMT_QUERY_TYPE, built_non_trans_tmp_query.ptr(), built_non_trans_tmp_query.length(), FALSE, FALSE, - is_drop_tmp_if_exists_with_no_defaultdb, + is_drop_tmp_with_no_defaultdb, 0); /* When temporary and regular tables or temporary tables with @@ -2774,22 +2802,27 @@ GTID. Since drop temporary table does not implicitly commit, in these cases we must force a commit. */ - if (gtid_mode > 0 && (trans_tmp_table_deleted || non_tmp_table_deleted)) + if (gtid_mode > 0 && (trans_tmp_table_delete_to_binlog + || non_tmp_table_deleted)) error |= mysql_bin_log.commit(thd, true); } - if (trans_tmp_table_deleted || - (have_nonexistent_tmp_table && !non_trans_tmp_table_deleted)) + if (trans_tmp_table_delete_to_binlog || + (nonexistent_tmp_table_to_binlog + && !non_trans_tmp_table_delete_to_binlog)) { - if (have_nonexistent_tmp_table) + if (nonexistent_tmp_table_to_binlog) built_trans_tmp_query.append(nonexistent_tmp_tables); /* Chop of the last comma */ built_trans_tmp_query.chop(); built_trans_tmp_query.append(" /* generated by server */"); +#ifdef WITH_WSREP + thd->wsrep_skip_wsrep_GTID = true; +#endif /* WITH_WSREP */ error |= thd->binlog_query(THD::STMT_QUERY_TYPE, built_trans_tmp_query.ptr(), built_trans_tmp_query.length(), TRUE, FALSE, - is_drop_tmp_if_exists_with_no_defaultdb, + is_drop_tmp_with_no_defaultdb, 0); /* When temporary and regular tables are dropped on a single @@ -2815,6 +2848,9 @@ built_query.append(" /* generated by server */"); int error_code = (non_tmp_error ? (foreign_key_error ? ER_ROW_IS_REFERENCED : ER_BAD_TABLE_ERROR) : 0); +#ifdef WITH_WSREP + thd->wsrep_skip_wsrep_GTID = false; +#endif /* WITH_WSREP */ error |= thd->binlog_query(THD::STMT_QUERY_TYPE, built_query.ptr(), built_query.length(), @@ -2862,6 +2898,9 @@ } end: +#ifdef WITH_WSREP + thd->wsrep_skip_wsrep_GTID = false; +#endif /* WITH_WSREP */ DBUG_RETURN(error); } @@ -3372,12 +3411,15 @@ /** Check if there is a duplicate key. Report a warning for every duplicate key. - @param thd Thread context. - @param key Key to be checked. - @param key_info Key meta-data info. - @param alter_info List of columns and indexes to create. + @param thd Thread context. + @param error_schema_name Schema name of the table used for error reporting. + @param error_table_name Table name used for error reporting. + @param key Key to be checked. + @param key_info Key meta-data info. + @param alter_info List of columns and indexes to create. */ -static void check_duplicate_key(THD *thd, +static void check_duplicate_key(THD *thd, const char *error_schema_name, + const char *error_table_name, Key *key, KEY *key_info, Alter_info *alter_info) { @@ -3457,8 +3499,8 @@ push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE, ER_DUP_INDEX, ER(ER_DUP_INDEX), key_info->name, - thd->lex->query_tables->db, - thd->lex->query_tables->table_name); + error_schema_name, + error_table_name); break; } } @@ -3471,6 +3513,10 @@ SYNOPSIS mysql_prepare_create_table() thd Thread object. + error_schema_name Schema name of the table to create/alter,only + used for error reporting. + error_table_name Name of table to create/alter, only used for + error reporting. create_info Create information (like MAX_ROWS). alter_info List of columns and indexes to create tmp_table If a temporary table is to be created. @@ -3492,7 +3538,9 @@ */ static int -mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, +mysql_prepare_create_table(THD *thd, const char *error_schema_name, + const char *error_table_name, + HA_CREATE_INFO *create_info, Alter_info *alter_info, bool tmp_table, uint *db_options, @@ -3512,6 +3560,21 @@ uint total_uneven_bit_length= 0; DBUG_ENTER("mysql_prepare_create_table"); + LEX_STRING* connect_string = &create_info->connect_string; + if (connect_string->length != 0 && + connect_string->length > CONNECT_STRING_MAXLEN && + (system_charset_info->cset->charpos(system_charset_info, + connect_string->str, + (connect_string->str + + connect_string->length), + CONNECT_STRING_MAXLEN) + < connect_string->length)) + { + my_error(ER_WRONG_STRING_LENGTH, MYF(0), + connect_string->str, "CONNECTION", CONNECT_STRING_MAXLEN); + DBUG_RETURN(TRUE); + } + select_field_pos= alter_info->create_list.elements - select_field_count; null_fields=blob_columns=0; create_info->varchar= 0; @@ -4419,9 +4482,18 @@ else key_info->flags|= HA_PACK_KEY; } - /* Check if the key segment is partial, set the key flag accordingly */ - if (key_part_length != sql_field->key_length) - key_info->flags|= HA_KEY_HAS_PART_KEY_SEG; + /* + Check if the key segment is partial, set the key flag + accordingly. The key segment for a POINT column is NOT considered + partial if key_length==MAX_LEN_GEOM_POINT_FIELD. + */ + if (key_part_length != sql_field->key_length && + !(sql_field->sql_type == MYSQL_TYPE_GEOMETRY && + sql_field->geom_type == Field::GEOM_POINT && + key_part_length == MAX_LEN_GEOM_POINT_FIELD)) + { + key_info->flags|= HA_KEY_HAS_PART_KEY_SEG; + } key_length+= key_part_length; key_part_info++; @@ -4479,7 +4551,8 @@ } // Check if a duplicate index is defined. - check_duplicate_key(thd, key, key_info, alter_info); + check_duplicate_key(thd, error_schema_name, error_table_name, + key, key_info, alter_info); if (alter_info->delayed_key_list.elements > 0) { @@ -4745,6 +4818,8 @@ @param thd Thread object @param db Database @param table_name Table name + @param error_table_name The real table name in case table_name is a temporary + table (ALTER). Only used for error messages. @param path Path to table (i.e. to its .FRM file without the extension). @param create_info Create information (like MAX_ROWS) @@ -4777,6 +4852,7 @@ static bool create_table_impl(THD *thd, const char *db, const char *table_name, + const char *error_table_name, const char *path, HA_CREATE_INFO *create_info, Alter_info *alter_info, @@ -5020,10 +5096,21 @@ } } } + if (alter_info->has_compressed_columns() && + !ha_check_storage_engine_flag(part_info->default_engine_type, + HTON_SUPPORTS_COMPRESSED_COLUMNS)) + { + my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), + ha_resolve_storage_engine_name(part_info->default_engine_type), + "COMPRESSED COLUMNS"); + goto err; + } + } #endif - if (mysql_prepare_create_table(thd, create_info, alter_info, + if (mysql_prepare_create_table(thd, db, error_table_name, + create_info, alter_info, internal_tmp_table, &db_options, file, key_info, key_count, @@ -5296,9 +5383,9 @@ } } - return create_table_impl(thd, db, table_name, path, create_info, alter_info, - false, select_field_count, false, is_trans, - ¬_used_1, ¬_used_2); + return create_table_impl(thd, db, table_name, table_name, path, create_info, + alter_info, false, select_field_count, false, + is_trans, ¬_used_1, ¬_used_2); } @@ -6534,8 +6621,8 @@ KEY *key_info_buffer= NULL; /* Create the prepared information. */ - if (mysql_prepare_create_table(thd, create_info, - &tmp_alter_info, + if (mysql_prepare_create_table(thd, "", "", + create_info, &tmp_alter_info, (table->s->tmp_table != NO_TMP_TABLE), &db_options, table->file, &key_info_buffer, @@ -8868,6 +8955,7 @@ tmp_disable_binlog(thd); error= create_table_impl(thd, alter_ctx.new_db, alter_ctx.tmp_name, + alter_ctx.table_name, alter_ctx.get_tmp_path(), create_info, alter_info, true, 0, true, NULL, @@ -10033,15 +10121,18 @@ Check if the given table has compressed columns, and if the storage engine does support it. */ - List_iterator it( - const_cast&>(alter_info->create_list)); - Create_field* sql_field= it++; - while (sql_field != 0 && - sql_field->column_format() != COLUMN_FORMAT_TYPE_COMPRESSED) - sql_field= it++; - if (sql_field != 0 && - ((*new_engine)->create_zip_dict == 0 || - (*new_engine)->drop_zip_dict == 0)) +#ifdef WITH_PARTITION_STORAGE_ENGINE + partition_info *part_info= thd->work_part_info; + bool check_compressed_columns= part_info == 0 && + !(create_info->db_type->partition_flags && + (create_info->db_type->partition_flags() & HA_USE_AUTO_PARTITION)); +#else + #define check_compress_columns true +#endif + + if (check_compressed_columns && alter_info->has_compressed_columns() && + !ha_check_storage_engine_flag(*new_engine, + HTON_SUPPORTS_COMPRESSED_COLUMNS)) { my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), ha_resolve_storage_engine_name(*new_engine), "COMPRESSED COLUMNS"); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_tmp_table.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_tmp_table.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_tmp_table.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_tmp_table.cc 2017-10-19 04:25:29.000000000 +0000 @@ -378,6 +378,13 @@ default: // Dosen't have to be stored break; } + + /* Make sure temporary fields are never compressed */ + if (result->column_format() == COLUMN_FORMAT_TYPE_COMPRESSED) + result->flags &= ~FIELD_FLAGS_COLUMN_FORMAT_MASK; + result->zip_dict_name = null_lex_cstr; + result->zip_dict_data = null_lex_cstr; + return result; } @@ -486,7 +493,6 @@ (ulong) rows_limit, MY_TEST(group))); thd->inc_status_created_tmp_tables(); - thd->query_plan_flags|= QPLAN_TMP_TABLE; if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES)) temp_pool_slot = bitmap_lock_set_next(&temp_pool); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_trigger.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_trigger.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_trigger.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_trigger.cc 2017-10-19 04:25:29.000000000 +0000 @@ -525,6 +525,8 @@ goto end; } + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, tables) + /* We also don't allow creation of triggers on views. */ tables->required_type= FRMTYPE_TABLE; /* @@ -595,6 +597,7 @@ */ sp_cache_invalidate(); +error: end: if (!result) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_truncate.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_truncate.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_truncate.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_truncate.cc 2017-10-19 04:25:29.000000000 +0000 @@ -479,8 +479,8 @@ #ifdef WITH_WSREP if (WSREP(thd) && wsrep_to_isolation_begin(thd, - table_ref->db, - table_ref->table_name, NULL)) + table_ref->db, + table_ref->table_name, NULL)) DBUG_RETURN(TRUE); #endif /* WITH_WSREP */ if (lock_table(thd, table_ref, &hton_can_recreate)) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_union.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_union.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_union.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_union.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -372,6 +372,19 @@ Item *item_tmp; while ((item_tmp= it++)) { + /* + If the outer query has a GROUP BY clause, an outer reference to this + query block may have been wrapped in a Item_outer_ref, which has not + been fixed yet. An Item_type_holder must be created based on a fixed + Item, so use the inner Item instead. + */ + DBUG_ASSERT(item_tmp->fixed || + (item_tmp->type() == Item::REF_ITEM && + ((Item_ref *)(item_tmp))->ref_type() == + Item_ref::OUTER_REF)); + if (!item_tmp->fixed) + item_tmp= item_tmp->real_item(); + /* Error's in 'new' will be detected after loop */ types.push_back(new Item_type_holder(thd_arg, item_tmp)); } @@ -537,6 +550,7 @@ for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) { + DBUG_ASSERT(!cleaned); DBUG_ASSERT(sl->join); if (optimized) { @@ -835,6 +849,10 @@ if (cleaned) { +#ifndef DBUG_OFF + for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) + DBUG_ASSERT(!sl->join); +#endif DBUG_RETURN(FALSE); } cleaned= true; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_update.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_update.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_update.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_update.cc 2017-10-19 04:25:29.000000000 +0000 @@ -502,7 +502,8 @@ goto exit_without_my_ok; } } - init_ftfuncs(thd, select_lex, 1); + if (select_lex->has_ft_funcs() && init_ftfuncs(thd, select_lex, 1)) + goto exit_without_my_ok; table->update_const_key_parts(conds); order= simple_remove_const(order, conds); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_view.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_view.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_view.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_view.cc 2017-10-19 04:25:29.000000000 +0000 @@ -433,6 +433,9 @@ goto err; lex->link_first_table_back(view, link_to_local); + + WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) + view->open_type= OT_BASE_ONLY; /* @@ -748,6 +751,7 @@ lex->link_first_table_back(view, link_to_local); DBUG_RETURN(0); +error: err: THD_STAGE_INFO(thd, stage_end); lex->link_first_table_back(view, link_to_local); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_yacc.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_yacc.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_yacc.cc 2016-12-13 08:49:19.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_yacc.cc 2017-10-27 11:39:29.000000000 +0000 @@ -76,7 +76,7 @@ /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ -#line 24 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 24 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" /* Note: YYTHD is passed as an argument to yyparse(), and subsequently to yylex(). @@ -1023,7 +1023,7 @@ /* Line 189 of yacc.c */ -#line 1027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.cc" +#line 1027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -2338,7 +2338,7 @@ { /* Line 214 of yacc.c */ -#line 968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" int num; ulong ulong_num; @@ -2400,7 +2400,7 @@ /* Line 214 of yacc.c */ -#line 2404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.cc" +#line 2404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -2411,13 +2411,13 @@ /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 1027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 1027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); /* Line 264 of yacc.c */ -#line 2421 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.cc" +#line 2421 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.cc" #ifdef short # undef short @@ -3878,228 +3878,228 @@ 5369, 5368, 5371, 5373, 5375, 5377, 5382, 5383, 5389, 5390, 5407, 5408, 5412, 5413, 5417, 5436, 5446, 5457, 5466, 5467, 5483, 5485, 5484, 5489, 5487, 5498, 5499, 5503, 5521, 5537, - 5538, 5554, 5569, 5591, 5592, 5597, 5596, 5620, 5630, 5652, - 5651, 5669, 5668, 5688, 5710, 5714, 5743, 5755, 5756, 5761, - 5772, 5760, 5797, 5798, 5802, 5815, 5836, 5849, 5875, 5876, - 5881, 5880, 5917, 5922, 5923, 5927, 5928, 5932, 5934, 5940, - 5942, 5944, 5946, 5948, 5950, 5960, 5975, 5959, 5989, 5990, - 5994, 5995, 5999, 6000, 6004, 6005, 6009, 6010, 6014, 6015, - 6019, 6023, 6024, 6027, 6029, 6033, 6034, 6038, 6039, 6040, - 6044, 6049, 6054, 6059, 6064, 6069, 6074, 6079, 6094, 6100, - 6115, 6120, 6135, 6141, 6159, 6164, 6169, 6174, 6179, 6185, - 6184, 6210, 6211, 6212, 6217, 6222, 6227, 6229, 6231, 6233, - 6239, 6247, 6265, 6282, 6308, 6326, 6327, 6328, 6329, 6330, - 6331, 6332, 6333, 6334, 6335, 6336, 6337, 6338, 6339, 6343, - 6344, 6345, 6349, 6350, 6354, 6355, 6356, 6357, 6362, 6369, - 6370, 6374, 6375, 6379, 6380, 6387, 6392, 6398, 6404, 6417, - 6436, 6442, 6444, 6448, 6452, 6453, 6457, 6462, 6461, 6485, - 6486, 6487, 6488, 6493, 6497, 6502, 6507, 6511, 6516, 6521, - 6527, 6532, 6538, 6542, 6547, 6552, 6570, 6572, 6574, 6590, - 6592, 6597, 6602, 6614, 6619, 6624, 6629, 6631, 6633, 6635, - 6637, 6639, 6641, 6643, 6646, 6645, 6650, 6649, 6653, 6655, - 6664, 6665, 6666, 6672, 6673, 6674, 6675, 6676, 6680, 6684, - 6685, 6689, 6690, 6694, 6695, 6696, 6697, 6698, 6702, 6703, - 6704, 6705, 6706, 6710, 6715, 6717, 6723, 6724, 6726, 6731, - 6741, 6742, 6746, 6747, 6748, 6756, 6757, 6761, 6762, 6766, - 6767, 6768, 6772, 6773, 6774, 6775, 6778, 6779, 6783, 6784, - 6788, 6789, 6793, 6794, 6798, 6799, 6800, 6801, 6802, 6803, - 6809, 6815, 6824, 6833, 6834, 6847, 6853, 6859, 6865, 6872, - 6877, 6882, 6890, 6891, 6903, 6924, 6932, 6933, 6938, 6939, - 6943, 6951, 6955, 6956, 6960, 6961, 6965, 6974, 6978, 6979, - 6983, 6991, 6992, 6996, 6997, 7001, 7002, 7007, 7008, 7012, - 7019, 7028, 7033, 7041, 7042, 7043, 7044, 7045, 7046, 7051, - 7059, 7060, 7065, 7064, 7077, 7078, 7082, 7085, 7086, 7087, - 7088, 7092, 7100, 7107, 7108, 7112, 7122, 7123, 7127, 7128, - 7131, 7133, 7137, 7149, 7150, 7154, 7161, 7174, 7175, 7177, - 7179, 7185, 7190, 7196, 7202, 7209, 7219, 7220, 7221, 7222, - 7223, 7227, 7231, 7232, 7237, 7238, 7242, 7243, 7247, 7248, - 7249, 7253, 7254, 7258, 7262, 7269, 7273, 7277, 7284, 7288, - 7292, 7296, 7309, 7321, 7322, 7326, 7327, 7331, 7332, 7336, - 7337, 7341, 7342, 7346, 7347, 7351, 7352, 7356, 7357, 7361, - 7363, 7367, 7368, 7372, 7376, 7377, 7390, 7391, 7392, 7396, - 7397, 7401, 7407, 7421, 7422, 7426, 7427, 7431, 7432, 7440, - 7439, 7485, 7484, 7498, 7510, 7509, 7528, 7527, 7546, 7545, - 7564, 7558, 7578, 7577, 7616, 7621, 7626, 7631, 7636, 7643, - 7650, 7655, 7663, 7664, 7665, 7666, 7670, 7671, 7683, 7684, - 7688, 7689, 7692, 7694, 7702, 7710, 7712, 7714, 7715, 7723, - 7724, 7728, 7737, 7735, 7749, 7763, 7762, 7776, 7774, 7788, - 7795, 7806, 7807, 7835, 7842, 7846, 7851, 7850, 7866, 7868, - 7873, 7881, 7880, 7896, 7900, 7899, 7911, 7912, 7916, 7931, - 7932, 7936, 7945, 7949, 7954, 7960, 7959, 7970, 7980, 7969, - 7995, 8004, 8013, 8022, 8031, 8037, 8043, 8052, 8061, 8089, - 8110, 8120, 8124, 8129, 8130, 8133, 8135, 8136, 8137, 8138, - 8141, 8146, 8157, 8162, 8173, 8174, 8178, 8179, 8183, 8184, - 8185, 8189, 8190, 8195, 8203, 8204, 8205, 8206, 8211, 8210, - 8239, 8249, 8266, 8269, 8276, 8280, 8287, 8291, 8297, 8301, - 8308, 8313, 8316, 8323, 8326, 8333, 8336, 8343, 8346, 8354, - 8357, 8364, 8368, 8375, 8379, 8386, 8387, 8412, 8413, 8414, - 8419, 8424, 8432, 8431, 8443, 8444, 8445, 8450, 8449, 8471, - 8472, 8476, 8477, 8481, 8482, 8483, 8488, 8487, 8509, 8518, - 8517, 8544, 8545, 8549, 8550, 8554, 8555, 8556, 8557, 8558, - 8559, 8564, 8563, 8585, 8586, 8587, 8592, 8591, 8597, 8604, - 8609, 8617, 8618, 8622, 8636, 8635, 8648, 8649, 8653, 8654, - 8658, 8668, 8678, 8679, 8684, 8683, 8694, 8695, 8699, 8700, - 8704, 8714, 8725, 8724, 8732, 8732, 8743, 8744, 8749, 8750, - 8759, 8768, 8769, 8773, 8778, 8783, 8788, 8793, 8792, 8812, - 8820, 8812, 8827, 8828, 8829, 8830, 8831, 8835, 8842, 8849, - 8851, 8862, 8863, 8867, 8868, 8896, 8926, 8928, 8937, 8950, - 8951, 8952, 8967, 8974, 8999, 9005, 9011, 9012, 9013, 9014, - 9015, 9019, 9020, 9025, 9076, 9083, 9126, 9132, 9138, 9144, - 9150, 9156, 9162, 9168, 9172, 9178, 9184, 9190, 9196, 9202, - 9206, 9212, 9222, 9228, 9236, 9242, 9252, 9258, 9267, 9277, - 9283, 9293, 9299, 9308, 9312, 9318, 9324, 9330, 9336, 9342, - 9348, 9354, 9360, 9366, 9372, 9378, 9384, 9390, 9396, 9400, - 9401, 9405, 9406, 9410, 9411, 9415, 9416, 9420, 9421, 9422, - 9423, 9424, 9425, 9429, 9430, 9434, 9435, 9436, 9437, 9438, - 9439, 9451, 9452, 9453, 9454, 9455, 9461, 9465, 9471, 9477, - 9483, 9489, 9491, 9498, 9505, 9511, 9552, 9561, 9568, 9576, - 9582, 9589, 9595, 9609, 9616, 9632, 9638, 9644, 9652, 9658, - 9664, 9670, 9676, 9691, 9703, 9709, 9715, 9721, 9727, 9733, - 9739, 9745, 9751, 9757, 9763, 9769, 9775, 9781, 9787, 9793, - 9799, 9807, 9828, 9835, 9841, 9848, 9855, 9862, 9869, 9875, - 9881, 9886, 9892, 9899, 9905, 9911, 9917, 9923, 9929, 9947, - 9953, 9959, 9966, 9973, 9988, 9994, 10000, 10006, 10012, 10019, - 10025, 10031, 10037, 10043, 10049, 10057, 10070, 10076, 10082, 10088, - 10094, 10102, 10108, 10120, 10126, 10132, 10140, 10150, 10156, 10172, - 10178, 10185, 10192, 10199, 10206, 10213, 10217, 10237, 10236, 10309, - 10349, 10351, 10356, 10357, 10361, 10362, 10366, 10367, 10371, 10378, - 10386, 10412, 10418, 10424, 10430, 10436, 10442, 10451, 10458, 10460, - 10457, 10467, 10478, 10484, 10490, 10496, 10502, 10508, 10514, 10520, - 10526, 10533, 10532, 10552, 10551, 10566, 10577, 10585, 10601, 10602, - 10607, 10612, 10615, 10618, 10617, 10634, 10636, 10642, 10641, 10658, - 10660, 10662, 10664, 10666, 10668, 10670, 10672, 10674, 10676, 10678, - 10683, 10684, 10688, 10695, 10703, 10704, 10708, 10715, 10723, 10724, - 10728, 10729, 10733, 10741, 10752, 10753, 10762, 10773, 10774, 10780, - 10781, 10801, 10803, 10807, 10805, 10822, 10820, 10838, 10836, 10843, - 10852, 10850, 10868, 10867, 10877, 10888, 10886, 10905, 10904, 10915, - 10926, 10927, 10928, 10936, 10937, 10941, 10956, 10956, 10971, 11011, - 11084, 11095, 11100, 11092, 11119, 11139, 11147, 11139, 11156, 11155, - 11178, 11195, 11178, 11202, 11206, 11232, 11233, 11238, 11241, 11242, - 11243, 11247, 11248, 11253, 11252, 11258, 11257, 11265, 11266, 11269, - 11271, 11271, 11275, 11275, 11280, 11281, 11285, 11287, 11292, 11293, - 11297, 11308, 11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, - 11329, 11330, 11331, 11332, 11336, 11337, 11338, 11339, 11340, 11341, - 11342, 11343, 11344, 11348, 11349, 11350, 11351, 11354, 11356, 11357, - 11361, 11362, 11370, 11372, 11376, 11378, 11377, 11391, 11394, 11393, - 11408, 11414, 11429, 11431, 11435, 11437, 11442, 11443, 11463, 11494, - 11498, 11499, 11503, 11516, 11518, 11523, 11522, 11557, 11559, 11564, - 11565, 11566, 11571, 11577, 11581, 11582, 11586, 11597, 11604, 11611, - 11621, 11648, 11652, 11658, 11664, 11674, 11678, 11692, 11693, 11694, - 11695, 11696, 11697, 11701, 11702, 11703, 11704, 11705, 11709, 11710, - 11711, 11712, 11713, 11717, 11718, 11719, 11720, 11724, 11729, 11730, - 11733, 11736, 11735, 11769, 11770, 11774, 11782, 11795, 11795, 11805, - 11806, 11810, 11829, 11869, 11868, 11881, 11889, 11880, 11891, 11903, - 11915, 11914, 11932, 11931, 11942, 11943, 11942, 11959, 11966, 11987, - 12008, 12020, 12025, 12024, 12034, 12040, 12047, 12052, 12057, 12064, - 12073, 12074, 12078, 12089, 12102, 12103, 12107, 12118, 12119, 12123, - 12124, 12127, 12129, 12132, 12133, 12134, 12138, 12139, 12147, 12155, - 12146, 12165, 12172, 12164, 12182, 12194, 12195, 12208, 12212, 12213, - 12229, 12230, 12234, 12243, 12244, 12245, 12247, 12246, 12257, 12258, - 12262, 12263, 12265, 12264, 12268, 12267, 12273, 12274, 12278, 12279, - 12283, 12293, 12294, 12298, 12299, 12304, 12303, 12317, 12318, 12322, - 12327, 12335, 12336, 12344, 12346, 12346, 12354, 12362, 12353, 12384, - 12385, 12389, 12397, 12398, 12402, 12412, 12413, 12420, 12419, 12435, - 12434, 12448, 12447, 12459, 12458, 12472, 12473, 12477, 12490, 12506, - 12507, 12511, 12512, 12516, 12517, 12518, 12523, 12522, 12544, 12546, - 12549, 12551, 12554, 12555, 12558, 12562, 12566, 12570, 12574, 12578, - 12582, 12586, 12590, 12598, 12601, 12611, 12610, 12625, 12632, 12640, - 12648, 12656, 12664, 12672, 12679, 12681, 12683, 12692, 12696, 12701, - 12700, 12706, 12705, 12710, 12719, 12726, 12731, 12733, 12735, 12737, - 12739, 12747, 12758, 12766, 12768, 12776, 12783, 12790, 12800, 12807, - 12813, 12822, 12830, 12834, 12839, 12843, 12847, 12854, 12861, 12868, - 12875, 12882, 12889, 12896, 12902, 12909, 12916, 12921, 12926, 12934, - 12936, 12938, 12943, 12944, 12947, 12949, 12953, 12954, 12958, 12959, - 12963, 12964, 12968, 12969, 12973, 12974, 12977, 12979, 12986, 12997, - 12996, 13012, 13011, 13018, 13019, 13020, 13021, 13022, 13026, 13027, - 13032, 13036, 13042, 13048, 13070, 13071, 13072, 13087, 13086, 13099, - 13108, 13098, 13110, 13114, 13115, 13127, 13126, 13148, 13149, 13154, - 13156, 13158, 13160, 13162, 13164, 13166, 13168, 13170, 13172, 13174, - 13176, 13178, 13180, 13182, 13184, 13186, 13188, 13190, 13195, 13196, - 13201, 13200, 13210, 13211, 13215, 13215, 13217, 13218, 13219, 13224, - 13225, 13230, 13229, 13240, 13241, 13248, 13252, 13256, 13266, 13271, - 13283, 13293, 13294, 13295, 13301, 13313, 13325, 13335, 13345, 13312, - 13353, 13354, 13358, 13359, 13363, 13364, 13376, 13380, 13381, 13382, - 13385, 13387, 13391, 13392, 13396, 13401, 13408, 13413, 13420, 13422, - 13426, 13427, 13431, 13436, 13444, 13445, 13448, 13450, 13458, 13460, - 13464, 13465, 13466, 13470, 13472, 13477, 13478, 13487, 13488, 13492, - 13493, 13497, 13517, 13541, 13553, 13564, 13583, 13591, 13603, 13618, - 13639, 13640, 13641, 13650, 13651, 13652, 13653, 13668, 13674, 13680, - 13686, 13692, 13723, 13756, 13766, 13776, 13782, 13791, 13803, 13809, - 13815, 13831, 13832, 13836, 13845, 13861, 13865, 13916, 13920, 13938, - 13942, 14022, 14047, 14078, 14079, 14095, 14105, 14109, 14115, 14121, - 14131, 14137, 14146, 14156, 14157, 14187, 14200, 14216, 14232, 14249, - 14250, 14261, 14262, 14273, 14274, 14275, 14279, 14306, 14339, 14354, - 14355, 14356, 14357, 14358, 14359, 14360, 14361, 14362, 14363, 14364, - 14365, 14366, 14367, 14368, 14369, 14370, 14371, 14372, 14373, 14374, - 14375, 14376, 14377, 14378, 14379, 14380, 14381, 14382, 14383, 14384, - 14385, 14386, 14387, 14388, 14389, 14390, 14391, 14392, 14393, 14394, - 14395, 14396, 14397, 14398, 14399, 14400, 14401, 14402, 14403, 14413, - 14414, 14415, 14416, 14417, 14418, 14419, 14420, 14421, 14422, 14423, - 14424, 14425, 14426, 14427, 14428, 14429, 14430, 14431, 14432, 14433, - 14434, 14435, 14436, 14437, 14438, 14439, 14440, 14441, 14442, 14443, - 14444, 14445, 14446, 14447, 14448, 14449, 14450, 14451, 14452, 14453, - 14454, 14455, 14456, 14457, 14458, 14459, 14460, 14461, 14466, 14467, - 14468, 14469, 14470, 14471, 14472, 14473, 14474, 14475, 14476, 14477, - 14478, 14479, 14480, 14481, 14482, 14483, 14484, 14485, 14486, 14487, - 14488, 14489, 14490, 14491, 14492, 14493, 14494, 14495, 14496, 14497, - 14498, 14499, 14500, 14501, 14502, 14503, 14504, 14505, 14506, 14507, - 14508, 14509, 14510, 14511, 14512, 14513, 14514, 14515, 14516, 14517, - 14518, 14519, 14520, 14521, 14522, 14523, 14524, 14525, 14526, 14527, - 14528, 14529, 14530, 14531, 14532, 14533, 14534, 14535, 14536, 14537, - 14538, 14539, 14540, 14541, 14542, 14543, 14544, 14545, 14546, 14547, - 14548, 14549, 14550, 14551, 14552, 14553, 14554, 14555, 14556, 14557, - 14558, 14559, 14560, 14561, 14562, 14563, 14564, 14565, 14566, 14567, - 14568, 14569, 14570, 14571, 14572, 14573, 14574, 14575, 14576, 14577, - 14578, 14579, 14580, 14581, 14582, 14583, 14584, 14585, 14586, 14587, - 14588, 14589, 14590, 14591, 14592, 14593, 14594, 14595, 14596, 14597, - 14598, 14599, 14600, 14601, 14602, 14603, 14604, 14605, 14606, 14607, - 14608, 14609, 14610, 14611, 14612, 14613, 14614, 14615, 14616, 14617, - 14618, 14619, 14620, 14621, 14622, 14623, 14624, 14625, 14626, 14627, - 14628, 14629, 14630, 14631, 14632, 14633, 14634, 14635, 14636, 14637, - 14638, 14639, 14640, 14641, 14642, 14643, 14644, 14645, 14646, 14647, - 14648, 14649, 14650, 14651, 14652, 14653, 14654, 14655, 14656, 14657, - 14658, 14659, 14660, 14661, 14662, 14663, 14664, 14665, 14666, 14667, - 14668, 14669, 14670, 14671, 14672, 14673, 14674, 14675, 14676, 14677, - 14678, 14679, 14680, 14681, 14682, 14683, 14684, 14685, 14686, 14687, - 14688, 14689, 14690, 14691, 14692, 14693, 14694, 14695, 14696, 14697, - 14698, 14699, 14700, 14701, 14702, 14703, 14704, 14705, 14706, 14707, - 14708, 14709, 14710, 14711, 14712, 14713, 14714, 14715, 14716, 14717, - 14718, 14719, 14720, 14721, 14722, 14723, 14724, 14725, 14726, 14727, - 14728, 14729, 14730, 14731, 14732, 14733, 14734, 14746, 14745, 14760, - 14759, 14787, 14788, 14793, 14792, 14799, 14798, 14808, 14807, 14818, - 14817, 14823, 14831, 14833, 14838, 14838, 14847, 14846, 14860, 14859, - 14864, 14868, 14869, 14870, 14874, 14875, 14876, 14877, 14881, 14882, - 14883, 14884, 14889, 14923, 14922, 15022, 15033, 15046, 15062, 15075, - 15097, 15132, 15174, 15202, 15248, 15262, 15263, 15264, 15265, 15269, - 15287, 15305, 15306, 15310, 15311, 15312, 15313, 15317, 15318, 15336, - 15350, 15351, 15352, 15358, 15364, 15375, 15386, 15390, 15395, 15394, - 15403, 15404, 15408, 15409, 15413, 15426, 15427, 15428, 15433, 15437, - 15448, 15452, 15463, 15479, 15496, 15495, 15534, 15535, 15539, 15540, - 15544, 15545, 15546, 15547, 15549, 15548, 15562, 15563, 15564, 15565, - 15566, 15572, 15572, 15577, 15582, 15592, 15602, 15606, 15615, 15615, - 15620, 15626, 15637, 15648, 15656, 15658, 15662, 15669, 15676, 15678, - 15682, 15683, 15688, 15687, 15691, 15690, 15694, 15693, 15697, 15696, - 15699, 15700, 15701, 15702, 15703, 15704, 15705, 15706, 15707, 15708, - 15709, 15710, 15711, 15712, 15713, 15714, 15715, 15716, 15717, 15718, - 15719, 15720, 15721, 15722, 15723, 15724, 15728, 15729, 15733, 15734, - 15738, 15748, 15758, 15771, 15786, 15799, 15812, 15824, 15829, 15837, - 15842, 15850, 15868, 15888, 15900, 15913, 15922, 15926, 15930, 15931, - 15935, 15962, 15964, 15968, 15972, 15976, 15983, 15984, 15988, 15989, - 15993, 15994, 15998, 15999, 16005, 16011, 16017, 16027, 16026, 16036, - 16037, 16042, 16043, 16044, 16049, 16050, 16051, 16055, 16056, 16060, - 16072, 16081, 16091, 16100, 16114, 16115, 16120, 16119, 16135, 16136, - 16137, 16141, 16142, 16146, 16146, 16170, 16171, 16175, 16176, 16177, - 16181, 16185, 16192, 16195, 16193, 16209, 16216, 16237, 16261, 16263, - 16267, 16268, 16272, 16273, 16281, 16282, 16283, 16284, 16290, 16296, - 16306, 16308, 16310, 16315, 16316, 16317, 16318, 16319, 16323, 16324, - 16325, 16326, 16327, 16328, 16338, 16339, 16344, 16357, 16370, 16372, - 16374, 16379, 16384, 16386, 16388, 16394, 16395, 16397, 16403, 16402, - 16420, 16421, 16425, 16430, 16438, 16438, 16464, 16463, 16480, 16484, - 16489, 16494, 16493, 16505, 16506, 16508, 16510, 16528, 16534, 16539, - 16521, 16602, 16620, 16645, 16677, 16682, 16690, 16713, 16641, 16779, - 16799, 16812, 16822, 16778, 16843, 16847, 16851, 16855, 16859, 16863, - 16870, 16877, 16884, 16894, 16895, 16899, 16900, 16901, 16905, 16906, - 16911, 16913, 16912, 16918, 16919, 16923, 16933 + 5538, 5554, 5569, 5591, 5592, 5597, 5596, 5620, 5636, 5658, + 5657, 5675, 5674, 5694, 5716, 5720, 5749, 5761, 5762, 5767, + 5778, 5766, 5803, 5804, 5808, 5821, 5842, 5855, 5881, 5882, + 5887, 5886, 5923, 5936, 5937, 5941, 5942, 5946, 5948, 5954, + 5956, 5958, 5960, 5962, 5964, 5974, 5989, 5973, 6003, 6004, + 6008, 6009, 6013, 6014, 6018, 6019, 6023, 6024, 6028, 6029, + 6033, 6037, 6038, 6041, 6043, 6047, 6048, 6052, 6053, 6054, + 6058, 6063, 6068, 6073, 6078, 6083, 6088, 6093, 6108, 6114, + 6129, 6134, 6149, 6155, 6173, 6178, 6183, 6188, 6193, 6199, + 6198, 6224, 6225, 6226, 6231, 6236, 6241, 6243, 6245, 6247, + 6253, 6261, 6279, 6296, 6322, 6340, 6341, 6342, 6343, 6344, + 6345, 6346, 6347, 6348, 6349, 6350, 6351, 6352, 6353, 6357, + 6358, 6359, 6363, 6364, 6368, 6369, 6370, 6371, 6376, 6383, + 6384, 6388, 6389, 6393, 6394, 6401, 6406, 6412, 6418, 6431, + 6450, 6456, 6458, 6462, 6466, 6467, 6471, 6476, 6475, 6499, + 6500, 6501, 6502, 6507, 6511, 6516, 6521, 6525, 6530, 6535, + 6541, 6546, 6552, 6556, 6561, 6566, 6584, 6586, 6588, 6604, + 6606, 6611, 6616, 6628, 6633, 6638, 6643, 6645, 6647, 6649, + 6651, 6653, 6655, 6657, 6660, 6659, 6664, 6663, 6667, 6669, + 6678, 6679, 6680, 6686, 6687, 6688, 6689, 6690, 6694, 6698, + 6699, 6703, 6704, 6708, 6709, 6710, 6711, 6712, 6716, 6717, + 6718, 6719, 6720, 6724, 6729, 6731, 6737, 6738, 6740, 6745, + 6755, 6756, 6760, 6761, 6762, 6770, 6771, 6775, 6776, 6780, + 6781, 6782, 6786, 6787, 6788, 6789, 6792, 6793, 6797, 6798, + 6802, 6803, 6807, 6808, 6812, 6813, 6814, 6815, 6816, 6817, + 6823, 6829, 6838, 6847, 6848, 6861, 6867, 6873, 6879, 6886, + 6891, 6896, 6904, 6905, 6917, 6938, 6946, 6947, 6952, 6953, + 6957, 6965, 6969, 6970, 6974, 6975, 6979, 6988, 6992, 6993, + 6997, 7005, 7006, 7010, 7011, 7015, 7016, 7021, 7022, 7026, + 7033, 7042, 7047, 7055, 7056, 7057, 7058, 7059, 7060, 7065, + 7073, 7074, 7079, 7078, 7091, 7092, 7096, 7099, 7100, 7101, + 7102, 7106, 7114, 7121, 7122, 7126, 7136, 7137, 7141, 7142, + 7145, 7147, 7151, 7163, 7164, 7168, 7175, 7188, 7189, 7191, + 7193, 7199, 7204, 7210, 7216, 7223, 7233, 7234, 7235, 7236, + 7237, 7241, 7245, 7246, 7251, 7252, 7256, 7257, 7261, 7262, + 7263, 7267, 7268, 7272, 7276, 7283, 7287, 7291, 7298, 7302, + 7306, 7310, 7323, 7335, 7336, 7340, 7341, 7345, 7346, 7350, + 7351, 7355, 7356, 7360, 7361, 7365, 7366, 7370, 7371, 7375, + 7377, 7381, 7382, 7386, 7390, 7391, 7404, 7405, 7406, 7410, + 7411, 7415, 7421, 7435, 7436, 7440, 7441, 7445, 7446, 7454, + 7453, 7499, 7498, 7512, 7524, 7523, 7542, 7541, 7560, 7559, + 7578, 7572, 7592, 7591, 7630, 7635, 7640, 7645, 7650, 7657, + 7664, 7669, 7677, 7678, 7679, 7680, 7684, 7685, 7697, 7698, + 7702, 7703, 7706, 7708, 7716, 7724, 7726, 7728, 7729, 7737, + 7738, 7742, 7751, 7749, 7763, 7777, 7776, 7790, 7788, 7802, + 7809, 7820, 7821, 7849, 7856, 7860, 7865, 7864, 7880, 7882, + 7887, 7895, 7894, 7910, 7914, 7913, 7925, 7926, 7930, 7945, + 7946, 7950, 7959, 7963, 7968, 7974, 7973, 7984, 7994, 7983, + 8009, 8018, 8027, 8036, 8045, 8051, 8057, 8066, 8075, 8103, + 8124, 8134, 8138, 8143, 8144, 8147, 8149, 8150, 8151, 8152, + 8155, 8160, 8171, 8176, 8187, 8188, 8192, 8193, 8197, 8198, + 8199, 8203, 8204, 8209, 8217, 8218, 8219, 8220, 8225, 8224, + 8253, 8263, 8280, 8283, 8290, 8294, 8301, 8305, 8311, 8315, + 8322, 8327, 8330, 8337, 8340, 8347, 8350, 8357, 8360, 8368, + 8371, 8378, 8382, 8389, 8393, 8400, 8401, 8426, 8427, 8428, + 8433, 8438, 8446, 8445, 8457, 8458, 8459, 8464, 8463, 8485, + 8486, 8490, 8491, 8495, 8496, 8497, 8502, 8501, 8523, 8532, + 8531, 8558, 8559, 8563, 8564, 8568, 8569, 8570, 8571, 8572, + 8573, 8578, 8577, 8599, 8600, 8601, 8606, 8605, 8611, 8618, + 8623, 8631, 8632, 8636, 8650, 8649, 8662, 8663, 8667, 8668, + 8672, 8682, 8692, 8693, 8698, 8697, 8708, 8709, 8713, 8714, + 8718, 8728, 8739, 8738, 8746, 8746, 8757, 8758, 8763, 8764, + 8773, 8782, 8783, 8787, 8792, 8797, 8802, 8807, 8806, 8826, + 8834, 8826, 8841, 8842, 8843, 8844, 8845, 8849, 8856, 8863, + 8865, 8876, 8877, 8881, 8882, 8910, 8940, 8942, 8951, 8964, + 8965, 8966, 8981, 8988, 9013, 9019, 9025, 9026, 9027, 9028, + 9029, 9033, 9034, 9039, 9090, 9097, 9140, 9146, 9152, 9158, + 9164, 9170, 9176, 9182, 9186, 9192, 9198, 9204, 9210, 9216, + 9220, 9226, 9236, 9242, 9250, 9256, 9266, 9272, 9281, 9291, + 9297, 9307, 9313, 9322, 9326, 9332, 9338, 9344, 9350, 9356, + 9362, 9368, 9374, 9380, 9386, 9392, 9398, 9404, 9410, 9414, + 9415, 9419, 9420, 9424, 9425, 9429, 9430, 9434, 9435, 9436, + 9437, 9438, 9439, 9443, 9444, 9448, 9449, 9450, 9451, 9452, + 9453, 9465, 9466, 9467, 9468, 9469, 9475, 9479, 9485, 9491, + 9497, 9503, 9505, 9512, 9519, 9525, 9566, 9575, 9582, 9590, + 9596, 9603, 9609, 9623, 9630, 9646, 9652, 9658, 9666, 9672, + 9678, 9684, 9690, 9705, 9717, 9723, 9729, 9735, 9741, 9747, + 9753, 9759, 9765, 9771, 9777, 9783, 9789, 9795, 9801, 9807, + 9813, 9821, 9842, 9849, 9855, 9862, 9869, 9876, 9883, 9889, + 9895, 9900, 9906, 9913, 9919, 9925, 9931, 9937, 9943, 9961, + 9967, 9973, 9980, 9987, 10002, 10008, 10014, 10020, 10026, 10033, + 10039, 10045, 10051, 10057, 10063, 10071, 10084, 10090, 10096, 10102, + 10108, 10116, 10122, 10134, 10140, 10146, 10154, 10164, 10170, 10186, + 10192, 10199, 10206, 10213, 10220, 10227, 10231, 10251, 10250, 10323, + 10363, 10365, 10370, 10371, 10375, 10376, 10380, 10381, 10385, 10392, + 10400, 10426, 10432, 10438, 10444, 10450, 10456, 10465, 10472, 10474, + 10471, 10481, 10492, 10498, 10504, 10510, 10516, 10522, 10528, 10534, + 10540, 10547, 10546, 10566, 10565, 10580, 10591, 10599, 10615, 10616, + 10621, 10626, 10629, 10632, 10631, 10648, 10650, 10656, 10655, 10672, + 10674, 10676, 10678, 10680, 10682, 10684, 10686, 10688, 10690, 10692, + 10697, 10698, 10702, 10709, 10717, 10718, 10722, 10729, 10737, 10738, + 10742, 10743, 10747, 10755, 10766, 10767, 10776, 10787, 10788, 10794, + 10795, 10815, 10817, 10821, 10819, 10836, 10834, 10852, 10850, 10857, + 10866, 10864, 10882, 10881, 10891, 10902, 10900, 10919, 10918, 10929, + 10940, 10941, 10942, 10950, 10951, 10955, 10970, 10970, 10985, 11025, + 11098, 11109, 11114, 11106, 11133, 11153, 11161, 11153, 11170, 11169, + 11192, 11209, 11192, 11216, 11220, 11246, 11247, 11252, 11255, 11256, + 11257, 11261, 11262, 11267, 11266, 11272, 11271, 11279, 11280, 11283, + 11285, 11285, 11289, 11289, 11294, 11295, 11299, 11301, 11306, 11307, + 11311, 11322, 11335, 11336, 11337, 11338, 11339, 11340, 11341, 11342, + 11343, 11344, 11345, 11346, 11350, 11351, 11352, 11353, 11354, 11355, + 11356, 11357, 11358, 11362, 11363, 11364, 11365, 11368, 11370, 11371, + 11375, 11376, 11384, 11386, 11390, 11392, 11391, 11405, 11408, 11407, + 11422, 11428, 11443, 11445, 11449, 11451, 11456, 11457, 11477, 11508, + 11512, 11513, 11517, 11530, 11532, 11537, 11536, 11571, 11573, 11578, + 11579, 11580, 11585, 11591, 11595, 11596, 11600, 11611, 11618, 11625, + 11635, 11662, 11666, 11672, 11678, 11688, 11692, 11706, 11707, 11708, + 11709, 11710, 11711, 11715, 11716, 11717, 11718, 11719, 11723, 11724, + 11725, 11726, 11727, 11731, 11732, 11733, 11734, 11738, 11743, 11744, + 11747, 11750, 11749, 11783, 11784, 11788, 11796, 11809, 11809, 11819, + 11820, 11824, 11843, 11883, 11882, 11895, 11903, 11894, 11905, 11917, + 11929, 11928, 11946, 11945, 11956, 11957, 11956, 11973, 11980, 12001, + 12022, 12034, 12039, 12038, 12048, 12054, 12061, 12066, 12071, 12078, + 12087, 12088, 12092, 12103, 12116, 12117, 12121, 12132, 12133, 12137, + 12138, 12141, 12143, 12146, 12147, 12148, 12152, 12153, 12161, 12169, + 12160, 12179, 12186, 12178, 12196, 12208, 12209, 12222, 12226, 12227, + 12243, 12244, 12248, 12257, 12258, 12259, 12261, 12260, 12271, 12272, + 12276, 12277, 12279, 12278, 12282, 12281, 12287, 12288, 12292, 12293, + 12297, 12307, 12308, 12312, 12313, 12318, 12317, 12331, 12332, 12336, + 12341, 12349, 12350, 12358, 12360, 12360, 12368, 12376, 12367, 12398, + 12399, 12403, 12411, 12412, 12416, 12426, 12427, 12434, 12433, 12449, + 12448, 12462, 12461, 12473, 12472, 12486, 12487, 12491, 12504, 12520, + 12521, 12525, 12526, 12530, 12531, 12532, 12537, 12536, 12558, 12560, + 12563, 12565, 12568, 12569, 12572, 12576, 12580, 12584, 12588, 12592, + 12596, 12600, 12604, 12612, 12615, 12625, 12624, 12639, 12646, 12654, + 12662, 12670, 12678, 12686, 12693, 12695, 12697, 12706, 12710, 12715, + 12714, 12720, 12719, 12724, 12733, 12740, 12745, 12747, 12749, 12751, + 12753, 12761, 12772, 12780, 12782, 12790, 12797, 12804, 12814, 12821, + 12827, 12836, 12844, 12848, 12853, 12857, 12861, 12868, 12875, 12882, + 12889, 12896, 12903, 12910, 12916, 12923, 12930, 12935, 12940, 12948, + 12950, 12952, 12957, 12958, 12961, 12963, 12967, 12968, 12972, 12973, + 12977, 12978, 12982, 12983, 12987, 12988, 12991, 12993, 13000, 13011, + 13010, 13026, 13025, 13032, 13033, 13034, 13035, 13036, 13040, 13041, + 13046, 13050, 13056, 13062, 13084, 13085, 13086, 13101, 13100, 13113, + 13122, 13112, 13124, 13128, 13129, 13141, 13140, 13162, 13163, 13168, + 13170, 13172, 13174, 13176, 13178, 13180, 13182, 13184, 13186, 13188, + 13190, 13192, 13194, 13196, 13198, 13200, 13202, 13204, 13209, 13210, + 13215, 13214, 13224, 13225, 13229, 13229, 13231, 13232, 13233, 13238, + 13239, 13244, 13243, 13254, 13255, 13262, 13266, 13270, 13280, 13285, + 13297, 13307, 13308, 13309, 13315, 13327, 13339, 13349, 13359, 13326, + 13367, 13368, 13372, 13373, 13377, 13378, 13390, 13394, 13395, 13396, + 13399, 13401, 13405, 13406, 13410, 13415, 13422, 13427, 13434, 13436, + 13440, 13441, 13445, 13450, 13458, 13459, 13462, 13464, 13472, 13474, + 13478, 13479, 13480, 13484, 13486, 13491, 13492, 13501, 13502, 13506, + 13507, 13511, 13531, 13555, 13567, 13578, 13597, 13605, 13617, 13632, + 13653, 13654, 13655, 13664, 13665, 13666, 13667, 13682, 13688, 13694, + 13700, 13706, 13737, 13770, 13780, 13790, 13796, 13805, 13817, 13823, + 13829, 13845, 13846, 13850, 13859, 13875, 13879, 13930, 13934, 13952, + 13956, 14036, 14061, 14092, 14093, 14109, 14119, 14123, 14129, 14135, + 14145, 14151, 14160, 14170, 14171, 14201, 14214, 14230, 14246, 14263, + 14264, 14275, 14276, 14287, 14288, 14289, 14293, 14320, 14353, 14368, + 14369, 14370, 14371, 14372, 14373, 14374, 14375, 14376, 14377, 14378, + 14379, 14380, 14381, 14382, 14383, 14384, 14385, 14386, 14387, 14388, + 14389, 14390, 14391, 14392, 14393, 14394, 14395, 14396, 14397, 14398, + 14399, 14400, 14401, 14402, 14403, 14404, 14405, 14406, 14407, 14408, + 14409, 14410, 14411, 14412, 14413, 14414, 14415, 14416, 14417, 14427, + 14428, 14429, 14430, 14431, 14432, 14433, 14434, 14435, 14436, 14437, + 14438, 14439, 14440, 14441, 14442, 14443, 14444, 14445, 14446, 14447, + 14448, 14449, 14450, 14451, 14452, 14453, 14454, 14455, 14456, 14457, + 14458, 14459, 14460, 14461, 14462, 14463, 14464, 14465, 14466, 14467, + 14468, 14469, 14470, 14471, 14472, 14473, 14474, 14475, 14480, 14481, + 14482, 14483, 14484, 14485, 14486, 14487, 14488, 14489, 14490, 14491, + 14492, 14493, 14494, 14495, 14496, 14497, 14498, 14499, 14500, 14501, + 14502, 14503, 14504, 14505, 14506, 14507, 14508, 14509, 14510, 14511, + 14512, 14513, 14514, 14515, 14516, 14517, 14518, 14519, 14520, 14521, + 14522, 14523, 14524, 14525, 14526, 14527, 14528, 14529, 14530, 14531, + 14532, 14533, 14534, 14535, 14536, 14537, 14538, 14539, 14540, 14541, + 14542, 14543, 14544, 14545, 14546, 14547, 14548, 14549, 14550, 14551, + 14552, 14553, 14554, 14555, 14556, 14557, 14558, 14559, 14560, 14561, + 14562, 14563, 14564, 14565, 14566, 14567, 14568, 14569, 14570, 14571, + 14572, 14573, 14574, 14575, 14576, 14577, 14578, 14579, 14580, 14581, + 14582, 14583, 14584, 14585, 14586, 14587, 14588, 14589, 14590, 14591, + 14592, 14593, 14594, 14595, 14596, 14597, 14598, 14599, 14600, 14601, + 14602, 14603, 14604, 14605, 14606, 14607, 14608, 14609, 14610, 14611, + 14612, 14613, 14614, 14615, 14616, 14617, 14618, 14619, 14620, 14621, + 14622, 14623, 14624, 14625, 14626, 14627, 14628, 14629, 14630, 14631, + 14632, 14633, 14634, 14635, 14636, 14637, 14638, 14639, 14640, 14641, + 14642, 14643, 14644, 14645, 14646, 14647, 14648, 14649, 14650, 14651, + 14652, 14653, 14654, 14655, 14656, 14657, 14658, 14659, 14660, 14661, + 14662, 14663, 14664, 14665, 14666, 14667, 14668, 14669, 14670, 14671, + 14672, 14673, 14674, 14675, 14676, 14677, 14678, 14679, 14680, 14681, + 14682, 14683, 14684, 14685, 14686, 14687, 14688, 14689, 14690, 14691, + 14692, 14693, 14694, 14695, 14696, 14697, 14698, 14699, 14700, 14701, + 14702, 14703, 14704, 14705, 14706, 14707, 14708, 14709, 14710, 14711, + 14712, 14713, 14714, 14715, 14716, 14717, 14718, 14719, 14720, 14721, + 14722, 14723, 14724, 14725, 14726, 14727, 14728, 14729, 14730, 14731, + 14732, 14733, 14734, 14735, 14736, 14737, 14738, 14739, 14740, 14741, + 14742, 14743, 14744, 14745, 14746, 14747, 14748, 14760, 14759, 14774, + 14773, 14802, 14803, 14808, 14807, 14814, 14813, 14823, 14822, 14833, + 14832, 14838, 14846, 14848, 14853, 14853, 14862, 14861, 14875, 14874, + 14879, 14883, 14884, 14885, 14889, 14890, 14891, 14892, 14896, 14897, + 14898, 14899, 14904, 14938, 14937, 15037, 15048, 15061, 15077, 15090, + 15112, 15147, 15189, 15217, 15263, 15277, 15278, 15279, 15280, 15284, + 15302, 15320, 15321, 15325, 15326, 15327, 15328, 15332, 15333, 15351, + 15365, 15366, 15367, 15373, 15379, 15390, 15401, 15405, 15410, 15409, + 15418, 15419, 15423, 15424, 15428, 15441, 15442, 15443, 15448, 15452, + 15463, 15467, 15478, 15494, 15511, 15510, 15549, 15550, 15554, 15555, + 15559, 15560, 15561, 15562, 15564, 15563, 15577, 15578, 15579, 15580, + 15581, 15587, 15587, 15592, 15597, 15607, 15617, 15621, 15630, 15630, + 15635, 15641, 15652, 15663, 15671, 15673, 15677, 15684, 15691, 15693, + 15697, 15698, 15703, 15702, 15706, 15705, 15709, 15708, 15712, 15711, + 15714, 15715, 15716, 15717, 15718, 15719, 15720, 15721, 15722, 15723, + 15724, 15725, 15726, 15727, 15728, 15729, 15730, 15731, 15732, 15733, + 15734, 15735, 15736, 15737, 15738, 15739, 15743, 15744, 15748, 15749, + 15753, 15763, 15773, 15786, 15801, 15814, 15827, 15839, 15844, 15852, + 15857, 15865, 15883, 15903, 15915, 15928, 15937, 15941, 15945, 15946, + 15950, 15977, 15979, 15983, 15987, 15991, 15998, 15999, 16003, 16004, + 16008, 16009, 16013, 16014, 16020, 16026, 16032, 16042, 16041, 16051, + 16052, 16057, 16058, 16059, 16064, 16065, 16066, 16070, 16071, 16075, + 16087, 16096, 16106, 16115, 16129, 16130, 16135, 16134, 16150, 16151, + 16152, 16156, 16157, 16161, 16161, 16185, 16186, 16190, 16191, 16192, + 16196, 16200, 16207, 16210, 16208, 16224, 16231, 16252, 16276, 16278, + 16282, 16283, 16287, 16288, 16296, 16297, 16298, 16299, 16305, 16311, + 16321, 16323, 16325, 16330, 16331, 16332, 16333, 16334, 16338, 16339, + 16340, 16341, 16342, 16343, 16353, 16354, 16359, 16372, 16385, 16387, + 16389, 16394, 16399, 16401, 16403, 16409, 16410, 16412, 16418, 16417, + 16435, 16436, 16440, 16445, 16453, 16453, 16479, 16478, 16495, 16499, + 16504, 16509, 16508, 16520, 16521, 16523, 16525, 16543, 16549, 16554, + 16536, 16617, 16635, 16660, 16692, 16697, 16705, 16728, 16656, 16794, + 16814, 16827, 16837, 16793, 16858, 16862, 16866, 16870, 16874, 16878, + 16885, 16892, 16899, 16909, 16910, 16914, 16915, 16916, 16920, 16921, + 16926, 16928, 16927, 16933, 16934, 16938, 16948 }; #endif @@ -19013,7 +19013,7 @@ case 2: /* Line 1455 of yacc.c */ -#line 1996 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 1996 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; if (!thd->bootstrap && @@ -19030,7 +19030,7 @@ case 3: /* Line 1455 of yacc.c */ -#line 2008 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2008 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex_input_stream *lip = YYLIP; @@ -19058,7 +19058,7 @@ case 5: /* Line 1455 of yacc.c */ -#line 2033 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2033 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Single query, not terminated. */ YYLIP->found_semicolon= NULL; @@ -19068,7 +19068,7 @@ case 62: /* Line 1455 of yacc.c */ -#line 2107 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2107 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -19080,7 +19080,7 @@ case 65: /* Line 1455 of yacc.c */ -#line 2122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -19102,7 +19102,7 @@ case 66: /* Line 1455 of yacc.c */ -#line 2142 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2142 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -19114,7 +19114,7 @@ case 67: /* Line 1455 of yacc.c */ -#line 2149 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2149 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -19126,7 +19126,7 @@ case 68: /* Line 1455 of yacc.c */ -#line 2159 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2159 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -19138,14 +19138,14 @@ case 69: /* Line 1455 of yacc.c */ -#line 2166 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2166 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 74: /* Line 1455 of yacc.c */ -#line 2181 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2181 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&(yyvsp[(2) - (2)].lex_str), sizeof(LEX_STRING)); @@ -19157,7 +19157,7 @@ case 75: /* Line 1455 of yacc.c */ -#line 2193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->sphead) { @@ -19170,7 +19170,7 @@ case 76: /* Line 1455 of yacc.c */ -#line 2201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_HELP; @@ -19181,7 +19181,7 @@ case 77: /* Line 1455 of yacc.c */ -#line 2212 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2212 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex = Lex; lex->sql_command = SQLCOM_CHANGE_MASTER; @@ -19199,14 +19199,14 @@ case 78: /* Line 1455 of yacc.c */ -#line 2225 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2225 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 81: /* Line 1455 of yacc.c */ -#line 2235 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2235 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.host = (yyvsp[(3) - (3)].lex_str).str; } @@ -19215,7 +19215,7 @@ case 82: /* Line 1455 of yacc.c */ -#line 2239 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2239 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.bind_addr = (yyvsp[(3) - (3)].lex_str).str; } @@ -19224,7 +19224,7 @@ case 83: /* Line 1455 of yacc.c */ -#line 2243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.user = (yyvsp[(3) - (3)].lex_str).str; } @@ -19233,7 +19233,7 @@ case 84: /* Line 1455 of yacc.c */ -#line 2247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.password = (yyvsp[(3) - (3)].lex_str).str; Lex->contains_plaintext_password= true; @@ -19243,7 +19243,7 @@ case 85: /* Line 1455 of yacc.c */ -#line 2252 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2252 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.port = (yyvsp[(3) - (3)].ulong_num); } @@ -19252,7 +19252,7 @@ case 86: /* Line 1455 of yacc.c */ -#line 2256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.connect_retry = (yyvsp[(3) - (3)].ulong_num); } @@ -19261,7 +19261,7 @@ case 87: /* Line 1455 of yacc.c */ -#line 2260 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2260 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.retry_count= (yyvsp[(3) - (3)].ulong_num); Lex->mi.retry_count_opt= LEX_MASTER_INFO::LEX_MI_ENABLE; @@ -19271,7 +19271,7 @@ case 88: /* Line 1455 of yacc.c */ -#line 2265 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2265 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(3) - (3)].ulong_num) > MASTER_DELAY_MAX) { @@ -19289,7 +19289,7 @@ case 89: /* Line 1455 of yacc.c */ -#line 2278 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2278 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl= (yyvsp[(3) - (3)].ulong_num) ? LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE; @@ -19299,7 +19299,7 @@ case 90: /* Line 1455 of yacc.c */ -#line 2283 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2283 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_ca= (yyvsp[(3) - (3)].lex_str).str; } @@ -19308,7 +19308,7 @@ case 91: /* Line 1455 of yacc.c */ -#line 2287 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2287 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_capath= (yyvsp[(3) - (3)].lex_str).str; } @@ -19317,7 +19317,7 @@ case 92: /* Line 1455 of yacc.c */ -#line 2291 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2291 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_cert= (yyvsp[(3) - (3)].lex_str).str; } @@ -19326,7 +19326,7 @@ case 93: /* Line 1455 of yacc.c */ -#line 2295 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2295 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_cipher= (yyvsp[(3) - (3)].lex_str).str; } @@ -19335,7 +19335,7 @@ case 94: /* Line 1455 of yacc.c */ -#line 2299 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2299 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_key= (yyvsp[(3) - (3)].lex_str).str; } @@ -19344,7 +19344,7 @@ case 95: /* Line 1455 of yacc.c */ -#line 2303 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2303 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_verify_server_cert= (yyvsp[(3) - (3)].ulong_num) ? LEX_MASTER_INFO::LEX_MI_ENABLE : LEX_MASTER_INFO::LEX_MI_DISABLE; @@ -19354,7 +19354,7 @@ case 96: /* Line 1455 of yacc.c */ -#line 2308 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2308 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_crl= (yyvsp[(3) - (3)].lex_str).str; } @@ -19363,7 +19363,7 @@ case 97: /* Line 1455 of yacc.c */ -#line 2312 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2312 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.ssl_crlpath= (yyvsp[(3) - (3)].lex_str).str; } @@ -19372,7 +19372,7 @@ case 98: /* Line 1455 of yacc.c */ -#line 2317 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2317 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.heartbeat_period= (float) (yyvsp[(3) - (3)].item_num)->val_real(); if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD || @@ -19408,7 +19408,7 @@ case 99: /* Line 1455 of yacc.c */ -#line 2348 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2348 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_ENABLE; } @@ -19417,7 +19417,7 @@ case 100: /* Line 1455 of yacc.c */ -#line 2353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.auto_position= (yyvsp[(3) - (3)].ulong_num) ? LEX_MASTER_INFO::LEX_MI_ENABLE : @@ -19428,7 +19428,7 @@ case 105: /* Line 1455 of yacc.c */ -#line 2370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->mi.repl_ignore_server_ids.elements == 0) { @@ -19445,7 +19445,7 @@ case 106: /* Line 1455 of yacc.c */ -#line 2384 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2384 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.log_file_name = (yyvsp[(3) - (3)].lex_str).str; } @@ -19454,7 +19454,7 @@ case 107: /* Line 1455 of yacc.c */ -#line 2388 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2388 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.pos = (yyvsp[(3) - (3)].ulonglong_number); /* @@ -19475,7 +19475,7 @@ case 108: /* Line 1455 of yacc.c */ -#line 2404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.relay_log_name = (yyvsp[(3) - (3)].lex_str).str; } @@ -19484,7 +19484,7 @@ case 109: /* Line 1455 of yacc.c */ -#line 2408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.relay_log_pos = (yyvsp[(3) - (3)].ulong_num); /* Adjust if < BIN_LOG_HEADER_SIZE (same comment as Lex->mi.pos) */ @@ -19496,7 +19496,7 @@ case 110: /* Line 1455 of yacc.c */ -#line 2420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -19527,7 +19527,7 @@ case 111: /* Line 1455 of yacc.c */ -#line 2446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -19551,7 +19551,7 @@ case 112: /* Line 1455 of yacc.c */ -#line 2465 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2465 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index_prepare(Lex, (yyvsp[(7) - (7)].table))) MYSQL_YYABORT; @@ -19561,7 +19561,7 @@ case 113: /* Line 1455 of yacc.c */ -#line 2470 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2470 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index(Lex, (yyvsp[(2) - (12)].key_type), (yyvsp[(4) - (12)].lex_str))) MYSQL_YYABORT; @@ -19571,14 +19571,14 @@ case 114: /* Line 1455 of yacc.c */ -#line 2474 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2474 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 115: /* Line 1455 of yacc.c */ -#line 2477 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2477 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index_prepare(Lex, (yyvsp[(7) - (7)].table))) MYSQL_YYABORT; @@ -19588,7 +19588,7 @@ case 116: /* Line 1455 of yacc.c */ -#line 2482 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2482 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index(Lex, (yyvsp[(2) - (12)].key_type), (yyvsp[(4) - (12)].lex_str))) MYSQL_YYABORT; @@ -19598,14 +19598,14 @@ case 117: /* Line 1455 of yacc.c */ -#line 2486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 118: /* Line 1455 of yacc.c */ -#line 2489 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2489 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index_prepare(Lex, (yyvsp[(7) - (7)].table))) MYSQL_YYABORT; @@ -19615,7 +19615,7 @@ case 119: /* Line 1455 of yacc.c */ -#line 2494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index(Lex, (yyvsp[(2) - (12)].key_type), (yyvsp[(4) - (12)].lex_str))) MYSQL_YYABORT; @@ -19625,14 +19625,14 @@ case 120: /* Line 1455 of yacc.c */ -#line 2498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 121: /* Line 1455 of yacc.c */ -#line 2500 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2500 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -19642,7 +19642,7 @@ case 122: /* Line 1455 of yacc.c */ -#line 2505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_CREATE_DB; @@ -19654,7 +19654,7 @@ case 123: /* Line 1455 of yacc.c */ -#line 2512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_mode= VIEW_CREATE_NEW; Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; @@ -19665,14 +19665,14 @@ case 124: /* Line 1455 of yacc.c */ -#line 2518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 125: /* Line 1455 of yacc.c */ -#line 2520 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2520 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_CREATE_USER; } @@ -19681,7 +19681,7 @@ case 126: /* Line 1455 of yacc.c */ -#line 2524 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2524 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP; } @@ -19690,7 +19690,7 @@ case 127: /* Line 1455 of yacc.c */ -#line 2528 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2528 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE; } @@ -19699,7 +19699,7 @@ case 128: /* Line 1455 of yacc.c */ -#line 2532 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2532 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_CREATE_SERVER; } @@ -19708,7 +19708,7 @@ case 129: /* Line 1455 of yacc.c */ -#line 2537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_CREATE_COMPRESSION_DICTIONARY; Lex->create_info.options= (yyvsp[(3) - (7)].num); @@ -19720,14 +19720,14 @@ case 130: /* Line 1455 of yacc.c */ -#line 2550 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2550 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 131: /* Line 1455 of yacc.c */ -#line 2552 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2552 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(1) - (1)].item)->type() == Item::FUNC_ITEM) { @@ -19749,7 +19749,7 @@ case 132: /* Line 1455 of yacc.c */ -#line 2576 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2576 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(2) - (10)].lex_str).length == 0) { @@ -19765,7 +19765,7 @@ case 135: /* Line 1455 of yacc.c */ -#line 2595 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2595 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->server_options.username= (yyvsp[(2) - (2)].lex_str).str; } @@ -19774,7 +19774,7 @@ case 136: /* Line 1455 of yacc.c */ -#line 2599 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2599 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->server_options.host= (yyvsp[(2) - (2)].lex_str).str; } @@ -19783,7 +19783,7 @@ case 137: /* Line 1455 of yacc.c */ -#line 2603 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2603 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->server_options.db= (yyvsp[(2) - (2)].lex_str).str; } @@ -19792,7 +19792,7 @@ case 138: /* Line 1455 of yacc.c */ -#line 2607 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2607 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->server_options.owner= (yyvsp[(2) - (2)].lex_str).str; } @@ -19801,7 +19801,7 @@ case 139: /* Line 1455 of yacc.c */ -#line 2611 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2611 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->server_options.password= (yyvsp[(2) - (2)].lex_str).str; Lex->contains_plaintext_password= true; @@ -19811,7 +19811,7 @@ case 140: /* Line 1455 of yacc.c */ -#line 2616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->server_options.socket= (yyvsp[(2) - (2)].lex_str).str; } @@ -19820,7 +19820,7 @@ case 141: /* Line 1455 of yacc.c */ -#line 2620 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2620 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->server_options.port= (yyvsp[(2) - (2)].ulong_num); } @@ -19829,7 +19829,7 @@ case 142: /* Line 1455 of yacc.c */ -#line 2627 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2627 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex=Lex; @@ -19850,7 +19850,7 @@ case 143: /* Line 1455 of yacc.c */ -#line 2647 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2647 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* sql_command is set here because some rules in ev_sql_stmt @@ -19863,7 +19863,7 @@ case 144: /* Line 1455 of yacc.c */ -#line 2658 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2658 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->item_expression= (yyvsp[(2) - (3)].item); Lex->event_parse_data->interval= (yyvsp[(3) - (3)].interval); @@ -19873,7 +19873,7 @@ case 146: /* Line 1455 of yacc.c */ -#line 2665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->item_execute_at= (yyvsp[(2) - (2)].item); } @@ -19882,14 +19882,14 @@ case 147: /* Line 1455 of yacc.c */ -#line 2671 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2671 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 148: /* Line 1455 of yacc.c */ -#line 2673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->status= Event_parse_data::ENABLED; Lex->event_parse_data->status_changed= true; @@ -19900,7 +19900,7 @@ case 149: /* Line 1455 of yacc.c */ -#line 2679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->status= Event_parse_data::SLAVESIDE_DISABLED; Lex->event_parse_data->status_changed= true; @@ -19911,7 +19911,7 @@ case 150: /* Line 1455 of yacc.c */ -#line 2685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->status= Event_parse_data::DISABLED; Lex->event_parse_data->status_changed= true; @@ -19922,7 +19922,7 @@ case 151: /* Line 1455 of yacc.c */ -#line 2694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *item= new (YYTHD->mem_root) Item_func_now_local(0); if (item == NULL) @@ -19934,7 +19934,7 @@ case 152: /* Line 1455 of yacc.c */ -#line 2701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->item_starts= (yyvsp[(2) - (2)].item); } @@ -19943,7 +19943,7 @@ case 154: /* Line 1455 of yacc.c */ -#line 2709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->item_ends= (yyvsp[(2) - (2)].item); } @@ -19952,14 +19952,14 @@ case 155: /* Line 1455 of yacc.c */ -#line 2715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 157: /* Line 1455 of yacc.c */ -#line 2721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->on_completion= Event_parse_data::ON_COMPLETION_PRESERVE; @@ -19970,7 +19970,7 @@ case 158: /* Line 1455 of yacc.c */ -#line 2727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->event_parse_data->on_completion= Event_parse_data::ON_COMPLETION_DROP; @@ -19981,14 +19981,14 @@ case 159: /* Line 1455 of yacc.c */ -#line 2735 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2735 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 160: /* Line 1455 of yacc.c */ -#line 2737 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2737 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->comment= Lex->event_parse_data->comment= (yyvsp[(2) - (2)].lex_str); (yyval.num)= 1; @@ -19998,7 +19998,7 @@ case 161: /* Line 1455 of yacc.c */ -#line 2744 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2744 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20046,7 +20046,7 @@ case 162: /* Line 1455 of yacc.c */ -#line 2787 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2787 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20061,7 +20061,7 @@ case 176: /* Line 1455 of yacc.c */ -#line 2816 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2816 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->users_list.empty(); @@ -20078,7 +20078,7 @@ case 177: /* Line 1455 of yacc.c */ -#line 2831 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2831 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!(yyvsp[(1) - (3)].lex_str).str || (check_and_convert_db_name(&(yyvsp[(1) - (3)].lex_str), FALSE) != IDENT_NAME_OK)) @@ -20097,7 +20097,7 @@ case 178: /* Line 1455 of yacc.c */ -#line 2845 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2845 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20118,105 +20118,105 @@ case 179: /* Line 1455 of yacc.c */ -#line 2863 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2863 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 180: /* Line 1455 of yacc.c */ -#line 2864 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2864 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 181: /* Line 1455 of yacc.c */ -#line 2868 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2868 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 182: /* Line 1455 of yacc.c */ -#line 2869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 183: /* Line 1455 of yacc.c */ -#line 2875 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2875 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.comment= (yyvsp[(2) - (2)].lex_str); } break; case 184: /* Line 1455 of yacc.c */ -#line 2877 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2877 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Just parse it, we only have one language for now. */ } break; case 185: /* Line 1455 of yacc.c */ -#line 2879 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2879 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.daccess= SP_NO_SQL; } break; case 186: /* Line 1455 of yacc.c */ -#line 2881 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2881 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.daccess= SP_CONTAINS_SQL; } break; case 187: /* Line 1455 of yacc.c */ -#line 2883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.daccess= SP_READS_SQL_DATA; } break; case 188: /* Line 1455 of yacc.c */ -#line 2885 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2885 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.daccess= SP_MODIFIES_SQL_DATA; } break; case 189: /* Line 1455 of yacc.c */ -#line 2887 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2887 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 190: /* Line 1455 of yacc.c */ -#line 2892 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2892 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 191: /* Line 1455 of yacc.c */ -#line 2893 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2893 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.detistic= TRUE; } break; case 192: /* Line 1455 of yacc.c */ -#line 2894 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2894 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.detistic= FALSE; } break; case 193: /* Line 1455 of yacc.c */ -#line 2899 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2899 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.suid= SP_IS_SUID; } @@ -20225,7 +20225,7 @@ case 194: /* Line 1455 of yacc.c */ -#line 2903 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2903 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sp_chistics.suid= SP_IS_NOT_SUID; } @@ -20234,7 +20234,7 @@ case 195: /* Line 1455 of yacc.c */ -#line 2910 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2910 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex = Lex; @@ -20248,14 +20248,14 @@ case 196: /* Line 1455 of yacc.c */ -#line 2918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 201: /* Line 1455 of yacc.c */ -#line 2934 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2934 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->value_list.push_back((yyvsp[(3) - (3)].item)); } @@ -20264,7 +20264,7 @@ case 202: /* Line 1455 of yacc.c */ -#line 2938 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2938 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->value_list.push_back((yyvsp[(1) - (1)].item)); } @@ -20273,7 +20273,7 @@ case 207: /* Line 1455 of yacc.c */ -#line 2956 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2956 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -20295,7 +20295,7 @@ case 208: /* Line 1455 of yacc.c */ -#line 2976 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 2976 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20327,7 +20327,7 @@ case 213: /* Line 1455 of yacc.c */ -#line 3017 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3017 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20358,49 +20358,49 @@ case 214: /* Line 1455 of yacc.c */ -#line 3045 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3045 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= sp_variable::MODE_IN; } break; case 215: /* Line 1455 of yacc.c */ -#line 3046 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3046 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= sp_variable::MODE_IN; } break; case 216: /* Line 1455 of yacc.c */ -#line 3047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= sp_variable::MODE_OUT; } break; case 217: /* Line 1455 of yacc.c */ -#line 3048 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3048 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= sp_variable::MODE_INOUT; } break; case 218: /* Line 1455 of yacc.c */ -#line 3052 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3052 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 220: /* Line 1455 of yacc.c */ -#line 3057 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3057 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 222: /* Line 1455 of yacc.c */ -#line 3063 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3063 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spblock).vars= (yyval.spblock).conds= (yyval.spblock).hndlrs= (yyval.spblock).curs= 0; } @@ -20409,7 +20409,7 @@ case 223: /* Line 1455 of yacc.c */ -#line 3067 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3067 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* We check for declarations out of (standard) order this way because letting the grammar rules reflect it caused tricky @@ -20437,7 +20437,7 @@ case 224: /* Line 1455 of yacc.c */ -#line 3093 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3093 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20452,7 +20452,7 @@ case 225: /* Line 1455 of yacc.c */ -#line 3104 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3104 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20530,7 +20530,7 @@ case 226: /* Line 1455 of yacc.c */ -#line 3177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20551,7 +20551,7 @@ case 227: /* Line 1455 of yacc.c */ -#line 3193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20596,7 +20596,7 @@ case 228: /* Line 1455 of yacc.c */ -#line 3233 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3233 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -20635,7 +20635,7 @@ case 229: /* Line 1455 of yacc.c */ -#line 3267 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3267 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -20649,7 +20649,7 @@ case 230: /* Line 1455 of yacc.c */ -#line 3276 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3276 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *cursor_lex= Lex; @@ -20715,35 +20715,35 @@ case 231: /* Line 1455 of yacc.c */ -#line 3339 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3339 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= sp_handler::EXIT; } break; case 232: /* Line 1455 of yacc.c */ -#line 3340 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3340 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= sp_handler::CONTINUE; } break; case 233: /* Line 1455 of yacc.c */ -#line 3346 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3346 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 234: /* Line 1455 of yacc.c */ -#line 3348 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3348 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)+= 1; } break; case 235: /* Line 1455 of yacc.c */ -#line 3353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -20768,7 +20768,7 @@ case 236: /* Line 1455 of yacc.c */ -#line 3376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* mysql errno */ if ((yyvsp[(1) - (1)].ulong_num) == 0) { @@ -20784,7 +20784,7 @@ case 238: /* Line 1455 of yacc.c */ -#line 3391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* SQLSTATE */ /* @@ -20808,21 +20808,21 @@ case 239: /* Line 1455 of yacc.c */ -#line 3412 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3412 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 240: /* Line 1455 of yacc.c */ -#line 3413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 241: /* Line 1455 of yacc.c */ -#line 3418 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3418 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spcondvalue)= (yyvsp[(1) - (1)].spcondvalue); } @@ -20831,7 +20831,7 @@ case 242: /* Line 1455 of yacc.c */ -#line 3422 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3422 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *pctx= lex->get_sp_current_parsing_ctx(); @@ -20849,7 +20849,7 @@ case 243: /* Line 1455 of yacc.c */ -#line 3435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value(sp_condition_value::WARNING); if ((yyval.spcondvalue) == NULL) @@ -20860,7 +20860,7 @@ case 244: /* Line 1455 of yacc.c */ -#line 3441 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3441 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value(sp_condition_value::NOT_FOUND); if ((yyval.spcondvalue) == NULL) @@ -20871,7 +20871,7 @@ case 245: /* Line 1455 of yacc.c */ -#line 3447 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3447 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spcondvalue)= new (YYTHD->mem_root) sp_condition_value(sp_condition_value::EXCEPTION); if ((yyval.spcondvalue) == NULL) @@ -20882,7 +20882,7 @@ case 246: /* Line 1455 of yacc.c */ -#line 3456 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3456 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -20899,7 +20899,7 @@ case 247: /* Line 1455 of yacc.c */ -#line 3471 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3471 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *pctx= lex->get_sp_current_parsing_ctx(); @@ -20930,28 +20930,28 @@ case 248: /* Line 1455 of yacc.c */ -#line 3497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spcondvalue)= (yyvsp[(1) - (1)].spcondvalue); } break; case 249: /* Line 1455 of yacc.c */ -#line 3502 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3502 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spcondvalue)= NULL; } break; case 250: /* Line 1455 of yacc.c */ -#line 3504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.spcondvalue)= (yyvsp[(1) - (1)].spcondvalue); } break; case 251: /* Line 1455 of yacc.c */ -#line 3509 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3509 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { YYTHD->m_parser_state->m_yacc.m_set_signal_info.clear(); } @@ -20960,7 +20960,7 @@ case 253: /* Line 1455 of yacc.c */ -#line 3517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Set_signal_information *info; info= & YYTHD->m_parser_state->m_yacc.m_set_signal_info; @@ -20973,7 +20973,7 @@ case 254: /* Line 1455 of yacc.c */ -#line 3526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Set_signal_information *info; info= & YYTHD->m_parser_state->m_yacc.m_set_signal_info; @@ -20991,14 +20991,14 @@ case 255: /* Line 1455 of yacc.c */ -#line 3545 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3545 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 256: /* Line 1455 of yacc.c */ -#line 3547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(1) - (1)].item)->type() == Item::FUNC_ITEM) { @@ -21021,98 +21021,98 @@ case 257: /* Line 1455 of yacc.c */ -#line 3565 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3565 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 258: /* Line 1455 of yacc.c */ -#line 3571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_CLASS_ORIGIN; } break; case 259: /* Line 1455 of yacc.c */ -#line 3573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_SUBCLASS_ORIGIN; } break; case 260: /* Line 1455 of yacc.c */ -#line 3575 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3575 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_CONSTRAINT_CATALOG; } break; case 261: /* Line 1455 of yacc.c */ -#line 3577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_CONSTRAINT_SCHEMA; } break; case 262: /* Line 1455 of yacc.c */ -#line 3579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_CONSTRAINT_NAME; } break; case 263: /* Line 1455 of yacc.c */ -#line 3581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_CATALOG_NAME; } break; case 264: /* Line 1455 of yacc.c */ -#line 3583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_SCHEMA_NAME; } break; case 265: /* Line 1455 of yacc.c */ -#line 3585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_TABLE_NAME; } break; case 266: /* Line 1455 of yacc.c */ -#line 3587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_COLUMN_NAME; } break; case 267: /* Line 1455 of yacc.c */ -#line 3589 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3589 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_CURSOR_NAME; } break; case 268: /* Line 1455 of yacc.c */ -#line 3591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_MESSAGE_TEXT; } break; case 269: /* Line 1455 of yacc.c */ -#line 3593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_condition_item_name)= DIAG_MYSQL_ERRNO; } break; case 270: /* Line 1455 of yacc.c */ -#line 3598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21130,7 +21130,7 @@ case 271: /* Line 1455 of yacc.c */ -#line 3614 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3614 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Diagnostics_information *info= (yyvsp[(4) - (4)].diag_info); @@ -21147,21 +21147,21 @@ case 272: /* Line 1455 of yacc.c */ -#line 3629 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3629 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_area)= Diagnostics_information::CURRENT_AREA; } break; case 273: /* Line 1455 of yacc.c */ -#line 3631 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3631 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_area)= Diagnostics_information::CURRENT_AREA; } break; case 274: /* Line 1455 of yacc.c */ -#line 3636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_info)= new (YYTHD->mem_root) Statement_information((yyvsp[(1) - (1)].stmt_info_list)); if ((yyval.diag_info) == NULL) @@ -21172,7 +21172,7 @@ case 275: /* Line 1455 of yacc.c */ -#line 3642 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3642 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.diag_info)= new (YYTHD->mem_root) Condition_information((yyvsp[(2) - (3)].item), (yyvsp[(3) - (3)].cond_info_list)); if ((yyval.diag_info) == NULL) @@ -21183,7 +21183,7 @@ case 276: /* Line 1455 of yacc.c */ -#line 3651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.stmt_info_list)= new (YYTHD->mem_root) List; if ((yyval.stmt_info_list) == NULL || (yyval.stmt_info_list)->push_back((yyvsp[(1) - (1)].stmt_info_item))) @@ -21194,7 +21194,7 @@ case 277: /* Line 1455 of yacc.c */ -#line 3657 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3657 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(1) - (3)].stmt_info_list)->push_back((yyvsp[(3) - (3)].stmt_info_item))) MYSQL_YYABORT; @@ -21205,7 +21205,7 @@ case 278: /* Line 1455 of yacc.c */ -#line 3666 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3666 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.stmt_info_item)= new (YYTHD->mem_root) Statement_information_item((yyvsp[(3) - (3)].stmt_info_item_name), (yyvsp[(1) - (3)].item)); if ((yyval.stmt_info_item) == NULL) @@ -21216,7 +21216,7 @@ case 279: /* Line 1455 of yacc.c */ -#line 3674 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3674 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21250,7 +21250,7 @@ case 280: /* Line 1455 of yacc.c */ -#line 3703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_get_user_var((yyvsp[(2) - (2)].lex_str)); if ((yyval.item) == NULL) @@ -21261,28 +21261,28 @@ case 281: /* Line 1455 of yacc.c */ -#line 3712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.stmt_info_item_name)= Statement_information_item::NUMBER; } break; case 282: /* Line 1455 of yacc.c */ -#line 3714 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3714 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.stmt_info_item_name)= Statement_information_item::ROW_COUNT; } break; case 283: /* Line 1455 of yacc.c */ -#line 3723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 284: /* Line 1455 of yacc.c */ -#line 3728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_list)= new (YYTHD->mem_root) List; if ((yyval.cond_info_list) == NULL || (yyval.cond_info_list)->push_back((yyvsp[(1) - (1)].cond_info_item))) @@ -21293,7 +21293,7 @@ case 285: /* Line 1455 of yacc.c */ -#line 3734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(1) - (3)].cond_info_list)->push_back((yyvsp[(3) - (3)].cond_info_item))) MYSQL_YYABORT; @@ -21304,7 +21304,7 @@ case 286: /* Line 1455 of yacc.c */ -#line 3743 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3743 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item)= new (YYTHD->mem_root) Condition_information_item((yyvsp[(3) - (3)].cond_info_item_name), (yyvsp[(1) - (3)].item)); if ((yyval.cond_info_item) == NULL) @@ -21315,98 +21315,98 @@ case 287: /* Line 1455 of yacc.c */ -#line 3751 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3751 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::CLASS_ORIGIN; } break; case 288: /* Line 1455 of yacc.c */ -#line 3753 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3753 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::SUBCLASS_ORIGIN; } break; case 289: /* Line 1455 of yacc.c */ -#line 3755 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3755 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::CONSTRAINT_CATALOG; } break; case 290: /* Line 1455 of yacc.c */ -#line 3757 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3757 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::CONSTRAINT_SCHEMA; } break; case 291: /* Line 1455 of yacc.c */ -#line 3759 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3759 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::CONSTRAINT_NAME; } break; case 292: /* Line 1455 of yacc.c */ -#line 3761 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3761 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::CATALOG_NAME; } break; case 293: /* Line 1455 of yacc.c */ -#line 3763 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3763 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::SCHEMA_NAME; } break; case 294: /* Line 1455 of yacc.c */ -#line 3765 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3765 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::TABLE_NAME; } break; case 295: /* Line 1455 of yacc.c */ -#line 3767 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3767 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::COLUMN_NAME; } break; case 296: /* Line 1455 of yacc.c */ -#line 3769 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3769 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::CURSOR_NAME; } break; case 297: /* Line 1455 of yacc.c */ -#line 3771 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3771 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::MESSAGE_TEXT; } break; case 298: /* Line 1455 of yacc.c */ -#line 3773 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3773 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::MYSQL_ERRNO; } break; case 299: /* Line 1455 of yacc.c */ -#line 3775 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3775 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cond_info_item_name)= Condition_information_item::RETURNED_SQLSTATE; } break; case 300: /* Line 1455 of yacc.c */ -#line 3780 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3780 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* NOTE: field definition is filled in sp_decl section. */ @@ -21431,7 +21431,7 @@ case 301: /* Line 1455 of yacc.c */ -#line 3800 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3800 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* NOTE: field definition is filled in sp_decl section. */ @@ -21456,35 +21456,35 @@ case 302: /* Line 1455 of yacc.c */ -#line 3823 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3823 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = NULL; } break; case 303: /* Line 1455 of yacc.c */ -#line 3825 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3825 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sphead->m_parser_data.push_expr_start_ptr(YY_TOKEN_END); } break; case 304: /* Line 1455 of yacc.c */ -#line 3827 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3827 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = (yyvsp[(3) - (3)].item); } break; case 318: /* Line 1455 of yacc.c */ -#line 3848 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3848 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sphead->m_parser_data.new_cont_backpatch(); } break; case 319: /* Line 1455 of yacc.c */ -#line 3850 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3850 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { sp_head *sp= Lex->sphead; @@ -21495,7 +21495,7 @@ case 320: /* Line 1455 of yacc.c */ -#line 3858 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3858 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21510,7 +21510,7 @@ case 321: /* Line 1455 of yacc.c */ -#line 3868 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3868 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21559,7 +21559,7 @@ case 322: /* Line 1455 of yacc.c */ -#line 3915 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3915 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21574,7 +21574,7 @@ case 323: /* Line 1455 of yacc.c */ -#line 3925 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3925 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21623,7 +21623,7 @@ case 324: /* Line 1455 of yacc.c */ -#line 3971 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3971 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Unlabeled controls get a secret label. */ THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21639,7 +21639,7 @@ case 325: /* Line 1455 of yacc.c */ -#line 3982 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3982 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -21653,7 +21653,7 @@ case 326: /* Line 1455 of yacc.c */ -#line 3994 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 3994 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -21714,7 +21714,7 @@ case 327: /* Line 1455 of yacc.c */ -#line 4053 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4053 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -21766,7 +21766,7 @@ case 328: /* Line 1455 of yacc.c */ -#line 4103 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4103 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -21792,7 +21792,7 @@ case 329: /* Line 1455 of yacc.c */ -#line 4127 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4127 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -21818,14 +21818,14 @@ case 330: /* Line 1455 of yacc.c */ -#line 4148 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4148 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 331: /* Line 1455 of yacc.c */ -#line 4153 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4153 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -21851,7 +21851,7 @@ case 335: /* Line 1455 of yacc.c */ -#line 4183 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4183 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -21874,7 +21874,7 @@ case 336: /* Line 1455 of yacc.c */ -#line 4201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -21897,7 +21897,7 @@ case 337: /* Line 1455 of yacc.c */ -#line 4221 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4221 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21911,7 +21911,7 @@ case 338: /* Line 1455 of yacc.c */ -#line 4230 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4230 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -21952,7 +21952,7 @@ case 339: /* Line 1455 of yacc.c */ -#line 4266 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4266 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -21976,7 +21976,7 @@ case 340: /* Line 1455 of yacc.c */ -#line 4285 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4285 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -21990,7 +21990,7 @@ case 346: /* Line 1455 of yacc.c */ -#line 4308 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4308 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -22006,7 +22006,7 @@ case 347: /* Line 1455 of yacc.c */ -#line 4319 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4319 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -22052,7 +22052,7 @@ case 348: /* Line 1455 of yacc.c */ -#line 4363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { case_stmt_action_end_case(Lex, true); } @@ -22061,7 +22061,7 @@ case 349: /* Line 1455 of yacc.c */ -#line 4370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { case_stmt_action_case(YYTHD); } @@ -22070,7 +22070,7 @@ case 350: /* Line 1455 of yacc.c */ -#line 4377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { case_stmt_action_end_case(Lex, false); } @@ -22079,7 +22079,7 @@ case 355: /* Line 1455 of yacc.c */ -#line 4394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -22093,7 +22093,7 @@ case 356: /* Line 1455 of yacc.c */ -#line 4403 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4403 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Simple case: = */ @@ -22138,7 +22138,7 @@ case 357: /* Line 1455 of yacc.c */ -#line 4444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (case_stmt_action_then(YYTHD, Lex)) MYSQL_YYABORT; @@ -22148,7 +22148,7 @@ case 358: /* Line 1455 of yacc.c */ -#line 4452 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4452 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -22162,7 +22162,7 @@ case 359: /* Line 1455 of yacc.c */ -#line 4461 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4461 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -22202,7 +22202,7 @@ case 360: /* Line 1455 of yacc.c */ -#line 4497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (case_stmt_action_then(YYTHD, Lex)) MYSQL_YYABORT; @@ -22212,7 +22212,7 @@ case 361: /* Line 1455 of yacc.c */ -#line 4505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -22231,7 +22231,7 @@ case 363: /* Line 1455 of yacc.c */ -#line 4523 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4523 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -22254,7 +22254,7 @@ case 364: /* Line 1455 of yacc.c */ -#line 4541 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4541 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -22276,21 +22276,21 @@ case 365: /* Line 1455 of yacc.c */ -#line 4560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= null_lex_str; } break; case 366: /* Line 1455 of yacc.c */ -#line 4561 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4561 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 367: /* Line 1455 of yacc.c */ -#line 4566 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4566 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -22311,7 +22311,7 @@ case 368: /* Line 1455 of yacc.c */ -#line 4582 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4582 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *pctx= lex->get_sp_current_parsing_ctx(); @@ -22331,7 +22331,7 @@ case 369: /* Line 1455 of yacc.c */ -#line 4599 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4599 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Unlabeled blocks get a secret label. */ LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -22347,7 +22347,7 @@ case 370: /* Line 1455 of yacc.c */ -#line 4610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->get_sp_current_parsing_ctx()->pop_label(); @@ -22357,7 +22357,7 @@ case 371: /* Line 1455 of yacc.c */ -#line 4618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* QQ This is just a dummy for grouping declarations and statements together. No [[NOT] ATOMIC] yet, and we need to figure out how make it coexist with the existing BEGIN COMMIT/ROLLBACK. */ @@ -22375,7 +22375,7 @@ case 372: /* Line 1455 of yacc.c */ -#line 4633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -22412,7 +22412,7 @@ case 373: /* Line 1455 of yacc.c */ -#line 4669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -22432,7 +22432,7 @@ case 374: /* Line 1455 of yacc.c */ -#line 4684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -22446,7 +22446,7 @@ case 375: /* Line 1455 of yacc.c */ -#line 4693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -22487,7 +22487,7 @@ case 376: /* Line 1455 of yacc.c */ -#line 4731 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4731 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -22508,7 +22508,7 @@ case 377: /* Line 1455 of yacc.c */ -#line 4747 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4747 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -22522,7 +22522,7 @@ case 378: /* Line 1455 of yacc.c */ -#line 4756 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4756 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -22564,49 +22564,49 @@ case 380: /* Line 1455 of yacc.c */ -#line 4797 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4797 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TRG_ACTION_BEFORE; } break; case 381: /* Line 1455 of yacc.c */ -#line 4799 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4799 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TRG_ACTION_AFTER; } break; case 382: /* Line 1455 of yacc.c */ -#line 4804 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4804 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TRG_EVENT_INSERT; } break; case 383: /* Line 1455 of yacc.c */ -#line 4806 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4806 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TRG_EVENT_UPDATE; } break; case 384: /* Line 1455 of yacc.c */ -#line 4808 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4808 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TRG_EVENT_DELETE; } break; case 388: /* Line 1455 of yacc.c */ -#line 4842 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4842 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 389: /* Line 1455 of yacc.c */ -#line 4844 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4844 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->logfile_group_name= (yyvsp[(4) - (4)].lex_str).str; @@ -22616,7 +22616,7 @@ case 390: /* Line 1455 of yacc.c */ -#line 4854 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4854 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE; } @@ -22625,7 +22625,7 @@ case 391: /* Line 1455 of yacc.c */ -#line 4860 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4860 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE; } @@ -22634,14 +22634,14 @@ case 396: /* Line 1455 of yacc.c */ -#line 4883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 447: /* Line 1455 of yacc.c */ -#line 4981 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4981 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->data_file_name= (yyvsp[(2) - (2)].lex_str).str; @@ -22651,7 +22651,7 @@ case 448: /* Line 1455 of yacc.c */ -#line 4989 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4989 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->undo_file_name= (yyvsp[(2) - (2)].lex_str).str; @@ -22661,7 +22661,7 @@ case 449: /* Line 1455 of yacc.c */ -#line 4997 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 4997 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->redo_file_name= (yyvsp[(2) - (2)].lex_str).str; @@ -22671,7 +22671,7 @@ case 450: /* Line 1455 of yacc.c */ -#line 5005 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5005 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info= new st_alter_tablespace(); @@ -22685,7 +22685,7 @@ case 451: /* Line 1455 of yacc.c */ -#line 5017 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5017 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info= new st_alter_tablespace(); @@ -22699,7 +22699,7 @@ case 452: /* Line 1455 of yacc.c */ -#line 5029 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5029 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_access_mode= TS_READ_ONLY; @@ -22709,7 +22709,7 @@ case 453: /* Line 1455 of yacc.c */ -#line 5034 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5034 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_access_mode= TS_READ_WRITE; @@ -22719,7 +22719,7 @@ case 454: /* Line 1455 of yacc.c */ -#line 5039 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5039 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE; @@ -22729,7 +22729,7 @@ case 455: /* Line 1455 of yacc.c */ -#line 5047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->initial_size= (yyvsp[(3) - (3)].ulonglong_number); @@ -22739,7 +22739,7 @@ case 456: /* Line 1455 of yacc.c */ -#line 5055 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5055 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->autoextend_size= (yyvsp[(3) - (3)].ulonglong_number); @@ -22749,7 +22749,7 @@ case 457: /* Line 1455 of yacc.c */ -#line 5063 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5063 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->max_size= (yyvsp[(3) - (3)].ulonglong_number); @@ -22759,7 +22759,7 @@ case 458: /* Line 1455 of yacc.c */ -#line 5071 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5071 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->extent_size= (yyvsp[(3) - (3)].ulonglong_number); @@ -22769,7 +22769,7 @@ case 459: /* Line 1455 of yacc.c */ -#line 5079 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5079 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->undo_buffer_size= (yyvsp[(3) - (3)].ulonglong_number); @@ -22779,7 +22779,7 @@ case 460: /* Line 1455 of yacc.c */ -#line 5087 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5087 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->redo_buffer_size= (yyvsp[(3) - (3)].ulonglong_number); @@ -22789,7 +22789,7 @@ case 461: /* Line 1455 of yacc.c */ -#line 5095 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5095 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP) @@ -22804,7 +22804,7 @@ case 462: /* Line 1455 of yacc.c */ -#line 5108 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5108 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->alter_tablespace_info->ts_comment != NULL) @@ -22819,7 +22819,7 @@ case 463: /* Line 1455 of yacc.c */ -#line 5121 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5121 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->alter_tablespace_info->storage_engine != NULL) @@ -22835,7 +22835,7 @@ case 464: /* Line 1455 of yacc.c */ -#line 5135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->wait_until_completed= TRUE; @@ -22845,7 +22845,7 @@ case 465: /* Line 1455 of yacc.c */ -#line 5140 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5140 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (!(lex->alter_tablespace_info->wait_until_completed)) @@ -22860,14 +22860,14 @@ case 466: /* Line 1455 of yacc.c */ -#line 5152 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5152 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulonglong_number)= (yyvsp[(1) - (1)].ulonglong_number);} break; case 467: /* Line 1455 of yacc.c */ -#line 5154 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5154 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { ulonglong number; uint text_shift_number= 0; @@ -22916,21 +22916,21 @@ case 468: /* Line 1455 of yacc.c */ -#line 5204 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5204 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 469: /* Line 1455 of yacc.c */ -#line 5207 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5207 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 470: /* Line 1455 of yacc.c */ -#line 5209 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5209 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; TABLE_LIST *src_table; @@ -22950,7 +22950,7 @@ case 471: /* Line 1455 of yacc.c */ -#line 5224 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5224 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; TABLE_LIST *src_table; @@ -22970,63 +22970,63 @@ case 472: /* Line 1455 of yacc.c */ -#line 5243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 473: /* Line 1455 of yacc.c */ -#line 5246 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5246 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_braces(1);} break; case 474: /* Line 1455 of yacc.c */ -#line 5247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 475: /* Line 1455 of yacc.c */ -#line 5251 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5251 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 476: /* Line 1455 of yacc.c */ -#line 5253 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5253 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_braces(0);} break; case 477: /* Line 1455 of yacc.c */ -#line 5254 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5254 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 478: /* Line 1455 of yacc.c */ -#line 5256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_braces(1);} break; case 479: /* Line 1455 of yacc.c */ -#line 5257 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5257 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 480: /* Line 1455 of yacc.c */ -#line 5262 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5262 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Remove all tables used in PARTITION clause from the global table @@ -23041,14 +23041,14 @@ case 481: /* Line 1455 of yacc.c */ -#line 5298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 483: /* Line 1455 of yacc.c */ -#line 5304 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5304 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->part_info= new partition_info(); @@ -23067,7 +23067,7 @@ case 485: /* Line 1455 of yacc.c */ -#line 5322 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5322 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { #ifdef WITH_PARTITION_STORAGE_ENGINE LEX_STRING partition_name={C_STRING_WITH_LEN("partition")}; @@ -23088,7 +23088,7 @@ case 486: /* Line 1455 of yacc.c */ -#line 5341 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5341 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (!lex->part_info) @@ -23106,14 +23106,14 @@ case 487: /* Line 1455 of yacc.c */ -#line 5353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 489: /* Line 1455 of yacc.c */ -#line 5362 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5362 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->list_of_part_fields= TRUE; @@ -23125,70 +23125,70 @@ case 490: /* Line 1455 of yacc.c */ -#line 5369 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5369 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->part_type= HASH_PARTITION; } break; case 491: /* Line 1455 of yacc.c */ -#line 5370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 492: /* Line 1455 of yacc.c */ -#line 5372 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5372 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->part_type= RANGE_PARTITION; } break; case 493: /* Line 1455 of yacc.c */ -#line 5374 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5374 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->part_type= RANGE_PARTITION; } break; case 494: /* Line 1455 of yacc.c */ -#line 5376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->part_type= LIST_PARTITION; } break; case 495: /* Line 1455 of yacc.c */ -#line 5378 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5378 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->part_type= LIST_PARTITION; } break; case 496: /* Line 1455 of yacc.c */ -#line 5382 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5382 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 497: /* Line 1455 of yacc.c */ -#line 5384 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5384 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->linear_hash_ind= TRUE;} break; case 498: /* Line 1455 of yacc.c */ -#line 5389 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5389 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->key_algorithm= partition_info::KEY_ALGORITHM_NONE;} break; case 499: /* Line 1455 of yacc.c */ -#line 5391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { switch ((yyvsp[(3) - (3)].ulong_num)) { case 1: @@ -23207,35 +23207,35 @@ case 500: /* Line 1455 of yacc.c */ -#line 5407 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5407 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 501: /* Line 1455 of yacc.c */ -#line 5408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 502: /* Line 1455 of yacc.c */ -#line 5412 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5412 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 503: /* Line 1455 of yacc.c */ -#line 5413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 504: /* Line 1455 of yacc.c */ -#line 5418 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5418 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->num_columns++; @@ -23256,7 +23256,7 @@ case 505: /* Line 1455 of yacc.c */ -#line 5437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->column_list= TRUE; @@ -23267,7 +23267,7 @@ case 506: /* Line 1455 of yacc.c */ -#line 5447 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5447 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; if (part_info->set_part_expr((yyvsp[(2) - (5)].simple_string)+1, (yyvsp[(3) - (5)].item), (yyvsp[(4) - (5)].simple_string), FALSE)) @@ -23280,7 +23280,7 @@ case 507: /* Line 1455 of yacc.c */ -#line 5458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->part_info->set_part_expr((yyvsp[(2) - (5)].simple_string)+1, (yyvsp[(3) - (5)].item), (yyvsp[(4) - (5)].simple_string), TRUE)) { MYSQL_YYABORT; } @@ -23290,14 +23290,14 @@ case 508: /* Line 1455 of yacc.c */ -#line 5466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 509: /* Line 1455 of yacc.c */ -#line 5468 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5468 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { uint num_parts= (yyvsp[(2) - (2)].ulong_num); partition_info *part_info= Lex->part_info; @@ -23315,28 +23315,28 @@ case 510: /* Line 1455 of yacc.c */ -#line 5483 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5483 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 511: /* Line 1455 of yacc.c */ -#line 5485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->subpart_type= HASH_PARTITION; } break; case 512: /* Line 1455 of yacc.c */ -#line 5486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 513: /* Line 1455 of yacc.c */ -#line 5489 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5489 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->subpart_type= HASH_PARTITION; @@ -23347,28 +23347,28 @@ case 514: /* Line 1455 of yacc.c */ -#line 5494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 515: /* Line 1455 of yacc.c */ -#line 5498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 516: /* Line 1455 of yacc.c */ -#line 5499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 517: /* Line 1455 of yacc.c */ -#line 5504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; if (part_info->subpart_field_list.push_back((yyvsp[(1) - (1)].lex_str).str)) @@ -23388,7 +23388,7 @@ case 518: /* Line 1455 of yacc.c */ -#line 5522 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5522 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; bool not_corr_func; @@ -23406,14 +23406,14 @@ case 519: /* Line 1455 of yacc.c */ -#line 5537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 520: /* Line 1455 of yacc.c */ -#line 5539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { uint num_parts= (yyvsp[(2) - (2)].ulong_num); LEX *lex= Lex; @@ -23430,7 +23430,7 @@ case 521: /* Line 1455 of yacc.c */ -#line 5554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; if (part_info->part_type == RANGE_PARTITION) @@ -23451,7 +23451,7 @@ case 522: /* Line 1455 of yacc.c */ -#line 5570 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5570 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; uint count_curr_parts= part_info->partitions.elements; @@ -23475,21 +23475,21 @@ case 523: /* Line 1455 of yacc.c */ -#line 5591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 524: /* Line 1455 of yacc.c */ -#line 5592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 525: /* Line 1455 of yacc.c */ -#line 5597 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5597 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; partition_element *p_elem= new partition_element(); @@ -23510,17 +23510,23 @@ case 526: /* Line 1455 of yacc.c */ -#line 5616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 527: /* Line 1455 of yacc.c */ -#line 5621 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5621 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; partition_element *p_elem= part_info->curr_part_elem; + if (check_string_char_length(&(yyvsp[(1) - (1)].lex_str), "", NAME_CHAR_LEN, + system_charset_info, true)) + { + my_error(ER_TOO_LONG_IDENT, MYF(0), (yyvsp[(1) - (1)].lex_str).str); + MYSQL_YYABORT; + } p_elem->partition_name= (yyvsp[(1) - (1)].lex_str).str; } break; @@ -23528,7 +23534,7 @@ case 528: /* Line 1455 of yacc.c */ -#line 5630 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; partition_info *part_info= lex->part_info; @@ -23555,7 +23561,7 @@ case 529: /* Line 1455 of yacc.c */ -#line 5652 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5658 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; partition_info *part_info= lex->part_info; @@ -23576,14 +23582,14 @@ case 530: /* Line 1455 of yacc.c */ -#line 5667 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 531: /* Line 1455 of yacc.c */ -#line 5669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5675 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; partition_info *part_info= lex->part_info; @@ -23604,14 +23610,14 @@ case 532: /* Line 1455 of yacc.c */ -#line 5684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5690 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 533: /* Line 1455 of yacc.c */ -#line 5689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; @@ -23638,14 +23644,14 @@ case 534: /* Line 1455 of yacc.c */ -#line 5710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 535: /* Line 1455 of yacc.c */ -#line 5715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; partition_info *part_info= lex->part_info; @@ -23679,7 +23685,7 @@ case 536: /* Line 1455 of yacc.c */ -#line 5744 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5750 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; if (part_info->num_columns < 2U) @@ -23693,21 +23699,21 @@ case 537: /* Line 1455 of yacc.c */ -#line 5755 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5761 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 538: /* Line 1455 of yacc.c */ -#line 5756 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5762 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 539: /* Line 1455 of yacc.c */ -#line 5761 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5767 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->print_debug("( part_value_item", NULL); @@ -23724,14 +23730,14 @@ case 540: /* Line 1455 of yacc.c */ -#line 5772 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5778 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 541: /* Line 1455 of yacc.c */ -#line 5774 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5780 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->print_debug(") part_value_item", NULL); @@ -23757,21 +23763,21 @@ case 542: /* Line 1455 of yacc.c */ -#line 5797 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5803 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 543: /* Line 1455 of yacc.c */ -#line 5798 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5804 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 544: /* Line 1455 of yacc.c */ -#line 5803 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5809 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; if (part_info->part_type == LIST_PARTITION) @@ -23789,7 +23795,7 @@ case 545: /* Line 1455 of yacc.c */ -#line 5816 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5822 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; partition_info *part_info= lex->part_info; @@ -23810,7 +23816,7 @@ case 546: /* Line 1455 of yacc.c */ -#line 5836 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5842 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; if (part_info->num_subparts != 0 && @@ -23829,7 +23835,7 @@ case 547: /* Line 1455 of yacc.c */ -#line 5850 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5856 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; if (part_info->num_subparts != 0) @@ -23857,21 +23863,21 @@ case 548: /* Line 1455 of yacc.c */ -#line 5875 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5881 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 549: /* Line 1455 of yacc.c */ -#line 5876 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5882 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 550: /* Line 1455 of yacc.c */ -#line 5881 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5887 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; partition_element *curr_part= part_info->current_partition; @@ -23909,56 +23915,64 @@ case 551: /* Line 1455 of yacc.c */ -#line 5913 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5919 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 552: /* Line 1455 of yacc.c */ -#line 5918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" - { Lex->part_info->curr_part_elem->partition_name= (yyvsp[(1) - (1)].lex_str).str; } +#line 5924 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" + { + if (check_string_char_length(&(yyvsp[(1) - (1)].lex_str), "", NAME_CHAR_LEN, + system_charset_info, true)) + { + my_error(ER_TOO_LONG_IDENT, MYF(0), (yyvsp[(1) - (1)].lex_str).str); + MYSQL_YYABORT; + } + Lex->part_info->curr_part_elem->partition_name= (yyvsp[(1) - (1)].lex_str).str; + } break; case 553: /* Line 1455 of yacc.c */ -#line 5922 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5936 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 554: /* Line 1455 of yacc.c */ -#line 5923 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5937 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 555: /* Line 1455 of yacc.c */ -#line 5927 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5941 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 556: /* Line 1455 of yacc.c */ -#line 5928 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5942 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 557: /* Line 1455 of yacc.c */ -#line 5933 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5947 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->curr_part_elem->tablespace_name= (yyvsp[(3) - (3)].lex_str).str; } break; case 558: /* Line 1455 of yacc.c */ -#line 5935 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5949 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->curr_part_elem->engine_type= (yyvsp[(4) - (4)].db_type); @@ -23969,49 +23983,49 @@ case 559: /* Line 1455 of yacc.c */ -#line 5941 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5955 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->curr_part_elem->nodegroup_id= (uint16) (yyvsp[(3) - (3)].ulong_num); } break; case 560: /* Line 1455 of yacc.c */ -#line 5943 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5957 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->curr_part_elem->part_max_rows= (ha_rows) (yyvsp[(3) - (3)].ulonglong_number); } break; case 561: /* Line 1455 of yacc.c */ -#line 5945 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5959 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->curr_part_elem->part_min_rows= (ha_rows) (yyvsp[(3) - (3)].ulonglong_number); } break; case 562: /* Line 1455 of yacc.c */ -#line 5947 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5961 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->curr_part_elem->data_file_name= (yyvsp[(4) - (4)].lex_str).str; } break; case 563: /* Line 1455 of yacc.c */ -#line 5949 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5963 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->curr_part_elem->index_file_name= (yyvsp[(4) - (4)].lex_str).str; } break; case 564: /* Line 1455 of yacc.c */ -#line 5951 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5965 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->curr_part_elem->part_comment= (yyvsp[(3) - (3)].lex_str).str; } break; case 565: /* Line 1455 of yacc.c */ -#line 5960 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->sql_command == SQLCOM_INSERT) @@ -24031,7 +24045,7 @@ case 566: /* Line 1455 of yacc.c */ -#line 5975 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5989 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= NO_MATTER; } @@ -24040,7 +24054,7 @@ case 567: /* Line 1455 of yacc.c */ -#line 5979 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 5993 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* The following work only with the local list, the global list @@ -24053,112 +24067,112 @@ case 568: /* Line 1455 of yacc.c */ -#line 5989 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6003 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 569: /* Line 1455 of yacc.c */ -#line 5990 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6004 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 570: /* Line 1455 of yacc.c */ -#line 5994 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6008 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 571: /* Line 1455 of yacc.c */ -#line 5995 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6009 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 572: /* Line 1455 of yacc.c */ -#line 5999 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6013 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 573: /* Line 1455 of yacc.c */ -#line 6000 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6014 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 574: /* Line 1455 of yacc.c */ -#line 6004 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6018 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 575: /* Line 1455 of yacc.c */ -#line 6005 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6019 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 576: /* Line 1455 of yacc.c */ -#line 6009 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6023 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 577: /* Line 1455 of yacc.c */ -#line 6010 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6024 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (1)].num);} break; case 578: /* Line 1455 of yacc.c */ -#line 6014 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6028 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=(yyvsp[(1) - (1)].num); } break; case 579: /* Line 1455 of yacc.c */ -#line 6015 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6029 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (2)].num) | (yyvsp[(2) - (2)].num); } break; case 580: /* Line 1455 of yacc.c */ -#line 6019 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6033 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=HA_LEX_CREATE_TMP_TABLE; } break; case 581: /* Line 1455 of yacc.c */ -#line 6023 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6037 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 582: /* Line 1455 of yacc.c */ -#line 6024 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6038 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=HA_LEX_CREATE_IF_NOT_EXISTS; } break; case 590: /* Line 1455 of yacc.c */ -#line 6045 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6059 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.db_type= (yyvsp[(3) - (3)].db_type); Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; @@ -24168,7 +24182,7 @@ case 591: /* Line 1455 of yacc.c */ -#line 6050 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6064 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.max_rows= (yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS; @@ -24178,7 +24192,7 @@ case 592: /* Line 1455 of yacc.c */ -#line 6055 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6069 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.min_rows= (yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS; @@ -24188,7 +24202,7 @@ case 593: /* Line 1455 of yacc.c */ -#line 6060 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6074 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.avg_row_length=(yyvsp[(3) - (3)].ulong_num); Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH; @@ -24198,7 +24212,7 @@ case 594: /* Line 1455 of yacc.c */ -#line 6065 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6079 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.password=(yyvsp[(3) - (3)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; @@ -24208,7 +24222,7 @@ case 595: /* Line 1455 of yacc.c */ -#line 6070 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6084 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.comment=(yyvsp[(3) - (3)].lex_str); Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; @@ -24218,7 +24232,7 @@ case 596: /* Line 1455 of yacc.c */ -#line 6075 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6089 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.auto_increment_value=(yyvsp[(3) - (3)].ulonglong_number); Lex->create_info.used_fields|= HA_CREATE_USED_AUTO; @@ -24228,7 +24242,7 @@ case 597: /* Line 1455 of yacc.c */ -#line 6080 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6094 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { switch((yyvsp[(3) - (3)].ulong_num)) { case 0: @@ -24248,7 +24262,7 @@ case 598: /* Line 1455 of yacc.c */ -#line 6095 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6109 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.table_options&= ~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS); @@ -24259,7 +24273,7 @@ case 599: /* Line 1455 of yacc.c */ -#line 6101 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6115 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { switch((yyvsp[(3) - (3)].ulong_num)) { case 0: @@ -24279,7 +24293,7 @@ case 600: /* Line 1455 of yacc.c */ -#line 6116 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6130 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.stats_auto_recalc= HA_STATS_AUTO_RECALC_DEFAULT; Lex->create_info.used_fields|= HA_CREATE_USED_STATS_AUTO_RECALC; @@ -24289,7 +24303,7 @@ case 601: /* Line 1455 of yacc.c */ -#line 6121 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { switch((yyvsp[(3) - (3)].ulong_num)) { case 0: @@ -24309,7 +24323,7 @@ case 602: /* Line 1455 of yacc.c */ -#line 6136 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6150 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.table_options&= ~(HA_OPTION_STATS_PERSISTENT | HA_OPTION_NO_STATS_PERSISTENT); @@ -24320,7 +24334,7 @@ case 603: /* Line 1455 of yacc.c */ -#line 6142 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6156 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* From user point of view STATS_SAMPLE_PAGES can be specified as STATS_SAMPLE_PAGES=N (where 0create_info.stats_sample_pages=0; Lex->create_info.used_fields|= HA_CREATE_USED_STATS_SAMPLE_PAGES; @@ -24353,7 +24367,7 @@ case 605: /* Line 1455 of yacc.c */ -#line 6165 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6179 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; @@ -24363,7 +24377,7 @@ case 606: /* Line 1455 of yacc.c */ -#line 6170 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6184 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; @@ -24373,7 +24387,7 @@ case 607: /* Line 1455 of yacc.c */ -#line 6175 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6189 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.table_options|= (yyvsp[(3) - (3)].ulong_num) ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; @@ -24383,7 +24397,7 @@ case 608: /* Line 1455 of yacc.c */ -#line 6180 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6194 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.row_type= (yyvsp[(3) - (3)].row_type); Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; @@ -24393,7 +24407,7 @@ case 609: /* Line 1455 of yacc.c */ -#line 6185 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6199 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->select_lex.table_list.save_and_clear(&Lex->save_list); } @@ -24402,7 +24416,7 @@ case 610: /* Line 1455 of yacc.c */ -#line 6189 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6203 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Move the union list to the merge_list and exclude its tables @@ -24429,7 +24443,7 @@ case 613: /* Line 1455 of yacc.c */ -#line 6213 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6227 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.merge_insert_method= (yyvsp[(3) - (3)].ulong_num); Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD; @@ -24439,7 +24453,7 @@ case 614: /* Line 1455 of yacc.c */ -#line 6218 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6232 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.data_file_name= (yyvsp[(4) - (4)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; @@ -24449,7 +24463,7 @@ case 615: /* Line 1455 of yacc.c */ -#line 6223 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.index_file_name= (yyvsp[(4) - (4)].lex_str).str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; @@ -24459,28 +24473,28 @@ case 616: /* Line 1455 of yacc.c */ -#line 6228 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6242 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {Lex->create_info.tablespace= (yyvsp[(2) - (2)].lex_str).str;} break; case 617: /* Line 1455 of yacc.c */ -#line 6230 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6244 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {Lex->create_info.storage_media= HA_SM_DISK;} break; case 618: /* Line 1455 of yacc.c */ -#line 6232 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6246 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {Lex->create_info.storage_media= HA_SM_MEMORY;} break; case 619: /* Line 1455 of yacc.c */ -#line 6234 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6248 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.connect_string.str= (yyvsp[(3) - (3)].lex_str).str; Lex->create_info.connect_string.length= (yyvsp[(3) - (3)].lex_str).length; @@ -24491,7 +24505,7 @@ case 620: /* Line 1455 of yacc.c */ -#line 6240 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6254 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE; Lex->create_info.key_block_size= (yyvsp[(3) - (3)].ulong_num); @@ -24501,7 +24515,7 @@ case 621: /* Line 1455 of yacc.c */ -#line 6248 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6262 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { HA_CREATE_INFO *cinfo= &Lex->create_info; if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && @@ -24521,7 +24535,7 @@ case 622: /* Line 1455 of yacc.c */ -#line 6266 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6280 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { HA_CREATE_INFO *cinfo= &Lex->create_info; if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) && @@ -24540,7 +24554,7 @@ case 623: /* Line 1455 of yacc.c */ -#line 6283 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6297 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; plugin_ref plugin= @@ -24568,7 +24582,7 @@ case 624: /* Line 1455 of yacc.c */ -#line 6309 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6323 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -24588,161 +24602,161 @@ case 625: /* Line 1455 of yacc.c */ -#line 6326 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6340 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_DEFAULT; } break; case 626: /* Line 1455 of yacc.c */ -#line 6327 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6341 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_FIXED; } break; case 627: /* Line 1455 of yacc.c */ -#line 6328 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6342 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_DYNAMIC; } break; case 628: /* Line 1455 of yacc.c */ -#line 6329 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6343 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_COMPRESSED; } break; case 629: /* Line 1455 of yacc.c */ -#line 6330 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6344 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_REDUNDANT; } break; case 630: /* Line 1455 of yacc.c */ -#line 6331 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6345 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_COMPACT; } break; case 631: /* Line 1455 of yacc.c */ -#line 6332 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6346 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_UNCOMPRESSED; } break; case 632: /* Line 1455 of yacc.c */ -#line 6333 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6347 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_ZLIB; } break; case 633: /* Line 1455 of yacc.c */ -#line 6334 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6348 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_SNAPPY; } break; case 634: /* Line 1455 of yacc.c */ -#line 6335 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6349 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_QUICKLZ; } break; case 635: /* Line 1455 of yacc.c */ -#line 6336 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6350 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_LZMA; } break; case 636: /* Line 1455 of yacc.c */ -#line 6337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6351 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_FAST; } break; case 637: /* Line 1455 of yacc.c */ -#line 6338 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6352 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_SMALL; } break; case 638: /* Line 1455 of yacc.c */ -#line 6339 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.row_type)= ROW_TYPE_TOKU_DEFAULT; } break; case 639: /* Line 1455 of yacc.c */ -#line 6343 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= MERGE_INSERT_DISABLED; } break; case 640: /* Line 1455 of yacc.c */ -#line 6344 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6358 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= MERGE_INSERT_TO_FIRST; } break; case 641: /* Line 1455 of yacc.c */ -#line 6345 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6359 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= MERGE_INSERT_TO_LAST; } break; case 642: /* Line 1455 of yacc.c */ -#line 6349 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 644: /* Line 1455 of yacc.c */ -#line 6354 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6368 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.num) = (int) STRING_RESULT; } break; case 645: /* Line 1455 of yacc.c */ -#line 6355 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6369 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.num) = (int) REAL_RESULT; } break; case 646: /* Line 1455 of yacc.c */ -#line 6356 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.num) = (int) DECIMAL_RESULT; } break; case 647: /* Line 1455 of yacc.c */ -#line 6357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6371 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.num) = (int) INT_RESULT; } break; case 648: /* Line 1455 of yacc.c */ -#line 6363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_last_non_select_table= Lex->last_table(); } @@ -24751,7 +24765,7 @@ case 654: /* Line 1455 of yacc.c */ -#line 6381 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6395 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->col_list.empty(); /* Alloced by sql_alloc */ } @@ -24760,7 +24774,7 @@ case 655: /* Line 1455 of yacc.c */ -#line 6388 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index (Lex, (yyvsp[(1) - (7)].key_type), (yyvsp[(2) - (7)].lex_str))) MYSQL_YYABORT; @@ -24770,7 +24784,7 @@ case 656: /* Line 1455 of yacc.c */ -#line 6394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index (Lex, (yyvsp[(1) - (8)].key_type), (yyvsp[(3) - (8)].lex_str))) MYSQL_YYABORT; @@ -24780,7 +24794,7 @@ case 657: /* Line 1455 of yacc.c */ -#line 6400 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6414 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_create_index (Lex, (yyvsp[(1) - (8)].key_type), (yyvsp[(3) - (8)].lex_str))) MYSQL_YYABORT; @@ -24790,7 +24804,7 @@ case 658: /* Line 1455 of yacc.c */ -#line 6406 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (((yyvsp[(1) - (8)].lex_str).length != 0) && ((enum Key::Keytype)(yyvsp[(2) - (8)].key_type) == (Key::CLUSTERING | Key::MULTIPLE))) @@ -24807,7 +24821,7 @@ case 659: /* Line 1455 of yacc.c */ -#line 6418 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6432 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Key *key= new Foreign_key((yyvsp[(4) - (8)].lex_str).str ? (yyvsp[(4) - (8)].lex_str) : (yyvsp[(1) - (8)].lex_str), lex->col_list, @@ -24831,7 +24845,7 @@ case 660: /* Line 1455 of yacc.c */ -#line 6437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6451 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->col_list.empty(); /* Alloced by sql_alloc */ } @@ -24840,28 +24854,28 @@ case 664: /* Line 1455 of yacc.c */ -#line 6452 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= null_lex_str; } break; case 665: /* Line 1455 of yacc.c */ -#line 6453 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6467 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 666: /* Line 1455 of yacc.c */ -#line 6457 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6471 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 667: /* Line 1455 of yacc.c */ -#line 6462 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6476 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->length=lex->dec=0; @@ -24876,7 +24890,7 @@ case 668: /* Line 1455 of yacc.c */ -#line 6472 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (add_field_to_list(lex->thd, &(yyvsp[(1) - (4)].lex_str), (enum enum_field_types) (yyvsp[(3) - (4)].num), @@ -24892,28 +24906,28 @@ case 669: /* Line 1455 of yacc.c */ -#line 6485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=(yyvsp[(1) - (3)].num); } break; case 670: /* Line 1455 of yacc.c */ -#line 6486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6500 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=(yyvsp[(1) - (3)].num); } break; case 671: /* Line 1455 of yacc.c */ -#line 6487 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6501 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_FLOAT; } break; case 672: /* Line 1455 of yacc.c */ -#line 6489 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6503 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (char*) "1"; (yyval.num)=MYSQL_TYPE_BIT; @@ -24923,7 +24937,7 @@ case 673: /* Line 1455 of yacc.c */ -#line 6494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6508 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_BIT; } @@ -24932,7 +24946,7 @@ case 674: /* Line 1455 of yacc.c */ -#line 6498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (char*) "1"; (yyval.num)=MYSQL_TYPE_TINY; @@ -24942,7 +24956,7 @@ case 675: /* Line 1455 of yacc.c */ -#line 6503 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (char*) "1"; (yyval.num)=MYSQL_TYPE_TINY; @@ -24952,7 +24966,7 @@ case 676: /* Line 1455 of yacc.c */ -#line 6508 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6522 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_STRING; } @@ -24961,7 +24975,7 @@ case 677: /* Line 1455 of yacc.c */ -#line 6512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (char*) "1"; (yyval.num)=MYSQL_TYPE_STRING; @@ -24971,7 +24985,7 @@ case 678: /* Line 1455 of yacc.c */ -#line 6517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6531 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_STRING; Lex->charset=national_charset_info; @@ -24981,7 +24995,7 @@ case 679: /* Line 1455 of yacc.c */ -#line 6522 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6536 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (char*) "1"; (yyval.num)=MYSQL_TYPE_STRING; @@ -24992,7 +25006,7 @@ case 680: /* Line 1455 of yacc.c */ -#line 6528 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6542 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; (yyval.num)=MYSQL_TYPE_STRING; @@ -25002,7 +25016,7 @@ case 681: /* Line 1455 of yacc.c */ -#line 6533 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (char*) "1"; Lex->charset=&my_charset_bin; @@ -25013,7 +25027,7 @@ case 682: /* Line 1455 of yacc.c */ -#line 6539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6553 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_TYPE_VARCHAR; } @@ -25022,7 +25036,7 @@ case 683: /* Line 1455 of yacc.c */ -#line 6543 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6557 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_TYPE_VARCHAR; Lex->charset=national_charset_info; @@ -25032,7 +25046,7 @@ case 684: /* Line 1455 of yacc.c */ -#line 6548 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6562 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; (yyval.num)= MYSQL_TYPE_VARCHAR; @@ -25042,7 +25056,7 @@ case 685: /* Line 1455 of yacc.c */ -#line 6553 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6567 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->length) { @@ -25065,21 +25079,21 @@ case 686: /* Line 1455 of yacc.c */ -#line 6571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_DATE; } break; case 687: /* Line 1455 of yacc.c */ -#line 6573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_TYPE_TIME2; } break; case 688: /* Line 1455 of yacc.c */ -#line 6575 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6589 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (YYTHD->variables.sql_mode & MODE_MAXDB) (yyval.num)=MYSQL_TYPE_DATETIME2; @@ -25100,14 +25114,14 @@ case 689: /* Line 1455 of yacc.c */ -#line 6591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6605 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_TYPE_DATETIME2; } break; case 690: /* Line 1455 of yacc.c */ -#line 6593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6607 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; (yyval.num)=MYSQL_TYPE_TINY_BLOB; @@ -25117,7 +25131,7 @@ case 691: /* Line 1455 of yacc.c */ -#line 6598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; (yyval.num)=MYSQL_TYPE_BLOB; @@ -25127,7 +25141,7 @@ case 692: /* Line 1455 of yacc.c */ -#line 6603 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6617 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { #ifdef HAVE_SPATIAL Lex->charset=&my_charset_bin; @@ -25144,7 +25158,7 @@ case 693: /* Line 1455 of yacc.c */ -#line 6615 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6629 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; @@ -25154,7 +25168,7 @@ case 694: /* Line 1455 of yacc.c */ -#line 6620 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6634 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; (yyval.num)=MYSQL_TYPE_LONG_BLOB; @@ -25164,7 +25178,7 @@ case 695: /* Line 1455 of yacc.c */ -#line 6625 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6639 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; @@ -25174,98 +25188,98 @@ case 696: /* Line 1455 of yacc.c */ -#line 6630 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6644 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; } break; case 697: /* Line 1455 of yacc.c */ -#line 6632 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6646 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_TINY_BLOB; } break; case 698: /* Line 1455 of yacc.c */ -#line 6634 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6648 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_BLOB; } break; case 699: /* Line 1455 of yacc.c */ -#line 6636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6650 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; } break; case 700: /* Line 1455 of yacc.c */ -#line 6638 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6652 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_LONG_BLOB; } break; case 701: /* Line 1455 of yacc.c */ -#line 6640 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_NEWDECIMAL;} break; case 702: /* Line 1455 of yacc.c */ -#line 6642 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6656 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_NEWDECIMAL;} break; case 703: /* Line 1455 of yacc.c */ -#line 6644 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6658 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_NEWDECIMAL;} break; case 704: /* Line 1455 of yacc.c */ -#line 6646 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6660 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {Lex->interval_list.empty();} break; case 705: /* Line 1455 of yacc.c */ -#line 6648 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6662 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_ENUM; } break; case 706: /* Line 1455 of yacc.c */ -#line 6650 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6664 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->interval_list.empty();} break; case 707: /* Line 1455 of yacc.c */ -#line 6652 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6666 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_SET; } break; case 708: /* Line 1455 of yacc.c */ -#line 6654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6668 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_MEDIUM_BLOB; } break; case 709: /* Line 1455 of yacc.c */ -#line 6656 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6670 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_LONGLONG; Lex->type|= (AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNSIGNED_FLAG | @@ -25276,21 +25290,21 @@ case 710: /* Line 1455 of yacc.c */ -#line 6664 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6678 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= Field::GEOM_GEOMETRY; } break; case 711: /* Line 1455 of yacc.c */ -#line 6665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= Field::GEOM_GEOMETRYCOLLECTION; } break; case 712: /* Line 1455 of yacc.c */ -#line 6667 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6681 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= const_cast(STRINGIFY_ARG (MAX_LEN_GEOM_POINT_FIELD)); @@ -25301,147 +25315,147 @@ case 713: /* Line 1455 of yacc.c */ -#line 6672 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6686 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= Field::GEOM_MULTIPOINT; } break; case 714: /* Line 1455 of yacc.c */ -#line 6673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6687 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= Field::GEOM_LINESTRING; } break; case 715: /* Line 1455 of yacc.c */ -#line 6674 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6688 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= Field::GEOM_MULTILINESTRING; } break; case 716: /* Line 1455 of yacc.c */ -#line 6675 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= Field::GEOM_POLYGON; } break; case 717: /* Line 1455 of yacc.c */ -#line 6676 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6690 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= Field::GEOM_MULTIPOLYGON; } break; case 718: /* Line 1455 of yacc.c */ -#line 6680 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 719: /* Line 1455 of yacc.c */ -#line 6684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 720: /* Line 1455 of yacc.c */ -#line 6685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6699 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 721: /* Line 1455 of yacc.c */ -#line 6689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 722: /* Line 1455 of yacc.c */ -#line 6690 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 723: /* Line 1455 of yacc.c */ -#line 6694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6708 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 724: /* Line 1455 of yacc.c */ -#line 6695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 725: /* Line 1455 of yacc.c */ -#line 6696 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 726: /* Line 1455 of yacc.c */ -#line 6697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 727: /* Line 1455 of yacc.c */ -#line 6698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 728: /* Line 1455 of yacc.c */ -#line 6702 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_LONG; } break; case 729: /* Line 1455 of yacc.c */ -#line 6703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_TINY; } break; case 730: /* Line 1455 of yacc.c */ -#line 6704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_SHORT; } break; case 731: /* Line 1455 of yacc.c */ -#line 6705 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_INT24; } break; case 732: /* Line 1455 of yacc.c */ -#line 6706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_LONGLONG; } break; case 733: /* Line 1455 of yacc.c */ -#line 6711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ? MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE; @@ -25451,42 +25465,42 @@ case 734: /* Line 1455 of yacc.c */ -#line 6716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6730 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_DOUBLE; } break; case 735: /* Line 1455 of yacc.c */ -#line 6718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=MYSQL_TYPE_DOUBLE; } break; case 736: /* Line 1455 of yacc.c */ -#line 6723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6737 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->dec=Lex->length= (char*)0; } break; case 737: /* Line 1455 of yacc.c */ -#line 6725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6739 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->dec= (char*)0; } break; case 738: /* Line 1455 of yacc.c */ -#line 6727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6741 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 739: /* Line 1455 of yacc.c */ -#line 6732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6746 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->length=(yyvsp[(2) - (5)].lex_str).str; @@ -25497,35 +25511,35 @@ case 740: /* Line 1455 of yacc.c */ -#line 6741 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6755 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->dec= (char *) 0; } break; case 741: /* Line 1455 of yacc.c */ -#line 6742 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6756 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->dec= (yyvsp[(2) - (3)].lex_str).str; } break; case 742: /* Line 1455 of yacc.c */ -#line 6746 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6760 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= 0; } break; case 743: /* Line 1455 of yacc.c */ -#line 6747 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6761 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= 0; } break; case 744: /* Line 1455 of yacc.c */ -#line 6749 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6763 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(2) - (3)].lex_str).str, NULL, &error); @@ -25535,168 +25549,168 @@ case 745: /* Line 1455 of yacc.c */ -#line 6756 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6770 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 746: /* Line 1455 of yacc.c */ -#line 6757 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6771 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 747: /* Line 1455 of yacc.c */ -#line 6761 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6775 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 748: /* Line 1455 of yacc.c */ -#line 6762 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6776 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 749: /* Line 1455 of yacc.c */ -#line 6766 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6780 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 750: /* Line 1455 of yacc.c */ -#line 6767 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6781 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= UNSIGNED_FLAG;} break; case 751: /* Line 1455 of yacc.c */ -#line 6768 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6782 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; } break; case 752: /* Line 1455 of yacc.c */ -#line 6772 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6786 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (yyvsp[(2) - (3)].lex_str).str; } break; case 753: /* Line 1455 of yacc.c */ -#line 6773 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6787 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (yyvsp[(2) - (3)].lex_str).str; } break; case 754: /* Line 1455 of yacc.c */ -#line 6774 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6788 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (yyvsp[(2) - (3)].lex_str).str; } break; case 755: /* Line 1455 of yacc.c */ -#line 6775 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6789 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length= (yyvsp[(2) - (3)].lex_str).str; } break; case 756: /* Line 1455 of yacc.c */ -#line 6778 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6792 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->length=(char*) 0; /* use default length */ } break; case 757: /* Line 1455 of yacc.c */ -#line 6779 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6793 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 758: /* Line 1455 of yacc.c */ -#line 6783 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6797 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 759: /* Line 1455 of yacc.c */ -#line 6784 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6798 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 760: /* Line 1455 of yacc.c */ -#line 6788 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6802 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 761: /* Line 1455 of yacc.c */ -#line 6789 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6803 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 762: /* Line 1455 of yacc.c */ -#line 6793 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6807 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 764: /* Line 1455 of yacc.c */ -#line 6798 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6812 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~ NOT_NULL_FLAG; } break; case 765: /* Line 1455 of yacc.c */ -#line 6799 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6813 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= NOT_NULL_FLAG; } break; case 766: /* Line 1455 of yacc.c */ -#line 6800 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6814 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->default_value=(yyvsp[(2) - (2)].item); } break; case 767: /* Line 1455 of yacc.c */ -#line 6801 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6815 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->on_update_value= (yyvsp[(3) - (3)].item); } break; case 768: /* Line 1455 of yacc.c */ -#line 6802 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6816 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG; } break; case 769: /* Line 1455 of yacc.c */ -#line 6804 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6818 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG; @@ -25707,7 +25721,7 @@ case 770: /* Line 1455 of yacc.c */ -#line 6810 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6824 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG; @@ -25718,7 +25732,7 @@ case 771: /* Line 1455 of yacc.c */ -#line 6816 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6830 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if ((yyvsp[(1) - (1)].key_type) & Key::UNIQUE) @@ -25732,7 +25746,7 @@ case 772: /* Line 1455 of yacc.c */ -#line 6825 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6839 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if ((yyvsp[(1) - (2)].key_type) & Key::UNIQUE) @@ -25746,14 +25760,14 @@ case 773: /* Line 1455 of yacc.c */ -#line 6833 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6847 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->comment= (yyvsp[(2) - (2)].lex_str); } break; case 774: /* Line 1455 of yacc.c */ -#line 6835 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6849 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->charset && !my_charset_same(Lex->charset,(yyvsp[(2) - (2)].charset))) { @@ -25771,7 +25785,7 @@ case 775: /* Line 1455 of yacc.c */ -#line 6848 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6862 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK); Lex->type|= @@ -25782,7 +25796,7 @@ case 776: /* Line 1455 of yacc.c */ -#line 6854 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6868 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK); Lex->type|= @@ -25793,7 +25807,7 @@ case 777: /* Line 1455 of yacc.c */ -#line 6860 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6874 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK); Lex->type|= @@ -25804,7 +25818,7 @@ case 778: /* Line 1455 of yacc.c */ -#line 6866 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6880 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK); Lex->type|= @@ -25816,7 +25830,7 @@ case 779: /* Line 1455 of yacc.c */ -#line 6873 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6887 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK); Lex->type|= (HA_SM_DEFAULT << FIELD_FLAGS_STORAGE_MEDIA); @@ -25826,7 +25840,7 @@ case 780: /* Line 1455 of yacc.c */ -#line 6878 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6892 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK); Lex->type|= (HA_SM_DISK << FIELD_FLAGS_STORAGE_MEDIA); @@ -25836,7 +25850,7 @@ case 781: /* Line 1455 of yacc.c */ -#line 6883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6897 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type&= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK); Lex->type|= (HA_SM_MEMORY << FIELD_FLAGS_STORAGE_MEDIA); @@ -25846,14 +25860,14 @@ case 782: /* Line 1455 of yacc.c */ -#line 6890 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6904 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_cstr)= null_lex_cstr; } break; case 783: /* Line 1455 of yacc.c */ -#line 6892 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6906 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* no single assignment because of @@ -25867,7 +25881,7 @@ case 784: /* Line 1455 of yacc.c */ -#line 6904 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (2)].num); @@ -25889,7 +25903,7 @@ case 785: /* Line 1455 of yacc.c */ -#line 6925 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6939 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_now_local((yyvsp[(2) - (2)].ulong_num)); if ((yyval.item) == NULL) @@ -25900,28 +25914,28 @@ case 787: /* Line 1455 of yacc.c */ -#line 6934 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6948 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 788: /* Line 1455 of yacc.c */ -#line 6938 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6952 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 789: /* Line 1455 of yacc.c */ -#line 6939 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6953 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 790: /* Line 1455 of yacc.c */ -#line 6944 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6958 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0)))) { @@ -25934,42 +25948,42 @@ case 791: /* Line 1455 of yacc.c */ -#line 6951 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6965 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)= &my_charset_bin; } break; case 792: /* Line 1455 of yacc.c */ -#line 6955 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6969 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 793: /* Line 1455 of yacc.c */ -#line 6956 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6970 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=NULL; } break; case 794: /* Line 1455 of yacc.c */ -#line 6960 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)= NULL; } break; case 795: /* Line 1455 of yacc.c */ -#line 6961 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6975 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)= (yyvsp[(2) - (2)].charset); } break; case 796: /* Line 1455 of yacc.c */ -#line 6966 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6980 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.charset)=get_charset_by_csname((yyvsp[(1) - (1)].lex_str).str,MY_CS_PRIMARY,MYF(0))) && !((yyval.charset)=get_old_charset_by_name((yyvsp[(1) - (1)].lex_str).str))) @@ -25983,28 +25997,28 @@ case 797: /* Line 1455 of yacc.c */ -#line 6974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6988 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)= &my_charset_bin; } break; case 798: /* Line 1455 of yacc.c */ -#line 6978 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6992 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 799: /* Line 1455 of yacc.c */ -#line 6979 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6993 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=NULL; } break; case 800: /* Line 1455 of yacc.c */ -#line 6984 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 6998 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.charset)= mysqld_collation_get_by_name((yyvsp[(1) - (1)].lex_str).str))) MYSQL_YYABORT; @@ -26014,56 +26028,56 @@ case 801: /* Line 1455 of yacc.c */ -#line 6991 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7005 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=NULL; } break; case 802: /* Line 1455 of yacc.c */ -#line 6992 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7006 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=(yyvsp[(2) - (2)].charset); } break; case 803: /* Line 1455 of yacc.c */ -#line 6996 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7010 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=(yyvsp[(1) - (1)].charset); } break; case 804: /* Line 1455 of yacc.c */ -#line 6997 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7011 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.charset)=NULL; } break; case 805: /* Line 1455 of yacc.c */ -#line 7001 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7015 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 806: /* Line 1455 of yacc.c */ -#line 7002 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7016 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 807: /* Line 1455 of yacc.c */ -#line 7007 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7021 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset= &my_charset_latin1; } break; case 808: /* Line 1455 of yacc.c */ -#line 7009 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7023 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset= &my_charset_latin1_bin; } @@ -26072,7 +26086,7 @@ case 809: /* Line 1455 of yacc.c */ -#line 7013 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset= &my_charset_latin1_bin; } @@ -26081,7 +26095,7 @@ case 810: /* Line 1455 of yacc.c */ -#line 7020 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7034 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!(Lex->charset=get_charset_by_csname("ucs2", MY_CS_PRIMARY,MYF(0)))) @@ -26095,7 +26109,7 @@ case 811: /* Line 1455 of yacc.c */ -#line 7029 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7043 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!(Lex->charset= mysqld_collation_get_by_name("ucs2_bin"))) MYSQL_YYABORT; @@ -26105,7 +26119,7 @@ case 812: /* Line 1455 of yacc.c */ -#line 7034 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7048 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!(Lex->charset= mysqld_collation_get_by_name("ucs2_bin"))) my_error(ER_UNKNOWN_COLLATION, MYF(0), "ucs2_bin"); @@ -26115,28 +26129,28 @@ case 813: /* Line 1455 of yacc.c */ -#line 7041 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7055 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=NULL; } break; case 816: /* Line 1455 of yacc.c */ -#line 7044 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7058 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=&my_charset_bin; } break; case 817: /* Line 1455 of yacc.c */ -#line 7045 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7059 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset=(yyvsp[(2) - (3)].charset); } break; case 818: /* Line 1455 of yacc.c */ -#line 7047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7061 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset= NULL; Lex->type|= BINCMP_FLAG; @@ -26146,7 +26160,7 @@ case 819: /* Line 1455 of yacc.c */ -#line 7052 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7066 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->charset= (yyvsp[(3) - (3)].charset); Lex->type|= BINCMP_FLAG; @@ -26156,21 +26170,21 @@ case 820: /* Line 1455 of yacc.c */ -#line 7059 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7073 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 821: /* Line 1455 of yacc.c */ -#line 7060 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7074 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= BINCMP_FLAG; } break; case 822: /* Line 1455 of yacc.c */ -#line 7065 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7079 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(2) - (2)].ulong_num) == 0) { @@ -26183,63 +26197,63 @@ case 823: /* Line 1455 of yacc.c */ -#line 7073 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7087 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(2) - (4)].ulong_num); } break; case 824: /* Line 1455 of yacc.c */ -#line 7077 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7091 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= 0; } break; case 825: /* Line 1455 of yacc.c */ -#line 7078 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7092 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= 1 << MY_STRXFRM_DESC_SHIFT; } break; case 826: /* Line 1455 of yacc.c */ -#line 7082 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7096 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= 1 << MY_STRXFRM_REVERSE_SHIFT; } break; case 827: /* Line 1455 of yacc.c */ -#line 7085 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7099 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= 0; } break; case 828: /* Line 1455 of yacc.c */ -#line 7086 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7100 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); } break; case 829: /* Line 1455 of yacc.c */ -#line 7087 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7101 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(1) - (2)].ulong_num) | (yyvsp[(2) - (2)].ulong_num); } break; case 830: /* Line 1455 of yacc.c */ -#line 7088 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7102 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num) ; } break; case 831: /* Line 1455 of yacc.c */ -#line 7093 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7107 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num) < 1 ? 1 : ((yyvsp[(1) - (1)].ulong_num) > MY_STRXFRM_NLEVELS ? MY_STRXFRM_NLEVELS : (yyvsp[(1) - (1)].ulong_num)); (yyval.ulong_num)--; @@ -26249,7 +26263,7 @@ case 832: /* Line 1455 of yacc.c */ -#line 7101 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7115 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (1 | (yyvsp[(2) - (2)].ulong_num)) << (yyvsp[(1) - (2)].ulong_num); } @@ -26258,21 +26272,21 @@ case 833: /* Line 1455 of yacc.c */ -#line 7107 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7121 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); } break; case 834: /* Line 1455 of yacc.c */ -#line 7108 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)|= (yyvsp[(3) - (3)].ulong_num); } break; case 835: /* Line 1455 of yacc.c */ -#line 7113 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7127 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { uint start= (yyvsp[(1) - (3)].ulong_num); uint end= (yyvsp[(3) - (3)].ulong_num); @@ -26284,35 +26298,35 @@ case 836: /* Line 1455 of yacc.c */ -#line 7122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7136 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); } break; case 837: /* Line 1455 of yacc.c */ -#line 7123 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7137 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(1) - (1)].ulong_num); } break; case 838: /* Line 1455 of yacc.c */ -#line 7127 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7141 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= 0; } break; case 839: /* Line 1455 of yacc.c */ -#line 7128 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7142 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (yyvsp[(2) - (2)].ulong_num); } break; case 842: /* Line 1455 of yacc.c */ -#line 7142 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7156 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table)=(yyvsp[(2) - (5)].table); } @@ -26321,14 +26335,14 @@ case 843: /* Line 1455 of yacc.c */ -#line 7149 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7163 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ref_list.empty(); } break; case 845: /* Line 1455 of yacc.c */ -#line 7155 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7169 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Key_part_spec *key= new Key_part_spec((yyvsp[(3) - (3)].lex_str), 0); if (key == NULL) @@ -26340,7 +26354,7 @@ case 846: /* Line 1455 of yacc.c */ -#line 7162 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7176 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Key_part_spec *key= new Key_part_spec((yyvsp[(1) - (1)].lex_str), 0); if (key == NULL) @@ -26354,35 +26368,35 @@ case 847: /* Line 1455 of yacc.c */ -#line 7174 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7188 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->fk_match_option= Foreign_key::FK_MATCH_UNDEF; } break; case 848: /* Line 1455 of yacc.c */ -#line 7176 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7190 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->fk_match_option= Foreign_key::FK_MATCH_FULL; } break; case 849: /* Line 1455 of yacc.c */ -#line 7178 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7192 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->fk_match_option= Foreign_key::FK_MATCH_PARTIAL; } break; case 850: /* Line 1455 of yacc.c */ -#line 7180 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7194 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; } break; case 851: /* Line 1455 of yacc.c */ -#line 7185 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7199 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF; @@ -26393,7 +26407,7 @@ case 852: /* Line 1455 of yacc.c */ -#line 7191 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7205 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->fk_update_opt= (yyvsp[(3) - (3)].m_fk_option); @@ -26404,7 +26418,7 @@ case 853: /* Line 1455 of yacc.c */ -#line 7197 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7211 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->fk_update_opt= Foreign_key::FK_OPTION_UNDEF; @@ -26415,7 +26429,7 @@ case 854: /* Line 1455 of yacc.c */ -#line 7204 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7218 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->fk_update_opt= (yyvsp[(3) - (6)].m_fk_option); @@ -26426,7 +26440,7 @@ case 855: /* Line 1455 of yacc.c */ -#line 7211 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7225 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->fk_update_opt= (yyvsp[(6) - (6)].m_fk_option); @@ -26437,112 +26451,112 @@ case 856: /* Line 1455 of yacc.c */ -#line 7219 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7233 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_fk_option)= Foreign_key::FK_OPTION_RESTRICT; } break; case 857: /* Line 1455 of yacc.c */ -#line 7220 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7234 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_fk_option)= Foreign_key::FK_OPTION_CASCADE; } break; case 858: /* Line 1455 of yacc.c */ -#line 7221 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7235 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_fk_option)= Foreign_key::FK_OPTION_SET_NULL; } break; case 859: /* Line 1455 of yacc.c */ -#line 7222 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7236 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_fk_option)= Foreign_key::FK_OPTION_NO_ACTION; } break; case 860: /* Line 1455 of yacc.c */ -#line 7223 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_fk_option)= Foreign_key::FK_OPTION_DEFAULT; } break; case 861: /* Line 1455 of yacc.c */ -#line 7227 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7241 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= Key::MULTIPLE; } break; case 862: /* Line 1455 of yacc.c */ -#line 7231 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7245 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= Key::PRIMARY; } break; case 863: /* Line 1455 of yacc.c */ -#line 7232 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7246 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= (yyvsp[(1) - (2)].key_type); } break; case 864: /* Line 1455 of yacc.c */ -#line 7237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7251 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 865: /* Line 1455 of yacc.c */ -#line 7238 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7252 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 866: /* Line 1455 of yacc.c */ -#line 7242 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 868: /* Line 1455 of yacc.c */ -#line 7247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7261 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 869: /* Line 1455 of yacc.c */ -#line 7248 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7262 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 870: /* Line 1455 of yacc.c */ -#line 7249 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7263 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 871: /* Line 1455 of yacc.c */ -#line 7253 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7267 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= Key::MULTIPLE; } break; case 873: /* Line 1455 of yacc.c */ -#line 7259 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7273 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= (enum Key::Keytype)((yyvsp[(1) - (1)].key_type) | Key::MULTIPLE); } @@ -26551,7 +26565,7 @@ case 874: /* Line 1455 of yacc.c */ -#line 7263 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7277 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= (yyvsp[(1) - (1)].key_type); } @@ -26560,7 +26574,7 @@ case 875: /* Line 1455 of yacc.c */ -#line 7270 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7284 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= (yyvsp[(1) - (1)].key_type); } @@ -26569,7 +26583,7 @@ case 876: /* Line 1455 of yacc.c */ -#line 7274 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7288 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= (enum Key::Keytype)((yyvsp[(1) - (2)].key_type) | (yyvsp[(2) - (2)].key_type)); } @@ -26578,7 +26592,7 @@ case 877: /* Line 1455 of yacc.c */ -#line 7278 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7292 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= (enum Key::Keytype)((yyvsp[(1) - (2)].key_type) | (yyvsp[(2) - (2)].key_type)); } @@ -26587,28 +26601,28 @@ case 878: /* Line 1455 of yacc.c */ -#line 7284 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= Key::UNIQUE; } break; case 879: /* Line 1455 of yacc.c */ -#line 7288 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7302 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= Key::CLUSTERING; } break; case 880: /* Line 1455 of yacc.c */ -#line 7292 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7306 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_type)= Key::FULLTEXT;} break; case 881: /* Line 1455 of yacc.c */ -#line 7297 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7311 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { #ifdef HAVE_SPATIAL (yyval.key_type)= Key::SPATIAL; @@ -26623,7 +26637,7 @@ case 882: /* Line 1455 of yacc.c */ -#line 7309 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7323 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->key_create_info= default_key_create_info; } @@ -26632,56 +26646,56 @@ case 885: /* Line 1455 of yacc.c */ -#line 7326 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7340 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 887: /* Line 1455 of yacc.c */ -#line 7331 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7345 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 889: /* Line 1455 of yacc.c */ -#line 7336 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7350 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 897: /* Line 1455 of yacc.c */ -#line 7356 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->key_create_info.algorithm= (yyvsp[(2) - (2)].key_alg); } break; case 898: /* Line 1455 of yacc.c */ -#line 7357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7371 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->key_create_info.algorithm= (yyvsp[(2) - (2)].key_alg); } break; case 899: /* Line 1455 of yacc.c */ -#line 7362 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->key_create_info.block_size= (yyvsp[(3) - (3)].ulong_num); } break; case 900: /* Line 1455 of yacc.c */ -#line 7363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->key_create_info.comment= (yyvsp[(2) - (2)].lex_str); } break; case 905: /* Line 1455 of yacc.c */ -#line 7378 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7392 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (plugin_is_ready(&(yyvsp[(3) - (3)].lex_str), MYSQL_FTPARSER_PLUGIN)) Lex->key_create_info.parser_name= (yyvsp[(3) - (3)].lex_str); @@ -26696,42 +26710,42 @@ case 906: /* Line 1455 of yacc.c */ -#line 7390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_alg)= HA_KEY_ALG_BTREE; } break; case 907: /* Line 1455 of yacc.c */ -#line 7391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7405 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_alg)= HA_KEY_ALG_RTREE; } break; case 908: /* Line 1455 of yacc.c */ -#line 7392 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7406 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_alg)= HA_KEY_ALG_HASH; } break; case 909: /* Line 1455 of yacc.c */ -#line 7396 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7410 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->col_list.push_back((yyvsp[(3) - (4)].key_part)); } break; case 910: /* Line 1455 of yacc.c */ -#line 7397 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7411 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->col_list.push_back((yyvsp[(1) - (2)].key_part)); } break; case 911: /* Line 1455 of yacc.c */ -#line 7402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7416 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.key_part)= new Key_part_spec((yyvsp[(1) - (1)].lex_str), 0); if ((yyval.key_part) == NULL) @@ -26742,7 +26756,7 @@ case 912: /* Line 1455 of yacc.c */ -#line 7408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7422 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int key_part_len= atoi((yyvsp[(3) - (4)].lex_str).str); if (!key_part_len) @@ -26758,49 +26772,49 @@ case 913: /* Line 1455 of yacc.c */ -#line 7421 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= null_lex_str; } break; case 914: /* Line 1455 of yacc.c */ -#line 7422 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7436 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 915: /* Line 1455 of yacc.c */ -#line 7426 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7440 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= null_lex_str; } break; case 916: /* Line 1455 of yacc.c */ -#line 7427 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7441 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(2) - (2)].lex_str); } break; case 917: /* Line 1455 of yacc.c */ -#line 7431 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7445 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->interval_list.push_back((yyvsp[(1) - (1)].string)); } break; case 918: /* Line 1455 of yacc.c */ -#line 7432 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->interval_list.push_back((yyvsp[(3) - (3)].string)); } break; case 919: /* Line 1455 of yacc.c */ -#line 7440 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7454 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26838,7 +26852,7 @@ case 920: /* Line 1455 of yacc.c */ -#line 7473 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7487 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -26855,7 +26869,7 @@ case 921: /* Line 1455 of yacc.c */ -#line 7485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -26865,7 +26879,7 @@ case 922: /* Line 1455 of yacc.c */ -#line 7490 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; @@ -26879,7 +26893,7 @@ case 923: /* Line 1455 of yacc.c */ -#line 7499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7513 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->sphead) @@ -26895,7 +26909,7 @@ case 924: /* Line 1455 of yacc.c */ -#line 7510 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7524 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -26911,7 +26925,7 @@ case 925: /* Line 1455 of yacc.c */ -#line 7521 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7535 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; @@ -26923,7 +26937,7 @@ case 926: /* Line 1455 of yacc.c */ -#line 7528 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7542 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -26939,7 +26953,7 @@ case 927: /* Line 1455 of yacc.c */ -#line 7539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7553 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; @@ -26951,7 +26965,7 @@ case 928: /* Line 1455 of yacc.c */ -#line 7546 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -26967,14 +26981,14 @@ case 929: /* Line 1455 of yacc.c */ -#line 7557 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 930: /* Line 1455 of yacc.c */ -#line 7564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -26991,14 +27005,14 @@ case 931: /* Line 1455 of yacc.c */ -#line 7576 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7590 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 932: /* Line 1455 of yacc.c */ -#line 7578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* It is safe to use Lex->spname because @@ -27022,7 +27036,7 @@ case 933: /* Line 1455 of yacc.c */ -#line 7601 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7615 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyvsp[(7) - (11)].num) || (yyvsp[(8) - (11)].num) || (yyvsp[(9) - (11)].num) || (yyvsp[(10) - (11)].num) || (yyvsp[(11) - (11)].num))) { @@ -27043,7 +27057,7 @@ case 934: /* Line 1455 of yacc.c */ -#line 7617 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7631 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_cmd_type= ALTER_TABLESPACE; @@ -27053,7 +27067,7 @@ case 935: /* Line 1455 of yacc.c */ -#line 7622 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_cmd_type= ALTER_LOGFILE_GROUP; @@ -27063,7 +27077,7 @@ case 936: /* Line 1455 of yacc.c */ -#line 7627 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7641 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_cmd_type= CHANGE_FILE_TABLESPACE; @@ -27073,7 +27087,7 @@ case 937: /* Line 1455 of yacc.c */ -#line 7632 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7646 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_cmd_type= ALTER_ACCESS_MODE_TABLESPACE; @@ -27083,7 +27097,7 @@ case 938: /* Line 1455 of yacc.c */ -#line 7637 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_ALTER_SERVER; @@ -27095,7 +27109,7 @@ case 939: /* Line 1455 of yacc.c */ -#line 7644 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7658 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_ALTER_USER; } @@ -27104,7 +27118,7 @@ case 940: /* Line 1455 of yacc.c */ -#line 7651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user))) MYSQL_YYABORT; @@ -27114,7 +27128,7 @@ case 941: /* Line 1455 of yacc.c */ -#line 7656 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7670 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user))) MYSQL_YYABORT; @@ -27124,42 +27138,42 @@ case 942: /* Line 1455 of yacc.c */ -#line 7663 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7677 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0;} break; case 943: /* Line 1455 of yacc.c */ -#line 7664 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7678 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 944: /* Line 1455 of yacc.c */ -#line 7665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 945: /* Line 1455 of yacc.c */ -#line 7666 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7680 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 946: /* Line 1455 of yacc.c */ -#line 7670 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0;} break; case 947: /* Line 1455 of yacc.c */ -#line 7672 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7686 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Use lex's spname to hold the new name. @@ -27173,35 +27187,35 @@ case 948: /* Line 1455 of yacc.c */ -#line 7683 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0;} break; case 949: /* Line 1455 of yacc.c */ -#line 7684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 950: /* Line 1455 of yacc.c */ -#line 7688 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7702 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str).str= 0; (yyval.lex_str).length= 0; } break; case 951: /* Line 1455 of yacc.c */ -#line 7689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 953: /* Line 1455 of yacc.c */ -#line 7695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->m_sql_cmd= new (YYTHD->mem_root) Sql_cmd_discard_import_tablespace( @@ -27214,7 +27228,7 @@ case 954: /* Line 1455 of yacc.c */ -#line 7703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->m_sql_cmd= new (YYTHD->mem_root) Sql_cmd_discard_import_tablespace( @@ -27227,7 +27241,7 @@ case 960: /* Line 1455 of yacc.c */ -#line 7725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7739 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_DROP_PARTITION; } @@ -27236,7 +27250,7 @@ case 961: /* Line 1455 of yacc.c */ -#line 7730 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7744 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_info.flags|= Alter_info::ALTER_REBUILD_PARTITION; @@ -27247,7 +27261,7 @@ case 962: /* Line 1455 of yacc.c */ -#line 7737 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7751 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27264,7 +27278,7 @@ case 964: /* Line 1455 of yacc.c */ -#line 7751 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7765 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27281,7 +27295,7 @@ case 965: /* Line 1455 of yacc.c */ -#line 7763 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7777 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27297,7 +27311,7 @@ case 967: /* Line 1455 of yacc.c */ -#line 7776 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7790 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27314,7 +27328,7 @@ case 969: /* Line 1455 of yacc.c */ -#line 7789 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7803 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_info.flags|= Alter_info::ALTER_COALESCE_PARTITION; @@ -27326,7 +27340,7 @@ case 970: /* Line 1455 of yacc.c */ -#line 7796 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7810 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27342,7 +27356,7 @@ case 972: /* Line 1455 of yacc.c */ -#line 7809 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7823 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -27371,7 +27385,7 @@ case 973: /* Line 1455 of yacc.c */ -#line 7836 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7850 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_REMOVE_PARTITIONING; } @@ -27380,7 +27394,7 @@ case 974: /* Line 1455 of yacc.c */ -#line 7843 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7857 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_ALL_PARTITION; } @@ -27389,7 +27403,7 @@ case 976: /* Line 1455 of yacc.c */ -#line 7851 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7865 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->part_info= new partition_info(); @@ -27406,14 +27420,14 @@ case 977: /* Line 1455 of yacc.c */ -#line 7863 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7877 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 979: /* Line 1455 of yacc.c */ -#line 7869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->part_info->num_parts= lex->part_info->partitions.elements; @@ -27423,7 +27437,7 @@ case 980: /* Line 1455 of yacc.c */ -#line 7874 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7888 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->part_info->num_parts= (yyvsp[(2) - (2)].ulong_num); } @@ -27432,7 +27446,7 @@ case 981: /* Line 1455 of yacc.c */ -#line 7881 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7895 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->part_info= new partition_info(); @@ -27448,7 +27462,7 @@ case 983: /* Line 1455 of yacc.c */ -#line 7896 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7910 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_TABLE_REORG; } @@ -27457,7 +27471,7 @@ case 984: /* Line 1455 of yacc.c */ -#line 7900 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7914 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_REORGANIZE_PARTITION; } @@ -27466,7 +27480,7 @@ case 985: /* Line 1455 of yacc.c */ -#line 7904 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { partition_info *part_info= Lex->part_info; part_info->num_parts= part_info->partitions.elements; @@ -27476,21 +27490,21 @@ case 986: /* Line 1455 of yacc.c */ -#line 7911 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7925 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 987: /* Line 1455 of yacc.c */ -#line 7912 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7926 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 988: /* Line 1455 of yacc.c */ -#line 7917 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7931 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->alter_info.partition_names.push_back((yyvsp[(1) - (1)].lex_str).str)) { @@ -27503,7 +27517,7 @@ case 991: /* Line 1455 of yacc.c */ -#line 7937 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7951 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->change=0; @@ -27514,7 +27528,7 @@ case 992: /* Line 1455 of yacc.c */ -#line 7946 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7960 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_last_non_select_table= Lex->last_table(); } @@ -27523,7 +27537,7 @@ case 993: /* Line 1455 of yacc.c */ -#line 7950 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7964 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_last_non_select_table= Lex->last_table(); Lex->alter_info.flags|= Alter_info::ALTER_ADD_INDEX; @@ -27533,7 +27547,7 @@ case 994: /* Line 1455 of yacc.c */ -#line 7955 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7969 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_ADD_COLUMN | Alter_info::ALTER_ADD_INDEX; @@ -27543,7 +27557,7 @@ case 995: /* Line 1455 of yacc.c */ -#line 7960 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->change= (yyvsp[(3) - (3)].lex_str).str; @@ -27554,7 +27568,7 @@ case 996: /* Line 1455 of yacc.c */ -#line 7966 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7980 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_last_non_select_table= Lex->last_table(); } @@ -27563,7 +27577,7 @@ case 997: /* Line 1455 of yacc.c */ -#line 7970 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7984 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->length=lex->dec=0; lex->type=0; @@ -27578,7 +27592,7 @@ case 998: /* Line 1455 of yacc.c */ -#line 7980 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 7994 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (add_field_to_list(lex->thd,&(yyvsp[(3) - (6)].lex_str), @@ -27595,7 +27609,7 @@ case 999: /* Line 1455 of yacc.c */ -#line 7992 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8006 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_last_non_select_table= Lex->last_table(); } @@ -27604,7 +27618,7 @@ case 1000: /* Line 1455 of yacc.c */ -#line 7996 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8010 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Alter_drop *ad= new Alter_drop(Alter_drop::COLUMN, (yyvsp[(3) - (4)].lex_str).str); @@ -27618,7 +27632,7 @@ case 1001: /* Line 1455 of yacc.c */ -#line 8005 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8019 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Alter_drop *ad= new Alter_drop(Alter_drop::FOREIGN_KEY, (yyvsp[(4) - (4)].lex_str).str); @@ -27632,7 +27646,7 @@ case 1002: /* Line 1455 of yacc.c */ -#line 8014 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8028 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Alter_drop *ad= new Alter_drop(Alter_drop::KEY, primary_key_name); @@ -27646,7 +27660,7 @@ case 1003: /* Line 1455 of yacc.c */ -#line 8023 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8037 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Alter_drop *ad= new Alter_drop(Alter_drop::KEY, (yyvsp[(3) - (3)].lex_str).str); @@ -27660,7 +27674,7 @@ case 1004: /* Line 1455 of yacc.c */ -#line 8032 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8046 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= Alter_info::DISABLE; @@ -27671,7 +27685,7 @@ case 1005: /* Line 1455 of yacc.c */ -#line 8038 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8052 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.keys_onoff= Alter_info::ENABLE; @@ -27682,7 +27696,7 @@ case 1006: /* Line 1455 of yacc.c */ -#line 8044 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8058 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Alter_column *ac= new Alter_column((yyvsp[(3) - (6)].lex_str).str,(yyvsp[(6) - (6)].item)); @@ -27696,7 +27710,7 @@ case 1007: /* Line 1455 of yacc.c */ -#line 8053 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8067 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Alter_column *ac= new Alter_column((yyvsp[(3) - (5)].lex_str).str, (Item*) 0); @@ -27710,7 +27724,7 @@ case 1008: /* Line 1455 of yacc.c */ -#line 8062 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8076 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; size_t dummy; @@ -27743,7 +27757,7 @@ case 1009: /* Line 1455 of yacc.c */ -#line 8090 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8104 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!(yyvsp[(4) - (5)].charset)) { @@ -27769,7 +27783,7 @@ case 1010: /* Line 1455 of yacc.c */ -#line 8111 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8125 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= Alter_info::ALTER_OPTIONS; @@ -27784,7 +27798,7 @@ case 1011: /* Line 1455 of yacc.c */ -#line 8121 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_RECREATE; } @@ -27793,7 +27807,7 @@ case 1012: /* Line 1455 of yacc.c */ -#line 8125 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8139 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->alter_info.flags|= Alter_info::ALTER_ORDER; @@ -27803,7 +27817,7 @@ case 1020: /* Line 1455 of yacc.c */ -#line 8142 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8156 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.requested_algorithm= Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT; @@ -27813,7 +27827,7 @@ case 1021: /* Line 1455 of yacc.c */ -#line 8147 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8161 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->alter_info.set_requested_algorithm(&(yyvsp[(3) - (3)].lex_str))) { @@ -27826,7 +27840,7 @@ case 1022: /* Line 1455 of yacc.c */ -#line 8158 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8172 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.requested_lock= Alter_info::ALTER_TABLE_LOCK_DEFAULT; @@ -27836,7 +27850,7 @@ case 1023: /* Line 1455 of yacc.c */ -#line 8163 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->alter_info.set_requested_lock(&(yyvsp[(3) - (3)].lex_str))) { @@ -27849,63 +27863,63 @@ case 1024: /* Line 1455 of yacc.c */ -#line 8173 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8187 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1025: /* Line 1455 of yacc.c */ -#line 8174 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8188 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1026: /* Line 1455 of yacc.c */ -#line 8178 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8192 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ignore= 0;} break; case 1027: /* Line 1455 of yacc.c */ -#line 8179 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ignore= 1;} break; case 1028: /* Line 1455 of yacc.c */ -#line 8183 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8197 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->drop_mode= DROP_DEFAULT; } break; case 1029: /* Line 1455 of yacc.c */ -#line 8184 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8198 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->drop_mode= DROP_RESTRICT; } break; case 1030: /* Line 1455 of yacc.c */ -#line 8185 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8199 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->drop_mode= DROP_CASCADE; } break; case 1031: /* Line 1455 of yacc.c */ -#line 8189 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8203 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1032: /* Line 1455 of yacc.c */ -#line 8191 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8205 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { store_position_for_column((yyvsp[(2) - (2)].lex_str).str); Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER; @@ -27915,7 +27929,7 @@ case 1033: /* Line 1455 of yacc.c */ -#line 8196 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8210 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { store_position_for_column(first_keyword); Lex->alter_info.flags |= Alter_info::ALTER_COLUMN_ORDER; @@ -27925,35 +27939,35 @@ case 1034: /* Line 1455 of yacc.c */ -#line 8203 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8217 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1035: /* Line 1455 of yacc.c */ -#line 8204 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8218 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1036: /* Line 1455 of yacc.c */ -#line 8205 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8219 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1037: /* Line 1455 of yacc.c */ -#line 8206 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8220 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1038: /* Line 1455 of yacc.c */ -#line 8211 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8225 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; /* Clean previous slave connection values */ @@ -27969,7 +27983,7 @@ case 1039: /* Line 1455 of yacc.c */ -#line 8223 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* It is not possible to set user's information when @@ -27991,7 +28005,7 @@ case 1040: /* Line 1455 of yacc.c */ -#line 8240 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8254 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_SLAVE_STOP; @@ -28003,7 +28017,7 @@ case 1041: /* Line 1455 of yacc.c */ -#line 8250 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8264 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_BEGIN; @@ -28021,7 +28035,7 @@ case 1042: /* Line 1455 of yacc.c */ -#line 8266 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8280 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } @@ -28030,7 +28044,7 @@ case 1043: /* Line 1455 of yacc.c */ -#line 8270 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8284 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (1)].num); } @@ -28039,7 +28053,7 @@ case 1044: /* Line 1455 of yacc.c */ -#line 8277 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8291 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (1)].num); } @@ -28048,7 +28062,7 @@ case 1045: /* Line 1455 of yacc.c */ -#line 8281 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8295 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (3)].num) | (yyvsp[(3) - (3)].num); } @@ -28057,7 +28071,7 @@ case 1046: /* Line 1455 of yacc.c */ -#line 8288 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8302 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; } @@ -28066,7 +28080,7 @@ case 1047: /* Line 1455 of yacc.c */ -#line 8292 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8306 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; Lex->value_list.empty(); @@ -28077,7 +28091,7 @@ case 1048: /* Line 1455 of yacc.c */ -#line 8298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8312 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_START_TRANS_OPT_READ_ONLY; } @@ -28086,7 +28100,7 @@ case 1049: /* Line 1455 of yacc.c */ -#line 8302 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8316 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= MYSQL_START_TRANS_OPT_READ_WRITE; } @@ -28095,7 +28109,7 @@ case 1051: /* Line 1455 of yacc.c */ -#line 8313 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8327 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* empty */ } @@ -28104,7 +28118,7 @@ case 1052: /* Line 1455 of yacc.c */ -#line 8317 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8331 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->slave_connection.user= (yyvsp[(3) - (3)].lex_str).str; } @@ -28113,7 +28127,7 @@ case 1053: /* Line 1455 of yacc.c */ -#line 8323 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* empty */ } @@ -28122,7 +28136,7 @@ case 1054: /* Line 1455 of yacc.c */ -#line 8327 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8341 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->slave_connection.password= (yyvsp[(3) - (3)].lex_str).str; Lex->contains_plaintext_password= true; @@ -28132,7 +28146,7 @@ case 1055: /* Line 1455 of yacc.c */ -#line 8333 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8347 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* empty */ } @@ -28141,7 +28155,7 @@ case 1056: /* Line 1455 of yacc.c */ -#line 8337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8351 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->slave_connection.plugin_auth= (yyvsp[(3) - (3)].lex_str).str; } @@ -28150,7 +28164,7 @@ case 1057: /* Line 1455 of yacc.c */ -#line 8343 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* empty */ } @@ -28159,7 +28173,7 @@ case 1058: /* Line 1455 of yacc.c */ -#line 8347 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8361 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->slave_connection.plugin_dir= (yyvsp[(3) - (3)].lex_str).str; } @@ -28168,7 +28182,7 @@ case 1059: /* Line 1455 of yacc.c */ -#line 8354 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8368 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } @@ -28177,7 +28191,7 @@ case 1060: /* Line 1455 of yacc.c */ -#line 8358 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8372 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (1)].num); } @@ -28186,7 +28200,7 @@ case 1061: /* Line 1455 of yacc.c */ -#line 8365 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8379 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (1)].num); } @@ -28195,7 +28209,7 @@ case 1062: /* Line 1455 of yacc.c */ -#line 8369 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8383 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (3)].num) | (yyvsp[(3) - (3)].num); } @@ -28204,7 +28218,7 @@ case 1063: /* Line 1455 of yacc.c */ -#line 8376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= SLAVE_SQL; } @@ -28213,7 +28227,7 @@ case 1064: /* Line 1455 of yacc.c */ -#line 8380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= SLAVE_IO; } @@ -28222,14 +28236,14 @@ case 1065: /* Line 1455 of yacc.c */ -#line 8386 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8400 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1066: /* Line 1455 of yacc.c */ -#line 8388 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (((lex->mi.log_file_name || lex->mi.pos) && @@ -28256,7 +28270,7 @@ case 1069: /* Line 1455 of yacc.c */ -#line 8415 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8429 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.gtid= (yyvsp[(3) - (3)].lex_str).str; Lex->mi.gtid_until_condition= LEX_MASTER_INFO::UNTIL_SQL_BEFORE_GTIDS; @@ -28266,7 +28280,7 @@ case 1070: /* Line 1455 of yacc.c */ -#line 8420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8434 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.gtid= (yyvsp[(3) - (3)].lex_str).str; Lex->mi.gtid_until_condition= LEX_MASTER_INFO::UNTIL_SQL_AFTER_GTIDS; @@ -28276,7 +28290,7 @@ case 1071: /* Line 1455 of yacc.c */ -#line 8425 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8439 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.until_after_gaps= true; } @@ -28285,7 +28299,7 @@ case 1072: /* Line 1455 of yacc.c */ -#line 8432 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_CHECKSUM; @@ -28297,35 +28311,35 @@ case 1073: /* Line 1455 of yacc.c */ -#line 8439 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8453 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1074: /* Line 1455 of yacc.c */ -#line 8443 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8457 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags= 0; } break; case 1075: /* Line 1455 of yacc.c */ -#line 8444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags= T_QUICK; } break; case 1076: /* Line 1455 of yacc.c */ -#line 8445 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8459 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags= T_EXTEND; } break; case 1077: /* Line 1455 of yacc.c */ -#line 8450 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8464 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPAIR; @@ -28340,7 +28354,7 @@ case 1078: /* Line 1455 of yacc.c */ -#line 8460 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8474 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX* lex= thd->lex; @@ -28354,56 +28368,56 @@ case 1079: /* Line 1455 of yacc.c */ -#line 8471 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 1080: /* Line 1455 of yacc.c */ -#line 8472 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1081: /* Line 1455 of yacc.c */ -#line 8476 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8490 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1082: /* Line 1455 of yacc.c */ -#line 8477 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8491 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1083: /* Line 1455 of yacc.c */ -#line 8481 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8495 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 1084: /* Line 1455 of yacc.c */ -#line 8482 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8496 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 1085: /* Line 1455 of yacc.c */ -#line 8483 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_USEFRM; } break; case 1086: /* Line 1455 of yacc.c */ -#line 8488 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8502 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_ANALYZE; @@ -28418,7 +28432,7 @@ case 1087: /* Line 1455 of yacc.c */ -#line 8498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX* lex= thd->lex; @@ -28432,7 +28446,7 @@ case 1088: /* Line 1455 of yacc.c */ -#line 8510 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8524 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT; Lex->comment= (yyvsp[(2) - (2)].lex_str); @@ -28442,7 +28456,7 @@ case 1089: /* Line 1455 of yacc.c */ -#line 8518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8532 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; @@ -28462,7 +28476,7 @@ case 1090: /* Line 1455 of yacc.c */ -#line 8533 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX* lex= thd->lex; @@ -28476,77 +28490,77 @@ case 1091: /* Line 1455 of yacc.c */ -#line 8544 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8558 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags = T_MEDIUM; } break; case 1092: /* Line 1455 of yacc.c */ -#line 8545 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8559 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1093: /* Line 1455 of yacc.c */ -#line 8549 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8563 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1094: /* Line 1455 of yacc.c */ -#line 8550 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1095: /* Line 1455 of yacc.c */ -#line 8554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8568 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags|= T_QUICK; } break; case 1096: /* Line 1455 of yacc.c */ -#line 8555 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8569 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags|= T_FAST; } break; case 1097: /* Line 1455 of yacc.c */ -#line 8556 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8570 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags|= T_MEDIUM; } break; case 1098: /* Line 1455 of yacc.c */ -#line 8557 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags|= T_EXTEND; } break; case 1099: /* Line 1455 of yacc.c */ -#line 8558 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8572 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; } break; case 1100: /* Line 1455 of yacc.c */ -#line 8559 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; } break; case 1101: /* Line 1455 of yacc.c */ -#line 8564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_OPTIMIZE; @@ -28561,7 +28575,7 @@ case 1102: /* Line 1455 of yacc.c */ -#line 8574 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8588 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX* lex= thd->lex; @@ -28575,28 +28589,28 @@ case 1103: /* Line 1455 of yacc.c */ -#line 8585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8599 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 1104: /* Line 1455 of yacc.c */ -#line 8586 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8600 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 1105: /* Line 1455 of yacc.c */ -#line 8587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8601 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 1106: /* Line 1455 of yacc.c */ -#line 8592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8606 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_RENAME_TABLE; } @@ -28605,14 +28619,14 @@ case 1107: /* Line 1455 of yacc.c */ -#line 8596 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1108: /* Line 1455 of yacc.c */ -#line 8598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_RENAME_USER; } @@ -28621,7 +28635,7 @@ case 1109: /* Line 1455 of yacc.c */ -#line 8605 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8619 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (3)].lex_user)) || Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -28631,7 +28645,7 @@ case 1110: /* Line 1455 of yacc.c */ -#line 8610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8624 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (5)].lex_user)) || Lex->users_list.push_back((yyvsp[(5) - (5)].lex_user))) MYSQL_YYABORT; @@ -28641,7 +28655,7 @@ case 1113: /* Line 1455 of yacc.c */ -#line 8623 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8637 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sl= lex->current_select; @@ -28656,7 +28670,7 @@ case 1114: /* Line 1455 of yacc.c */ -#line 8636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8650 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.reset(); } @@ -28665,7 +28679,7 @@ case 1115: /* Line 1455 of yacc.c */ -#line 8640 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; @@ -28676,7 +28690,7 @@ case 1120: /* Line 1455 of yacc.c */ -#line 8659 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (2)].table), NULL, 0, TL_READ, MDL_SHARED_READ, @@ -28688,7 +28702,7 @@ case 1121: /* Line 1455 of yacc.c */ -#line 8669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8683 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), NULL, 0, TL_READ, MDL_SHARED_READ, @@ -28700,21 +28714,21 @@ case 1122: /* Line 1455 of yacc.c */ -#line 8678 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8692 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 1123: /* Line 1455 of yacc.c */ -#line 8679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str) = default_key_cache_base; } break; case 1124: /* Line 1455 of yacc.c */ -#line 8684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; @@ -28725,14 +28739,14 @@ case 1125: /* Line 1455 of yacc.c */ -#line 8690 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1130: /* Line 1455 of yacc.c */ -#line 8705 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (3)].table), NULL, (yyvsp[(3) - (3)].num), TL_READ, MDL_SHARED_READ, @@ -28744,7 +28758,7 @@ case 1131: /* Line 1455 of yacc.c */ -#line 8715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8729 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (4)].table), NULL, (yyvsp[(4) - (4)].num), TL_READ, MDL_SHARED_READ, @@ -28756,7 +28770,7 @@ case 1132: /* Line 1455 of yacc.c */ -#line 8725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8739 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->alter_info.flags|= Alter_info::ALTER_ADMIN_PARTITION; } @@ -28765,7 +28779,7 @@ case 1134: /* Line 1455 of yacc.c */ -#line 8732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8746 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->select_lex.alloc_index_hints(YYTHD); Select->set_index_hint_type(INDEX_HINT_USE, @@ -28778,28 +28792,28 @@ case 1136: /* Line 1455 of yacc.c */ -#line 8743 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8757 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 1138: /* Line 1455 of yacc.c */ -#line 8749 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8763 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 1139: /* Line 1455 of yacc.c */ -#line 8750 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8764 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TL_OPTION_IGNORE_LEAVES; } break; case 1140: /* Line 1455 of yacc.c */ -#line 8760 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8774 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -28809,7 +28823,7 @@ case 1143: /* Line 1455 of yacc.c */ -#line 8774 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8788 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (setup_select_in_parentheses(Lex)) MYSQL_YYABORT; @@ -28819,7 +28833,7 @@ case 1145: /* Line 1455 of yacc.c */ -#line 8784 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8798 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (setup_select_in_parentheses(Lex)) MYSQL_YYABORT; @@ -28829,7 +28843,7 @@ case 1147: /* Line 1455 of yacc.c */ -#line 8793 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8807 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -28850,7 +28864,7 @@ case 1149: /* Line 1455 of yacc.c */ -#line 8812 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8826 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -28863,7 +28877,7 @@ case 1150: /* Line 1455 of yacc.c */ -#line 8820 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8834 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= NO_MATTER; } @@ -28872,14 +28886,14 @@ case 1152: /* Line 1455 of yacc.c */ -#line 8827 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8841 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1157: /* Line 1455 of yacc.c */ -#line 8837 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8851 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->context.table_list= Select->context.first_name_resolution_table= @@ -28890,7 +28904,7 @@ case 1160: /* Line 1455 of yacc.c */ -#line 8852 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8866 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Select->options & SELECT_DISTINCT && Select->options & SELECT_ALL) { @@ -28903,7 +28917,7 @@ case 1164: /* Line 1455 of yacc.c */ -#line 8869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Allow this flag only on the first top-level SELECT statement, if @@ -28936,7 +28950,7 @@ case 1165: /* Line 1455 of yacc.c */ -#line 8897 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8911 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Allow this flag only on the first top-level SELECT statement, if @@ -28969,7 +28983,7 @@ case 1167: /* Line 1455 of yacc.c */ -#line 8929 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8943 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe) @@ -28983,7 +28997,7 @@ case 1168: /* Line 1455 of yacc.c */ -#line 8938 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8952 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe) @@ -28998,7 +29012,7 @@ case 1171: /* Line 1455 of yacc.c */ -#line 8953 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8967 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Item *item= new (thd->mem_root) @@ -29015,7 +29029,7 @@ case 1172: /* Line 1455 of yacc.c */ -#line 8968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8982 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; @@ -29027,7 +29041,7 @@ case 1173: /* Line 1455 of yacc.c */ -#line 8975 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 8989 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; DBUG_ASSERT((yyvsp[(1) - (4)].simple_string) < (yyvsp[(3) - (4)].simple_string)); @@ -29054,7 +29068,7 @@ case 1174: /* Line 1455 of yacc.c */ -#line 8999 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9013 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.simple_string)= (char*) YYLIP->get_cpp_tok_start(); } @@ -29063,7 +29077,7 @@ case 1175: /* Line 1455 of yacc.c */ -#line 9005 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9019 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.simple_string)= (char*) YYLIP->get_cpp_tok_end(); } @@ -29072,56 +29086,56 @@ case 1176: /* Line 1455 of yacc.c */ -#line 9011 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9025 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=null_lex_str;} break; case 1177: /* Line 1455 of yacc.c */ -#line 9012 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9026 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 1178: /* Line 1455 of yacc.c */ -#line 9013 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str); } break; case 1179: /* Line 1455 of yacc.c */ -#line 9014 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9028 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1180: /* Line 1455 of yacc.c */ -#line 9015 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9029 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 1181: /* Line 1455 of yacc.c */ -#line 9019 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9033 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1182: /* Line 1455 of yacc.c */ -#line 9020 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9034 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1183: /* Line 1455 of yacc.c */ -#line 9026 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9040 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Design notes: @@ -29177,7 +29191,7 @@ case 1184: /* Line 1455 of yacc.c */ -#line 9077 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9091 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* XOR is a proprietary extension */ (yyval.item) = new (YYTHD->mem_root) Item_func_xor((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); @@ -29189,7 +29203,7 @@ case 1185: /* Line 1455 of yacc.c */ -#line 9084 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9098 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* See comments in rule expr: expr or expr */ Item_cond_and *item1; @@ -29237,7 +29251,7 @@ case 1186: /* Line 1455 of yacc.c */ -#line 9127 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9141 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); if ((yyval.item) == NULL) @@ -29248,7 +29262,7 @@ case 1187: /* Line 1455 of yacc.c */ -#line 9133 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9147 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_istrue((yyvsp[(1) - (3)].item)); if ((yyval.item) == NULL) @@ -29259,7 +29273,7 @@ case 1188: /* Line 1455 of yacc.c */ -#line 9139 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9153 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnottrue((yyvsp[(1) - (4)].item)); if ((yyval.item) == NULL) @@ -29270,7 +29284,7 @@ case 1189: /* Line 1455 of yacc.c */ -#line 9145 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9159 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isfalse((yyvsp[(1) - (3)].item)); if ((yyval.item) == NULL) @@ -29281,7 +29295,7 @@ case 1190: /* Line 1455 of yacc.c */ -#line 9151 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9165 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnotfalse((yyvsp[(1) - (4)].item)); if ((yyval.item) == NULL) @@ -29292,7 +29306,7 @@ case 1191: /* Line 1455 of yacc.c */ -#line 9157 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9171 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnull((yyvsp[(1) - (3)].item)); if ((yyval.item) == NULL) @@ -29303,7 +29317,7 @@ case 1192: /* Line 1455 of yacc.c */ -#line 9163 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnotnull((yyvsp[(1) - (4)].item)); if ((yyval.item) == NULL) @@ -29314,7 +29328,7 @@ case 1194: /* Line 1455 of yacc.c */ -#line 9173 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9187 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnull((yyvsp[(1) - (3)].item)); if ((yyval.item) == NULL) @@ -29325,7 +29339,7 @@ case 1195: /* Line 1455 of yacc.c */ -#line 9179 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_isnotnull((yyvsp[(1) - (4)].item)); if ((yyval.item) == NULL) @@ -29336,7 +29350,7 @@ case 1196: /* Line 1455 of yacc.c */ -#line 9185 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9199 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_equal((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29347,7 +29361,7 @@ case 1197: /* Line 1455 of yacc.c */ -#line 9191 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9205 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (*(yyvsp[(2) - (3)].boolfunc2creator))(0)->create((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29358,7 +29372,7 @@ case 1198: /* Line 1455 of yacc.c */ -#line 9197 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9211 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= all_any_subquery_creator((yyvsp[(1) - (6)].item), (yyvsp[(2) - (6)].boolfunc2creator), (yyvsp[(3) - (6)].num), (yyvsp[(5) - (6)].select_lex)); if ((yyval.item) == NULL) @@ -29369,7 +29383,7 @@ case 1200: /* Line 1455 of yacc.c */ -#line 9207 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9221 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_in_subselect((yyvsp[(1) - (5)].item), (yyvsp[(4) - (5)].select_lex)); if ((yyval.item) == NULL) @@ -29380,7 +29394,7 @@ case 1201: /* Line 1455 of yacc.c */ -#line 9213 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9227 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Item *item= new (thd->mem_root) Item_in_subselect((yyvsp[(1) - (6)].item), (yyvsp[(5) - (6)].select_lex)); @@ -29395,7 +29409,7 @@ case 1202: /* Line 1455 of yacc.c */ -#line 9223 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (5)].item), true, (yyvsp[(4) - (5)].item)); if ((yyval.item) == NULL) @@ -29406,7 +29420,7 @@ case 1203: /* Line 1455 of yacc.c */ -#line 9229 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(4) - (7)].item)); (yyvsp[(6) - (7)].item_list)->push_front((yyvsp[(1) - (7)].item)); @@ -29419,7 +29433,7 @@ case 1204: /* Line 1455 of yacc.c */ -#line 9237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9251 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= handle_sql2003_note184_exception(YYTHD, (yyvsp[(1) - (6)].item), false, (yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -29430,7 +29444,7 @@ case 1205: /* Line 1455 of yacc.c */ -#line 9243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9257 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item)); (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(1) - (8)].item)); @@ -29445,7 +29459,7 @@ case 1206: /* Line 1455 of yacc.c */ -#line 9253 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9267 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_between((yyvsp[(1) - (5)].item),(yyvsp[(3) - (5)].item),(yyvsp[(5) - (5)].item)); if ((yyval.item) == NULL) @@ -29456,7 +29470,7 @@ case 1207: /* Line 1455 of yacc.c */ -#line 9259 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9273 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item_func_between *item; item= new (YYTHD->mem_root) Item_func_between((yyvsp[(1) - (6)].item),(yyvsp[(4) - (6)].item),(yyvsp[(6) - (6)].item)); @@ -29470,7 +29484,7 @@ case 1208: /* Line 1455 of yacc.c */ -#line 9268 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9282 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *item1= new (YYTHD->mem_root) Item_func_soundex((yyvsp[(1) - (4)].item)); Item *item4= new (YYTHD->mem_root) Item_func_soundex((yyvsp[(4) - (4)].item)); @@ -29485,7 +29499,7 @@ case 1209: /* Line 1455 of yacc.c */ -#line 9278 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9292 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_like((yyvsp[(1) - (4)].item),(yyvsp[(3) - (4)].item),(yyvsp[(4) - (4)].item),Lex->escape_used); if ((yyval.item) == NULL) @@ -29496,7 +29510,7 @@ case 1210: /* Line 1455 of yacc.c */ -#line 9284 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *item= new (YYTHD->mem_root) Item_func_like((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].item), Lex->escape_used); @@ -29511,7 +29525,7 @@ case 1211: /* Line 1455 of yacc.c */ -#line 9294 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9308 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_regex((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29522,7 +29536,7 @@ case 1212: /* Line 1455 of yacc.c */ -#line 9300 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9314 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *item= new (YYTHD->mem_root) Item_func_regex((yyvsp[(1) - (4)].item),(yyvsp[(4) - (4)].item)); if (item == NULL) @@ -29536,7 +29550,7 @@ case 1214: /* Line 1455 of yacc.c */ -#line 9313 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9327 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_bit_or((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29547,7 +29561,7 @@ case 1215: /* Line 1455 of yacc.c */ -#line 9319 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9333 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_bit_and((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29558,7 +29572,7 @@ case 1216: /* Line 1455 of yacc.c */ -#line 9325 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9339 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_shift_left((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29569,7 +29583,7 @@ case 1217: /* Line 1455 of yacc.c */ -#line 9331 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9345 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_shift_right((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29580,7 +29594,7 @@ case 1218: /* Line 1455 of yacc.c */ -#line 9337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9351 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_plus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29591,7 +29605,7 @@ case 1219: /* Line 1455 of yacc.c */ -#line 9343 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_minus((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29602,7 +29616,7 @@ case 1220: /* Line 1455 of yacc.c */ -#line 9349 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].interval),0); if ((yyval.item) == NULL) @@ -29613,7 +29627,7 @@ case 1221: /* Line 1455 of yacc.c */ -#line 9355 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9369 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(1) - (5)].item),(yyvsp[(4) - (5)].item),(yyvsp[(5) - (5)].interval),1); if ((yyval.item) == NULL) @@ -29624,7 +29638,7 @@ case 1222: /* Line 1455 of yacc.c */ -#line 9361 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9375 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_mul((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29635,7 +29649,7 @@ case 1223: /* Line 1455 of yacc.c */ -#line 9367 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9381 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29646,7 +29660,7 @@ case 1224: /* Line 1455 of yacc.c */ -#line 9373 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9387 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29657,7 +29671,7 @@ case 1225: /* Line 1455 of yacc.c */ -#line 9379 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9393 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_int_div((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29668,7 +29682,7 @@ case 1226: /* Line 1455 of yacc.c */ -#line 9385 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9399 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_mod((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29679,7 +29693,7 @@ case 1227: /* Line 1455 of yacc.c */ -#line 9391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9405 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_bit_xor((yyvsp[(1) - (3)].item),(yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29690,63 +29704,63 @@ case 1237: /* Line 1455 of yacc.c */ -#line 9420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9434 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_eq_creator; } break; case 1238: /* Line 1455 of yacc.c */ -#line 9421 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_ge_creator; } break; case 1239: /* Line 1455 of yacc.c */ -#line 9422 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9436 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_gt_creator; } break; case 1240: /* Line 1455 of yacc.c */ -#line 9423 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_le_creator; } break; case 1241: /* Line 1455 of yacc.c */ -#line 9424 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9438 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_lt_creator; } break; case 1242: /* Line 1455 of yacc.c */ -#line 9425 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9439 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.boolfunc2creator) = &comp_ne_creator; } break; case 1243: /* Line 1455 of yacc.c */ -#line 9429 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9443 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num) = 1; } break; case 1244: /* Line 1455 of yacc.c */ -#line 9430 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num) = 0; } break; case 1250: /* Line 1455 of yacc.c */ -#line 9440 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9454 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Item *i1= new (thd->mem_root) Item_string((yyvsp[(3) - (3)].lex_str).str, @@ -29763,7 +29777,7 @@ case 1255: /* Line 1455 of yacc.c */ -#line 9456 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9470 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_concat((yyvsp[(1) - (3)].item), (yyvsp[(3) - (3)].item)); if ((yyval.item) == NULL) @@ -29774,7 +29788,7 @@ case 1256: /* Line 1455 of yacc.c */ -#line 9462 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9476 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (2)].item); } @@ -29783,7 +29797,7 @@ case 1257: /* Line 1455 of yacc.c */ -#line 9466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9480 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_neg((yyvsp[(2) - (2)].item)); if ((yyval.item) == NULL) @@ -29794,7 +29808,7 @@ case 1258: /* Line 1455 of yacc.c */ -#line 9472 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_bit_neg((yyvsp[(2) - (2)].item)); if ((yyval.item) == NULL) @@ -29805,7 +29819,7 @@ case 1259: /* Line 1455 of yacc.c */ -#line 9478 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9492 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= negate_expression(YYTHD, (yyvsp[(2) - (2)].item)); if ((yyval.item) == NULL) @@ -29816,7 +29830,7 @@ case 1260: /* Line 1455 of yacc.c */ -#line 9484 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_singlerow_subselect((yyvsp[(2) - (3)].select_lex)); if ((yyval.item) == NULL) @@ -29827,14 +29841,14 @@ case 1261: /* Line 1455 of yacc.c */ -#line 9490 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (3)].item); } break; case 1262: /* Line 1455 of yacc.c */ -#line 9492 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9506 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(4) - (5)].item_list)->push_front((yyvsp[(2) - (5)].item)); (yyval.item)= new (YYTHD->mem_root) Item_row(*(yyvsp[(4) - (5)].item_list)); @@ -29846,7 +29860,7 @@ case 1263: /* Line 1455 of yacc.c */ -#line 9499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9513 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(5) - (6)].item_list)->push_front((yyvsp[(3) - (6)].item)); (yyval.item)= new (YYTHD->mem_root) Item_row(*(yyvsp[(5) - (6)].item_list)); @@ -29858,7 +29872,7 @@ case 1264: /* Line 1455 of yacc.c */ -#line 9506 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9520 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_exists_subselect((yyvsp[(3) - (4)].select_lex)); if ((yyval.item) == NULL) @@ -29869,7 +29883,7 @@ case 1265: /* Line 1455 of yacc.c */ -#line 9512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item_string *item; (yyval.item)= NULL; @@ -29915,7 +29929,7 @@ case 1266: /* Line 1455 of yacc.c */ -#line 9553 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9567 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(2) - (7)].item_list)->push_front((yyvsp[(5) - (7)].item)); Item_func_match *i1= new (YYTHD->mem_root) Item_func_match(*(yyvsp[(2) - (7)].item_list), (yyvsp[(6) - (7)].num)); @@ -29929,7 +29943,7 @@ case 1267: /* Line 1455 of yacc.c */ -#line 9562 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9576 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= create_func_cast(YYTHD, (yyvsp[(2) - (2)].item), ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); @@ -29941,7 +29955,7 @@ case 1268: /* Line 1455 of yacc.c */ -#line 9569 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; (yyval.item)= create_func_cast(YYTHD, (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), lex->length, lex->dec, @@ -29954,7 +29968,7 @@ case 1269: /* Line 1455 of yacc.c */ -#line 9577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_case(* (yyvsp[(3) - (5)].item_list), (yyvsp[(2) - (5)].item), (yyvsp[(4) - (5)].item) ); if ((yyval.item) == NULL) @@ -29965,7 +29979,7 @@ case 1270: /* Line 1455 of yacc.c */ -#line 9583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9597 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= create_func_cast(YYTHD, (yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].cast_type), Lex->length, Lex->dec, Lex->charset); @@ -29977,7 +29991,7 @@ case 1271: /* Line 1455 of yacc.c */ -#line 9590 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9604 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_conv_charset((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].charset)); if ((yyval.item) == NULL) @@ -29988,7 +30002,7 @@ case 1272: /* Line 1455 of yacc.c */ -#line 9596 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(3) - (4)].item)->is_splocal()) { @@ -30007,7 +30021,7 @@ case 1273: /* Line 1455 of yacc.c */ -#line 9610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9624 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(), (yyvsp[(3) - (4)].item)); @@ -30019,7 +30033,7 @@ case 1274: /* Line 1455 of yacc.c */ -#line 9618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9632 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(5) - (5)].item),(yyvsp[(2) - (5)].item),(yyvsp[(3) - (5)].interval),0); if ((yyval.item) == NULL) @@ -30030,7 +30044,7 @@ case 1275: /* Line 1455 of yacc.c */ -#line 9633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9647 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_char(*(yyvsp[(3) - (4)].item_list)); if ((yyval.item) == NULL) @@ -30041,7 +30055,7 @@ case 1276: /* Line 1455 of yacc.c */ -#line 9639 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9653 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_char(*(yyvsp[(3) - (6)].item_list), (yyvsp[(5) - (6)].charset)); if ((yyval.item) == NULL) @@ -30052,7 +30066,7 @@ case 1277: /* Line 1455 of yacc.c */ -#line 9645 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9659 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context()); if ((yyval.item) == NULL) @@ -30065,7 +30079,7 @@ case 1278: /* Line 1455 of yacc.c */ -#line 9653 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9667 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_typecast((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30076,7 +30090,7 @@ case 1279: /* Line 1455 of yacc.c */ -#line 9659 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_dayofmonth((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30087,7 +30101,7 @@ case 1280: /* Line 1455 of yacc.c */ -#line 9665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_hour((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30098,7 +30112,7 @@ case 1281: /* Line 1455 of yacc.c */ -#line 9671 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_insert((yyvsp[(3) - (10)].item),(yyvsp[(5) - (10)].item),(yyvsp[(7) - (10)].item),(yyvsp[(9) - (10)].item)); if ((yyval.item) == NULL) @@ -30109,7 +30123,7 @@ case 1282: /* Line 1455 of yacc.c */ -#line 9677 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9691 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; List *list= new (thd->mem_root) List; @@ -30129,7 +30143,7 @@ case 1283: /* Line 1455 of yacc.c */ -#line 9692 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; (yyvsp[(7) - (8)].item_list)->push_front((yyvsp[(5) - (8)].item)); @@ -30146,7 +30160,7 @@ case 1284: /* Line 1455 of yacc.c */ -#line 9704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_left((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30157,7 +30171,7 @@ case 1285: /* Line 1455 of yacc.c */ -#line 9710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_minute((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30168,7 +30182,7 @@ case 1286: /* Line 1455 of yacc.c */ -#line 9716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9730 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_month((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30179,7 +30193,7 @@ case 1287: /* Line 1455 of yacc.c */ -#line 9722 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9736 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_right((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30190,7 +30204,7 @@ case 1288: /* Line 1455 of yacc.c */ -#line 9728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9742 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_second((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30201,7 +30215,7 @@ case 1289: /* Line 1455 of yacc.c */ -#line 9734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9748 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_time_typecast((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30212,7 +30226,7 @@ case 1290: /* Line 1455 of yacc.c */ -#line 9740 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9754 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_datetime_typecast((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30223,7 +30237,7 @@ case 1291: /* Line 1455 of yacc.c */ -#line 9746 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9760 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_add_time((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), 1, 0); if ((yyval.item) == NULL) @@ -30234,7 +30248,7 @@ case 1292: /* Line 1455 of yacc.c */ -#line 9752 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9766 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30245,7 +30259,7 @@ case 1293: /* Line 1455 of yacc.c */ -#line 9758 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9772 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_ltrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); if ((yyval.item) == NULL) @@ -30256,7 +30270,7 @@ case 1294: /* Line 1455 of yacc.c */ -#line 9764 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9778 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_rtrim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); if ((yyval.item) == NULL) @@ -30267,7 +30281,7 @@ case 1295: /* Line 1455 of yacc.c */ -#line 9770 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9784 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(6) - (7)].item),(yyvsp[(4) - (7)].item)); if ((yyval.item) == NULL) @@ -30278,7 +30292,7 @@ case 1296: /* Line 1455 of yacc.c */ -#line 9776 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9790 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_ltrim((yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30289,7 +30303,7 @@ case 1297: /* Line 1455 of yacc.c */ -#line 9782 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9796 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_rtrim((yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30300,7 +30314,7 @@ case 1298: /* Line 1455 of yacc.c */ -#line 9788 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9802 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30311,7 +30325,7 @@ case 1299: /* Line 1455 of yacc.c */ -#line 9794 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9808 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_trim((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); if ((yyval.item) == NULL) @@ -30322,7 +30336,7 @@ case 1300: /* Line 1455 of yacc.c */ -#line 9800 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9814 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_user(); if ((yyval.item) == NULL) @@ -30335,7 +30349,7 @@ case 1301: /* Line 1455 of yacc.c */ -#line 9808 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9822 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_year((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30346,7 +30360,7 @@ case 1302: /* Line 1455 of yacc.c */ -#line 9829 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9843 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 0); @@ -30358,7 +30372,7 @@ case 1303: /* Line 1455 of yacc.c */ -#line 9836 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9850 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 0); if ((yyval.item) == NULL) @@ -30369,7 +30383,7 @@ case 1304: /* Line 1455 of yacc.c */ -#line 9842 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9856 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_curdate_local(); if ((yyval.item) == NULL) @@ -30381,7 +30395,7 @@ case 1305: /* Line 1455 of yacc.c */ -#line 9849 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9863 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_curtime_local((yyvsp[(2) - (2)].ulong_num)); if ((yyval.item) == NULL) @@ -30393,7 +30407,7 @@ case 1306: /* Line 1455 of yacc.c */ -#line 9857 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9871 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item),(yyvsp[(6) - (8)].item),(yyvsp[(7) - (8)].interval),0); if ((yyval.item) == NULL) @@ -30404,7 +30418,7 @@ case 1307: /* Line 1455 of yacc.c */ -#line 9864 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9878 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item),(yyvsp[(6) - (8)].item),(yyvsp[(7) - (8)].interval),1); if ((yyval.item) == NULL) @@ -30415,7 +30429,7 @@ case 1308: /* Line 1455 of yacc.c */ -#line 9870 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9884 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=new (YYTHD->mem_root) Item_extract( (yyvsp[(3) - (6)].interval), (yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30426,7 +30440,7 @@ case 1309: /* Line 1455 of yacc.c */ -#line 9876 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9890 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_get_format((yyvsp[(3) - (6)].date_time_type), (yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30437,7 +30451,7 @@ case 1310: /* Line 1455 of yacc.c */ -#line 9882 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9896 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); Lex->safe_to_cache_query= 0; @@ -30447,7 +30461,7 @@ case 1311: /* Line 1455 of yacc.c */ -#line 9887 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9901 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = new (YYTHD->mem_root) Item_func_locate((yyvsp[(5) - (6)].item),(yyvsp[(3) - (6)].item)); if ((yyval.item) == NULL) @@ -30458,7 +30472,7 @@ case 1312: /* Line 1455 of yacc.c */ -#line 9893 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9907 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), INTERVAL_DAY, 1); @@ -30470,7 +30484,7 @@ case 1313: /* Line 1455 of yacc.c */ -#line 9900 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9914 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(3) - (8)].item), (yyvsp[(6) - (8)].item), (yyvsp[(7) - (8)].interval), 1); if ((yyval.item) == NULL) @@ -30481,7 +30495,7 @@ case 1314: /* Line 1455 of yacc.c */ -#line 9906 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9920 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); if ((yyval.item) == NULL) @@ -30492,7 +30506,7 @@ case 1315: /* Line 1455 of yacc.c */ -#line 9912 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9926 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30503,7 +30517,7 @@ case 1316: /* Line 1455 of yacc.c */ -#line 9918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9932 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); if ((yyval.item) == NULL) @@ -30514,7 +30528,7 @@ case 1317: /* Line 1455 of yacc.c */ -#line 9924 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9938 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_substr((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30525,7 +30539,7 @@ case 1318: /* Line 1455 of yacc.c */ -#line 9930 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9944 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Unlike other time-related functions, SYSDATE() is @@ -30548,7 +30562,7 @@ case 1319: /* Line 1455 of yacc.c */ -#line 9948 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9962 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_date_add_interval((yyvsp[(7) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(3) - (8)].interval_time_st),0); if ((yyval.item) == NULL) @@ -30559,7 +30573,7 @@ case 1320: /* Line 1455 of yacc.c */ -#line 9954 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_timestamp_diff((yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item),(yyvsp[(3) - (8)].interval_time_st)); if ((yyval.item) == NULL) @@ -30570,7 +30584,7 @@ case 1321: /* Line 1455 of yacc.c */ -#line 9960 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_curdate_utc(); if ((yyval.item) == NULL) @@ -30582,7 +30596,7 @@ case 1322: /* Line 1455 of yacc.c */ -#line 9967 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9981 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_curtime_utc((yyvsp[(2) - (2)].ulong_num)); if ((yyval.item) == NULL) @@ -30594,7 +30608,7 @@ case 1323: /* Line 1455 of yacc.c */ -#line 9974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 9988 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_now_utc((yyvsp[(2) - (2)].ulong_num)); if ((yyval.item) == NULL) @@ -30606,7 +30620,7 @@ case 1324: /* Line 1455 of yacc.c */ -#line 9989 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10003 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_ascii((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30617,7 +30631,7 @@ case 1325: /* Line 1455 of yacc.c */ -#line 9995 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10009 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_charset((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30628,7 +30642,7 @@ case 1326: /* Line 1455 of yacc.c */ -#line 10001 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10015 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_coalesce(* (yyvsp[(3) - (4)].item_list)); if ((yyval.item) == NULL) @@ -30639,7 +30653,7 @@ case 1327: /* Line 1455 of yacc.c */ -#line 10007 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10021 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_collation((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30650,7 +30664,7 @@ case 1328: /* Line 1455 of yacc.c */ -#line 10013 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_database(); if ((yyval.item) == NULL) @@ -30662,7 +30676,7 @@ case 1329: /* Line 1455 of yacc.c */ -#line 10020 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10034 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_if((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); if ((yyval.item) == NULL) @@ -30673,7 +30687,7 @@ case 1330: /* Line 1455 of yacc.c */ -#line 10026 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10040 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_format((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30684,7 +30698,7 @@ case 1331: /* Line 1455 of yacc.c */ -#line 10032 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10046 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_format((yyvsp[(3) - (8)].item), (yyvsp[(5) - (8)].item), (yyvsp[(7) - (8)].item)); if ((yyval.item) == NULL) @@ -30695,7 +30709,7 @@ case 1332: /* Line 1455 of yacc.c */ -#line 10038 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10052 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_microsecond((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30706,7 +30720,7 @@ case 1333: /* Line 1455 of yacc.c */ -#line 10044 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10058 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = new (YYTHD->mem_root) Item_func_mod((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30717,7 +30731,7 @@ case 1334: /* Line 1455 of yacc.c */ -#line 10050 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10064 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { WARN_DEPRECATED(YYTHD, "OLD_PASSWORD", "PASSWORD"); (yyval.item)= new (YYTHD->mem_root) Item_func_old_password((yyvsp[(3) - (4)].item)); @@ -30730,7 +30744,7 @@ case 1335: /* Line 1455 of yacc.c */ -#line 10058 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10072 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Item* i1; @@ -30748,7 +30762,7 @@ case 1336: /* Line 1455 of yacc.c */ -#line 10071 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10085 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = new (YYTHD->mem_root) Item_func_quarter((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30759,7 +30773,7 @@ case 1337: /* Line 1455 of yacc.c */ -#line 10077 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10091 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_repeat((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30770,7 +30784,7 @@ case 1338: /* Line 1455 of yacc.c */ -#line 10083 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10097 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_replace((yyvsp[(3) - (8)].item),(yyvsp[(5) - (8)].item),(yyvsp[(7) - (8)].item)); if ((yyval.item) == NULL) @@ -30781,7 +30795,7 @@ case 1339: /* Line 1455 of yacc.c */ -#line 10089 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10103 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_reverse((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -30792,7 +30806,7 @@ case 1340: /* Line 1455 of yacc.c */ -#line 10095 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10109 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_row_count(); if ((yyval.item) == NULL) @@ -30805,7 +30819,7 @@ case 1341: /* Line 1455 of yacc.c */ -#line 10103 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10117 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_round((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item),1); if ((yyval.item) == NULL) @@ -30816,7 +30830,7 @@ case 1342: /* Line 1455 of yacc.c */ -#line 10109 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10123 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Item *i1= new (thd->mem_root) Item_int(NAME_STRING("0"), @@ -30833,7 +30847,7 @@ case 1343: /* Line 1455 of yacc.c */ -#line 10121 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_week((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item)); if ((yyval.item) == NULL) @@ -30844,7 +30858,7 @@ case 1344: /* Line 1455 of yacc.c */ -#line 10127 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10141 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_weight_string((yyvsp[(3) - (5)].item), 0, 0, (yyvsp[(4) - (5)].ulong_num)); if ((yyval.item) == NULL) @@ -30855,7 +30869,7 @@ case 1345: /* Line 1455 of yacc.c */ -#line 10133 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10147 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_weight_string((yyvsp[(3) - (8)].item), 0, (yyvsp[(6) - (8)].ulong_num), @@ -30868,7 +30882,7 @@ case 1346: /* Line 1455 of yacc.c */ -#line 10141 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10155 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *item= new (YYTHD->mem_root) Item_char_typecast((yyvsp[(3) - (7)].item), (yyvsp[(6) - (7)].ulong_num), &my_charset_bin); if (item == NULL) @@ -30883,7 +30897,7 @@ case 1347: /* Line 1455 of yacc.c */ -#line 10151 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10165 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_weight_string((yyvsp[(3) - (10)].item), (yyvsp[(5) - (10)].ulong_num), (yyvsp[(7) - (10)].ulong_num), (yyvsp[(9) - (10)].ulong_num)); if ((yyval.item) == NULL) @@ -30894,7 +30908,7 @@ case 1348: /* Line 1455 of yacc.c */ -#line 10157 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10171 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { #ifdef HAVE_SPATIAL (yyval.item)= (yyvsp[(1) - (1)].item); @@ -30912,7 +30926,7 @@ case 1349: /* Line 1455 of yacc.c */ -#line 10173 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10187 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_spatial_mbr_rel((yyvsp[(3) - (6)].item), (yyvsp[(5) - (6)].item), @@ -30923,7 +30937,7 @@ case 1350: /* Line 1455 of yacc.c */ -#line 10179 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), @@ -30935,7 +30949,7 @@ case 1351: /* Line 1455 of yacc.c */ -#line 10186 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10200 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), @@ -30947,7 +30961,7 @@ case 1352: /* Line 1455 of yacc.c */ -#line 10193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10207 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), @@ -30959,7 +30973,7 @@ case 1353: /* Line 1455 of yacc.c */ -#line 10200 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10214 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), @@ -30971,7 +30985,7 @@ case 1354: /* Line 1455 of yacc.c */ -#line 10207 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10221 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), @@ -30983,7 +30997,7 @@ case 1355: /* Line 1455 of yacc.c */ -#line 10214 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10228 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_point((yyvsp[(3) - (6)].item),(yyvsp[(5) - (6)].item))); } @@ -30992,7 +31006,7 @@ case 1356: /* Line 1455 of yacc.c */ -#line 10218 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10232 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= GEOM_NEW(YYTHD, Item_func_spatial_collection(* (yyvsp[(3) - (4)].item_list), @@ -31004,7 +31018,7 @@ case 1357: /* Line 1455 of yacc.c */ -#line 10237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10251 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { #ifdef HAVE_DLOPEN udf_func *udf= 0; @@ -31028,7 +31042,7 @@ case 1358: /* Line 1455 of yacc.c */ -#line 10256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10270 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Create_func *builder; @@ -31087,7 +31101,7 @@ case 1359: /* Line 1455 of yacc.c */ -#line 10310 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10324 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Create_qfunc *builder; @@ -31129,63 +31143,63 @@ case 1360: /* Line 1455 of yacc.c */ -#line 10350 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10364 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= (yyvsp[(1) - (2)].num) | (yyvsp[(2) - (2)].num); } break; case 1361: /* Line 1455 of yacc.c */ -#line 10352 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10366 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= FT_BOOL; } break; case 1362: /* Line 1455 of yacc.c */ -#line 10356 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= FT_NL; } break; case 1363: /* Line 1455 of yacc.c */ -#line 10357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10371 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= FT_NL; } break; case 1364: /* Line 1455 of yacc.c */ -#line 10361 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10375 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 1365: /* Line 1455 of yacc.c */ -#line 10362 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= FT_EXPAND; } break; case 1366: /* Line 1455 of yacc.c */ -#line 10366 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= NULL; } break; case 1367: /* Line 1455 of yacc.c */ -#line 10367 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10381 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); } break; case 1368: /* Line 1455 of yacc.c */ -#line 10372 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10386 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= new (YYTHD->mem_root) List; if ((yyval.item_list) == NULL) @@ -31197,7 +31211,7 @@ case 1369: /* Line 1455 of yacc.c */ -#line 10379 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10393 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(1) - (3)].item_list)->push_back((yyvsp[(3) - (3)].item)); (yyval.item_list)= (yyvsp[(1) - (3)].item_list); @@ -31207,7 +31221,7 @@ case 1370: /* Line 1455 of yacc.c */ -#line 10387 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10401 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Use Item::name as a storage for the attribute value of user @@ -31235,7 +31249,7 @@ case 1371: /* Line 1455 of yacc.c */ -#line 10413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10427 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_avg((yyvsp[(3) - (4)].item), FALSE); if ((yyval.item) == NULL) @@ -31246,7 +31260,7 @@ case 1372: /* Line 1455 of yacc.c */ -#line 10419 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10433 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_avg((yyvsp[(4) - (5)].item), TRUE); if ((yyval.item) == NULL) @@ -31257,7 +31271,7 @@ case 1373: /* Line 1455 of yacc.c */ -#line 10425 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10439 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_and((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -31268,7 +31282,7 @@ case 1374: /* Line 1455 of yacc.c */ -#line 10431 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10445 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_or((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -31279,7 +31293,7 @@ case 1375: /* Line 1455 of yacc.c */ -#line 10437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10451 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_xor((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -31290,7 +31304,7 @@ case 1376: /* Line 1455 of yacc.c */ -#line 10443 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10457 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *item= new (YYTHD->mem_root) Item_int((int32) 0L,1); if (item == NULL) @@ -31304,7 +31318,7 @@ case 1377: /* Line 1455 of yacc.c */ -#line 10452 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_count((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -31315,21 +31329,21 @@ case 1378: /* Line 1455 of yacc.c */ -#line 10458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10472 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->in_sum_expr++; } break; case 1379: /* Line 1455 of yacc.c */ -#line 10460 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10474 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->in_sum_expr--; } break; case 1380: /* Line 1455 of yacc.c */ -#line 10462 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10476 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_count(* (yyvsp[(5) - (7)].item_list)); if ((yyval.item) == NULL) @@ -31340,7 +31354,7 @@ case 1381: /* Line 1455 of yacc.c */ -#line 10468 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10482 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_min((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -31351,7 +31365,7 @@ case 1382: /* Line 1455 of yacc.c */ -#line 10479 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10493 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_min((yyvsp[(4) - (5)].item)); if ((yyval.item) == NULL) @@ -31362,7 +31376,7 @@ case 1383: /* Line 1455 of yacc.c */ -#line 10485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_max((yyvsp[(3) - (4)].item)); if ((yyval.item) == NULL) @@ -31373,7 +31387,7 @@ case 1384: /* Line 1455 of yacc.c */ -#line 10491 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_max((yyvsp[(4) - (5)].item)); if ((yyval.item) == NULL) @@ -31384,7 +31398,7 @@ case 1385: /* Line 1455 of yacc.c */ -#line 10497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10511 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_std((yyvsp[(3) - (4)].item), 0); if ((yyval.item) == NULL) @@ -31395,7 +31409,7 @@ case 1386: /* Line 1455 of yacc.c */ -#line 10503 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_variance((yyvsp[(3) - (4)].item), 0); if ((yyval.item) == NULL) @@ -31406,7 +31420,7 @@ case 1387: /* Line 1455 of yacc.c */ -#line 10509 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10523 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_std((yyvsp[(3) - (4)].item), 1); if ((yyval.item) == NULL) @@ -31417,7 +31431,7 @@ case 1388: /* Line 1455 of yacc.c */ -#line 10515 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10529 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_variance((yyvsp[(3) - (4)].item), 1); if ((yyval.item) == NULL) @@ -31428,7 +31442,7 @@ case 1389: /* Line 1455 of yacc.c */ -#line 10521 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10535 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_sum((yyvsp[(3) - (4)].item), FALSE); if ((yyval.item) == NULL) @@ -31439,7 +31453,7 @@ case 1390: /* Line 1455 of yacc.c */ -#line 10527 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10541 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_sum_sum((yyvsp[(4) - (5)].item), TRUE); if ((yyval.item) == NULL) @@ -31450,14 +31464,14 @@ case 1391: /* Line 1455 of yacc.c */ -#line 10533 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->in_sum_expr++; } break; case 1392: /* Line 1455 of yacc.c */ -#line 10537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10551 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; sel->in_sum_expr--; @@ -31474,7 +31488,7 @@ case 1393: /* Line 1455 of yacc.c */ -#line 10552 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10566 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (! Lex->parsing_options.allows_variable) { @@ -31487,7 +31501,7 @@ case 1394: /* Line 1455 of yacc.c */ -#line 10560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10574 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(3) - (3)].item); } @@ -31496,7 +31510,7 @@ case 1395: /* Line 1455 of yacc.c */ -#line 10567 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item_func_set_user_var *item; (yyval.item)= item= @@ -31512,7 +31526,7 @@ case 1396: /* Line 1455 of yacc.c */ -#line 10578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_func_get_user_var((yyvsp[(1) - (1)].lex_str)); if ((yyval.item) == NULL) @@ -31525,7 +31539,7 @@ case 1397: /* Line 1455 of yacc.c */ -#line 10586 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10600 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* disallow "SELECT @@global.global.variable" */ if ((yyvsp[(3) - (4)].lex_str).str && (yyvsp[(4) - (4)].lex_str).str && check_reserved_words(&(yyvsp[(3) - (4)].lex_str))) @@ -31543,21 +31557,21 @@ case 1398: /* Line 1455 of yacc.c */ -#line 10601 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10615 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num) = 0; } break; case 1399: /* Line 1455 of yacc.c */ -#line 10602 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num) = 1; } break; case 1400: /* Line 1455 of yacc.c */ -#line 10607 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10621 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.string)= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); if ((yyval.string) == NULL) @@ -31568,14 +31582,14 @@ case 1401: /* Line 1455 of yacc.c */ -#line 10612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10626 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.string) = (yyvsp[(2) - (2)].string); } break; case 1403: /* Line 1455 of yacc.c */ -#line 10618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10632 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -31593,21 +31607,21 @@ case 1405: /* Line 1455 of yacc.c */ -#line 10635 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10649 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_gorder_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1406: /* Line 1455 of yacc.c */ -#line 10637 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_gorder_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1407: /* Line 1455 of yacc.c */ -#line 10642 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10656 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->current_select->inc_in_sum_expr()) @@ -31621,7 +31635,7 @@ case 1408: /* Line 1455 of yacc.c */ -#line 10651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->in_sum_expr--; (yyval.item)= (yyvsp[(3) - (3)].item); @@ -31631,98 +31645,98 @@ case 1409: /* Line 1455 of yacc.c */ -#line 10659 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; } break; case 1410: /* Line 1455 of yacc.c */ -#line 10661 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10675 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->dec= 0; } break; case 1411: /* Line 1455 of yacc.c */ -#line 10663 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10677 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; } break; case 1412: /* Line 1455 of yacc.c */ -#line 10665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1413: /* Line 1455 of yacc.c */ -#line 10667 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10681 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1414: /* Line 1455 of yacc.c */ -#line 10669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10683 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1415: /* Line 1455 of yacc.c */ -#line 10671 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; } break; case 1416: /* Line 1455 of yacc.c */ -#line 10673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10687 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)= ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec= Lex->length= (char *) 0; } break; case 1417: /* Line 1455 of yacc.c */ -#line 10675 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)= ITEM_CAST_TIME; Lex->charset= NULL; Lex->length= (char *) 0; } break; case 1418: /* Line 1455 of yacc.c */ -#line 10677 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10691 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)= ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->length= (char *) 0; } break; case 1419: /* Line 1455 of yacc.c */ -#line 10679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.cast_type)=ITEM_CAST_DECIMAL; Lex->charset= NULL; } break; case 1420: /* Line 1455 of yacc.c */ -#line 10683 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= NULL; } break; case 1421: /* Line 1455 of yacc.c */ -#line 10684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list);} break; case 1422: /* Line 1455 of yacc.c */ -#line 10689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= new (YYTHD->mem_root) List; if ((yyval.item_list) == NULL) @@ -31734,7 +31748,7 @@ case 1423: /* Line 1455 of yacc.c */ -#line 10696 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(1) - (3)].item_list)->push_back((yyvsp[(3) - (3)].item)); (yyval.item_list)= (yyvsp[(1) - (3)].item_list); @@ -31744,21 +31758,21 @@ case 1424: /* Line 1455 of yacc.c */ -#line 10703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= (yyvsp[(1) - (1)].item_list); } break; case 1425: /* Line 1455 of yacc.c */ -#line 10704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= (yyvsp[(2) - (3)].item_list); } break; case 1426: /* Line 1455 of yacc.c */ -#line 10709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= new (YYTHD->mem_root) List; if ((yyval.item_list) == NULL) @@ -31770,7 +31784,7 @@ case 1427: /* Line 1455 of yacc.c */ -#line 10716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10730 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(1) - (3)].item_list)->push_back((yyvsp[(3) - (3)].item)); (yyval.item_list)= (yyvsp[(1) - (3)].item_list); @@ -31780,35 +31794,35 @@ case 1428: /* Line 1455 of yacc.c */ -#line 10723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10737 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= NULL; } break; case 1429: /* Line 1455 of yacc.c */ -#line 10724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10738 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1430: /* Line 1455 of yacc.c */ -#line 10728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10742 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= NULL; } break; case 1431: /* Line 1455 of yacc.c */ -#line 10729 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10743 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(2) - (2)].item); } break; case 1432: /* Line 1455 of yacc.c */ -#line 10734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10748 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_list)= new List; if ((yyval.item_list) == NULL) @@ -31821,7 +31835,7 @@ case 1433: /* Line 1455 of yacc.c */ -#line 10742 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10756 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(3) - (5)].item)); (yyvsp[(1) - (5)].item_list)->push_back((yyvsp[(5) - (5)].item)); @@ -31832,14 +31846,14 @@ case 1434: /* Line 1455 of yacc.c */ -#line 10752 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10766 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1435: /* Line 1455 of yacc.c */ -#line 10754 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10768 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->nest_last_join(lex->thd))) @@ -31850,35 +31864,35 @@ case 1436: /* Line 1455 of yacc.c */ -#line 10762 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10776 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyval.table_list)=(yyvsp[(1) - (1)].table_list)); } break; case 1437: /* Line 1455 of yacc.c */ -#line 10773 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10787 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1438: /* Line 1455 of yacc.c */ -#line 10774 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10788 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table_list)=(yyvsp[(3) - (4)].table_list); } break; case 1439: /* Line 1455 of yacc.c */ -#line 10780 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10794 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table_list)=(yyvsp[(1) - (1)].table_list); } break; case 1440: /* Line 1455 of yacc.c */ -#line 10782 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10796 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } @@ -31887,21 +31901,21 @@ case 1441: /* Line 1455 of yacc.c */ -#line 10802 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10816 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); } break; case 1442: /* Line 1455 of yacc.c */ -#line 10804 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10818 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].table_list) && ((yyval.table_list)=(yyvsp[(3) - (3)].table_list))); (yyvsp[(3) - (3)].table_list)->straight=1; } break; case 1443: /* Line 1455 of yacc.c */ -#line 10807 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10821 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ @@ -31914,7 +31928,7 @@ case 1444: /* Line 1455 of yacc.c */ -#line 10815 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10829 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); Lex->pop_context(); @@ -31925,7 +31939,7 @@ case 1445: /* Line 1455 of yacc.c */ -#line 10822 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10836 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); /* Change the current name resolution context to a local context. */ @@ -31938,7 +31952,7 @@ case 1446: /* Line 1455 of yacc.c */ -#line 10830 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10844 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(3) - (6)].table_list)->straight=1; add_join_on((yyvsp[(3) - (6)].table_list),(yyvsp[(6) - (6)].item)); @@ -31950,7 +31964,7 @@ case 1447: /* Line 1455 of yacc.c */ -#line 10838 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10852 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && (yyvsp[(3) - (4)].table_list)); } @@ -31959,14 +31973,14 @@ case 1448: /* Line 1455 of yacc.c */ -#line 10842 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10856 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { add_join_natural((yyvsp[(1) - (8)].table_list),(yyvsp[(3) - (8)].table_list),(yyvsp[(7) - (8)].string_list),Select); (yyval.table_list)=(yyvsp[(3) - (8)].table_list); } break; case 1449: /* Line 1455 of yacc.c */ -#line 10844 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10858 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (4)].table_list) && ((yyval.table_list)=(yyvsp[(4) - (4)].table_list))); add_join_natural((yyvsp[(1) - (4)].table_list),(yyvsp[(4) - (4)].table_list),NULL,Select); @@ -31976,7 +31990,7 @@ case 1450: /* Line 1455 of yacc.c */ -#line 10852 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10866 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ @@ -31989,7 +32003,7 @@ case 1451: /* Line 1455 of yacc.c */ -#line 10860 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10874 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { add_join_on((yyvsp[(5) - (8)].table_list),(yyvsp[(8) - (8)].item)); Lex->pop_context(); @@ -32002,7 +32016,7 @@ case 1452: /* Line 1455 of yacc.c */ -#line 10868 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10882 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } @@ -32011,7 +32025,7 @@ case 1453: /* Line 1455 of yacc.c */ -#line 10872 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10886 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { add_join_natural((yyvsp[(1) - (10)].table_list),(yyvsp[(5) - (10)].table_list),(yyvsp[(9) - (10)].string_list),Select); (yyvsp[(5) - (10)].table_list)->outer_join|=JOIN_TYPE_LEFT; @@ -32022,7 +32036,7 @@ case 1454: /* Line 1455 of yacc.c */ -#line 10878 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10892 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); add_join_natural((yyvsp[(1) - (6)].table_list),(yyvsp[(6) - (6)].table_list),NULL,Select); @@ -32034,7 +32048,7 @@ case 1455: /* Line 1455 of yacc.c */ -#line 10888 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10902 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(5) - (6)].table_list)); /* Change the current name resolution context to a local context. */ @@ -32047,7 +32061,7 @@ case 1456: /* Line 1455 of yacc.c */ -#line 10896 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10910 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->convert_right_join())) @@ -32061,7 +32075,7 @@ case 1457: /* Line 1455 of yacc.c */ -#line 10905 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10919 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].table_list) && (yyvsp[(5) - (5)].table_list)); } @@ -32070,7 +32084,7 @@ case 1458: /* Line 1455 of yacc.c */ -#line 10909 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10923 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (!((yyval.table_list)= lex->current_select->convert_right_join())) @@ -32082,7 +32096,7 @@ case 1459: /* Line 1455 of yacc.c */ -#line 10916 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10930 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (6)].table_list) && (yyvsp[(6) - (6)].table_list)); add_join_natural((yyvsp[(6) - (6)].table_list),(yyvsp[(1) - (6)].table_list),NULL,Select); @@ -32095,35 +32109,35 @@ case 1460: /* Line 1455 of yacc.c */ -#line 10926 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10940 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1461: /* Line 1455 of yacc.c */ -#line 10927 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10941 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1462: /* Line 1455 of yacc.c */ -#line 10928 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10942 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1463: /* Line 1455 of yacc.c */ -#line 10936 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10950 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.string_list)= 0;} break; case 1465: /* Line 1455 of yacc.c */ -#line 10942 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10956 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.string_list)= (yyvsp[(3) - (5)].string_list); } @@ -32132,7 +32146,7 @@ case 1466: /* Line 1455 of yacc.c */ -#line 10956 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10970 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; sel->table_join_options= 0; @@ -32142,7 +32156,7 @@ case 1467: /* Line 1455 of yacc.c */ -#line 10961 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10975 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.table_list)= Select->add_table_to_list(YYTHD, (yyvsp[(2) - (5)].table), (yyvsp[(4) - (5)].lex_str_ptr), Select->get_table_join_options(), @@ -32158,7 +32172,7 @@ case 1468: /* Line 1455 of yacc.c */ -#line 10972 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 10986 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -32185,7 +32199,7 @@ case 1469: /* Line 1455 of yacc.c */ -#line 11012 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11026 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Use $2 instead of Lex->current_select as derived table will alter value of Lex->current_select. */ @@ -32240,7 +32254,7 @@ case 1470: /* Line 1455 of yacc.c */ -#line 11085 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11099 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(1) - (2)].table_list) && (yyvsp[(2) - (2)].is_not_empty)) { @@ -32253,7 +32267,7 @@ case 1471: /* Line 1455 of yacc.c */ -#line 11095 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11109 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_select_to_union_list(Lex, (bool)(yyvsp[(3) - (3)].num), FALSE)) MYSQL_YYABORT; @@ -32263,7 +32277,7 @@ case 1472: /* Line 1455 of yacc.c */ -#line 11100 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11114 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Remove from the name resolution context stack the context of the @@ -32276,7 +32290,7 @@ case 1473: /* Line 1455 of yacc.c */ -#line 11108 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(1) - (7)].table_list) != NULL) { @@ -32289,7 +32303,7 @@ case 1474: /* Line 1455 of yacc.c */ -#line 11120 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11134 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -32310,7 +32324,7 @@ case 1475: /* Line 1455 of yacc.c */ -#line 11139 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11153 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -32323,7 +32337,7 @@ case 1476: /* Line 1455 of yacc.c */ -#line 11147 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11161 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= NO_MATTER; } @@ -32332,7 +32346,7 @@ case 1478: /* Line 1455 of yacc.c */ -#line 11156 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11170 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if ((yyvsp[(1) - (1)].select_lex)->init_nested_join(lex->thd)) @@ -32343,7 +32357,7 @@ case 1479: /* Line 1455 of yacc.c */ -#line 11162 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11176 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; /* for normal joins, $3 != NULL and end_nested_join() != NULL, @@ -32362,7 +32376,7 @@ case 1480: /* Line 1455 of yacc.c */ -#line 11178 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11192 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->derived_tables|= DERIVED_SUBQUERY; @@ -32384,7 +32398,7 @@ case 1481: /* Line 1455 of yacc.c */ -#line 11195 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11209 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= NO_MATTER; } @@ -32393,14 +32407,14 @@ case 1483: /* Line 1455 of yacc.c */ -#line 11202 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11216 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.select_lex)= Select; } break; case 1484: /* Line 1455 of yacc.c */ -#line 11207 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11221 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -32428,21 +32442,21 @@ case 1485: /* Line 1455 of yacc.c */ -#line 11232 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11246 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1486: /* Line 1455 of yacc.c */ -#line 11233 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1487: /* Line 1455 of yacc.c */ -#line 11238 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11252 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= old_mode ? INDEX_HINT_MASK_JOIN : INDEX_HINT_MASK_ALL; } @@ -32451,42 +32465,42 @@ case 1488: /* Line 1455 of yacc.c */ -#line 11241 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11255 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= INDEX_HINT_MASK_JOIN; } break; case 1489: /* Line 1455 of yacc.c */ -#line 11242 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= INDEX_HINT_MASK_ORDER; } break; case 1490: /* Line 1455 of yacc.c */ -#line 11243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11257 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= INDEX_HINT_MASK_GROUP; } break; case 1491: /* Line 1455 of yacc.c */ -#line 11247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11261 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.index_hint)= INDEX_HINT_FORCE; } break; case 1492: /* Line 1455 of yacc.c */ -#line 11248 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11262 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.index_hint)= INDEX_HINT_IGNORE; } break; case 1493: /* Line 1455 of yacc.c */ -#line 11253 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11267 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_index_hint_type((yyvsp[(1) - (3)].index_hint), (yyvsp[(3) - (3)].num)); } @@ -32495,7 +32509,7 @@ case 1495: /* Line 1455 of yacc.c */ -#line 11258 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11272 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_index_hint_type(INDEX_HINT_USE, (yyvsp[(3) - (3)].num)); } @@ -32504,49 +32518,49 @@ case 1500: /* Line 1455 of yacc.c */ -#line 11271 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11285 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->alloc_index_hints(YYTHD); } break; case 1502: /* Line 1455 of yacc.c */ -#line 11275 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11289 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->clear_index_hints(); } break; case 1504: /* Line 1455 of yacc.c */ -#line 11280 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11294 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->add_index_hint(YYTHD, NULL, 0); } break; case 1505: /* Line 1455 of yacc.c */ -#line 11281 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11295 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1506: /* Line 1455 of yacc.c */ -#line 11286 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11300 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->add_index_hint(YYTHD, (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); } break; case 1507: /* Line 1455 of yacc.c */ -#line 11288 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11302 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->add_index_hint(YYTHD, (char *)"PRIMARY", 7); } break; case 1510: /* Line 1455 of yacc.c */ -#line 11298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11312 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.string_list)= new List)) MYSQL_YYABORT; @@ -32562,7 +32576,7 @@ case 1511: /* Line 1455 of yacc.c */ -#line 11309 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11323 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { String *s= new (YYTHD->mem_root) String((const char *) (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length, @@ -32577,189 +32591,189 @@ case 1512: /* Line 1455 of yacc.c */ -#line 11321 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11335 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1513: /* Line 1455 of yacc.c */ -#line 11322 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11336 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_HOUR; } break; case 1514: /* Line 1455 of yacc.c */ -#line 11323 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_MICROSECOND; } break; case 1515: /* Line 1455 of yacc.c */ -#line 11324 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11338 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_MINUTE; } break; case 1516: /* Line 1455 of yacc.c */ -#line 11325 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11339 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_DAY_SECOND; } break; case 1517: /* Line 1455 of yacc.c */ -#line 11326 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11340 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_MICROSECOND; } break; case 1518: /* Line 1455 of yacc.c */ -#line 11327 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11341 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_MINUTE; } break; case 1519: /* Line 1455 of yacc.c */ -#line 11328 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11342 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_HOUR_SECOND; } break; case 1520: /* Line 1455 of yacc.c */ -#line 11329 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11343 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_MINUTE_MICROSECOND; } break; case 1521: /* Line 1455 of yacc.c */ -#line 11330 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11344 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_MINUTE_SECOND; } break; case 1522: /* Line 1455 of yacc.c */ -#line 11331 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11345 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_SECOND_MICROSECOND; } break; case 1523: /* Line 1455 of yacc.c */ -#line 11332 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11346 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval)=INTERVAL_YEAR_MONTH; } break; case 1524: /* Line 1455 of yacc.c */ -#line 11336 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11350 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_DAY; } break; case 1525: /* Line 1455 of yacc.c */ -#line 11337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11351 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_WEEK; } break; case 1526: /* Line 1455 of yacc.c */ -#line 11338 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11352 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_HOUR; } break; case 1527: /* Line 1455 of yacc.c */ -#line 11339 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MINUTE; } break; case 1528: /* Line 1455 of yacc.c */ -#line 11340 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11354 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MONTH; } break; case 1529: /* Line 1455 of yacc.c */ -#line 11341 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11355 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_QUARTER; } break; case 1530: /* Line 1455 of yacc.c */ -#line 11342 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11356 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_SECOND; } break; case 1531: /* Line 1455 of yacc.c */ -#line 11343 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_MICROSECOND; } break; case 1532: /* Line 1455 of yacc.c */ -#line 11344 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11358 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.interval_time_st)=INTERVAL_YEAR; } break; case 1533: /* Line 1455 of yacc.c */ -#line 11348 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11362 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.date_time_type)= MYSQL_TIMESTAMP_DATE; } break; case 1534: /* Line 1455 of yacc.c */ -#line 11349 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.date_time_type)= MYSQL_TIMESTAMP_TIME; } break; case 1535: /* Line 1455 of yacc.c */ -#line 11350 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11364 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.date_time_type)= MYSQL_TIMESTAMP_DATETIME; } break; case 1536: /* Line 1455 of yacc.c */ -#line 11351 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11365 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.date_time_type)= MYSQL_TIMESTAMP_DATETIME; } break; case 1540: /* Line 1455 of yacc.c */ -#line 11361 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11375 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str_ptr)=0; } break; case 1541: /* Line 1455 of yacc.c */ -#line 11363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str_ptr)= (LEX_STRING*) sql_memdup(&(yyvsp[(2) - (2)].lex_str),sizeof(LEX_STRING)); if ((yyval.lex_str_ptr) == NULL) @@ -32770,14 +32784,14 @@ case 1544: /* Line 1455 of yacc.c */ -#line 11376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->where= 0; } break; case 1545: /* Line 1455 of yacc.c */ -#line 11378 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11392 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= IN_WHERE; } @@ -32786,7 +32800,7 @@ case 1546: /* Line 1455 of yacc.c */ -#line 11382 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11396 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *select= Select; select->where= (yyvsp[(3) - (3)].item); @@ -32799,7 +32813,7 @@ case 1548: /* Line 1455 of yacc.c */ -#line 11394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= IN_HAVING; } @@ -32808,7 +32822,7 @@ case 1549: /* Line 1455 of yacc.c */ -#line 11398 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11412 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; sel->having= (yyvsp[(3) - (3)].item); @@ -32821,7 +32835,7 @@ case 1550: /* Line 1455 of yacc.c */ -#line 11409 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11423 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->escape_used= TRUE; (yyval.item)= (yyvsp[(2) - (2)].item); @@ -32831,7 +32845,7 @@ case 1551: /* Line 1455 of yacc.c */ -#line 11414 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11428 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; Lex->escape_used= FALSE; @@ -32846,28 +32860,28 @@ case 1554: /* Line 1455 of yacc.c */ -#line 11436 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11450 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_group_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1555: /* Line 1455 of yacc.c */ -#line 11438 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11452 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_group_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1556: /* Line 1455 of yacc.c */ -#line 11442 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11456 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1557: /* Line 1455 of yacc.c */ -#line 11444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* 'WITH CUBE' is reserved in the MySQL syntax, but not implemented, @@ -32892,7 +32906,7 @@ case 1558: /* Line 1455 of yacc.c */ -#line 11464 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11478 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* 'WITH ROLLUP' is needed for backward compatibility, @@ -32921,7 +32935,7 @@ case 1562: /* Line 1455 of yacc.c */ -#line 11504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; bool ascending= ((yyvsp[(2) - (2)].num) == 1) ? true : false; @@ -32933,7 +32947,7 @@ case 1565: /* Line 1455 of yacc.c */ -#line 11523 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; SELECT_LEX *sel= lex->current_select; @@ -32969,42 +32983,42 @@ case 1567: /* Line 1455 of yacc.c */ -#line 11558 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11572 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_order_to_list(YYTHD, (yyvsp[(3) - (4)].item),(bool) (yyvsp[(4) - (4)].num))) MYSQL_YYABORT; } break; case 1568: /* Line 1455 of yacc.c */ -#line 11560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11574 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_order_to_list(YYTHD, (yyvsp[(1) - (2)].item),(bool) (yyvsp[(2) - (2)].num))) MYSQL_YYABORT; } break; case 1569: /* Line 1455 of yacc.c */ -#line 11564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num) = 1; } break; case 1570: /* Line 1455 of yacc.c */ -#line 11565 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num) =1; } break; case 1571: /* Line 1455 of yacc.c */ -#line 11566 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11580 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num) =0; } break; case 1572: /* Line 1455 of yacc.c */ -#line 11571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; SELECT_LEX *sel= lex->current_select; @@ -33016,28 +33030,28 @@ case 1573: /* Line 1455 of yacc.c */ -#line 11577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1574: /* Line 1455 of yacc.c */ -#line 11581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11595 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1575: /* Line 1455 of yacc.c */ -#line 11582 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11596 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1576: /* Line 1455 of yacc.c */ -#line 11587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11601 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Select->select_limit->fixed && Select->select_limit->val_int() != 0) @@ -33050,7 +33064,7 @@ case 1577: /* Line 1455 of yacc.c */ -#line 11598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(1) - (1)].item); @@ -33062,7 +33076,7 @@ case 1578: /* Line 1455 of yacc.c */ -#line 11605 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11619 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(3) - (3)].item); @@ -33074,7 +33088,7 @@ case 1579: /* Line 1455 of yacc.c */ -#line 11612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11626 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(1) - (3)].item); @@ -33086,7 +33100,7 @@ case 1580: /* Line 1455 of yacc.c */ -#line 11622 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -33118,7 +33132,7 @@ case 1581: /* Line 1455 of yacc.c */ -#line 11649 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11663 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { ((Item_param *) (yyvsp[(1) - (1)].item))->limit_clause_param= TRUE; } @@ -33127,7 +33141,7 @@ case 1582: /* Line 1455 of yacc.c */ -#line 11653 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11667 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if ((yyval.item) == NULL) @@ -33138,7 +33152,7 @@ case 1583: /* Line 1455 of yacc.c */ -#line 11659 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if ((yyval.item) == NULL) @@ -33149,7 +33163,7 @@ case 1584: /* Line 1455 of yacc.c */ -#line 11665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if ((yyval.item) == NULL) @@ -33160,7 +33174,7 @@ case 1585: /* Line 1455 of yacc.c */ -#line 11674 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11688 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->current_select->select_limit= 0; @@ -33170,7 +33184,7 @@ case 1586: /* Line 1455 of yacc.c */ -#line 11679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; sel->select_limit= (yyvsp[(2) - (2)].item); @@ -33186,154 +33200,154 @@ case 1587: /* Line 1455 of yacc.c */ -#line 11692 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1588: /* Line 1455 of yacc.c */ -#line 11693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11707 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); } break; case 1589: /* Line 1455 of yacc.c */ -#line 11694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11708 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1590: /* Line 1455 of yacc.c */ -#line 11695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1591: /* Line 1455 of yacc.c */ -#line 11696 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1592: /* Line 1455 of yacc.c */ -#line 11697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1593: /* Line 1455 of yacc.c */ -#line 11701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1594: /* Line 1455 of yacc.c */ -#line 11702 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ulong_num)= (ulong) strtol((yyvsp[(1) - (1)].lex_str).str, (char**) 0, 16); } break; case 1595: /* Line 1455 of yacc.c */ -#line 11703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1596: /* Line 1455 of yacc.c */ -#line 11704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulong_num)= (ulong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1597: /* Line 1455 of yacc.c */ -#line 11705 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT; } break; case 1598: /* Line 1455 of yacc.c */ -#line 11709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1599: /* Line 1455 of yacc.c */ -#line 11710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1600: /* Line 1455 of yacc.c */ -#line 11711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1601: /* Line 1455 of yacc.c */ -#line 11712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11726 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1602: /* Line 1455 of yacc.c */ -#line 11713 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1603: /* Line 1455 of yacc.c */ -#line 11717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11731 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1604: /* Line 1455 of yacc.c */ -#line 11718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1605: /* Line 1455 of yacc.c */ -#line 11719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11733 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); } break; case 1606: /* Line 1455 of yacc.c */ -#line 11720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT; } break; case 1607: /* Line 1455 of yacc.c */ -#line 11725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11739 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { my_parse_error(ER(ER_ONLY_INTEGERS_ALLOWED)); } break; case 1611: /* Line 1455 of yacc.c */ -#line 11736 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11750 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -33368,14 +33382,14 @@ case 1613: /* Line 1455 of yacc.c */ -#line 11769 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11783 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1614: /* Line 1455 of yacc.c */ -#line 11771 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11785 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->proc_analyse->max_tree_elements= (yyvsp[(1) - (1)].ulonglong_number); } @@ -33384,7 +33398,7 @@ case 1615: /* Line 1455 of yacc.c */ -#line 11775 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11789 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->proc_analyse->max_tree_elements= (yyvsp[(1) - (3)].ulonglong_number); Lex->proc_analyse->max_treemem= (yyvsp[(3) - (3)].ulonglong_number); @@ -33394,7 +33408,7 @@ case 1616: /* Line 1455 of yacc.c */ -#line 11783 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11797 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.ulonglong_number)= (ulonglong) my_strtoll10((yyvsp[(1) - (1)].lex_str).str, (char**) 0, &error); @@ -33409,7 +33423,7 @@ case 1617: /* Line 1455 of yacc.c */ -#line 11795 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11809 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe && (!(lex->result= new select_dumpvar()))) @@ -33420,21 +33434,21 @@ case 1618: /* Line 1455 of yacc.c */ -#line 11801 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11815 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1620: /* Line 1455 of yacc.c */ -#line 11806 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11820 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1621: /* Line 1455 of yacc.c */ -#line 11811 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11825 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->result) @@ -33458,7 +33472,7 @@ case 1622: /* Line 1455 of yacc.c */ -#line 11830 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11844 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; #ifndef DBUG_OFF @@ -33499,7 +33513,7 @@ case 1623: /* Line 1455 of yacc.c */ -#line 11869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (! Lex->parsing_options.allows_select_into) { @@ -33512,7 +33526,7 @@ case 1625: /* Line 1455 of yacc.c */ -#line 11881 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11895 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_SIDEEFFECT); @@ -33525,14 +33539,14 @@ case 1626: /* Line 1455 of yacc.c */ -#line 11889 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11903 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->exchange->cs= (yyvsp[(4) - (4)].charset); } break; case 1628: /* Line 1455 of yacc.c */ -#line 11892 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11906 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!lex->describe) @@ -33549,7 +33563,7 @@ case 1629: /* Line 1455 of yacc.c */ -#line 11904 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } @@ -33558,7 +33572,7 @@ case 1630: /* Line 1455 of yacc.c */ -#line 11915 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11929 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DO; @@ -33569,7 +33583,7 @@ case 1631: /* Line 1455 of yacc.c */ -#line 11921 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11935 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->insert_list= (yyvsp[(3) - (3)].item_list); } @@ -33578,7 +33592,7 @@ case 1632: /* Line 1455 of yacc.c */ -#line 11932 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11946 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_DROP_TABLE; @@ -33592,21 +33606,21 @@ case 1633: /* Line 1455 of yacc.c */ -#line 11941 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11955 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1634: /* Line 1455 of yacc.c */ -#line 11942 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11956 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1635: /* Line 1455 of yacc.c */ -#line 11943 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11957 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; Alter_drop *ad= new Alter_drop(Alter_drop::KEY, (yyvsp[(3) - (6)].lex_str).str); @@ -33627,14 +33641,14 @@ case 1636: /* Line 1455 of yacc.c */ -#line 11958 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11972 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1637: /* Line 1455 of yacc.c */ -#line 11960 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_DB; @@ -33646,7 +33660,7 @@ case 1638: /* Line 1455 of yacc.c */ -#line 11967 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 11981 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -33672,7 +33686,7 @@ case 1639: /* Line 1455 of yacc.c */ -#line 11988 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12002 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -33698,7 +33712,7 @@ case 1640: /* Line 1455 of yacc.c */ -#line 12009 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12023 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -33715,7 +33729,7 @@ case 1641: /* Line 1455 of yacc.c */ -#line 12021 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12035 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_DROP_USER; } @@ -33724,7 +33738,7 @@ case 1642: /* Line 1455 of yacc.c */ -#line 12025 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12039 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_VIEW; @@ -33737,14 +33751,14 @@ case 1643: /* Line 1455 of yacc.c */ -#line 12033 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1644: /* Line 1455 of yacc.c */ -#line 12035 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12049 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->drop_if_exists= (yyvsp[(3) - (4)].num); Lex->spname= (yyvsp[(4) - (4)].spname); @@ -33755,7 +33769,7 @@ case 1645: /* Line 1455 of yacc.c */ -#line 12041 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12055 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DROP_TRIGGER; @@ -33767,7 +33781,7 @@ case 1646: /* Line 1455 of yacc.c */ -#line 12048 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12062 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE; @@ -33777,7 +33791,7 @@ case 1647: /* Line 1455 of yacc.c */ -#line 12053 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12067 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP; @@ -33787,7 +33801,7 @@ case 1648: /* Line 1455 of yacc.c */ -#line 12058 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12072 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_DROP_SERVER; Lex->drop_if_exists= (yyvsp[(3) - (4)].num); @@ -33799,7 +33813,7 @@ case 1649: /* Line 1455 of yacc.c */ -#line 12065 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12079 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_DROP_COMPRESSION_DICTIONARY; Lex->drop_if_exists= (yyvsp[(3) - (4)].num); @@ -33810,7 +33824,7 @@ case 1652: /* Line 1455 of yacc.c */ -#line 12079 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12093 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING, @@ -33823,7 +33837,7 @@ case 1653: /* Line 1455 of yacc.c */ -#line 12090 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12104 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (2)].table), NULL, TL_OPTION_UPDATING, @@ -33838,7 +33852,7 @@ case 1656: /* Line 1455 of yacc.c */ -#line 12108 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(1) - (1)].table), NULL, TL_OPTION_UPDATING | TL_OPTION_ALIAS, @@ -33851,35 +33865,35 @@ case 1657: /* Line 1455 of yacc.c */ -#line 12118 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12132 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 1658: /* Line 1455 of yacc.c */ -#line 12119 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12133 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 1659: /* Line 1455 of yacc.c */ -#line 12123 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12137 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 1660: /* Line 1455 of yacc.c */ -#line 12124 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12138 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 1668: /* Line 1455 of yacc.c */ -#line 12147 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12161 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_INSERT; @@ -33891,7 +33905,7 @@ case 1669: /* Line 1455 of yacc.c */ -#line 12155 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12169 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_lock_for_tables((yyvsp[(3) - (5)].lock_type)); Lex->current_select= &Lex->select_lex; @@ -33901,14 +33915,14 @@ case 1670: /* Line 1455 of yacc.c */ -#line 12160 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12174 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1671: /* Line 1455 of yacc.c */ -#line 12165 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12179 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_REPLACE; @@ -33920,7 +33934,7 @@ case 1672: /* Line 1455 of yacc.c */ -#line 12172 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12186 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_lock_for_tables((yyvsp[(3) - (4)].lock_type)); Lex->current_select= &Lex->select_lex; @@ -33930,14 +33944,14 @@ case 1673: /* Line 1455 of yacc.c */ -#line 12177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12191 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1674: /* Line 1455 of yacc.c */ -#line 12182 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12196 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -33955,14 +33969,14 @@ case 1675: /* Line 1455 of yacc.c */ -#line 12194 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12208 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1676: /* Line 1455 of yacc.c */ -#line 12196 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12210 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->keyword_delayed_begin_offset= (uint)(YYLIP->get_tok_start() - YYTHD->query()); @@ -33980,21 +33994,21 @@ case 1677: /* Line 1455 of yacc.c */ -#line 12208 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12222 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lock_type)= TL_WRITE; } break; case 1678: /* Line 1455 of yacc.c */ -#line 12212 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12226 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lock_type)= (yyvsp[(1) - (1)].lock_type); } break; case 1679: /* Line 1455 of yacc.c */ -#line 12214 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12228 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->keyword_delayed_begin_offset= (uint)(YYLIP->get_tok_start() - YYTHD->query()); @@ -34012,21 +34026,21 @@ case 1680: /* Line 1455 of yacc.c */ -#line 12229 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1681: /* Line 1455 of yacc.c */ -#line 12230 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12244 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1682: /* Line 1455 of yacc.c */ -#line 12235 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12249 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->field_list.empty(); @@ -34038,28 +34052,28 @@ case 1683: /* Line 1455 of yacc.c */ -#line 12243 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12257 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1684: /* Line 1455 of yacc.c */ -#line 12244 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12258 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1685: /* Line 1455 of yacc.c */ -#line 12245 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12259 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1686: /* Line 1455 of yacc.c */ -#line 12247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12261 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!(lex->insert_list = new List_item) || @@ -34071,63 +34085,63 @@ case 1688: /* Line 1455 of yacc.c */ -#line 12257 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12271 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1689: /* Line 1455 of yacc.c */ -#line 12258 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12272 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1690: /* Line 1455 of yacc.c */ -#line 12262 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12276 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1691: /* Line 1455 of yacc.c */ -#line 12263 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12277 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1692: /* Line 1455 of yacc.c */ -#line 12265 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12279 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_braces(0);} break; case 1693: /* Line 1455 of yacc.c */ -#line 12266 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12280 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1694: /* Line 1455 of yacc.c */ -#line 12268 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12282 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->set_braces(1);} break; case 1695: /* Line 1455 of yacc.c */ -#line 12269 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12283 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1700: /* Line 1455 of yacc.c */ -#line 12284 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->field_list.push_back((yyvsp[(1) - (3)].item)) || @@ -34139,35 +34153,35 @@ case 1701: /* Line 1455 of yacc.c */ -#line 12293 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12307 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1702: /* Line 1455 of yacc.c */ -#line 12294 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12308 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1703: /* Line 1455 of yacc.c */ -#line 12298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12312 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1704: /* Line 1455 of yacc.c */ -#line 12299 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12313 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1705: /* Line 1455 of yacc.c */ -#line 12304 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12318 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!(Lex->insert_list = new List_item)) MYSQL_YYABORT; @@ -34177,7 +34191,7 @@ case 1706: /* Line 1455 of yacc.c */ -#line 12309 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12323 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->many_values.push_back(lex->insert_list)) @@ -34188,14 +34202,14 @@ case 1707: /* Line 1455 of yacc.c */ -#line 12317 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12331 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1709: /* Line 1455 of yacc.c */ -#line 12323 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->insert_list->push_back((yyvsp[(3) - (3)].item))) MYSQL_YYABORT; @@ -34205,7 +34219,7 @@ case 1710: /* Line 1455 of yacc.c */ -#line 12328 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12342 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->insert_list->push_back((yyvsp[(1) - (1)].item))) MYSQL_YYABORT; @@ -34215,14 +34229,14 @@ case 1711: /* Line 1455 of yacc.c */ -#line 12335 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12349 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1712: /* Line 1455 of yacc.c */ -#line 12337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12351 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_default_value(Lex->current_context()); if ((yyval.item) == NULL) @@ -34233,14 +34247,14 @@ case 1714: /* Line 1455 of yacc.c */ -#line 12346 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12360 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->duplicates= DUP_UPDATE; } break; case 1716: /* Line 1455 of yacc.c */ -#line 12354 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12368 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -34252,7 +34266,7 @@ case 1717: /* Line 1455 of yacc.c */ -#line 12362 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->select_lex.table_list.elements > 1) @@ -34276,14 +34290,14 @@ case 1718: /* Line 1455 of yacc.c */ -#line 12380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1721: /* Line 1455 of yacc.c */ -#line 12390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_item_to_list(YYTHD, (yyvsp[(1) - (3)].item)) || add_value_to_list(YYTHD, (yyvsp[(3) - (3)].item))) MYSQL_YYABORT; @@ -34293,7 +34307,7 @@ case 1724: /* Line 1455 of yacc.c */ -#line 12403 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12417 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->update_list.push_back((yyvsp[(1) - (3)].item)) || @@ -34305,21 +34319,21 @@ case 1725: /* Line 1455 of yacc.c */ -#line 12412 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12426 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1726: /* Line 1455 of yacc.c */ -#line 12413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12427 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1727: /* Line 1455 of yacc.c */ -#line 12420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12434 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; @@ -34335,7 +34349,7 @@ case 1729: /* Line 1455 of yacc.c */ -#line 12435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12449 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!Select->add_table_to_list(YYTHD, (yyvsp[(2) - (3)].table), NULL, TL_OPTION_UPDATING, YYPS->m_lock_type, @@ -34351,14 +34365,14 @@ case 1730: /* Line 1455 of yacc.c */ -#line 12446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12460 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1731: /* Line 1455 of yacc.c */ -#line 12448 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12462 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { mysql_init_multi_delete(Lex); YYPS->m_lock_type= TL_READ_DEFAULT; @@ -34369,7 +34383,7 @@ case 1732: /* Line 1455 of yacc.c */ -#line 12454 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12468 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -34379,7 +34393,7 @@ case 1733: /* Line 1455 of yacc.c */ -#line 12459 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12473 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { mysql_init_multi_delete(Lex); YYPS->m_lock_type= TL_READ_DEFAULT; @@ -34390,7 +34404,7 @@ case 1734: /* Line 1455 of yacc.c */ -#line 12465 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12479 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (multi_delete_set_locks_and_link_aux_tables(Lex)) MYSQL_YYABORT; @@ -34400,7 +34414,7 @@ case 1737: /* Line 1455 of yacc.c */ -#line 12478 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12492 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Table_ident *ti= new Table_ident((yyvsp[(1) - (2)].lex_str)); if (ti == NULL) @@ -34418,7 +34432,7 @@ case 1738: /* Line 1455 of yacc.c */ -#line 12491 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Table_ident *ti= new Table_ident(YYTHD, (yyvsp[(1) - (4)].lex_str), (yyvsp[(3) - (4)].lex_str), 0); if (ti == NULL) @@ -34436,56 +34450,56 @@ case 1739: /* Line 1455 of yacc.c */ -#line 12506 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12520 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1740: /* Line 1455 of yacc.c */ -#line 12507 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12521 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1741: /* Line 1455 of yacc.c */ -#line 12511 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12525 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1742: /* Line 1455 of yacc.c */ -#line 12512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1743: /* Line 1455 of yacc.c */ -#line 12516 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12530 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->options|= OPTION_QUICK; } break; case 1744: /* Line 1455 of yacc.c */ -#line 12517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12531 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { YYPS->m_lock_type= TL_WRITE_LOW_PRIORITY; } break; case 1745: /* Line 1455 of yacc.c */ -#line 12518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12532 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ignore= 1; } break; case 1746: /* Line 1455 of yacc.c */ -#line 12523 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX* lex= Lex; lex->sql_command= SQLCOM_TRUNCATE; @@ -34501,7 +34515,7 @@ case 1747: /* Line 1455 of yacc.c */ -#line 12534 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12548 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX* lex= thd->lex; @@ -34515,7 +34529,7 @@ case 1754: /* Line 1455 of yacc.c */ -#line 12559 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_CPU; } @@ -34524,7 +34538,7 @@ case 1755: /* Line 1455 of yacc.c */ -#line 12563 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_MEMORY; } @@ -34533,7 +34547,7 @@ case 1756: /* Line 1455 of yacc.c */ -#line 12567 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_BLOCK_IO; } @@ -34542,7 +34556,7 @@ case 1757: /* Line 1455 of yacc.c */ -#line 12571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_CONTEXT; } @@ -34551,7 +34565,7 @@ case 1758: /* Line 1455 of yacc.c */ -#line 12575 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12589 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_PAGE_FAULTS; } @@ -34560,7 +34574,7 @@ case 1759: /* Line 1455 of yacc.c */ -#line 12579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_IPC; } @@ -34569,7 +34583,7 @@ case 1760: /* Line 1455 of yacc.c */ -#line 12583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12597 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_SWAPS; } @@ -34578,7 +34592,7 @@ case 1761: /* Line 1455 of yacc.c */ -#line 12587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12601 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_SOURCE; } @@ -34587,7 +34601,7 @@ case 1762: /* Line 1455 of yacc.c */ -#line 12591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12605 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_options|= PROFILE_ALL; } @@ -34596,7 +34610,7 @@ case 1763: /* Line 1455 of yacc.c */ -#line 12598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_query_id= 0; } @@ -34605,7 +34619,7 @@ case 1764: /* Line 1455 of yacc.c */ -#line 12602 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->profile_query_id= atoi((yyvsp[(3) - (3)].lex_str).str); } @@ -34614,7 +34628,7 @@ case 1765: /* Line 1455 of yacc.c */ -#line 12611 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12625 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->wild=0; @@ -34627,7 +34641,7 @@ case 1766: /* Line 1455 of yacc.c */ -#line 12619 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= NO_MATTER; } @@ -34636,7 +34650,7 @@ case 1767: /* Line 1455 of yacc.c */ -#line 12626 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12640 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_DATABASES; @@ -34648,7 +34662,7 @@ case 1768: /* Line 1455 of yacc.c */ -#line 12633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12647 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_TABLES; @@ -34661,7 +34675,7 @@ case 1769: /* Line 1455 of yacc.c */ -#line 12641 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12655 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_TRIGGERS; @@ -34674,7 +34688,7 @@ case 1770: /* Line 1455 of yacc.c */ -#line 12649 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12663 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_EVENTS; @@ -34687,7 +34701,7 @@ case 1771: /* Line 1455 of yacc.c */ -#line 12657 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12671 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_TABLE_STATUS; @@ -34700,7 +34714,7 @@ case 1772: /* Line 1455 of yacc.c */ -#line 12665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_OPEN_TABLES; @@ -34713,7 +34727,7 @@ case 1773: /* Line 1455 of yacc.c */ -#line 12673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12687 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_PLUGINS; @@ -34725,21 +34739,21 @@ case 1774: /* Line 1455 of yacc.c */ -#line 12680 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.db_type= (yyvsp[(2) - (3)].db_type); } break; case 1775: /* Line 1455 of yacc.c */ -#line 12682 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12696 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_info.db_type= NULL; } break; case 1776: /* Line 1455 of yacc.c */ -#line 12684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_FIELDS; @@ -34753,7 +34767,7 @@ case 1777: /* Line 1455 of yacc.c */ -#line 12693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12707 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_BINLOGS; } @@ -34762,7 +34776,7 @@ case 1778: /* Line 1455 of yacc.c */ -#line 12697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_HOSTS; } @@ -34771,7 +34785,7 @@ case 1779: /* Line 1455 of yacc.c */ -#line 12701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS; @@ -34781,7 +34795,7 @@ case 1781: /* Line 1455 of yacc.c */ -#line 12706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_RELAYLOG_EVENTS; @@ -34791,7 +34805,7 @@ case 1783: /* Line 1455 of yacc.c */ -#line 12711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_KEYS; @@ -34805,7 +34819,7 @@ case 1784: /* Line 1455 of yacc.c */ -#line 12720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES; @@ -34817,7 +34831,7 @@ case 1785: /* Line 1455 of yacc.c */ -#line 12727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12741 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_PRIVILEGES; @@ -34827,35 +34841,35 @@ case 1786: /* Line 1455 of yacc.c */ -#line 12732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12746 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (void) create_select_for_variable("warning_count"); } break; case 1787: /* Line 1455 of yacc.c */ -#line 12734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12748 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (void) create_select_for_variable("error_count"); } break; case 1788: /* Line 1455 of yacc.c */ -#line 12736 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12750 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_WARNS;} break; case 1789: /* Line 1455 of yacc.c */ -#line 12738 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12752 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_ERRORS;} break; case 1790: /* Line 1455 of yacc.c */ -#line 12740 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12754 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN, ER_WARN_DEPRECATED_SYNTAX, @@ -34868,7 +34882,7 @@ case 1791: /* Line 1455 of yacc.c */ -#line 12748 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12762 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { push_warning_printf(YYTHD, Sql_condition::WARN_LEVEL_WARN, ER_WARN_DEPRECATED_SYNTAX, @@ -34884,7 +34898,7 @@ case 1792: /* Line 1455 of yacc.c */ -#line 12759 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12773 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_STATUS; @@ -34897,14 +34911,14 @@ case 1793: /* Line 1455 of yacc.c */ -#line 12767 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12781 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;} break; case 1794: /* Line 1455 of yacc.c */ -#line 12769 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12783 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_VARIABLES; @@ -34917,7 +34931,7 @@ case 1795: /* Line 1455 of yacc.c */ -#line 12777 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12791 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_CHARSETS; @@ -34929,7 +34943,7 @@ case 1796: /* Line 1455 of yacc.c */ -#line 12784 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12798 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_COLLATIONS; @@ -34941,7 +34955,7 @@ case 1797: /* Line 1455 of yacc.c */ -#line 12791 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12805 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -34956,7 +34970,7 @@ case 1798: /* Line 1455 of yacc.c */ -#line 12801 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12815 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; @@ -34968,7 +34982,7 @@ case 1799: /* Line 1455 of yacc.c */ -#line 12808 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12822 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command=SQLCOM_SHOW_CREATE_DB; Lex->create_info.options=(yyvsp[(3) - (4)].num); @@ -34979,7 +34993,7 @@ case 1800: /* Line 1455 of yacc.c */ -#line 12814 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12828 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; @@ -34993,7 +35007,7 @@ case 1801: /* Line 1455 of yacc.c */ -#line 12823 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12837 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command = SQLCOM_SHOW_CREATE; @@ -35006,7 +35020,7 @@ case 1802: /* Line 1455 of yacc.c */ -#line 12831 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12845 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_MASTER_STAT; } @@ -35015,7 +35029,7 @@ case 1803: /* Line 1455 of yacc.c */ -#line 12835 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12849 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT; } @@ -35024,7 +35038,7 @@ case 1804: /* Line 1455 of yacc.c */ -#line 12840 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12854 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_NOLOCK_STAT; } @@ -35033,7 +35047,7 @@ case 1805: /* Line 1455 of yacc.c */ -#line 12844 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12858 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_SHOW_SLAVE_NOLOCK_STAT; } @@ -35042,7 +35056,7 @@ case 1806: /* Line 1455 of yacc.c */ -#line 12848 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12862 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; Lex->sql_command= SQLCOM_SELECT; @@ -35054,7 +35068,7 @@ case 1807: /* Line 1455 of yacc.c */ -#line 12855 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -35066,7 +35080,7 @@ case 1808: /* Line 1455 of yacc.c */ -#line 12862 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12876 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; Lex->sql_command= SQLCOM_SELECT; @@ -35078,7 +35092,7 @@ case 1809: /* Line 1455 of yacc.c */ -#line 12869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -35090,7 +35104,7 @@ case 1810: /* Line 1455 of yacc.c */ -#line 12876 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12890 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SELECT; @@ -35102,7 +35116,7 @@ case 1811: /* Line 1455 of yacc.c */ -#line 12883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12897 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -35114,7 +35128,7 @@ case 1812: /* Line 1455 of yacc.c */ -#line 12890 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12904 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; @@ -35126,7 +35140,7 @@ case 1813: /* Line 1455 of yacc.c */ -#line 12897 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12911 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_CREATE_TRIGGER; @@ -35137,7 +35151,7 @@ case 1814: /* Line 1455 of yacc.c */ -#line 12903 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12917 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_STATUS_PROC; @@ -35149,7 +35163,7 @@ case 1815: /* Line 1455 of yacc.c */ -#line 12910 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12924 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_STATUS_FUNC; @@ -35161,7 +35175,7 @@ case 1816: /* Line 1455 of yacc.c */ -#line 12917 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12931 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_PROC_CODE; Lex->spname= (yyvsp[(3) - (3)].spname); @@ -35171,7 +35185,7 @@ case 1817: /* Line 1455 of yacc.c */ -#line 12922 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12936 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_FUNC_CODE; Lex->spname= (yyvsp[(3) - (3)].spname); @@ -35181,7 +35195,7 @@ case 1818: /* Line 1455 of yacc.c */ -#line 12927 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12941 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->spname= (yyvsp[(3) - (3)].spname); Lex->sql_command = SQLCOM_SHOW_CREATE_EVENT; @@ -35191,84 +35205,84 @@ case 1819: /* Line 1455 of yacc.c */ -#line 12935 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12949 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS; } break; case 1820: /* Line 1455 of yacc.c */ -#line 12937 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12951 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_ENGINE_MUTEX; } break; case 1821: /* Line 1455 of yacc.c */ -#line 12939 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12953 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_SHOW_ENGINE_LOGS; } break; case 1826: /* Line 1455 of yacc.c */ -#line 12953 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12967 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.simple_string)= 0; } break; case 1827: /* Line 1455 of yacc.c */ -#line 12954 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.simple_string)= (yyvsp[(2) - (2)].lex_str).str; } break; case 1828: /* Line 1455 of yacc.c */ -#line 12958 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12972 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->verbose=0; } break; case 1829: /* Line 1455 of yacc.c */ -#line 12959 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12973 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->verbose=1; } break; case 1832: /* Line 1455 of yacc.c */ -#line 12968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12982 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.log_file_name = 0; } break; case 1833: /* Line 1455 of yacc.c */ -#line 12969 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12983 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.log_file_name = (yyvsp[(2) - (2)].lex_str).str; } break; case 1834: /* Line 1455 of yacc.c */ -#line 12973 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12987 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.pos = 4; /* skip magic number */ } break; case 1835: /* Line 1455 of yacc.c */ -#line 12974 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12988 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->mi.pos = (yyvsp[(2) - (2)].ulonglong_number); } break; case 1837: /* Line 1455 of yacc.c */ -#line 12980 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 12994 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->wild= new (YYTHD->mem_root) String((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, system_charset_info); @@ -35280,7 +35294,7 @@ case 1838: /* Line 1455 of yacc.c */ -#line 12987 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13001 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->where= (yyvsp[(2) - (2)].item); if ((yyvsp[(2) - (2)].item)) @@ -35291,7 +35305,7 @@ case 1839: /* Line 1455 of yacc.c */ -#line 12997 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13011 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -35307,7 +35321,7 @@ case 1840: /* Line 1455 of yacc.c */ -#line 13008 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13022 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->parsing_place= NO_MATTER; } @@ -35316,21 +35330,21 @@ case 1841: /* Line 1455 of yacc.c */ -#line 13012 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13026 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->describe|= DESCRIBE_NORMAL; } break; case 1842: /* Line 1455 of yacc.c */ -#line 13014 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13028 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->select_lex.options|= SELECT_DESCRIBE; } break; case 1850: /* Line 1455 of yacc.c */ -#line 13032 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13046 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((Lex->explain_format= new Explain_format_traditional) == NULL) MYSQL_YYABORT; @@ -35340,7 +35354,7 @@ case 1851: /* Line 1455 of yacc.c */ -#line 13037 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13051 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((Lex->explain_format= new Explain_format_traditional) == NULL) MYSQL_YYABORT; @@ -35351,7 +35365,7 @@ case 1852: /* Line 1455 of yacc.c */ -#line 13043 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13057 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((Lex->explain_format= new Explain_format_traditional) == NULL) MYSQL_YYABORT; @@ -35362,7 +35376,7 @@ case 1853: /* Line 1455 of yacc.c */ -#line 13049 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13063 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!my_strcasecmp(system_charset_info, (yyvsp[(3) - (3)].lex_str).str, "JSON")) { @@ -35386,21 +35400,21 @@ case 1854: /* Line 1455 of yacc.c */ -#line 13070 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13084 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1855: /* Line 1455 of yacc.c */ -#line 13071 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13085 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->wild= (yyvsp[(1) - (1)].string); } break; case 1856: /* Line 1455 of yacc.c */ -#line 13073 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13087 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->wild= new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, @@ -35413,7 +35427,7 @@ case 1857: /* Line 1455 of yacc.c */ -#line 13087 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13101 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_FLUSH; @@ -35425,14 +35439,14 @@ case 1858: /* Line 1455 of yacc.c */ -#line 13094 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13108 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1859: /* Line 1455 of yacc.c */ -#line 13099 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13113 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_TABLES; /* @@ -35447,28 +35461,28 @@ case 1860: /* Line 1455 of yacc.c */ -#line 13108 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1861: /* Line 1455 of yacc.c */ -#line 13109 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13123 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1863: /* Line 1455 of yacc.c */ -#line 13114 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13128 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1864: /* Line 1455 of yacc.c */ -#line 13116 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13130 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { TABLE_LIST *tables= Lex->query_tables; Lex->type|= REFRESH_READ_LOCK; @@ -35484,7 +35498,7 @@ case 1865: /* Line 1455 of yacc.c */ -#line 13127 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13141 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->query_tables == NULL) // Table list can't be empty { @@ -35497,7 +35511,7 @@ case 1866: /* Line 1455 of yacc.c */ -#line 13135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13149 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { TABLE_LIST *tables= Lex->query_tables; Lex->type|= REFRESH_FOR_EXPORT; @@ -35513,161 +35527,161 @@ case 1868: /* Line 1455 of yacc.c */ -#line 13150 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13164 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1869: /* Line 1455 of yacc.c */ -#line 13155 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13169 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_ERROR_LOG; } break; case 1870: /* Line 1455 of yacc.c */ -#line 13157 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13171 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_ENGINE_LOG; } break; case 1871: /* Line 1455 of yacc.c */ -#line 13159 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13173 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_GENERAL_LOG; } break; case 1872: /* Line 1455 of yacc.c */ -#line 13161 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13175 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_SLOW_LOG; } break; case 1873: /* Line 1455 of yacc.c */ -#line 13163 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_BINARY_LOG; } break; case 1874: /* Line 1455 of yacc.c */ -#line 13165 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13179 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_RELAY_LOG; } break; case 1875: /* Line 1455 of yacc.c */ -#line 13167 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13181 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE_FREE; } break; case 1876: /* Line 1455 of yacc.c */ -#line 13169 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13183 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_HOSTS; } break; case 1877: /* Line 1455 of yacc.c */ -#line 13171 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13185 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_GRANT; } break; case 1878: /* Line 1455 of yacc.c */ -#line 13173 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13187 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_LOG; } break; case 1879: /* Line 1455 of yacc.c */ -#line 13175 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13189 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_STATUS; } break; case 1880: /* Line 1455 of yacc.c */ -#line 13177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13191 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_CLIENT_STATS; } break; case 1881: /* Line 1455 of yacc.c */ -#line 13179 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13193 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_USER_STATS; } break; case 1882: /* Line 1455 of yacc.c */ -#line 13181 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13195 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_THREAD_STATS; } break; case 1883: /* Line 1455 of yacc.c */ -#line 13183 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13197 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_TABLE_STATS; } break; case 1884: /* Line 1455 of yacc.c */ -#line 13185 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13199 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_INDEX_STATS; } break; case 1885: /* Line 1455 of yacc.c */ -#line 13187 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_DES_KEY_FILE; } break; case 1886: /* Line 1455 of yacc.c */ -#line 13189 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13203 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_USER_RESOURCES; } break; case 1887: /* Line 1455 of yacc.c */ -#line 13191 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13205 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_FLUSH_PAGE_BITMAPS; } break; case 1888: /* Line 1455 of yacc.c */ -#line 13195 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13209 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1889: /* Line 1455 of yacc.c */ -#line 13196 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13210 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1890: /* Line 1455 of yacc.c */ -#line 13201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13215 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RESET; lex->type=0; @@ -35677,63 +35691,63 @@ case 1891: /* Line 1455 of yacc.c */ -#line 13206 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13220 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1894: /* Line 1455 of yacc.c */ -#line 13215 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13229 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_SLAVE; } break; case 1895: /* Line 1455 of yacc.c */ -#line 13216 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13230 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 1896: /* Line 1455 of yacc.c */ -#line 13217 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13231 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_MASTER; } break; case 1897: /* Line 1455 of yacc.c */ -#line 13218 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13232 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type|= REFRESH_QUERY_CACHE;} break; case 1898: /* Line 1455 of yacc.c */ -#line 13220 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13234 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type |= REFRESH_RESET_PAGE_BITMAPS; } break; case 1899: /* Line 1455 of yacc.c */ -#line 13224 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13238 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->reset_slave_info.all= false; } break; case 1900: /* Line 1455 of yacc.c */ -#line 13225 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13239 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->reset_slave_info.all= true; } break; case 1901: /* Line 1455 of yacc.c */ -#line 13230 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13244 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->type=0; @@ -35744,14 +35758,14 @@ case 1902: /* Line 1455 of yacc.c */ -#line 13236 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13250 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1904: /* Line 1455 of yacc.c */ -#line 13242 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13256 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->value_list.empty(); @@ -35763,7 +35777,7 @@ case 1906: /* Line 1455 of yacc.c */ -#line 13253 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13267 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->to_log = (yyvsp[(2) - (2)].lex_str).str; } @@ -35772,7 +35786,7 @@ case 1907: /* Line 1455 of yacc.c */ -#line 13257 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13271 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->value_list.empty(); @@ -35784,7 +35798,7 @@ case 1908: /* Line 1455 of yacc.c */ -#line 13267 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13281 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->to_log = (yyvsp[(2) - (2)].lex_str).str; Lex->sql_command= SQLCOM_PURGE_ARCHIVE; @@ -35794,7 +35808,7 @@ case 1909: /* Line 1455 of yacc.c */ -#line 13272 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13286 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->value_list.empty(); @@ -35806,7 +35820,7 @@ case 1910: /* Line 1455 of yacc.c */ -#line 13284 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->value_list.empty(); @@ -35818,28 +35832,28 @@ case 1911: /* Line 1455 of yacc.c */ -#line 13293 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13307 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type= 0; } break; case 1912: /* Line 1455 of yacc.c */ -#line 13294 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13308 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type= 0; } break; case 1913: /* Line 1455 of yacc.c */ -#line 13295 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13309 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->type= ONLY_KILL_QUERY; } break; case 1914: /* Line 1455 of yacc.c */ -#line 13302 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13316 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command=SQLCOM_CHANGE_DB; @@ -35850,7 +35864,7 @@ case 1915: /* Line 1455 of yacc.c */ -#line 13313 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13327 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -35867,7 +35881,7 @@ case 1916: /* Line 1455 of yacc.c */ -#line 13325 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13339 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_LOAD; @@ -35882,7 +35896,7 @@ case 1917: /* Line 1455 of yacc.c */ -#line 13335 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13349 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!Select->add_table_to_list(YYTHD, (yyvsp[(12) - (13)].table), NULL, TL_OPTION_UPDATING, @@ -35897,56 +35911,56 @@ case 1918: /* Line 1455 of yacc.c */ -#line 13345 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13359 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->exchange->cs= (yyvsp[(15) - (15)].charset); } break; case 1919: /* Line 1455 of yacc.c */ -#line 13349 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1920: /* Line 1455 of yacc.c */ -#line 13353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13367 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.filetype)= FILETYPE_CSV; } break; case 1921: /* Line 1455 of yacc.c */ -#line 13354 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13368 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.filetype)= FILETYPE_XML; } break; case 1922: /* Line 1455 of yacc.c */ -#line 13358 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13372 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=0;} break; case 1923: /* Line 1455 of yacc.c */ -#line 13359 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13373 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=1;} break; case 1924: /* Line 1455 of yacc.c */ -#line 13363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_DEFAULT; } break; case 1925: /* Line 1455 of yacc.c */ -#line 13365 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13379 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { #ifdef HAVE_QUERY_CACHE /* @@ -35963,35 +35977,35 @@ case 1926: /* Line 1455 of yacc.c */ -#line 13376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lock_type)= TL_WRITE_LOW_PRIORITY; } break; case 1927: /* Line 1455 of yacc.c */ -#line 13380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->duplicates=DUP_ERROR; } break; case 1928: /* Line 1455 of yacc.c */ -#line 13381 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13395 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->duplicates=DUP_REPLACE; } break; case 1929: /* Line 1455 of yacc.c */ -#line 13382 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13396 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ignore= 1; } break; case 1934: /* Line 1455 of yacc.c */ -#line 13397 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13411 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->field_term= (yyvsp[(3) - (3)].string); @@ -36001,7 +36015,7 @@ case 1935: /* Line 1455 of yacc.c */ -#line 13402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13416 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; DBUG_ASSERT(lex->exchange != 0); @@ -36013,7 +36027,7 @@ case 1936: /* Line 1455 of yacc.c */ -#line 13409 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13423 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->enclosed= (yyvsp[(3) - (3)].string); @@ -36023,7 +36037,7 @@ case 1937: /* Line 1455 of yacc.c */ -#line 13414 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13428 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->escaped= (yyvsp[(3) - (3)].string); @@ -36033,7 +36047,7 @@ case 1942: /* Line 1455 of yacc.c */ -#line 13432 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->line_term= (yyvsp[(3) - (3)].string); @@ -36043,7 +36057,7 @@ case 1943: /* Line 1455 of yacc.c */ -#line 13437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13451 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->line_start= (yyvsp[(3) - (3)].string); @@ -36053,21 +36067,21 @@ case 1944: /* Line 1455 of yacc.c */ -#line 13444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 1945: /* Line 1455 of yacc.c */ -#line 13446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13460 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->exchange->line_term = (yyvsp[(4) - (4)].string); } break; case 1947: /* Line 1455 of yacc.c */ -#line 13451 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13465 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { DBUG_ASSERT(Lex->exchange != 0); Lex->exchange->skip_lines= atol((yyvsp[(2) - (3)].lex_str).str); @@ -36077,63 +36091,63 @@ case 1948: /* Line 1455 of yacc.c */ -#line 13458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13472 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 1949: /* Line 1455 of yacc.c */ -#line 13460 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13474 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { } break; case 1950: /* Line 1455 of yacc.c */ -#line 13464 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13478 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1951: /* Line 1455 of yacc.c */ -#line 13465 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13479 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1952: /* Line 1455 of yacc.c */ -#line 13466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13480 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1953: /* Line 1455 of yacc.c */ -#line 13471 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(3) - (3)].item)); } break; case 1954: /* Line 1455 of yacc.c */ -#line 13473 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13487 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->field_list.push_back((yyvsp[(1) - (1)].item)); } break; case 1955: /* Line 1455 of yacc.c */ -#line 13477 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13491 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {(yyval.item)= (yyvsp[(1) - (1)].item);} break; case 1956: /* Line 1455 of yacc.c */ -#line 13479 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13493 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_user_var_as_out_param((yyvsp[(2) - (2)].lex_str)); if ((yyval.item) == NULL) @@ -36144,21 +36158,21 @@ case 1957: /* Line 1455 of yacc.c */ -#line 13487 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13501 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1958: /* Line 1455 of yacc.c */ -#line 13488 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13502 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 1961: /* Line 1455 of yacc.c */ -#line 13498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; uint length= (uint) ((yyvsp[(5) - (5)].simple_string) - (yyvsp[(3) - (5)].simple_string)); @@ -36178,7 +36192,7 @@ case 1962: /* Line 1455 of yacc.c */ -#line 13518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13532 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX_STRING tmp; THD *thd= YYTHD; @@ -36207,7 +36221,7 @@ case 1963: /* Line 1455 of yacc.c */ -#line 13542 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13556 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { uint repertoire= Lex->text_string_is_7bit ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; @@ -36224,7 +36238,7 @@ case 1964: /* Line 1455 of yacc.c */ -#line 13554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13568 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item_string *str= new (YYTHD->mem_root) Item_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, (yyvsp[(1) - (2)].charset)); @@ -36240,7 +36254,7 @@ case 1965: /* Line 1455 of yacc.c */ -#line 13565 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item_string* item= (Item_string*) (yyvsp[(1) - (2)].item); item->append((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); @@ -36261,7 +36275,7 @@ case 1966: /* Line 1455 of yacc.c */ -#line 13584 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.string)= new (YYTHD->mem_root) String((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, @@ -36274,7 +36288,7 @@ case 1967: /* Line 1455 of yacc.c */ -#line 13592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13606 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *tmp= new (YYTHD->mem_root) Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (tmp == NULL) @@ -36291,7 +36305,7 @@ case 1968: /* Line 1455 of yacc.c */ -#line 13604 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *tmp= new (YYTHD->mem_root) Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (tmp == NULL) @@ -36308,7 +36322,7 @@ case 1969: /* Line 1455 of yacc.c */ -#line 13619 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -36331,21 +36345,21 @@ case 1970: /* Line 1455 of yacc.c */ -#line 13639 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13653 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1971: /* Line 1455 of yacc.c */ -#line 13640 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = (yyvsp[(2) - (2)].item_num); } break; case 1972: /* Line 1455 of yacc.c */ -#line 13642 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13656 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyvsp[(2) - (2)].item_num)->max_length++; (yyval.item)= (yyvsp[(2) - (2)].item_num)->neg(); @@ -36355,28 +36369,28 @@ case 1973: /* Line 1455 of yacc.c */ -#line 13650 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13664 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item); } break; case 1974: /* Line 1455 of yacc.c */ -#line 13651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = (yyvsp[(1) - (1)].item_num); } break; case 1975: /* Line 1455 of yacc.c */ -#line 13652 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13666 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1976: /* Line 1455 of yacc.c */ -#line 13654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13668 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex_input_stream *lip= YYLIP; /* @@ -36396,7 +36410,7 @@ case 1977: /* Line 1455 of yacc.c */ -#line 13669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13683 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_int(NAME_STRING("FALSE"), 0, 1); if ((yyval.item) == NULL) @@ -36407,7 +36421,7 @@ case 1978: /* Line 1455 of yacc.c */ -#line 13675 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_int(NAME_STRING("TRUE"), 1, 1); if ((yyval.item) == NULL) @@ -36418,7 +36432,7 @@ case 1979: /* Line 1455 of yacc.c */ -#line 13681 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item) = new (YYTHD->mem_root) Item_hex_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if ((yyval.item) == NULL) @@ -36429,7 +36443,7 @@ case 1980: /* Line 1455 of yacc.c */ -#line 13687 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= new (YYTHD->mem_root) Item_bin_string((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if ((yyval.item) == NULL) @@ -36440,7 +36454,7 @@ case 1981: /* Line 1455 of yacc.c */ -#line 13693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13707 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *tmp= new (YYTHD->mem_root) Item_hex_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); if (tmp == NULL) @@ -36476,7 +36490,7 @@ case 1982: /* Line 1455 of yacc.c */ -#line 13724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13738 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item *tmp= new (YYTHD->mem_root) Item_bin_string((yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length); if (tmp == NULL) @@ -36511,7 +36525,7 @@ case 1983: /* Line 1455 of yacc.c */ -#line 13757 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13771 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.item_num)= new (YYTHD->mem_root) @@ -36526,7 +36540,7 @@ case 1984: /* Line 1455 of yacc.c */ -#line 13767 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13781 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { int error; (yyval.item_num)= new (YYTHD->mem_root) @@ -36541,7 +36555,7 @@ case 1985: /* Line 1455 of yacc.c */ -#line 13777 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13791 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_num)= new (YYTHD->mem_root) Item_uint((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if ((yyval.item_num) == NULL) @@ -36552,7 +36566,7 @@ case 1986: /* Line 1455 of yacc.c */ -#line 13783 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13797 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_num)= new (YYTHD->mem_root) Item_decimal((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length, YYTHD->charset()); @@ -36566,7 +36580,7 @@ case 1987: /* Line 1455 of yacc.c */ -#line 13792 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13806 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item_num)= new (YYTHD->mem_root) Item_float((yyvsp[(1) - (1)].lex_str).str, (yyvsp[(1) - (1)].lex_str).length); if (((yyval.item_num) == NULL) || (YYTHD->is_error())) @@ -36579,7 +36593,7 @@ case 1988: /* Line 1455 of yacc.c */ -#line 13804 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13818 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.item)= create_temporal_literal(YYTHD, (yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, YYCSCL, MYSQL_TYPE_DATE, true))) @@ -36590,7 +36604,7 @@ case 1989: /* Line 1455 of yacc.c */ -#line 13810 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13824 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.item)= create_temporal_literal(YYTHD, (yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, YYCSCL, MYSQL_TYPE_TIME, true))) @@ -36601,7 +36615,7 @@ case 1990: /* Line 1455 of yacc.c */ -#line 13816 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13830 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.item)= create_temporal_literal(YYTHD, (yyvsp[(2) - (2)].lex_str).str, (yyvsp[(2) - (2)].lex_str).length, YYCSCL, MYSQL_TYPE_DATETIME, true))) @@ -36612,21 +36626,21 @@ case 1991: /* Line 1455 of yacc.c */ -#line 13831 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13845 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1992: /* Line 1455 of yacc.c */ -#line 13832 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13846 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1993: /* Line 1455 of yacc.c */ -#line 13837 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13851 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { SELECT_LEX *sel= Select; (yyval.item)= new (YYTHD->mem_root) Item_field(Lex->current_context(), @@ -36640,7 +36654,7 @@ case 1994: /* Line 1455 of yacc.c */ -#line 13846 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13860 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; SELECT_LEX *sel= Select; @@ -36658,14 +36672,14 @@ case 1995: /* Line 1455 of yacc.c */ -#line 13861 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13875 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 1996: /* Line 1455 of yacc.c */ -#line 13866 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13880 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -36721,14 +36735,14 @@ case 1997: /* Line 1455 of yacc.c */ -#line 13916 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13930 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 1998: /* Line 1455 of yacc.c */ -#line 13921 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13935 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; SELECT_LEX *sel=Select; @@ -36751,14 +36765,14 @@ case 1999: /* Line 1455 of yacc.c */ -#line 13938 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13952 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)= (yyvsp[(1) - (1)].item); } break; case 2000: /* Line 1455 of yacc.c */ -#line 13943 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 13957 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -36843,7 +36857,7 @@ case 2001: /* Line 1455 of yacc.c */ -#line 14023 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14037 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -36873,7 +36887,7 @@ case 2002: /* Line 1455 of yacc.c */ -#line 14048 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14062 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -36906,14 +36920,14 @@ case 2003: /* Line 1455 of yacc.c */ -#line 14078 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14092 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 2004: /* Line 1455 of yacc.c */ -#line 14080 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14094 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { TABLE_LIST *table= Select->table_list.first; if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (5)].lex_str).str, table->db)) @@ -36934,7 +36948,7 @@ case 2005: /* Line 1455 of yacc.c */ -#line 14096 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14110 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { TABLE_LIST *table= Select->table_list.first; if (my_strcasecmp(table_alias_charset, (yyvsp[(1) - (3)].lex_str).str, table->alias)) @@ -36949,14 +36963,14 @@ case 2006: /* Line 1455 of yacc.c */ -#line 14105 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14119 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(2) - (2)].lex_str);} break; case 2007: /* Line 1455 of yacc.c */ -#line 14110 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14124 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table)= new Table_ident((yyvsp[(1) - (1)].lex_str)); if ((yyval.table) == NULL) @@ -36967,7 +36981,7 @@ case 2008: /* Line 1455 of yacc.c */ -#line 14116 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14130 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table)= new Table_ident(YYTHD, (yyvsp[(1) - (3)].lex_str),(yyvsp[(3) - (3)].lex_str),0); if ((yyval.table) == NULL) @@ -36978,7 +36992,7 @@ case 2009: /* Line 1455 of yacc.c */ -#line 14122 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14136 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* For Delphi */ (yyval.table)= new Table_ident((yyvsp[(2) - (2)].lex_str)); @@ -36990,7 +37004,7 @@ case 2010: /* Line 1455 of yacc.c */ -#line 14132 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14146 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table)= new Table_ident((yyvsp[(1) - (2)].lex_str)); if ((yyval.table) == NULL) @@ -37001,7 +37015,7 @@ case 2011: /* Line 1455 of yacc.c */ -#line 14138 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14152 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.table)= new Table_ident(YYTHD, (yyvsp[(1) - (4)].lex_str),(yyvsp[(3) - (4)].lex_str),0); if ((yyval.table) == NULL) @@ -37012,7 +37026,7 @@ case 2012: /* Line 1455 of yacc.c */ -#line 14147 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14161 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX_STRING db={(char*) any_db,3}; (yyval.table)= new Table_ident(YYTHD, db,(yyvsp[(1) - (1)].lex_str),0); @@ -37024,14 +37038,14 @@ case 2013: /* Line 1455 of yacc.c */ -#line 14156 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14170 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); } break; case 2014: /* Line 1455 of yacc.c */ -#line 14158 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14172 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; @@ -37063,7 +37077,7 @@ case 2015: /* Line 1455 of yacc.c */ -#line 14188 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14202 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!strcont((yyvsp[(1) - (1)].lex_str).str, "\n")) (yyval.lex_str)= (yyvsp[(1) - (1)].lex_str); @@ -37078,7 +37092,7 @@ case 2016: /* Line 1455 of yacc.c */ -#line 14201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14215 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; @@ -37096,7 +37110,7 @@ case 2017: /* Line 1455 of yacc.c */ -#line 14217 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14231 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; @@ -37114,7 +37128,7 @@ case 2018: /* Line 1455 of yacc.c */ -#line 14233 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14247 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; @@ -37133,14 +37147,14 @@ case 2019: /* Line 1455 of yacc.c */ -#line 14249 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14263 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 2020: /* Line 1455 of yacc.c */ -#line 14251 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14265 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); @@ -37153,14 +37167,14 @@ case 2021: /* Line 1455 of yacc.c */ -#line 14261 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14275 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str); } break; case 2022: /* Line 1455 of yacc.c */ -#line 14263 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14277 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; (yyval.lex_str).str= thd->strmake((yyvsp[(1) - (1)].symbol).str, (yyvsp[(1) - (1)].symbol).length); @@ -37173,28 +37187,28 @@ case 2023: /* Line 1455 of yacc.c */ -#line 14273 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14287 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 2024: /* Line 1455 of yacc.c */ -#line 14274 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14288 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 2025: /* Line 1455 of yacc.c */ -#line 14275 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14289 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_str)=(yyvsp[(1) - (1)].lex_str);} break; case 2026: /* Line 1455 of yacc.c */ -#line 14280 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14294 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) @@ -37226,7 +37240,7 @@ case 2027: /* Line 1455 of yacc.c */ -#line 14307 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14321 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; if (!((yyval.lex_user)=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) @@ -37264,7 +37278,7 @@ case 2028: /* Line 1455 of yacc.c */ -#line 14340 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14354 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (!((yyval.lex_user)=(LEX_USER*) YYTHD->alloc(sizeof(st_lex_user)))) MYSQL_YYABORT; @@ -37280,2583 +37294,2583 @@ case 2029: /* Line 1455 of yacc.c */ -#line 14354 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14368 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2030: /* Line 1455 of yacc.c */ -#line 14355 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14369 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2031: /* Line 1455 of yacc.c */ -#line 14356 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2032: /* Line 1455 of yacc.c */ -#line 14357 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14371 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2033: /* Line 1455 of yacc.c */ -#line 14358 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14372 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2034: /* Line 1455 of yacc.c */ -#line 14359 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14373 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2035: /* Line 1455 of yacc.c */ -#line 14360 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14374 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2036: /* Line 1455 of yacc.c */ -#line 14361 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14375 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2037: /* Line 1455 of yacc.c */ -#line 14362 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2038: /* Line 1455 of yacc.c */ -#line 14363 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2039: /* Line 1455 of yacc.c */ -#line 14364 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14378 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2040: /* Line 1455 of yacc.c */ -#line 14365 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14379 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2041: /* Line 1455 of yacc.c */ -#line 14366 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2042: /* Line 1455 of yacc.c */ -#line 14367 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14381 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2043: /* Line 1455 of yacc.c */ -#line 14368 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14382 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2044: /* Line 1455 of yacc.c */ -#line 14369 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14383 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2045: /* Line 1455 of yacc.c */ -#line 14370 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14384 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2046: /* Line 1455 of yacc.c */ -#line 14371 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14385 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2047: /* Line 1455 of yacc.c */ -#line 14372 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14386 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2048: /* Line 1455 of yacc.c */ -#line 14373 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14387 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2049: /* Line 1455 of yacc.c */ -#line 14374 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14388 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2050: /* Line 1455 of yacc.c */ -#line 14375 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14389 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2051: /* Line 1455 of yacc.c */ -#line 14376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2052: /* Line 1455 of yacc.c */ -#line 14377 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2053: /* Line 1455 of yacc.c */ -#line 14378 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14392 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2054: /* Line 1455 of yacc.c */ -#line 14379 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14393 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2055: /* Line 1455 of yacc.c */ -#line 14380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2056: /* Line 1455 of yacc.c */ -#line 14381 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14395 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2057: /* Line 1455 of yacc.c */ -#line 14382 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14396 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2058: /* Line 1455 of yacc.c */ -#line 14383 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14397 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2059: /* Line 1455 of yacc.c */ -#line 14384 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14398 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2060: /* Line 1455 of yacc.c */ -#line 14385 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14399 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2061: /* Line 1455 of yacc.c */ -#line 14386 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14400 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2062: /* Line 1455 of yacc.c */ -#line 14387 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14401 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2063: /* Line 1455 of yacc.c */ -#line 14388 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2064: /* Line 1455 of yacc.c */ -#line 14389 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14403 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2065: /* Line 1455 of yacc.c */ -#line 14390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2066: /* Line 1455 of yacc.c */ -#line 14391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14405 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2067: /* Line 1455 of yacc.c */ -#line 14392 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14406 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2068: /* Line 1455 of yacc.c */ -#line 14393 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14407 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2069: /* Line 1455 of yacc.c */ -#line 14394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14408 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2070: /* Line 1455 of yacc.c */ -#line 14395 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14409 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2071: /* Line 1455 of yacc.c */ -#line 14396 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14410 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2072: /* Line 1455 of yacc.c */ -#line 14397 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14411 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2073: /* Line 1455 of yacc.c */ -#line 14398 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14412 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2074: /* Line 1455 of yacc.c */ -#line 14399 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2075: /* Line 1455 of yacc.c */ -#line 14400 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14414 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2076: /* Line 1455 of yacc.c */ -#line 14401 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14415 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2077: /* Line 1455 of yacc.c */ -#line 14402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14416 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2078: /* Line 1455 of yacc.c */ -#line 14403 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14417 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2079: /* Line 1455 of yacc.c */ -#line 14413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14427 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2080: /* Line 1455 of yacc.c */ -#line 14414 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14428 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2081: /* Line 1455 of yacc.c */ -#line 14415 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14429 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2082: /* Line 1455 of yacc.c */ -#line 14416 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14430 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2083: /* Line 1455 of yacc.c */ -#line 14417 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14431 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2084: /* Line 1455 of yacc.c */ -#line 14418 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14432 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2085: /* Line 1455 of yacc.c */ -#line 14419 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14433 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2086: /* Line 1455 of yacc.c */ -#line 14420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14434 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2087: /* Line 1455 of yacc.c */ -#line 14421 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2088: /* Line 1455 of yacc.c */ -#line 14422 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14436 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2089: /* Line 1455 of yacc.c */ -#line 14423 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2090: /* Line 1455 of yacc.c */ -#line 14424 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14438 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2091: /* Line 1455 of yacc.c */ -#line 14425 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14439 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2092: /* Line 1455 of yacc.c */ -#line 14426 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14440 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2093: /* Line 1455 of yacc.c */ -#line 14427 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14441 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2094: /* Line 1455 of yacc.c */ -#line 14428 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14442 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2095: /* Line 1455 of yacc.c */ -#line 14429 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14443 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2096: /* Line 1455 of yacc.c */ -#line 14430 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2097: /* Line 1455 of yacc.c */ -#line 14431 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14445 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2098: /* Line 1455 of yacc.c */ -#line 14432 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2099: /* Line 1455 of yacc.c */ -#line 14433 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14447 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2100: /* Line 1455 of yacc.c */ -#line 14434 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14448 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2101: /* Line 1455 of yacc.c */ -#line 14435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14449 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2102: /* Line 1455 of yacc.c */ -#line 14436 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14450 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2103: /* Line 1455 of yacc.c */ -#line 14437 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14451 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2104: /* Line 1455 of yacc.c */ -#line 14438 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14452 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2105: /* Line 1455 of yacc.c */ -#line 14439 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14453 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2106: /* Line 1455 of yacc.c */ -#line 14440 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14454 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2107: /* Line 1455 of yacc.c */ -#line 14441 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14455 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2108: /* Line 1455 of yacc.c */ -#line 14442 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14456 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2109: /* Line 1455 of yacc.c */ -#line 14443 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14457 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2110: /* Line 1455 of yacc.c */ -#line 14444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2111: /* Line 1455 of yacc.c */ -#line 14445 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14459 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2112: /* Line 1455 of yacc.c */ -#line 14446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14460 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2113: /* Line 1455 of yacc.c */ -#line 14447 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14461 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2114: /* Line 1455 of yacc.c */ -#line 14448 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14462 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2115: /* Line 1455 of yacc.c */ -#line 14449 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14463 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2116: /* Line 1455 of yacc.c */ -#line 14450 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14464 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2117: /* Line 1455 of yacc.c */ -#line 14451 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14465 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2118: /* Line 1455 of yacc.c */ -#line 14452 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2119: /* Line 1455 of yacc.c */ -#line 14453 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14467 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2120: /* Line 1455 of yacc.c */ -#line 14454 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14468 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2121: /* Line 1455 of yacc.c */ -#line 14455 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14469 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2122: /* Line 1455 of yacc.c */ -#line 14456 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14470 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2123: /* Line 1455 of yacc.c */ -#line 14457 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14471 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2124: /* Line 1455 of yacc.c */ -#line 14458 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14472 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2125: /* Line 1455 of yacc.c */ -#line 14459 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14473 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2126: /* Line 1455 of yacc.c */ -#line 14460 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14474 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2127: /* Line 1455 of yacc.c */ -#line 14461 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14475 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2128: /* Line 1455 of yacc.c */ -#line 14466 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14480 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2129: /* Line 1455 of yacc.c */ -#line 14467 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14481 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2130: /* Line 1455 of yacc.c */ -#line 14468 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14482 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2131: /* Line 1455 of yacc.c */ -#line 14469 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14483 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2132: /* Line 1455 of yacc.c */ -#line 14470 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14484 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2133: /* Line 1455 of yacc.c */ -#line 14471 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2134: /* Line 1455 of yacc.c */ -#line 14472 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2135: /* Line 1455 of yacc.c */ -#line 14473 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14487 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2136: /* Line 1455 of yacc.c */ -#line 14474 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14488 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2137: /* Line 1455 of yacc.c */ -#line 14475 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14489 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2138: /* Line 1455 of yacc.c */ -#line 14476 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14490 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2139: /* Line 1455 of yacc.c */ -#line 14477 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14491 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2140: /* Line 1455 of yacc.c */ -#line 14478 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14492 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2141: /* Line 1455 of yacc.c */ -#line 14479 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14493 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2142: /* Line 1455 of yacc.c */ -#line 14480 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2143: /* Line 1455 of yacc.c */ -#line 14481 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14495 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2144: /* Line 1455 of yacc.c */ -#line 14482 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14496 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2145: /* Line 1455 of yacc.c */ -#line 14483 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2146: /* Line 1455 of yacc.c */ -#line 14484 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2147: /* Line 1455 of yacc.c */ -#line 14485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2148: /* Line 1455 of yacc.c */ -#line 14486 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14500 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2149: /* Line 1455 of yacc.c */ -#line 14487 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14501 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2150: /* Line 1455 of yacc.c */ -#line 14488 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14502 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2151: /* Line 1455 of yacc.c */ -#line 14489 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14503 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2152: /* Line 1455 of yacc.c */ -#line 14490 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2153: /* Line 1455 of yacc.c */ -#line 14491 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2154: /* Line 1455 of yacc.c */ -#line 14492 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14506 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2155: /* Line 1455 of yacc.c */ -#line 14493 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14507 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2156: /* Line 1455 of yacc.c */ -#line 14494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14508 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2157: /* Line 1455 of yacc.c */ -#line 14495 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14509 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2158: /* Line 1455 of yacc.c */ -#line 14496 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14510 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2159: /* Line 1455 of yacc.c */ -#line 14497 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14511 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2160: /* Line 1455 of yacc.c */ -#line 14498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2161: /* Line 1455 of yacc.c */ -#line 14499 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14513 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2162: /* Line 1455 of yacc.c */ -#line 14500 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14514 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2163: /* Line 1455 of yacc.c */ -#line 14501 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14515 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2164: /* Line 1455 of yacc.c */ -#line 14502 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14516 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2165: /* Line 1455 of yacc.c */ -#line 14503 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2166: /* Line 1455 of yacc.c */ -#line 14504 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2167: /* Line 1455 of yacc.c */ -#line 14505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14519 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2168: /* Line 1455 of yacc.c */ -#line 14506 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14520 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2169: /* Line 1455 of yacc.c */ -#line 14507 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14521 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2170: /* Line 1455 of yacc.c */ -#line 14508 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14522 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2171: /* Line 1455 of yacc.c */ -#line 14509 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14523 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2172: /* Line 1455 of yacc.c */ -#line 14510 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14524 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2173: /* Line 1455 of yacc.c */ -#line 14511 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14525 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2174: /* Line 1455 of yacc.c */ -#line 14512 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2175: /* Line 1455 of yacc.c */ -#line 14513 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14527 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2176: /* Line 1455 of yacc.c */ -#line 14514 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14528 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2177: /* Line 1455 of yacc.c */ -#line 14515 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14529 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2178: /* Line 1455 of yacc.c */ -#line 14516 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14530 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2179: /* Line 1455 of yacc.c */ -#line 14517 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14531 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2180: /* Line 1455 of yacc.c */ -#line 14518 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14532 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2181: /* Line 1455 of yacc.c */ -#line 14519 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14533 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2182: /* Line 1455 of yacc.c */ -#line 14520 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14534 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2183: /* Line 1455 of yacc.c */ -#line 14521 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14535 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2184: /* Line 1455 of yacc.c */ -#line 14522 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14536 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2185: /* Line 1455 of yacc.c */ -#line 14523 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2186: /* Line 1455 of yacc.c */ -#line 14524 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14538 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2187: /* Line 1455 of yacc.c */ -#line 14525 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2188: /* Line 1455 of yacc.c */ -#line 14526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14540 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2189: /* Line 1455 of yacc.c */ -#line 14527 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14541 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2190: /* Line 1455 of yacc.c */ -#line 14528 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14542 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2191: /* Line 1455 of yacc.c */ -#line 14529 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14543 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2192: /* Line 1455 of yacc.c */ -#line 14530 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14544 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2193: /* Line 1455 of yacc.c */ -#line 14531 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14545 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2194: /* Line 1455 of yacc.c */ -#line 14532 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14546 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2195: /* Line 1455 of yacc.c */ -#line 14533 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2196: /* Line 1455 of yacc.c */ -#line 14534 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14548 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2197: /* Line 1455 of yacc.c */ -#line 14535 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14549 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2198: /* Line 1455 of yacc.c */ -#line 14536 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14550 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2199: /* Line 1455 of yacc.c */ -#line 14537 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14551 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2200: /* Line 1455 of yacc.c */ -#line 14538 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14552 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2201: /* Line 1455 of yacc.c */ -#line 14539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14553 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2202: /* Line 1455 of yacc.c */ -#line 14540 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2203: /* Line 1455 of yacc.c */ -#line 14541 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14555 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2204: /* Line 1455 of yacc.c */ -#line 14542 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14556 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2205: /* Line 1455 of yacc.c */ -#line 14543 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14557 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2206: /* Line 1455 of yacc.c */ -#line 14544 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14558 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2207: /* Line 1455 of yacc.c */ -#line 14545 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14559 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2208: /* Line 1455 of yacc.c */ -#line 14546 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2209: /* Line 1455 of yacc.c */ -#line 14547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14561 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2210: /* Line 1455 of yacc.c */ -#line 14548 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14562 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2211: /* Line 1455 of yacc.c */ -#line 14549 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14563 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2212: /* Line 1455 of yacc.c */ -#line 14550 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2213: /* Line 1455 of yacc.c */ -#line 14551 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14565 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2214: /* Line 1455 of yacc.c */ -#line 14552 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14566 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2215: /* Line 1455 of yacc.c */ -#line 14553 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14567 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2216: /* Line 1455 of yacc.c */ -#line 14554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14568 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2217: /* Line 1455 of yacc.c */ -#line 14555 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14569 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2218: /* Line 1455 of yacc.c */ -#line 14556 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14570 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2219: /* Line 1455 of yacc.c */ -#line 14557 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2220: /* Line 1455 of yacc.c */ -#line 14558 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14572 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2221: /* Line 1455 of yacc.c */ -#line 14559 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2222: /* Line 1455 of yacc.c */ -#line 14560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14574 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2223: /* Line 1455 of yacc.c */ -#line 14561 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14575 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2224: /* Line 1455 of yacc.c */ -#line 14562 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14576 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2225: /* Line 1455 of yacc.c */ -#line 14563 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2226: /* Line 1455 of yacc.c */ -#line 14564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2227: /* Line 1455 of yacc.c */ -#line 14565 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2228: /* Line 1455 of yacc.c */ -#line 14566 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14580 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2229: /* Line 1455 of yacc.c */ -#line 14567 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2230: /* Line 1455 of yacc.c */ -#line 14568 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14582 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2231: /* Line 1455 of yacc.c */ -#line 14569 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2232: /* Line 1455 of yacc.c */ -#line 14570 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14584 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2233: /* Line 1455 of yacc.c */ -#line 14571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2234: /* Line 1455 of yacc.c */ -#line 14572 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14586 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2235: /* Line 1455 of yacc.c */ -#line 14573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2236: /* Line 1455 of yacc.c */ -#line 14574 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14588 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2237: /* Line 1455 of yacc.c */ -#line 14575 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14589 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2238: /* Line 1455 of yacc.c */ -#line 14576 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14590 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2239: /* Line 1455 of yacc.c */ -#line 14577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2240: /* Line 1455 of yacc.c */ -#line 14578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2241: /* Line 1455 of yacc.c */ -#line 14579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2242: /* Line 1455 of yacc.c */ -#line 14580 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14594 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2243: /* Line 1455 of yacc.c */ -#line 14581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14595 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2244: /* Line 1455 of yacc.c */ -#line 14582 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14596 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2245: /* Line 1455 of yacc.c */ -#line 14583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14597 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2246: /* Line 1455 of yacc.c */ -#line 14584 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2247: /* Line 1455 of yacc.c */ -#line 14585 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14599 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2248: /* Line 1455 of yacc.c */ -#line 14586 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14600 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2249: /* Line 1455 of yacc.c */ -#line 14587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14601 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2250: /* Line 1455 of yacc.c */ -#line 14588 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14602 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2251: /* Line 1455 of yacc.c */ -#line 14589 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14603 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2252: /* Line 1455 of yacc.c */ -#line 14590 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14604 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2253: /* Line 1455 of yacc.c */ -#line 14591 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14605 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2254: /* Line 1455 of yacc.c */ -#line 14592 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14606 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2255: /* Line 1455 of yacc.c */ -#line 14593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14607 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2256: /* Line 1455 of yacc.c */ -#line 14594 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14608 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2257: /* Line 1455 of yacc.c */ -#line 14595 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14609 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2258: /* Line 1455 of yacc.c */ -#line 14596 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2259: /* Line 1455 of yacc.c */ -#line 14597 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14611 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2260: /* Line 1455 of yacc.c */ -#line 14598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2261: /* Line 1455 of yacc.c */ -#line 14599 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14613 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2262: /* Line 1455 of yacc.c */ -#line 14600 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14614 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2263: /* Line 1455 of yacc.c */ -#line 14601 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14615 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2264: /* Line 1455 of yacc.c */ -#line 14602 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2265: /* Line 1455 of yacc.c */ -#line 14603 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14617 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2266: /* Line 1455 of yacc.c */ -#line 14604 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2267: /* Line 1455 of yacc.c */ -#line 14605 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14619 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2268: /* Line 1455 of yacc.c */ -#line 14606 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14620 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2269: /* Line 1455 of yacc.c */ -#line 14607 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14621 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2270: /* Line 1455 of yacc.c */ -#line 14608 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14622 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2271: /* Line 1455 of yacc.c */ -#line 14609 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14623 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2272: /* Line 1455 of yacc.c */ -#line 14610 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14624 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2273: /* Line 1455 of yacc.c */ -#line 14611 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14625 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2274: /* Line 1455 of yacc.c */ -#line 14612 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14626 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2275: /* Line 1455 of yacc.c */ -#line 14613 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14627 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2276: /* Line 1455 of yacc.c */ -#line 14614 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14628 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2277: /* Line 1455 of yacc.c */ -#line 14615 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14629 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2278: /* Line 1455 of yacc.c */ -#line 14616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14630 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2279: /* Line 1455 of yacc.c */ -#line 14617 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14631 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2280: /* Line 1455 of yacc.c */ -#line 14618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14632 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2281: /* Line 1455 of yacc.c */ -#line 14619 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2282: /* Line 1455 of yacc.c */ -#line 14620 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14634 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2283: /* Line 1455 of yacc.c */ -#line 14621 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14635 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2284: /* Line 1455 of yacc.c */ -#line 14622 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2285: /* Line 1455 of yacc.c */ -#line 14623 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14637 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2286: /* Line 1455 of yacc.c */ -#line 14624 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14638 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2287: /* Line 1455 of yacc.c */ -#line 14625 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14639 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2288: /* Line 1455 of yacc.c */ -#line 14626 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14640 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2289: /* Line 1455 of yacc.c */ -#line 14627 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14641 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2290: /* Line 1455 of yacc.c */ -#line 14628 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14642 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2291: /* Line 1455 of yacc.c */ -#line 14629 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14643 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2292: /* Line 1455 of yacc.c */ -#line 14630 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14644 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2293: /* Line 1455 of yacc.c */ -#line 14631 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14645 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2294: /* Line 1455 of yacc.c */ -#line 14632 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14646 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2295: /* Line 1455 of yacc.c */ -#line 14633 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14647 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2296: /* Line 1455 of yacc.c */ -#line 14634 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14648 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2297: /* Line 1455 of yacc.c */ -#line 14635 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14649 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2298: /* Line 1455 of yacc.c */ -#line 14636 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14650 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2299: /* Line 1455 of yacc.c */ -#line 14637 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2300: /* Line 1455 of yacc.c */ -#line 14638 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14652 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2301: /* Line 1455 of yacc.c */ -#line 14639 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14653 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2302: /* Line 1455 of yacc.c */ -#line 14640 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2303: /* Line 1455 of yacc.c */ -#line 14641 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14655 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2304: /* Line 1455 of yacc.c */ -#line 14642 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14656 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2305: /* Line 1455 of yacc.c */ -#line 14643 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14657 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2306: /* Line 1455 of yacc.c */ -#line 14644 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14658 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2307: /* Line 1455 of yacc.c */ -#line 14645 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14659 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2308: /* Line 1455 of yacc.c */ -#line 14646 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14660 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2309: /* Line 1455 of yacc.c */ -#line 14647 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14661 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2310: /* Line 1455 of yacc.c */ -#line 14648 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14662 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2311: /* Line 1455 of yacc.c */ -#line 14649 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14663 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2312: /* Line 1455 of yacc.c */ -#line 14650 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14664 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2313: /* Line 1455 of yacc.c */ -#line 14651 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2314: /* Line 1455 of yacc.c */ -#line 14652 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14666 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2315: /* Line 1455 of yacc.c */ -#line 14653 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14667 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2316: /* Line 1455 of yacc.c */ -#line 14654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14668 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2317: /* Line 1455 of yacc.c */ -#line 14655 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2318: /* Line 1455 of yacc.c */ -#line 14656 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14670 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2319: /* Line 1455 of yacc.c */ -#line 14657 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14671 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2320: /* Line 1455 of yacc.c */ -#line 14658 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14672 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2321: /* Line 1455 of yacc.c */ -#line 14659 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2322: /* Line 1455 of yacc.c */ -#line 14660 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14674 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2323: /* Line 1455 of yacc.c */ -#line 14661 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14675 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2324: /* Line 1455 of yacc.c */ -#line 14662 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14676 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2325: /* Line 1455 of yacc.c */ -#line 14663 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14677 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2326: /* Line 1455 of yacc.c */ -#line 14664 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14678 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2327: /* Line 1455 of yacc.c */ -#line 14665 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2328: /* Line 1455 of yacc.c */ -#line 14666 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14680 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2329: /* Line 1455 of yacc.c */ -#line 14667 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14681 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2330: /* Line 1455 of yacc.c */ -#line 14668 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14682 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2331: /* Line 1455 of yacc.c */ -#line 14669 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14683 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2332: /* Line 1455 of yacc.c */ -#line 14670 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2333: /* Line 1455 of yacc.c */ -#line 14671 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2334: /* Line 1455 of yacc.c */ -#line 14672 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14686 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2335: /* Line 1455 of yacc.c */ -#line 14673 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14687 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2336: /* Line 1455 of yacc.c */ -#line 14674 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14688 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2337: /* Line 1455 of yacc.c */ -#line 14675 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2338: /* Line 1455 of yacc.c */ -#line 14676 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14690 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2339: /* Line 1455 of yacc.c */ -#line 14677 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14691 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2340: /* Line 1455 of yacc.c */ -#line 14678 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14692 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2341: /* Line 1455 of yacc.c */ -#line 14679 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2342: /* Line 1455 of yacc.c */ -#line 14680 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2343: /* Line 1455 of yacc.c */ -#line 14681 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2344: /* Line 1455 of yacc.c */ -#line 14682 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14696 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2345: /* Line 1455 of yacc.c */ -#line 14683 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2346: /* Line 1455 of yacc.c */ -#line 14684 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2347: /* Line 1455 of yacc.c */ -#line 14685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14699 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2348: /* Line 1455 of yacc.c */ -#line 14686 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14700 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2349: /* Line 1455 of yacc.c */ -#line 14687 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2350: /* Line 1455 of yacc.c */ -#line 14688 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14702 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2351: /* Line 1455 of yacc.c */ -#line 14689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2352: /* Line 1455 of yacc.c */ -#line 14690 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2353: /* Line 1455 of yacc.c */ -#line 14691 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14705 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2354: /* Line 1455 of yacc.c */ -#line 14692 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2355: /* Line 1455 of yacc.c */ -#line 14693 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14707 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2356: /* Line 1455 of yacc.c */ -#line 14694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14708 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2357: /* Line 1455 of yacc.c */ -#line 14695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2358: /* Line 1455 of yacc.c */ -#line 14696 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2359: /* Line 1455 of yacc.c */ -#line 14697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2360: /* Line 1455 of yacc.c */ -#line 14698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2361: /* Line 1455 of yacc.c */ -#line 14699 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14713 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2362: /* Line 1455 of yacc.c */ -#line 14700 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14714 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2363: /* Line 1455 of yacc.c */ -#line 14701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2364: /* Line 1455 of yacc.c */ -#line 14702 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2365: /* Line 1455 of yacc.c */ -#line 14703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2366: /* Line 1455 of yacc.c */ -#line 14704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2367: /* Line 1455 of yacc.c */ -#line 14705 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2368: /* Line 1455 of yacc.c */ -#line 14706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2369: /* Line 1455 of yacc.c */ -#line 14707 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2370: /* Line 1455 of yacc.c */ -#line 14708 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14722 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2371: /* Line 1455 of yacc.c */ -#line 14709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2372: /* Line 1455 of yacc.c */ -#line 14710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2373: /* Line 1455 of yacc.c */ -#line 14711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2374: /* Line 1455 of yacc.c */ -#line 14712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14726 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2375: /* Line 1455 of yacc.c */ -#line 14713 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2376: /* Line 1455 of yacc.c */ -#line 14714 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2377: /* Line 1455 of yacc.c */ -#line 14715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14729 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2378: /* Line 1455 of yacc.c */ -#line 14716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14730 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2379: /* Line 1455 of yacc.c */ -#line 14717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14731 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2380: /* Line 1455 of yacc.c */ -#line 14718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2381: /* Line 1455 of yacc.c */ -#line 14719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14733 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2382: /* Line 1455 of yacc.c */ -#line 14720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2383: /* Line 1455 of yacc.c */ -#line 14721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14735 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2384: /* Line 1455 of yacc.c */ -#line 14722 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14736 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2385: /* Line 1455 of yacc.c */ -#line 14723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14737 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2386: /* Line 1455 of yacc.c */ -#line 14724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14738 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2387: /* Line 1455 of yacc.c */ -#line 14725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14739 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2388: /* Line 1455 of yacc.c */ -#line 14726 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14740 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2389: /* Line 1455 of yacc.c */ -#line 14727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14741 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2390: /* Line 1455 of yacc.c */ -#line 14728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14742 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2391: /* Line 1455 of yacc.c */ -#line 14729 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14743 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2392: /* Line 1455 of yacc.c */ -#line 14730 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14744 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2393: /* Line 1455 of yacc.c */ -#line 14731 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14745 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2394: /* Line 1455 of yacc.c */ -#line 14732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14746 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2395: /* Line 1455 of yacc.c */ -#line 14733 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14747 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2396: /* Line 1455 of yacc.c */ -#line 14734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14748 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2397: /* Line 1455 of yacc.c */ -#line 14746 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14760 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -39873,14 +39887,14 @@ case 2398: /* Line 1455 of yacc.c */ -#line 14758 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14772 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2399: /* Line 1455 of yacc.c */ -#line 14760 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14774 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; mysql_init_select(lex); @@ -39891,6 +39905,7 @@ lex->one_shot_set= 0; lex->autocommit= 0; lex->set_statement= true; + lex->option_type= OPT_SESSION; sp_head *sp= lex->sphead; if (sp && !sp->is_invoked()) { @@ -39903,14 +39918,14 @@ case 2400: /* Line 1455 of yacc.c */ -#line 14778 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14793 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2403: /* Line 1455 of yacc.c */ -#line 14793 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14808 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END)) MYSQL_YYABORT; @@ -39920,7 +39935,7 @@ case 2405: /* Line 1455 of yacc.c */ -#line 14799 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14814 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->option_type= OPT_DEFAULT; } @@ -39929,7 +39944,7 @@ case 2406: /* Line 1455 of yacc.c */ -#line 14803 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14818 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END)) MYSQL_YYABORT; @@ -39939,7 +39954,7 @@ case 2407: /* Line 1455 of yacc.c */ -#line 14808 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14823 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->option_type= (yyvsp[(1) - (1)].var_type); } @@ -39948,7 +39963,7 @@ case 2409: /* Line 1455 of yacc.c */ -#line 14818 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14833 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END)) MYSQL_YYABORT; @@ -39958,7 +39973,7 @@ case 2411: /* Line 1455 of yacc.c */ -#line 14824 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14839 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END)) MYSQL_YYABORT; @@ -39968,7 +39983,7 @@ case 2414: /* Line 1455 of yacc.c */ -#line 14838 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14853 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { sp_create_assignment_lex(YYTHD, YY_TOKEN_START); } @@ -39977,7 +39992,7 @@ case 2415: /* Line 1455 of yacc.c */ -#line 14842 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14857 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END)) MYSQL_YYABORT; @@ -39987,7 +40002,7 @@ case 2416: /* Line 1455 of yacc.c */ -#line 14847 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14862 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { sp_create_assignment_lex(YYTHD, YY_TOKEN_START); } @@ -39996,7 +40011,7 @@ case 2417: /* Line 1455 of yacc.c */ -#line 14851 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14866 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (sp_create_assignment_instr(YYTHD, YY_TOKEN_END)) MYSQL_YYABORT; @@ -40006,7 +40021,7 @@ case 2418: /* Line 1455 of yacc.c */ -#line 14860 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14875 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->option_type= (yyvsp[(1) - (1)].var_type); } @@ -40015,84 +40030,84 @@ case 2421: /* Line 1455 of yacc.c */ -#line 14868 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 2422: /* Line 1455 of yacc.c */ -#line 14869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14884 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 2423: /* Line 1455 of yacc.c */ -#line 14870 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14885 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 2424: /* Line 1455 of yacc.c */ -#line 14874 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14889 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 2425: /* Line 1455 of yacc.c */ -#line 14875 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14890 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 2426: /* Line 1455 of yacc.c */ -#line 14876 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14891 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 2427: /* Line 1455 of yacc.c */ -#line 14877 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14892 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 2428: /* Line 1455 of yacc.c */ -#line 14881 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14896 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_DEFAULT; } break; case 2429: /* Line 1455 of yacc.c */ -#line 14882 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14897 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_GLOBAL; } break; case 2430: /* Line 1455 of yacc.c */ -#line 14883 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14898 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 2431: /* Line 1455 of yacc.c */ -#line 14884 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14899 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.var_type)=OPT_SESSION; } break; case 2432: /* Line 1455 of yacc.c */ -#line 14890 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14905 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -40126,7 +40141,7 @@ case 2433: /* Line 1455 of yacc.c */ -#line 14923 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14938 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { sp_head *sp= Lex->sphead; @@ -40138,7 +40153,7 @@ case 2434: /* Line 1455 of yacc.c */ -#line 14930 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 14945 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -40236,7 +40251,7 @@ case 2435: /* Line 1455 of yacc.c */ -#line 15023 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15038 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Item_func_set_user_var *item; item= new (YYTHD->mem_root) Item_func_set_user_var((yyvsp[(2) - (4)].lex_str), (yyvsp[(4) - (4)].item), false); @@ -40252,7 +40267,7 @@ case 2436: /* Line 1455 of yacc.c */ -#line 15034 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15049 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; struct sys_var_with_base tmp= (yyvsp[(4) - (6)].variable); @@ -40270,7 +40285,7 @@ case 2437: /* Line 1455 of yacc.c */ -#line 15047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15062 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -40291,7 +40306,7 @@ case 2438: /* Line 1455 of yacc.c */ -#line 15063 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15078 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_pcontext *pctx= lex->get_sp_current_parsing_ctx(); @@ -40309,7 +40324,7 @@ case 2439: /* Line 1455 of yacc.c */ -#line 15076 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15091 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; const CHARSET_INFO *cs2; @@ -40336,7 +40351,7 @@ case 2440: /* Line 1455 of yacc.c */ -#line 15098 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15113 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -40376,7 +40391,7 @@ case 2441: /* Line 1455 of yacc.c */ -#line 15133 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15148 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX_USER *user= (yyvsp[(3) - (5)].lex_user); LEX *lex= Lex; @@ -40420,7 +40435,7 @@ case 2442: /* Line 1455 of yacc.c */ -#line 15175 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15190 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -40453,7 +40468,7 @@ case 2443: /* Line 1455 of yacc.c */ -#line 15203 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15218 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -40504,7 +40519,7 @@ case 2444: /* Line 1455 of yacc.c */ -#line 15249 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15264 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { sys_var *tmp=find_sys_var(YYTHD, (yyvsp[(3) - (3)].lex_str).str, (yyvsp[(3) - (3)].lex_str).length); if (!tmp) @@ -40520,7 +40535,7 @@ case 2449: /* Line 1455 of yacc.c */ -#line 15270 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15285 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex=Lex; @@ -40540,7 +40555,7 @@ case 2450: /* Line 1455 of yacc.c */ -#line 15288 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15303 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex=Lex; @@ -40560,56 +40575,56 @@ case 2451: /* Line 1455 of yacc.c */ -#line 15305 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15320 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= true; } break; case 2452: /* Line 1455 of yacc.c */ -#line 15306 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15321 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= false; } break; case 2453: /* Line 1455 of yacc.c */ -#line 15310 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15325 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.tx_isolation)= ISO_READ_UNCOMMITTED; } break; case 2454: /* Line 1455 of yacc.c */ -#line 15311 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15326 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.tx_isolation)= ISO_READ_COMMITTED; } break; case 2455: /* Line 1455 of yacc.c */ -#line 15312 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15327 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.tx_isolation)= ISO_REPEATABLE_READ; } break; case 2456: /* Line 1455 of yacc.c */ -#line 15313 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15328 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.tx_isolation)= ISO_SERIALIZABLE; } break; case 2457: /* Line 1455 of yacc.c */ -#line 15317 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15332 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.simple_string)=(yyvsp[(1) - (1)].lex_str).str;} break; case 2458: /* Line 1455 of yacc.c */ -#line 15319 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15334 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if ((yyvsp[(3) - (4)].lex_str).length == 0) (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).str; @@ -40632,7 +40647,7 @@ case 2459: /* Line 1455 of yacc.c */ -#line 15337 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15352 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { WARN_DEPRECATED(YYTHD, "OLD_PASSWORD", "PASSWORD"); (yyval.simple_string)= (yyvsp[(3) - (4)].lex_str).length ? Item_func_old_password:: @@ -40647,21 +40662,21 @@ case 2460: /* Line 1455 of yacc.c */ -#line 15350 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15365 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=(yyvsp[(1) - (1)].item); } break; case 2461: /* Line 1455 of yacc.c */ -#line 15351 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15366 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=0; } break; case 2462: /* Line 1455 of yacc.c */ -#line 15353 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15368 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=new (YYTHD->mem_root) Item_string("ON", 2, system_charset_info); if ((yyval.item) == NULL) @@ -40672,7 +40687,7 @@ case 2463: /* Line 1455 of yacc.c */ -#line 15359 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15374 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=new (YYTHD->mem_root) Item_string("ALL", 3, system_charset_info); if ((yyval.item) == NULL) @@ -40683,7 +40698,7 @@ case 2464: /* Line 1455 of yacc.c */ -#line 15365 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.item)=new (YYTHD->mem_root) Item_string("binary", 6, system_charset_info); if ((yyval.item) == NULL) @@ -40694,7 +40709,7 @@ case 2465: /* Line 1455 of yacc.c */ -#line 15376 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->sphead) { @@ -40707,7 +40722,7 @@ case 2466: /* Line 1455 of yacc.c */ -#line 15387 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_LOCK_BINLOG_FOR_BACKUP; } @@ -40716,7 +40731,7 @@ case 2467: /* Line 1455 of yacc.c */ -#line 15391 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15406 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_LOCK_TABLES_FOR_BACKUP; } @@ -40725,7 +40740,7 @@ case 2468: /* Line 1455 of yacc.c */ -#line 15395 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15410 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_LOCK_TABLES; } @@ -40734,14 +40749,14 @@ case 2469: /* Line 1455 of yacc.c */ -#line 15399 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15414 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2474: /* Line 1455 of yacc.c */ -#line 15414 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15429 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { thr_lock_type lock_type= (thr_lock_type) (yyvsp[(3) - (3)].num); bool lock_for_write= (lock_type >= TL_WRITE_ALLOW_WRITE); @@ -40756,21 +40771,21 @@ case 2475: /* Line 1455 of yacc.c */ -#line 15426 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15441 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TL_READ_NO_INSERT; } break; case 2476: /* Line 1455 of yacc.c */ -#line 15427 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15442 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TL_WRITE_DEFAULT; } break; case 2477: /* Line 1455 of yacc.c */ -#line 15429 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15444 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TL_WRITE_LOW_PRIORITY; WARN_DEPRECATED(YYTHD, "LOW_PRIORITY WRITE", "WRITE"); @@ -40780,14 +40795,14 @@ case 2478: /* Line 1455 of yacc.c */ -#line 15433 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15448 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= TL_READ; } break; case 2479: /* Line 1455 of yacc.c */ -#line 15438 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15453 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->sphead) { @@ -40800,7 +40815,7 @@ case 2480: /* Line 1455 of yacc.c */ -#line 15449 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15464 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_UNLOCK_BINLOG; } @@ -40809,7 +40824,7 @@ case 2481: /* Line 1455 of yacc.c */ -#line 15453 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15468 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_UNLOCK_TABLES; } @@ -40818,7 +40833,7 @@ case 2482: /* Line 1455 of yacc.c */ -#line 15464 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15479 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -40839,7 +40854,7 @@ case 2483: /* Line 1455 of yacc.c */ -#line 15480 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15495 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -40860,7 +40875,7 @@ case 2484: /* Line 1455 of yacc.c */ -#line 15496 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15511 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->sphead) @@ -40883,7 +40898,7 @@ case 2485: /* Line 1455 of yacc.c */ -#line 15514 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15529 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -40906,63 +40921,63 @@ case 2486: /* Line 1455 of yacc.c */ -#line 15534 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15549 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ident= null_lex_str; (yyval.ha_read_mode)=(yyvsp[(1) - (1)].ha_read_mode); } break; case 2487: /* Line 1455 of yacc.c */ -#line 15535 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15550 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ident= (yyvsp[(1) - (2)].lex_str); (yyval.ha_read_mode)=(yyvsp[(2) - (2)].ha_read_mode); } break; case 2488: /* Line 1455 of yacc.c */ -#line 15539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_read_mode)= RFIRST; } break; case 2489: /* Line 1455 of yacc.c */ -#line 15540 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15555 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_read_mode)= RNEXT; } break; case 2490: /* Line 1455 of yacc.c */ -#line 15544 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15559 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_read_mode)= RFIRST; } break; case 2491: /* Line 1455 of yacc.c */ -#line 15545 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15560 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_read_mode)= RNEXT; } break; case 2492: /* Line 1455 of yacc.c */ -#line 15546 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15561 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_read_mode)= RPREV; } break; case 2493: /* Line 1455 of yacc.c */ -#line 15547 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15562 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_read_mode)= RLAST; } break; case 2494: /* Line 1455 of yacc.c */ -#line 15549 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { YYTHD->m_parser_state->m_yacc.m_ha_rkey_mode= (yyvsp[(1) - (1)].ha_rkey_mode); Lex->insert_list= new List_item; @@ -40974,7 +40989,7 @@ case 2495: /* Line 1455 of yacc.c */ -#line 15556 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15571 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_read_mode)= RKEY; } @@ -40983,56 +40998,56 @@ case 2496: /* Line 1455 of yacc.c */ -#line 15562 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15577 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_EXACT; } break; case 2497: /* Line 1455 of yacc.c */ -#line 15563 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_NEXT; } break; case 2498: /* Line 1455 of yacc.c */ -#line 15564 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15579 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_KEY_OR_PREV; } break; case 2499: /* Line 1455 of yacc.c */ -#line 15565 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15580 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_AFTER_KEY; } break; case 2500: /* Line 1455 of yacc.c */ -#line 15566 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15581 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.ha_rkey_mode)=HA_READ_BEFORE_KEY; } break; case 2501: /* Line 1455 of yacc.c */ -#line 15572 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15587 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_REVOKE; } break; case 2502: /* Line 1455 of yacc.c */ -#line 15573 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15588 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2503: /* Line 1455 of yacc.c */ -#line 15578 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->type= 0; @@ -41042,7 +41057,7 @@ case 2504: /* Line 1455 of yacc.c */ -#line 15583 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15598 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -41057,7 +41072,7 @@ case 2505: /* Line 1455 of yacc.c */ -#line 15593 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15608 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -41072,7 +41087,7 @@ case 2506: /* Line 1455 of yacc.c */ -#line 15603 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15618 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_REVOKE_ALL; } @@ -41081,7 +41096,7 @@ case 2507: /* Line 1455 of yacc.c */ -#line 15607 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15622 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->users_list.push_front ((yyvsp[(3) - (5)].lex_user)); @@ -41092,21 +41107,21 @@ case 2508: /* Line 1455 of yacc.c */ -#line 15615 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15630 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command= SQLCOM_GRANT; } break; case 2509: /* Line 1455 of yacc.c */ -#line 15616 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15631 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2510: /* Line 1455 of yacc.c */ -#line 15622 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15637 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->type= 0; @@ -41116,7 +41131,7 @@ case 2511: /* Line 1455 of yacc.c */ -#line 15628 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15643 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -41131,7 +41146,7 @@ case 2512: /* Line 1455 of yacc.c */ -#line 15639 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15654 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->columns.elements) @@ -41146,7 +41161,7 @@ case 2513: /* Line 1455 of yacc.c */ -#line 15649 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15664 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->users_list.push_front ((yyvsp[(3) - (6)].lex_user)); @@ -41157,7 +41172,7 @@ case 2516: /* Line 1455 of yacc.c */ -#line 15663 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15678 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; if (lex->grant == GLOBAL_ACLS && @@ -41169,7 +41184,7 @@ case 2517: /* Line 1455 of yacc.c */ -#line 15670 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15685 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->all_privileges= 1; Lex->grant= GLOBAL_ACLS; @@ -41179,259 +41194,259 @@ case 2522: /* Line 1455 of yacc.c */ -#line 15688 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->which_columns = SELECT_ACL;} break; case 2523: /* Line 1455 of yacc.c */ -#line 15689 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2524: /* Line 1455 of yacc.c */ -#line 15691 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->which_columns = INSERT_ACL;} break; case 2525: /* Line 1455 of yacc.c */ -#line 15692 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15707 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2526: /* Line 1455 of yacc.c */ -#line 15694 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->which_columns = UPDATE_ACL; } break; case 2527: /* Line 1455 of yacc.c */ -#line 15695 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2528: /* Line 1455 of yacc.c */ -#line 15697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->which_columns = REFERENCES_ACL;} break; case 2529: /* Line 1455 of yacc.c */ -#line 15698 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15713 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2530: /* Line 1455 of yacc.c */ -#line 15699 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15714 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= DELETE_ACL;} break; case 2531: /* Line 1455 of yacc.c */ -#line 15700 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2532: /* Line 1455 of yacc.c */ -#line 15701 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= INDEX_ACL;} break; case 2533: /* Line 1455 of yacc.c */ -#line 15702 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= ALTER_ACL;} break; case 2534: /* Line 1455 of yacc.c */ -#line 15703 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= CREATE_ACL;} break; case 2535: /* Line 1455 of yacc.c */ -#line 15704 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= DROP_ACL;} break; case 2536: /* Line 1455 of yacc.c */ -#line 15705 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= EXECUTE_ACL;} break; case 2537: /* Line 1455 of yacc.c */ -#line 15706 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= RELOAD_ACL;} break; case 2538: /* Line 1455 of yacc.c */ -#line 15707 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15722 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= SHUTDOWN_ACL;} break; case 2539: /* Line 1455 of yacc.c */ -#line 15708 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= PROCESS_ACL;} break; case 2540: /* Line 1455 of yacc.c */ -#line 15709 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= FILE_ACL;} break; case 2541: /* Line 1455 of yacc.c */ -#line 15710 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15725 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 2542: /* Line 1455 of yacc.c */ -#line 15711 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15726 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= SHOW_DB_ACL;} break; case 2543: /* Line 1455 of yacc.c */ -#line 15712 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15727 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= SUPER_ACL;} break; case 2544: /* Line 1455 of yacc.c */ -#line 15713 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= CREATE_TMP_ACL;} break; case 2545: /* Line 1455 of yacc.c */ -#line 15714 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15729 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= LOCK_TABLES_ACL; } break; case 2546: /* Line 1455 of yacc.c */ -#line 15715 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15730 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= REPL_SLAVE_ACL; } break; case 2547: /* Line 1455 of yacc.c */ -#line 15716 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15731 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= REPL_CLIENT_ACL; } break; case 2548: /* Line 1455 of yacc.c */ -#line 15717 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15732 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= CREATE_VIEW_ACL; } break; case 2549: /* Line 1455 of yacc.c */ -#line 15718 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15733 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= SHOW_VIEW_ACL; } break; case 2550: /* Line 1455 of yacc.c */ -#line 15719 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15734 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= CREATE_PROC_ACL; } break; case 2551: /* Line 1455 of yacc.c */ -#line 15720 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15735 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= ALTER_PROC_ACL; } break; case 2552: /* Line 1455 of yacc.c */ -#line 15721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15736 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= CREATE_USER_ACL; } break; case 2553: /* Line 1455 of yacc.c */ -#line 15722 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15737 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= EVENT_ACL;} break; case 2554: /* Line 1455 of yacc.c */ -#line 15723 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15738 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= TRIGGER_ACL; } break; case 2555: /* Line 1455 of yacc.c */ -#line 15724 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15739 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= CREATE_TABLESPACE_ACL; } break; case 2556: /* Line 1455 of yacc.c */ -#line 15728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15743 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2557: /* Line 1455 of yacc.c */ -#line 15729 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15744 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2560: /* Line 1455 of yacc.c */ -#line 15739 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15754 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_subject) @@ -41446,7 +41461,7 @@ case 2561: /* Line 1455 of yacc.c */ -#line 15749 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15764 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->x509_issuer) @@ -41461,7 +41476,7 @@ case 2562: /* Line 1455 of yacc.c */ -#line 15759 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15774 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (lex->ssl_cipher) @@ -41476,7 +41491,7 @@ case 2563: /* Line 1455 of yacc.c */ -#line 15772 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15787 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; size_t dummy; @@ -41496,7 +41511,7 @@ case 2564: /* Line 1455 of yacc.c */ -#line 15787 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15802 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = (yyvsp[(1) - (3)].lex_str).str; @@ -41514,7 +41529,7 @@ case 2565: /* Line 1455 of yacc.c */ -#line 15800 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15815 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->current_select->db = NULL; @@ -41532,7 +41547,7 @@ case 2566: /* Line 1455 of yacc.c */ -#line 15813 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15828 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!lex->current_select->add_table_to_list(lex->thd, (yyvsp[(1) - (1)].table),NULL, @@ -41546,7 +41561,7 @@ case 2567: /* Line 1455 of yacc.c */ -#line 15825 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15840 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT; @@ -41556,7 +41571,7 @@ case 2568: /* Line 1455 of yacc.c */ -#line 15830 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15845 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -41566,7 +41581,7 @@ case 2569: /* Line 1455 of yacc.c */ -#line 15838 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15853 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(1) - (1)].lex_user))) MYSQL_YYABORT; @@ -41576,7 +41591,7 @@ case 2570: /* Line 1455 of yacc.c */ -#line 15843 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15858 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->users_list.push_back((yyvsp[(3) - (3)].lex_user))) MYSQL_YYABORT; @@ -41586,7 +41601,7 @@ case 2571: /* Line 1455 of yacc.c */ -#line 15851 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15866 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_user)=(yyvsp[(1) - (4)].lex_user); (yyvsp[(1) - (4)].lex_user)->password=(yyvsp[(4) - (4)].lex_str); if (Lex->sql_command == SQLCOM_REVOKE) @@ -41609,7 +41624,7 @@ case 2572: /* Line 1455 of yacc.c */ -#line 15869 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15884 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->sql_command == SQLCOM_REVOKE) { @@ -41634,7 +41649,7 @@ case 2573: /* Line 1455 of yacc.c */ -#line 15889 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15904 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->sql_command == SQLCOM_REVOKE) { @@ -41651,7 +41666,7 @@ case 2574: /* Line 1455 of yacc.c */ -#line 15901 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15916 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->sql_command == SQLCOM_REVOKE) { @@ -41669,7 +41684,7 @@ case 2575: /* Line 1455 of yacc.c */ -#line 15914 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15929 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.lex_user)= (yyvsp[(1) - (1)].lex_user); (yyvsp[(1) - (1)].lex_user)->password= null_lex_str; @@ -41679,7 +41694,7 @@ case 2576: /* Line 1455 of yacc.c */ -#line 15922 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15937 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->grant |= lex->which_columns; @@ -41689,7 +41704,7 @@ case 2580: /* Line 1455 of yacc.c */ -#line 15936 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15951 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { String *new_str = new (YYTHD->mem_root) String((const char*) (yyvsp[(1) - (1)].lex_str).str,(yyvsp[(1) - (1)].lex_str).length,system_charset_info); if (new_str == NULL) @@ -41719,7 +41734,7 @@ case 2582: /* Line 1455 of yacc.c */ -#line 15965 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15980 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_SPECIFIED; } @@ -41728,7 +41743,7 @@ case 2583: /* Line 1455 of yacc.c */ -#line 15969 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15984 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_ANY; } @@ -41737,7 +41752,7 @@ case 2584: /* Line 1455 of yacc.c */ -#line 15973 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15988 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_X509; } @@ -41746,7 +41761,7 @@ case 2585: /* Line 1455 of yacc.c */ -#line 15977 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15992 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->ssl_type=SSL_TYPE_NONE; } @@ -41755,49 +41770,49 @@ case 2586: /* Line 1455 of yacc.c */ -#line 15983 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 15998 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2588: /* Line 1455 of yacc.c */ -#line 15988 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16003 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2589: /* Line 1455 of yacc.c */ -#line 15989 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16004 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 2590: /* Line 1455 of yacc.c */ -#line 15993 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16008 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2591: /* Line 1455 of yacc.c */ -#line 15994 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16009 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2592: /* Line 1455 of yacc.c */ -#line 15998 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16013 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->grant |= GRANT_ACL;} break; case 2593: /* Line 1455 of yacc.c */ -#line 16000 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16015 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->mqh.questions=(yyvsp[(2) - (2)].ulong_num); @@ -41808,7 +41823,7 @@ case 2594: /* Line 1455 of yacc.c */ -#line 16006 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16021 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->mqh.updates=(yyvsp[(2) - (2)].ulong_num); @@ -41819,7 +41834,7 @@ case 2595: /* Line 1455 of yacc.c */ -#line 16012 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->mqh.conn_per_hour= (yyvsp[(2) - (2)].ulong_num); @@ -41830,7 +41845,7 @@ case 2596: /* Line 1455 of yacc.c */ -#line 16018 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16033 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->mqh.user_conn= (yyvsp[(2) - (2)].ulong_num); @@ -41841,7 +41856,7 @@ case 2597: /* Line 1455 of yacc.c */ -#line 16027 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16042 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command = SQLCOM_BEGIN; @@ -41852,84 +41867,84 @@ case 2598: /* Line 1455 of yacc.c */ -#line 16032 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16047 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2599: /* Line 1455 of yacc.c */ -#line 16036 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16051 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2600: /* Line 1455 of yacc.c */ -#line 16037 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16052 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2601: /* Line 1455 of yacc.c */ -#line 16042 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16057 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_yes_no_unk)= TVL_UNKNOWN; } break; case 2602: /* Line 1455 of yacc.c */ -#line 16043 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16058 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_yes_no_unk)= TVL_NO; } break; case 2603: /* Line 1455 of yacc.c */ -#line 16044 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16059 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_yes_no_unk)= TVL_YES; } break; case 2604: /* Line 1455 of yacc.c */ -#line 16049 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16064 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_yes_no_unk)= TVL_UNKNOWN; } break; case 2605: /* Line 1455 of yacc.c */ -#line 16050 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16065 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_yes_no_unk)= TVL_YES; } break; case 2606: /* Line 1455 of yacc.c */ -#line 16051 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16066 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.m_yes_no_unk)= TVL_NO; } break; case 2607: /* Line 1455 of yacc.c */ -#line 16055 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16070 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2608: /* Line 1455 of yacc.c */ -#line 16056 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16071 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2609: /* Line 1455 of yacc.c */ -#line 16061 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16076 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_COMMIT; @@ -41943,7 +41958,7 @@ case 2610: /* Line 1455 of yacc.c */ -#line 16073 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16088 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK; @@ -41957,7 +41972,7 @@ case 2611: /* Line 1455 of yacc.c */ -#line 16083 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16098 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_ROLLBACK_TO_SAVEPOINT; @@ -41968,7 +41983,7 @@ case 2612: /* Line 1455 of yacc.c */ -#line 16092 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16107 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_SAVEPOINT; @@ -41979,7 +41994,7 @@ case 2613: /* Line 1455 of yacc.c */ -#line 16101 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16116 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; lex->sql_command= SQLCOM_RELEASE_SAVEPOINT; @@ -41990,14 +42005,14 @@ case 2614: /* Line 1455 of yacc.c */ -#line 16114 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16129 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2616: /* Line 1455 of yacc.c */ -#line 16120 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_select_to_union_list(Lex, (bool)(yyvsp[(2) - (2)].num), TRUE)) MYSQL_YYABORT; @@ -42007,7 +42022,7 @@ case 2617: /* Line 1455 of yacc.c */ -#line 16125 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16140 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* Remove from the name resolution context stack the context of the @@ -42020,42 +42035,42 @@ case 2618: /* Line 1455 of yacc.c */ -#line 16135 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16150 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 0; } break; case 2619: /* Line 1455 of yacc.c */ -#line 16136 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16151 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 2620: /* Line 1455 of yacc.c */ -#line 16137 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16152 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)= 1; } break; case 2621: /* Line 1455 of yacc.c */ -#line 16141 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16156 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.is_not_empty)= false; } break; case 2622: /* Line 1455 of yacc.c */ -#line 16142 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16157 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.is_not_empty)= true; } break; case 2623: /* Line 1455 of yacc.c */ -#line 16146 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16161 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42076,7 +42091,7 @@ case 2624: /* Line 1455 of yacc.c */ -#line 16162 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; thd->lex->current_select->no_table_names_allowed= 0; @@ -42087,28 +42102,28 @@ case 2627: /* Line 1455 of yacc.c */ -#line 16175 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16190 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=1; } break; case 2628: /* Line 1455 of yacc.c */ -#line 16176 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16191 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=1; } break; case 2629: /* Line 1455 of yacc.c */ -#line 16177 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16192 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.num)=0; } break; case 2630: /* Line 1455 of yacc.c */ -#line 16182 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16197 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.select_lex)= Lex->current_select->master_unit()->first_select(); } @@ -42117,7 +42132,7 @@ case 2631: /* Line 1455 of yacc.c */ -#line 16186 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.select_lex)= Lex->current_select->master_unit()->first_select(); } @@ -42126,7 +42141,7 @@ case 2633: /* Line 1455 of yacc.c */ -#line 16195 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16210 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (add_select_to_union_list(Lex, (bool)(yyvsp[(3) - (3)].num), FALSE)) MYSQL_YYABORT; @@ -42136,7 +42151,7 @@ case 2634: /* Line 1455 of yacc.c */ -#line 16201 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16216 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->pop_context(); (yyval.select_lex)= (yyvsp[(1) - (6)].select_lex); @@ -42146,7 +42161,7 @@ case 2635: /* Line 1455 of yacc.c */ -#line 16210 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16225 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { (yyval.select_lex)= (yyvsp[(2) - (3)].select_lex); } @@ -42155,7 +42170,7 @@ case 2636: /* Line 1455 of yacc.c */ -#line 16216 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16231 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; if (!lex->expr_allows_subselect || @@ -42179,7 +42194,7 @@ case 2637: /* Line 1455 of yacc.c */ -#line 16237 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16252 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex=Lex; @@ -42207,14 +42222,14 @@ case 2642: /* Line 1455 of yacc.c */ -#line 16272 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16287 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->options|= SELECT_STRAIGHT_JOIN; } break; case 2643: /* Line 1455 of yacc.c */ -#line 16274 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16289 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -42227,28 +42242,28 @@ case 2644: /* Line 1455 of yacc.c */ -#line 16281 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16296 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->options|= SELECT_DISTINCT; } break; case 2645: /* Line 1455 of yacc.c */ -#line 16282 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16297 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->options|= SELECT_SMALL_RESULT; } break; case 2646: /* Line 1455 of yacc.c */ -#line 16283 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16298 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->options|= SELECT_BIG_RESULT; } break; case 2647: /* Line 1455 of yacc.c */ -#line 16285 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16300 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -42259,7 +42274,7 @@ case 2648: /* Line 1455 of yacc.c */ -#line 16291 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16306 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (check_simple_select()) MYSQL_YYABORT; @@ -42270,35 +42285,35 @@ case 2649: /* Line 1455 of yacc.c */ -#line 16296 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16311 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Select->options|= SELECT_ALL; } break; case 2650: /* Line 1455 of yacc.c */ -#line 16307 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16322 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2651: /* Line 1455 of yacc.c */ -#line 16309 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16324 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2652: /* Line 1455 of yacc.c */ -#line 16311 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16326 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2666: /* Line 1455 of yacc.c */ -#line 16344 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16359 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* We have to distinguish missing DEFINER-clause from case when @@ -42314,7 +42329,7 @@ case 2667: /* Line 1455 of yacc.c */ -#line 16358 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16373 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { YYTHD->lex->definer= get_current_user(YYTHD, (yyvsp[(3) - (3)].lex_user)); } @@ -42323,77 +42338,77 @@ case 2668: /* Line 1455 of yacc.c */ -#line 16371 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16386 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2669: /* Line 1455 of yacc.c */ -#line 16373 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16388 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2670: /* Line 1455 of yacc.c */ -#line 16375 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16390 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2671: /* Line 1455 of yacc.c */ -#line 16380 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16395 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_mode= VIEW_CREATE_OR_REPLACE; } break; case 2672: /* Line 1455 of yacc.c */ -#line 16385 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16400 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_UNDEFINED; } break; case 2673: /* Line 1455 of yacc.c */ -#line 16387 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16402 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_MERGE; } break; case 2674: /* Line 1455 of yacc.c */ -#line 16389 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16404 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_algorithm= VIEW_ALGORITHM_TMPTABLE; } break; case 2675: /* Line 1455 of yacc.c */ -#line 16394 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16409 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFAULT; } break; case 2676: /* Line 1455 of yacc.c */ -#line 16396 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16411 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_DEFINER; } break; case 2677: /* Line 1455 of yacc.c */ -#line 16398 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16413 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_suid= VIEW_SUID_INVOKER; } break; case 2678: /* Line 1455 of yacc.c */ -#line 16403 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16418 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42411,14 +42426,14 @@ case 2680: /* Line 1455 of yacc.c */ -#line 16420 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16435 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2682: /* Line 1455 of yacc.c */ -#line 16426 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16441 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) sql_memdup(&(yyvsp[(1) - (1)].lex_str), sizeof(LEX_STRING))); @@ -42428,7 +42443,7 @@ case 2683: /* Line 1455 of yacc.c */ -#line 16431 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16446 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->view_list.push_back((LEX_STRING*) sql_memdup(&(yyvsp[(3) - (3)].lex_str), sizeof(LEX_STRING))); @@ -42438,7 +42453,7 @@ case 2684: /* Line 1455 of yacc.c */ -#line 16438 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16453 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->parsing_options.allows_variable= FALSE; @@ -42452,7 +42467,7 @@ case 2685: /* Line 1455 of yacc.c */ -#line 16447 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16462 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -42471,7 +42486,7 @@ case 2686: /* Line 1455 of yacc.c */ -#line 16464 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16479 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (Lex->current_select->set_braces(0)) { @@ -42492,7 +42507,7 @@ case 2689: /* Line 1455 of yacc.c */ -#line 16485 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16500 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { if (setup_select_in_parentheses(Lex)) MYSQL_YYABORT; @@ -42502,7 +42517,7 @@ case 2691: /* Line 1455 of yacc.c */ -#line 16494 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16509 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->current_select->table_list.save_and_clear(&Lex->save_list); } @@ -42511,7 +42526,7 @@ case 2692: /* Line 1455 of yacc.c */ -#line 16498 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16513 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->current_select->table_list.push_front(&Lex->save_list); } @@ -42520,35 +42535,35 @@ case 2693: /* Line 1455 of yacc.c */ -#line 16505 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16520 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_NONE; } break; case 2694: /* Line 1455 of yacc.c */ -#line 16507 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16522 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2695: /* Line 1455 of yacc.c */ -#line 16509 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16524 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_CASCADED; } break; case 2696: /* Line 1455 of yacc.c */ -#line 16511 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16526 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->create_view_check= VIEW_CHECK_LOCAL; } break; case 2697: /* Line 1455 of yacc.c */ -#line 16528 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16543 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $8 */ Lex->raw_trg_on_table_name_begin= YYLIP->get_tok_start(); } @@ -42557,7 +42572,7 @@ case 2698: /* Line 1455 of yacc.c */ -#line 16534 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16549 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $12 */ Lex->raw_trg_on_table_name_end= YYLIP->get_tok_start(); } @@ -42566,7 +42581,7 @@ case 2699: /* Line 1455 of yacc.c */ -#line 16539 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16554 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $15 */ THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42601,7 +42616,7 @@ case 2700: /* Line 1455 of yacc.c */ -#line 16569 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16584 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $17 */ THD *thd= YYTHD; LEX *lex= Lex; @@ -42631,7 +42646,7 @@ case 2701: /* Line 1455 of yacc.c */ -#line 16604 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16619 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42653,7 +42668,7 @@ case 2702: /* Line 1455 of yacc.c */ -#line 16622 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16637 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42675,7 +42690,7 @@ case 2703: /* Line 1455 of yacc.c */ -#line 16645 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16660 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $5 */ THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42711,7 +42726,7 @@ case 2704: /* Line 1455 of yacc.c */ -#line 16677 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16692 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $8 */ Lex->sphead->m_parser_data.set_parameter_end_ptr( YYLIP->get_cpp_tok_start()); @@ -42721,7 +42736,7 @@ case 2705: /* Line 1455 of yacc.c */ -#line 16682 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16697 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $10 */ LEX *lex= Lex; lex->charset= NULL; @@ -42734,7 +42749,7 @@ case 2706: /* Line 1455 of yacc.c */ -#line 16690 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16705 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $12 */ LEX *lex= Lex; sp_head *sp= lex->sphead; @@ -42762,7 +42777,7 @@ case 2707: /* Line 1455 of yacc.c */ -#line 16713 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16728 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* $14 */ THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42775,7 +42790,7 @@ case 2708: /* Line 1455 of yacc.c */ -#line 16721 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16736 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42835,7 +42850,7 @@ case 2709: /* Line 1455 of yacc.c */ -#line 16779 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16794 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -42860,7 +42875,7 @@ case 2710: /* Line 1455 of yacc.c */ -#line 16799 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16814 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { /* NOTE: the start of the parameters in the query string is @@ -42877,7 +42892,7 @@ case 2711: /* Line 1455 of yacc.c */ -#line 16812 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16827 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42892,7 +42907,7 @@ case 2712: /* Line 1455 of yacc.c */ -#line 16822 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16837 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= thd->lex; @@ -42905,7 +42920,7 @@ case 2713: /* Line 1455 of yacc.c */ -#line 16830 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16845 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { THD *thd= YYTHD; LEX *lex= Lex; @@ -42919,7 +42934,7 @@ case 2714: /* Line 1455 of yacc.c */ -#line 16844 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16859 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_START; } @@ -42928,7 +42943,7 @@ case 2715: /* Line 1455 of yacc.c */ -#line 16848 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16863 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_END; } @@ -42937,7 +42952,7 @@ case 2716: /* Line 1455 of yacc.c */ -#line 16852 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16867 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_PREPARE; } @@ -42946,7 +42961,7 @@ case 2717: /* Line 1455 of yacc.c */ -#line 16856 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16871 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_COMMIT; } @@ -42955,7 +42970,7 @@ case 2718: /* Line 1455 of yacc.c */ -#line 16860 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16875 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_ROLLBACK; } @@ -42964,7 +42979,7 @@ case 2719: /* Line 1455 of yacc.c */ -#line 16864 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16879 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->sql_command = SQLCOM_XA_RECOVER; } @@ -42973,7 +42988,7 @@ case 2720: /* Line 1455 of yacc.c */ -#line 16871 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16886 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (1)].string)->length() <= MAXGTRIDSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -42985,7 +43000,7 @@ case 2721: /* Line 1455 of yacc.c */ -#line 16878 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16893 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (3)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (3)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -42997,7 +43012,7 @@ case 2722: /* Line 1455 of yacc.c */ -#line 16885 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16900 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { MYSQL_YYABORT_UNLESS((yyvsp[(1) - (5)].string)->length() <= MAXGTRIDSIZE && (yyvsp[(3) - (5)].string)->length() <= MAXBQUALSIZE); if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID)))) @@ -43009,84 +43024,84 @@ case 2723: /* Line 1455 of yacc.c */ -#line 16894 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16909 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2724: /* Line 1455 of yacc.c */ -#line 16895 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16910 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2725: /* Line 1455 of yacc.c */ -#line 16899 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16914 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2726: /* Line 1455 of yacc.c */ -#line 16900 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16915 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_JOIN; } break; case 2727: /* Line 1455 of yacc.c */ -#line 16901 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16916 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_RESUME; } break; case 2728: /* Line 1455 of yacc.c */ -#line 16905 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16920 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2729: /* Line 1455 of yacc.c */ -#line 16906 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16921 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_ONE_PHASE; } break; case 2730: /* Line 1455 of yacc.c */ -#line 16911 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16926 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_NONE; } break; case 2731: /* Line 1455 of yacc.c */ -#line 16913 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16928 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_SUSPEND; } break; case 2733: /* Line 1455 of yacc.c */ -#line 16918 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16933 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" {} break; case 2734: /* Line 1455 of yacc.c */ -#line 16919 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16934 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { Lex->xa_opt=XA_FOR_MIGRATE; } break; case 2735: /* Line 1455 of yacc.c */ -#line 16924 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16939 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_INSTALL_PLUGIN; @@ -43098,7 +43113,7 @@ case 2736: /* Line 1455 of yacc.c */ -#line 16934 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 16949 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" { LEX *lex= Lex; lex->sql_command= SQLCOM_UNINSTALL_PLUGIN; @@ -43109,7 +43124,7 @@ /* Line 1455 of yacc.c */ -#line 43113 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.cc" +#line 43128 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_yacc.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_yacc.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_yacc.h 2016-12-13 08:49:19.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_yacc.h 2017-10-27 11:39:29.000000000 +0000 @@ -1327,7 +1327,7 @@ { /* Line 1676 of yacc.c */ -#line 968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.yy" +#line 968 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.yy" int num; ulong ulong_num; @@ -1389,7 +1389,7 @@ /* Line 1676 of yacc.c */ -#line 1393 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-new/sql/sql_yacc.h" +#line 1393 "/mnt/workspace/percona-xtradb-cluster-5.6-source-tarball-combined/sql/sql_yacc.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_yacc.yy percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_yacc.yy --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_yacc.yy 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_yacc.yy 2017-10-19 04:25:29.000000000 +0000 @@ -5621,6 +5621,12 @@ { partition_info *part_info= Lex->part_info; partition_element *p_elem= part_info->curr_part_elem; + if (check_string_char_length(&$1, "", NAME_CHAR_LEN, + system_charset_info, true)) + { + my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str); + MYSQL_YYABORT; + } p_elem->partition_name= $1.str; } ; @@ -5915,7 +5921,15 @@ sub_name: ident_or_text - { Lex->part_info->curr_part_elem->partition_name= $1.str; } + { + if (check_string_char_length(&$1, "", NAME_CHAR_LEN, + system_charset_info, true)) + { + my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str); + MYSQL_YYABORT; + } + Lex->part_info->curr_part_elem->partition_name= $1.str; + } ; opt_part_options: @@ -14767,6 +14781,7 @@ lex->one_shot_set= 0; lex->autocommit= 0; lex->set_statement= true; + lex->option_type= OPT_SESSION; sp_head *sp= lex->sphead; if (sp && !sp->is_invoked()) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_zip_dict.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_zip_dict.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_zip_dict.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_zip_dict.cc 2017-10-19 04:25:29.000000000 +0000 @@ -41,6 +41,12 @@ @retval ER_COMPRESSION_DICTIONARY_EXISTS Dictionary with such name already exists @retval ER_READ_ONLY_MODE Forbidden in read-only mode +@retval ER_ILLEGAL_HA Forbidden when fake changes + enabled +@retval ER_OUT_OF_RESOURCES Out of memory +@retval ER_RECORD_FILE_FULL Out of disk space +@retval ER_TOO_MANY_CONCURRENT_TRXS Too many concurrent + transactions @retval ER_UNKNOWN_ERROR Unknown error */ int mysql_create_zip_dict(THD* thd, const char* name, ulong name_len, @@ -51,7 +57,8 @@ DBUG_ENTER("mysql_create_zip_dict"); handlerton *hton= ha_default_handlerton(thd); - if (!hton->create_zip_dict) + if (!ha_check_storage_engine_flag(hton, + HTON_SUPPORTS_COMPRESSED_COLUMNS)) { error= ER_ILLEGAL_HA_CREATE_OPTION; my_error(error, MYF(0), @@ -94,6 +101,22 @@ error= ER_READ_ONLY_MODE; my_error(error, MYF(0)); break; + case HA_CREATE_ZIP_DICT_FAKE_CHANGES: + error= ER_ILLEGAL_HA; + my_error(error, MYF(0), name); + break; + case HA_CREATE_ZIP_DICT_OUT_OF_MEMORY: + error= ER_OUT_OF_RESOURCES; + my_error(error, MYF(0)); + break; + case HA_CREATE_ZIP_DICT_OUT_OF_FILE_SPACE: + error= ER_RECORD_FILE_FULL; + my_error(error, MYF(0), "SYS_ZIP_DICT"); + break; + case HA_CREATE_ZIP_DICT_TOO_MANY_CONCURRENT_TRXS: + error= ER_TOO_MANY_CONCURRENT_TRXS; + my_error(error, MYF(0)); + break; default: DBUG_ASSERT(0); error= ER_UNKNOWN_ERROR; @@ -123,6 +146,12 @@ @retval ER_COMPRESSION_DICTIONARY_IS_REFERENCED Dictictionary is still in use @retval ER_READ_ONLY_MODE Forbidden in read-only mode +@retval ER_ILLEGAL_HA Forbidden when fake changes + enabled +@retval ER_OUT_OF_RESOURCES Out of memory +@retval ER_RECORD_FILE_FULL Out of disk space +@retval ER_TOO_MANY_CONCURRENT_TRXS Too many concurrent + transactions @retval ER_UNKNOWN_ERROR Unknown error */ int mysql_drop_zip_dict(THD* thd, const char* name, ulong name_len, @@ -133,7 +162,8 @@ DBUG_ENTER("mysql_drop_zip_dict"); handlerton *hton= ha_default_handlerton(thd); - if (!hton->drop_zip_dict) + if (!ha_check_storage_engine_flag(hton, + HTON_SUPPORTS_COMPRESSED_COLUMNS)) { error= ER_ILLEGAL_HA_CREATE_OPTION; my_error(error, MYF(0), @@ -170,6 +200,22 @@ error= ER_READ_ONLY_MODE; my_error(error, MYF(0)); break; + case HA_DROP_ZIP_DICT_FAKE_CHANGES: + error= ER_ILLEGAL_HA; + my_error(error, MYF(0), name); + break; + case HA_DROP_ZIP_DICT_OUT_OF_MEMORY: + error= ER_OUT_OF_RESOURCES; + my_error(error, MYF(0)); + break; + case HA_DROP_ZIP_DICT_OUT_OF_FILE_SPACE: + error= ER_RECORD_FILE_FULL; + my_error(error, MYF(0), "SYS_ZIP_DICT"); + break; + case HA_DROP_ZIP_DICT_TOO_MANY_CONCURRENT_TRXS: + error= ER_TOO_MANY_CONCURRENT_TRXS; + my_error(error, MYF(0)); + break; default: DBUG_ASSERT(0); error= ER_UNKNOWN_ERROR; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_zip_dict.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_zip_dict.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sql_zip_dict.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sql_zip_dict.h 2017-10-19 04:25:29.000000000 +0000 @@ -42,6 +42,8 @@ @retval ER_COMPRESSION_DICTIONARY_EXISTS Dictionary with such name already exists @retval ER_READ_ONLY_MODE Forbidden in read-only mode + @retval ER_ILLEGAL_HA Forbidden when fake + changes enabled @retval ER_UNKNOWN_ERROR Unknown error */ int mysql_create_zip_dict(THD* thd, const char* name, ulong name_len, @@ -65,6 +67,8 @@ use @retval ER_READ_ONLY_MODE Forbidden in read-only mode + @retval ER_ILLEGAL_HA Forbidden when fake + changes enabled @retval ER_UNKNOWN_ERROR Unknown error */ int mysql_drop_zip_dict(THD* thd, const char* name, ulong name_len, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sys_vars.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sys_vars.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/sys_vars.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/sys_vars.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1801,13 +1801,6 @@ NO_CMD_LINE, VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(0), NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_cached_query_exec_time)); -static Sys_var_ulong sys_query_exec_id( - "query_exec_id", - "Pretend queries take this query id. When 0 (the default) use the" - "actual query id. Used only for debugging.", - SESSION_VAR(query_exec_id), - NO_CMD_LINE, VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1), - NO_MUTEX_GUARD, IN_BINLOG); #endif static bool fix_low_prio_updates(sys_var *self, THD *thd, enum_var_type type) @@ -2224,6 +2217,25 @@ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_net_write_timeout)); +// Sync kill_idle_transaction and innodb_kill_idle_transaction values +extern long srv_kill_idle_transaction; + +static bool fix_kill_idle_transaction(sys_var *self, THD *thd, + enum_var_type type) +{ + srv_kill_idle_transaction= kill_idle_transaction_timeout; + return false; +} + +static Sys_var_ulong Sys_kill_idle_transaction( + "kill_idle_transaction", + "If non-zero, number of seconds to wait before killing idle " + "connections that have open transactions", + GLOBAL_VAR(kill_idle_transaction_timeout), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(0), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), + ON_UPDATE(fix_kill_idle_transaction)); + static bool fix_net_retry_count(sys_var *self, THD *thd, enum_var_type type) { if (type != OPT_GLOBAL) @@ -4923,7 +4935,7 @@ GLOBAL_VAR(wsrep_slave_threads), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1, 512), DEFAULT(1), BLOCK_SIZE(1), &PLock_wsrep_slave_threads, NOT_IN_BINLOG, - ON_CHECK(wsrep_slave_threads_check), + ON_CHECK(NULL), ON_UPDATE(wsrep_slave_threads_update)); static Sys_var_charptr Sys_wsrep_dbug_option( diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/table_cache.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/table_cache.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/table_cache.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/table_cache.cc 2017-10-19 04:25:29.000000000 +0000 @@ -361,7 +361,17 @@ #ifndef DBUG_OFF if (remove_type == TDC_RT_REMOVE_ALL) +#ifdef WITH_WSREP + { + /* following assert may cause false posivive fire for CTAS */ + if (thd->lex->sql_command != SQLCOM_CREATE_TABLE) + { +#endif /* WITH_WSREP */ DBUG_ASSERT(cache_el[i]->used_tables.is_empty()); +#ifdef WITH_WSREP + } + } +#endif /* WITH_WSREP */ else if (remove_type == TDC_RT_REMOVE_NOT_OWN || remove_type == TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/table.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/table.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/table.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/table.cc 2017-10-19 04:25:29.000000000 +0000 @@ -871,18 +871,22 @@ /** Setup key-related fields of Field object for given key and key part. - @param[in] share Pointer to TABLE_SHARE - @param[in] handler Pointer to handler - @param[in] primary_key_n Primary key number - @param[in] keyinfo Pointer to processed key - @param[in] key_n Processed key number - @param[in] key_part_n Processed key part number - @param[in,out] usable_parts Pointer to usable_parts variable + @param[in] share Pointer to TABLE_SHARE + @param[in] handler_file Pointer to handler + @param[in] primary_key_n Primary key number + @param[in] keyinfo Pointer to processed key + @param[in] key_n Processed key number + @param[in] key_part_n Processed key part number + @param[in,out] usable_parts Pointer to usable_parts variable + @param[in] part_of_key_not_extended Set when column is part of the Key + and not appended by the storage + engine from primary key columns. */ static void setup_key_part_field(TABLE_SHARE *share, handler *handler_file, uint primary_key_n, KEY *keyinfo, uint key_n, - uint key_part_n, uint *usable_parts) + uint key_part_n, uint *usable_parts, + bool part_of_key_not_extended) { KEY_PART_INFO *key_part= &keyinfo->key_part[key_part_n]; Field *field= key_part->field; @@ -909,7 +913,8 @@ { share->keys_for_keyread.set_bit(key_n); field->part_of_key.set_bit(key_n); - field->part_of_key_not_clustered.set_bit(key_n); + if (part_of_key_not_extended) + field->part_of_key_not_extended.set_bit(key_n); } if (handler_file->index_flags(key_n, key_part_n, 1) & HA_READ_ORDER) field->part_of_sortkey.set_bit(key_n); @@ -989,7 +994,7 @@ *current_key_part= *pk_key_part; setup_key_part_field(share, handler_file, pk_n, sk, sk_n, - sk->actual_key_parts, usable_parts); + sk->actual_key_parts, usable_parts, false); *current_rec_per_key++= 0; sk->actual_key_parts++; sk->unused_key_parts--; @@ -1838,13 +1843,25 @@ *field_ptr=0; // End marker /* update zip dict info (name + data) from the handler */ if (share->has_compressed_columns()) - handler_file->update_field_defs_with_zip_dict_info(); + handler_file->update_field_defs_with_zip_dict_info(NULL); /* Fix key->name and key_part->field */ if (key_parts) { - uint primary_key=(uint) (find_type(primary_key_name, &share->keynames, - FIND_TYPE_NO_PREFIX) - 1); + const int pk_off= find_type(primary_key_name, &share->keynames, + FIND_TYPE_NO_PREFIX); + uint primary_key= (pk_off > 0 ? pk_off-1 : MAX_KEY); + /* + The following if-else is here for MyRocks: + set share->primary_key as early as possible, because the return value + of ha_rocksdb::index_flags(key, ...) (HA_KEYREAD_ONLY bit in particular) + depends on whether the key is the primary key. + */ + if (primary_key < MAX_KEY && share->keys_in_use.is_set(primary_key)) + share->primary_key= primary_key; + else + share->primary_key= MAX_KEY; + longlong ha_option= handler_file->ha_table_flags(); keyinfo= share->key_info; key_part= keyinfo->key_part; @@ -1899,6 +1916,13 @@ break; } } + + /* + The following is here for MyRocks. See the comment above + about "set share->primary_key as early as possible" + */ + if (primary_key < MAX_KEY && share->keys_in_use.is_set(primary_key)) + share->primary_key= primary_key; } for (i=0 ; i < keyinfo->user_defined_key_parts ; key_part++,i++) @@ -1935,7 +1959,7 @@ key_part->init_flags(); setup_key_part_field(share, handler_file, primary_key, - keyinfo, key, i, &usable_parts); + keyinfo, key, i, &usable_parts, true); field->flags|= PART_KEY_FLAG; if (key == primary_key) @@ -2022,10 +2046,28 @@ if (handler_file->init_with_fields()) goto err; - if (primary_key < MAX_KEY && - (share->keys_in_use.is_set(primary_key))) + if (primary_key < MAX_KEY && (handler_file->ha_table_flags() & + HA_PRIMARY_KEY_IN_READ_INDEX)) + { + keyinfo= &share->key_info[primary_key]; + key_part= keyinfo->key_part; + for (i=0 ; i < keyinfo->user_defined_key_parts ; key_part++,i++) + { + Field *field= key_part->field; + /* + If this field is part of the primary key and all keys contains + the primary key, then we can use any key to find this column + */ + if (field->key_length() == key_part->length && + !(field->flags & BLOB_FLAG)) + field->part_of_key= share->keys_in_use; + if (field->part_of_sortkey.is_set(primary_key)) + field->part_of_sortkey= share->keys_in_use; + } + } + + if (share->primary_key != MAX_KEY) { - share->primary_key= primary_key; /* If we are using an integer as the primary key then allow the user to refer to it as '_rowid' @@ -2041,8 +2083,6 @@ } } } - else - share->primary_key = MAX_KEY; // we do not have a primary key } else share->primary_key= MAX_KEY; @@ -3389,11 +3429,7 @@ and type) @retval FALSE OK - @retval TRUE There was an error. An error message is output - to the error log. We do not push an error - message into the error stack because this - function is currently only called at start up, - and such errors never reach the user. + @retval TRUE There was an error. */ bool @@ -3483,28 +3519,28 @@ if (strncmp(sql_type.c_ptr_safe(), field_def->type.str, field_def->type.length - 1)) { - report_error(0, "Incorrect definition of table %s.%s: " - "expected column '%s' at position %d to have type " - "%s, found type %s.", table->s->db.str, table->alias, - field_def->name.str, i, field_def->type.str, + report_error(ER_CANNOT_LOAD_FROM_TABLE_V2, "Incorrect definition of " + "table %s.%s: expected column '%s' at position %d to " + "have type %s, found type %s.", table->s->db.str, + table->alias, field_def->name.str, i, field_def->type.str, sql_type.c_ptr_safe()); error= TRUE; } else if (field_def->cset.str && !field->has_charset()) { - report_error(0, "Incorrect definition of table %s.%s: " - "expected the type of column '%s' at position %d " - "to have character set '%s' but the type has no " - "character set.", table->s->db.str, table->alias, + report_error(ER_CANNOT_LOAD_FROM_TABLE_V2, "Incorrect definition of " + "table %s.%s: expected the type of column '%s' at " + "position %d to have character set '%s' but the type " + "has no character set.", table->s->db.str, table->alias, field_def->name.str, i, field_def->cset.str); error= TRUE; } else if (field_def->cset.str && strcmp(field->charset()->csname, field_def->cset.str)) { - report_error(0, "Incorrect definition of table %s.%s: " - "expected the type of column '%s' at position %d " - "to have character set '%s' but found " + report_error(ER_CANNOT_LOAD_FROM_TABLE_V2, "Incorrect definition of " + "table %s.%s: expected the type of column '%s' at " + "position %d to have character set '%s' but found " "character set '%s'.", table->s->db.str, table->alias, field_def->name.str, i, field_def->cset.str, field->charset()->csname); @@ -3513,11 +3549,11 @@ } else { - report_error(0, "Incorrect definition of table %s.%s: " - "expected column '%s' at position %d to have type %s " - " but the column is not found.", - table->s->db.str, table->alias, - field_def->name.str, i, field_def->type.str); + report_error(ER_CANNOT_LOAD_FROM_TABLE_V2, "Incorrect definition of " + "table %s.%s: expected column '%s' at position %d to " + "have type %s but the column is not found.", + table->s->db.str, table->alias, field_def->name.str, i, + field_def->type.str); error= TRUE; } } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/table.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/table.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/table.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/table.h 2017-10-19 04:25:29.000000000 +0000 @@ -1325,6 +1325,19 @@ values from the supplied list of Create_field objects. */ void update_compressed_columns_info(const List& fields); +private: + bool should_binlog_drop_if_temp_flag; + +public: + void set_binlog_drop_if_temp(bool should_binlog) + { + should_binlog_drop_if_temp_flag= should_binlog; + } + + bool should_binlog_drop_if_temp(void) const + { + return should_binlog_drop_if_temp_flag; + } }; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/threadpool_common.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/threadpool_common.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/threadpool_common.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/threadpool_common.cc 2017-10-19 04:25:29.000000000 +0000 @@ -111,6 +111,7 @@ extern PSI_statement_info stmt_info_new_packet; #endif +#ifdef HAVE_PSI_INTERFACE static void threadpool_net_before_header_psi_noop(struct st_net * /* net */, void * /* user_data */, size_t /* count */) @@ -158,6 +159,7 @@ thd->m_server_idle = false; } } +#endif static void threadpool_init_net_server_extension(THD *thd) { @@ -214,6 +216,7 @@ if (!setup_connection_thread_globals(thd)) { + lex_start(thd); bool rc= login_connection(thd); MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd); if (!rc) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/threadpool_unix.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/threadpool_unix.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/threadpool_unix.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/threadpool_unix.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1466,7 +1466,7 @@ c->abs_wait_timeout= pool_timer.current_microtime + 1000LL*pool_timer.tick_interval + - 1000000LL*c->thd->variables.net_wait_timeout; + 1000000LL*c->thd->get_wait_timeout(); set_next_timeout_check(c->abs_wait_timeout); DBUG_VOID_RETURN; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/threadpool_win.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/threadpool_win.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/threadpool_win.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/threadpool_win.cc 2017-10-19 04:25:29.000000000 +0000 @@ -411,7 +411,7 @@ void set_wait_timeout(connection_t *connection, ulonglong old_timeout) { ulonglong new_timeout = now() + - 10000000LL*connection->thd->variables.net_wait_timeout; + 10000000LL*connection->thd->get_wait_timeout(); if (new_timeout < old_timeout) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/transaction.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/transaction.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/transaction.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/transaction.cc 2017-10-19 04:25:29.000000000 +0000 @@ -704,7 +704,7 @@ #ifdef WITH_WSREP bool mdl_can_safely_rollback_to_savepoint= (!((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) - && thd->variables.sql_log_bin) || + && thd->variables.sql_log_bin) || ha_rollback_to_savepoint_can_release_mdl(thd)); wsrep_register_hton(thd, TRUE); #else diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_applier.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_applier.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_applier.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_applier.cc 2017-10-19 04:25:29.000000000 +0000 @@ -206,6 +206,8 @@ { THD* const thd((THD*)ctx); + assert(thd->wsrep_apply_toi == false); + // Allow tests to block the applier thread using the DBUG facilities DBUG_EXECUTE_IF("sync.wsrep_apply_cb", { @@ -373,7 +375,7 @@ mysql_mutex_unlock(&LOCK_wsrep_slave_threads); } - if (*exit == false && thd->wsrep_applier) + if (thd->wsrep_applier) { /* From trans_begin() */ thd->variables.option_bits|= OPTION_BEGIN; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_hton.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_hton.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_hton.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_hton.cc 2017-10-19 04:25:29.000000000 +0000 @@ -45,8 +45,8 @@ 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_certify_empty_trx= false; thd->wsrep_affected_rows= 0; + thd->wsrep_skip_wsrep_GTID= false; return; } @@ -316,7 +316,7 @@ int replay_round= 0; if (thd->get_stmt_da()->is_error()) { - WSREP_ERROR("commit issue, error: %d %s", + WSREP_DEBUG("commit issue, error: %d %s", thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message()); } @@ -519,7 +519,10 @@ set to NO_CONFLICT and commit proceeds as usual. */ if (thd->wsrep_conflict_state == MUST_ABORT) - thd->wsrep_conflict_state= NO_CONFLICT; + { + thd->killed= THD::NOT_KILLED; + thd->wsrep_conflict_state= NO_CONFLICT; + } if (thd->wsrep_conflict_state != NO_CONFLICT) { @@ -584,6 +587,38 @@ DBUG_RETURN(WSREP_TRX_OK); } +bool wsrep_replicate_GTID(THD *thd) +{ + if (thd->slave_thread) + { + WSREP_DEBUG("GTID replication"); + DBUG_ASSERT (WSREP_UNDEFINED_TRX_ID == thd->wsrep_ws_handle.trx_id); + (void)wsrep_ws_handle_for_trx(&thd->wsrep_ws_handle, thd->query_id); + DBUG_ASSERT (WSREP_UNDEFINED_TRX_ID != thd->wsrep_ws_handle.trx_id); + WSREP_DEBUG("slave trx using query ID %llu for replication GTID", + (ulonglong) thd->wsrep_ws_handle.trx_id); + enum wsrep_trx_status rcode= wsrep_run_wsrep_commit(thd, wsrep_hton, true); + if (rcode) + { + /* + TODO: should error here cause stopping of MySQL slave? + Slave applying was totally filtered out, and fauílure in replicating + GTID event, would cause a hole in GTID history in other cluster nodes + + */ + WSREP_INFO("GTID replication failed: %d", rcode); + wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle); + thd->wsrep_replicate_GTID= false; + my_message(ER_ERROR_DURING_COMMIT, + "WSREP GTID replication was interrupted", MYF(0)); + return true; + } + wsrep_post_commit(thd, true); + } + thd->wsrep_replicate_GTID= false; + + return false; +} static int wsrep_hton_init(void *p) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_mysqld.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_mysqld.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_mysqld.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_mysqld.cc 2017-10-19 04:25:29.000000000 +0000 @@ -2,7 +2,7 @@ This 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. + the Free Software Foundation; version 2 of the License.x1 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,6 +17,7 @@ #include #include #include "debug_sync.h" +#include /* find_temporary_table() */ #include "wsrep_priv.h" #include "wsrep_thd.h" #include "wsrep_sst.h" @@ -204,7 +205,8 @@ wsrep_cluster_size, wsrep_local_index, view->proto_ver); /* Proceed further only if view is PRIMARY */ - if (WSREP_VIEW_PRIMARY != view->status) { + if (WSREP_VIEW_PRIMARY != view->status) + { #ifdef HAVE_QUERY_CACHE // query cache must be initialised by now query_cache.flush(); @@ -221,6 +223,8 @@ goto out; } + wsrep_ready_set(TRUE); + switch (view->proto_ver) { case 0: @@ -345,7 +349,7 @@ void wsrep_ready_set (my_bool x) { - WSREP_DEBUG("Setting wsrep_ready to %d", x); + WSREP_INFO("Setting wsrep_ready to %s", (x ? "true" : "false")); if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort(); if (wsrep_ready != x) { @@ -375,6 +379,7 @@ if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort(); if (!wsrep_ready) { + WSREP_INFO("This node is synced, setting wsrep_ready to true"); wsrep_ready= TRUE; mysql_cond_signal (&COND_wsrep_ready); signal_main= true; @@ -561,27 +566,17 @@ size_t const node_addr_len= strlen(node_addr); if (node_addr_len > 0) { - const char* const colon= strrchr(node_addr, ':'); - if (strchr(node_addr, ':') == colon) // 1 or 0 ':' + size_t const ip_len= wsrep_host_len(node_addr, node_addr_len); + if (ip_len + 7 /* :55555\0 */ < inc_addr_max) { - size_t const ip_len= colon ? colon - node_addr : node_addr_len; - if (ip_len + 7 /* :55555\0 */ < inc_addr_max) - { - memcpy (inc_addr, node_addr, ip_len); - snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u", - (int)mysqld_port); - } - else - { - WSREP_WARN("Guessing address for incoming client connections: " - "address too long."); - inc_addr[0]= '\0'; - } + memcpy (inc_addr, node_addr, ip_len); + snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u", + (int)mysqld_port); } else { WSREP_WARN("Guessing address for incoming client connections: " - "too many colons :) ."); + "address too long."); inc_addr[0]= '\0'; } } @@ -874,17 +869,7 @@ return false; } -/* - * Helpers to deal with TOI key arrays - */ -typedef struct wsrep_key_arr -{ - wsrep_key_t* keys; - size_t keys_len; -} wsrep_key_arr_t; - - -static void wsrep_keys_free(wsrep_key_arr_t* key_arr) +void wsrep_keys_free(wsrep_key_arr_t* key_arr) { for (size_t i= 0; i < key_arr->keys_len; ++i) { @@ -949,90 +934,72 @@ } /* Prepare key list from db/table and table_list */ -static bool wsrep_prepare_keys_for_isolation(THD* thd, - const char* db, - const char* table, - const TABLE_LIST* table_list, - wsrep_key_arr_t* ka) -{ - ka->keys= 0; - ka->keys_len= 0; - - extern TABLE* find_temporary_table(THD*, const TABLE_LIST*); - - if (db || table) - { - TABLE_LIST tmp_table; - MDL_request mdl_request; - - memset(&tmp_table, 0, sizeof(tmp_table)); - tmp_table.table_name= (char*)table; - tmp_table.db= (char*)db; - tmp_table.mdl_request.init(MDL_key::GLOBAL, (db) ? db : "", - (table) ? table : "", - MDL_INTENTION_EXCLUSIVE, MDL_STATEMENT); +bool wsrep_prepare_keys_for_isolation(THD* thd, + const char* db, + const char* table, + const TABLE_LIST* table_list, + wsrep_key_arr_t* ka) +{ + ka->keys= 0; + ka->keys_len= 0; - if (!table || !find_temporary_table(thd, &tmp_table)) - { - if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0)))) - { - WSREP_ERROR("Can't allocate memory for key_array"); - goto err; - } - ka->keys_len= 1; - if (!(ka->keys[0].key_parts= (wsrep_buf_t*) - my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) - { - WSREP_ERROR("Can't allocate memory for key_parts"); - goto err; - } - ka->keys[0].key_parts_num= 2; - if (!wsrep_prepare_key_for_isolation( - db, table, - (wsrep_buf_t*)ka->keys[0].key_parts, - &ka->keys[0].key_parts_num)) - { - WSREP_ERROR("Preparing keys for isolation failed"); - goto err; - } - } + if (db || table) + { + if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0)))) + { + WSREP_ERROR("Can't allocate memory for key_array"); + goto err; + } + ka->keys_len= 1; + if (!(ka->keys[0].key_parts= (wsrep_buf_t*) + my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) + { + WSREP_ERROR("Can't allocate memory for key_parts"); + goto err; } + ka->keys[0].key_parts_num= 2; + if (!wsrep_prepare_key_for_isolation( + db, table, + (wsrep_buf_t*)ka->keys[0].key_parts, + &ka->keys[0].key_parts_num)) + { + WSREP_ERROR("Preparing keys for isolation failed (1)"); + goto err; + } + } - for (const TABLE_LIST* table= table_list; table; table= table->next_global) + for (const TABLE_LIST* table= table_list; table; table= table->next_global) + { + wsrep_key_t* tmp; + tmp= (wsrep_key_t*)my_realloc(ka->keys, + (ka->keys_len + 1) * sizeof(wsrep_key_t), + MYF(0)); + if (!tmp) { - if (!find_temporary_table(thd, table)) - { - wsrep_key_t* tmp; - tmp= (wsrep_key_t*)my_realloc( - ka->keys, (ka->keys_len + 1) * sizeof(wsrep_key_t), MYF(0)); - if (!tmp) - { - WSREP_ERROR("Can't allocate memory for key_array"); - goto err; - } - ka->keys= tmp; - if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*) - my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) - { - WSREP_ERROR("Can't allocate memory for key_parts"); - goto err; - } - ka->keys[ka->keys_len].key_parts_num= 2; - ++ka->keys_len; - if (!wsrep_prepare_key_for_isolation( - table->db, table->table_name, - (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts, - &ka->keys[ka->keys_len - 1].key_parts_num)) - { - WSREP_ERROR("Preparing keys for isolation failed"); - goto err; - } - } + WSREP_ERROR("Can't allocate memory for key_array"); + goto err; } - return true; + ka->keys= tmp; + if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*) + my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) + { + WSREP_ERROR("Can't allocate memory for key_parts"); + goto err; + } + ka->keys[ka->keys_len].key_parts_num= 2; + ++ka->keys_len; + if (!wsrep_prepare_key_for_isolation(table->db, table->table_name, + (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts, + &ka->keys[ka->keys_len - 1].key_parts_num)) + { + WSREP_ERROR("Preparing keys for isolation failed (2)"); + goto err; + } + } + return 0; err: wsrep_keys_free(ka); - return false; + return 1; } @@ -1196,6 +1163,153 @@ } /* + Rewrite DROP TABLE for TOI. Temporary tables are eliminated from + the query as they are visible only to client connection. + + TODO: See comments for sql_base.cc:drop_temporary_table() and refine + the function to deal with transactional locked tables. + */ +static int wsrep_drop_table_query(THD* thd, uchar** buf, size_t* buf_len) +{ + + LEX* lex= thd->lex; + SELECT_LEX* select_lex= &lex->select_lex; + TABLE_LIST* first_table= select_lex->table_list.first; + String buff; + + DBUG_ASSERT(!lex->drop_temporary); + + bool found_temp_table= false; + for (TABLE_LIST* table= first_table; table; table= table->next_global) + { + if (find_temporary_table(thd, table->db, table->table_name)) + { + found_temp_table= true; + break; + } + } + + if (found_temp_table) + { + buff.append("DROP TABLE "); + if (lex->drop_if_exists) + buff.append("IF EXISTS "); + + for (TABLE_LIST* table= first_table; table; table= table->next_global) + { + if (!find_temporary_table(thd, table->db, table->table_name)) + { + append_identifier(thd, &buff, table->db, strlen(table->db), + system_charset_info, thd->charset()); + buff.append("."); + append_identifier(thd, &buff, table->table_name, + strlen(table->table_name), + system_charset_info, thd->charset()); + buff.append(","); + } + } + + /* Chop the last comma */ + buff.chop(); + buff.append(" /* generated by wsrep */"); + + WSREP_DEBUG("Rewrote '%s' as '%s'", thd->query(), buff.ptr()); + + return wsrep_to_buf_helper(thd, buff.ptr(), buff.length(), buf, buf_len); + } + else + { + return wsrep_to_buf_helper(thd, thd->query(), thd->query_length(), + buf, buf_len); + } +} + +/* + Decide if statement should run in TOI. + + Look if table or table_list contain temporary tables. If the + statement affects only temporary tables, statement should not run + in TOI. If the table list contains mix of regular and temporary tables + (DROP TABLE, OPTIMIZE, ANALYZE), statement should be run in TOI but + should be rewritten at later time for replication to contain only + non-temporary tables. + */ +static bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table, + const TABLE_LIST *table_list) +{ + DBUG_ASSERT(!table || db); + DBUG_ASSERT(table_list || db); + + /* Only if binlog is enabled and user try to set sql_log_bin=0. */ + if (mysql_bin_log.is_open() && !(thd->variables.option_bits & OPTION_BIN_LOG)) + return false; + + LEX* lex= thd->lex; + SELECT_LEX* select_lex= &lex->select_lex; + TABLE_LIST* first_table= select_lex->table_list.first; + + switch (lex->sql_command) + { + case SQLCOM_CREATE_TABLE: + DBUG_ASSERT(!table_list); + if (thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) + { + return false; + } + return true; + + case SQLCOM_CREATE_VIEW: + + DBUG_ASSERT(!table_list); + DBUG_ASSERT(first_table); /* First table is view name */ + /* + If any of the remaining tables refer to temporary table error + is returned to client, so TOI can be skipped + */ + for (TABLE_LIST* it= first_table->next_global; it; it= it->next_global) + { + if (find_temporary_table(thd, it)) + { + return false; + } + } + return true; + + case SQLCOM_CREATE_TRIGGER: + +#if 0 + /* Trigger statement is invoked with table_list with length = 1 */ + DBUG_ASSERT(!table_list); +#endif + DBUG_ASSERT(first_table); + + if (find_temporary_table(thd, first_table)) + { + return false; + } + return true; + + default: + if (table && !find_temporary_table(thd, db, table)) + { + return true; + } + + if (table_list && first_table) + { + for (TABLE_LIST* table= first_table; table; table= table->next_global) + { + if (!find_temporary_table(thd, table->db, table->table_name)) + { + return true; + } + } + } + return !(table || (table_list && first_table)); + } +} + +/* returns: 0: statement was replicated as TOI 1: TOI replication was skipped @@ -1209,6 +1323,12 @@ size_t buf_len(0); int buf_err; + if (wsrep_can_run_in_toi(thd, db_, table_, table_list) == false) + { + WSREP_DEBUG("No TOI for %s", WSREP_QUERY(thd)); + return 1; + } + WSREP_DEBUG("TO BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd), thd->wsrep_exec_mode, WSREP_QUERY(thd)); switch (thd->lex->sql_command) @@ -1229,9 +1349,12 @@ case SQLCOM_ALTER_EVENT: buf_err= wsrep_alter_event_query(thd, &buf, &buf_len); break; + case SQLCOM_DROP_TABLE: + buf_err= wsrep_drop_table_query(thd, &buf, &buf_len); + break; default: - buf_err= wsrep_to_buf_helper(thd, thd->query(), thd->query_length(), &buf, - &buf_len); + buf_err= wsrep_to_buf_helper(thd, thd->query(), thd->query_length(), + &buf, &buf_len); break; } @@ -1250,9 +1373,9 @@ struct wsrep_buf buff = { buf, buf_len }; if (WSREP(thd)) thd_proc_info(thd, "Preparing for TO isolation"); - if (!buf_err && - wsrep_prepare_keys_for_isolation(thd, db_, table_, table_list, &key_arr)&& - key_arr.keys_len > 0 && + if (!buf_err && + !wsrep_prepare_keys_for_isolation(thd, db_, table_, table_list, &key_arr) && + key_arr.keys_len > 0 && WSREP_OK == (ret = wsrep->to_execute_start(wsrep, thd->thread_id, key_arr.keys, key_arr.keys_len, &buff, 1, @@ -1263,7 +1386,7 @@ if (buf) my_free(buf); wsrep_keys_free(&key_arr); WSREP_DEBUG("TO BEGIN: %lld, %d",(long long)wsrep_thd_trx_seqno(thd), - thd->wsrep_exec_mode); + thd->wsrep_exec_mode); } else if (key_arr.keys_len > 0) { /* jump to error handler in mysql_execute_command() */ @@ -1271,7 +1394,7 @@ "connection state and retry the query.", ret, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd)); my_error(ER_LOCK_DEADLOCK, MYF(0), "WSREP replication failed. Check " - "your wsrep connection state and retry the query."); + "your wsrep connection state and retry the query."); if (buf) my_free(buf); wsrep_keys_free(&key_arr); return -1; @@ -1279,8 +1402,10 @@ else { /* non replicated DDL, affecting temporary tables only */ WSREP_DEBUG("TO isolation skipped for: %d, sql: %s." - "Only temporary tables affected.", - ret, WSREP_QUERY(thd)); + "Only temporary tables affected.", + ret, WSREP_QUERY(thd)); + if (buf) my_free(buf); + wsrep_keys_free(&key_arr); return 1; } return 0; @@ -1471,9 +1596,12 @@ if (thd->variables.wsrep_on && thd->wsrep_exec_mode==LOCAL_STATE) { switch (thd->variables.wsrep_OSU_method) { - case WSREP_OSU_TOI: ret = wsrep_TOI_begin(thd, db_, table_, - table_list); break; - case WSREP_OSU_RSU: ret = wsrep_RSU_begin(thd, db_, table_); break; + case WSREP_OSU_TOI: + ret = wsrep_TOI_begin(thd, db_, table_, table_list); + break; + case WSREP_OSU_RSU: + ret = wsrep_RSU_begin(thd, db_, table_); + break; default: WSREP_ERROR("Unsupported OSU method: %lu", thd->variables.wsrep_OSU_method); @@ -1568,7 +1696,7 @@ } else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE) { - WSREP_DEBUG("DROP caused BF abort"); + WSREP_DEBUG("DROP caused BF abort, conf %d", granted_thd->wsrep_conflict_state); ticket->wsrep_report(wsrep_debug); mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_mysqld.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_mysqld.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_mysqld.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_mysqld.h 2017-10-19 04:25:29.000000000 +0000 @@ -114,11 +114,12 @@ enum enum_wsrep_sync_wait { WSREP_SYNC_WAIT_NONE = 0x0, - // show, select, begin + // select, begin WSREP_SYNC_WAIT_BEFORE_READ = 0x1, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE = 0x2, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE = 0x4, - WSREP_SYNC_WAIT_MAX = 0x7 + WSREP_SYNC_WAIT_BEFORE_SHOW = 0x8, + WSREP_SYNC_WAIT_MAX = 0xF }; // MySQL status variables @@ -206,11 +207,19 @@ wsrep_provider && \ strcmp(wsrep_provider, WSREP_NONE)) +/* use xxxxxx_NNULL macros when thd pointer is guaranteed to be non-null to + * avoid compiler warnings (GCC 6 and later) */ +#define WSREP_NNULL(thd) \ + (WSREP_ON && wsrep && thd->variables.wsrep_on) + #define WSREP(thd) \ - (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on)) + (thd && WSREP_NNULL(thd)) #define WSREP_CLIENT(thd) \ - (WSREP(thd) && thd->wsrep_client_thread) + (WSREP(thd) && thd->wsrep_client_thread) + +#define WSREP_EMULATE_BINLOG_NNULL(thd) \ + (WSREP_NNULL(thd) && wsrep_emulate_bin_log) #define WSREP_EMULATE_BINLOG(thd) \ (WSREP(thd) && wsrep_emulate_bin_log) @@ -334,4 +343,17 @@ void wsrep_init_sidno(const wsrep_uuid_t&); bool wsrep_node_is_donor(); bool wsrep_node_is_synced(); +bool wsrep_replicate_GTID(THD* thd); + +typedef struct wsrep_key_arr +{ + wsrep_key_t* keys; + size_t keys_len; +} wsrep_key_arr_t; +bool wsrep_prepare_keys_for_isolation(THD* thd, + const char* db, + const char* table, + const TABLE_LIST* table_list, + wsrep_key_arr_t* ka); +void wsrep_keys_free(wsrep_key_arr_t* key_arr); #endif /* WSREP_MYSQLD_H */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_sst.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_sst.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_sst.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_sst.cc 2017-10-19 04:25:29.000000000 +0000 @@ -407,8 +407,7 @@ if (opt_bin_log && gtid_mode > 0) { assert(opt_bin_logname); - *ret= strcmp(opt_bin_logname, "0") ? - my_strdup(opt_bin_logname, MYF(0)) : my_strdup("", MYF(0)); + *ret= my_strdup(opt_bin_logname, MYF(0)); } else { @@ -766,18 +765,19 @@ // Figure out SST address. Common for all SST methods if (wsrep_sst_receive_address && - strcmp (wsrep_sst_receive_address, WSREP_SST_ADDRESS_AUTO)) + strcmp (wsrep_sst_receive_address, WSREP_SST_ADDRESS_AUTO)) { addr_in= wsrep_sst_receive_address; } else if (wsrep_node_address && strlen(wsrep_node_address)) { - const char* const colon= strchr (wsrep_node_address, ':'); - if (colon) + size_t const addr_len= strlen(wsrep_node_address); + size_t const host_len= wsrep_host_len(wsrep_node_address, addr_len); + + if (host_len < addr_len) { - ptrdiff_t const len= colon - wsrep_node_address; - strncpy (ip_buf, wsrep_node_address, len); - ip_buf[len]= '\0'; + strncpy (ip_buf, wsrep_node_address, host_len); + ip_buf[host_len]= '\0'; addr_in= ip_buf; } else @@ -929,25 +929,6 @@ bool bypass, char** env) // carries auth info { - size_t host_len; - const char* port = strchr (addr, ':'); - - if (port) - { - port += 1; - host_len = port - addr; - } - else - { - port = ""; - host_len = strlen (addr) + 1; - } - - char *host= static_cast(alloca(host_len)); - - strncpy (host, addr, host_len - 1); - host[host_len - 1] = '\0'; - int const cmd_len= 4096; wsp::string cmd_str(cmd_len); @@ -962,14 +943,13 @@ int ret= snprintf (cmd_str(), cmd_len, "wsrep_sst_mysqldump " - WSREP_SST_OPT_HOST" '%s' " - WSREP_SST_OPT_PORT" '%s' " + WSREP_SST_OPT_ADDR" '%s' " WSREP_SST_OPT_LPORT" '%u' " WSREP_SST_OPT_SOCKET" '%s' " WSREP_SST_OPT_CONF" '%s' " WSREP_SST_OPT_GTID" '%s:%lld'" "%s", - host, port, mysqld_port, mysqld_unix_port, + addr, mysqld_port, mysqld_unix_port, wsrep_defaults_file, uuid_str, (long long)seqno, bypass ? " " WSREP_SST_OPT_BYPASS : ""); @@ -987,7 +967,6 @@ wsrep->sst_sent (wsrep, &state_id, ret); - return ret; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_thd.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_thd.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_thd.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_thd.cc 2017-10-19 04:25:29.000000000 +0000 @@ -36,8 +36,8 @@ /* must have (&thd->LOCK_wsrep_thd) */ void wsrep_client_rollback(THD *thd) { - WSREP_DEBUG("client rollback due to BF abort for (%ld), query: %s", - thd->thread_id, WSREP_QUERY(thd)); + WSREP_DEBUG("client rollback due to BF abort for (%ld %lld), query: %s", + thd->thread_id, thd->query_id, WSREP_QUERY(thd)); my_atomic_add64(&wsrep_bf_aborts_counter, 1); @@ -47,7 +47,11 @@ /* Check for comments in Relay_log_info::cleanup_context */ trans_rollback_stmt(thd); - trans_rollback(thd); + if (trans_rollback(thd)) + { + WSREP_WARN("client rollback failed for: %lu %lld, conf: %d", + thd->thread_id, thd->query_id, thd->wsrep_conflict_state); + } if (thd->locked_tables_mode && thd->lock) { @@ -93,61 +97,6 @@ new Format_description_log_event(BINLOG_VERSION)); return (rli); - -#ifdef REMOVED - Rpl_info_handler* handler_src= NULL; - Rpl_info_handler* handler_dest= NULL; - ulong *key_info_idx= NULL; - const char *msg= "Failed to allocate memory for the relay log info " - "structure"; - - DBUG_ENTER("Rpl_info_factory::create_rli"); - - if (!(rli= new Relay_log_info(false -#ifdef HAVE_PSI_INTERFACE - ,&key_relay_log_info_run_lock, - &key_relay_log_info_data_lock, - &key_relay_log_info_sleep_lock, - &key_relay_log_info_data_cond, - &key_relay_log_info_start_cond, - &key_relay_log_info_stop_cond, - &key_relay_log_info_sleep_cond -#endif /* HAVE_PSI_INTERFACE */ - ))) - goto err; - - if (!(key_info_idx= new ulong[NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR])) - goto err; - key_info_idx[0]= server_id; - rli->set_idx_info(key_info_idx, NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR); - - if(Rpl_info_factory::init_rli_repositories(rli, rli_option, &handler_src, - &handler_dest, &msg)) - goto err; - - if (Rpl_info_factory::decide_repository(rli, rli_option, &handler_src, - &handler_dest, &msg)) - goto err; - - DBUG_RETURN(rli); -err: - delete handler_src; - delete handler_dest; - delete []key_info_idx; - if (rli) - { - /* - The handler was previously deleted so we need to remove - any reference to it. - */ - rli->set_idx_info(NULL, 0); - rli->set_rpl_info_handler(NULL); - rli->set_rpl_info_type(INVALID_INFO_REPOSITORY); - delete rli; - } - WSREP_ERROR("Error creating relay log info: %s.", msg); - DBUG_RETURN(NULL); -#endif /* REMOVED */ } static void wsrep_prepare_bf_thd(THD *thd, struct wsrep_thd_shadow* shadow) @@ -181,6 +130,7 @@ thd->reset_db(NULL, 0); shadow->user_time = thd->user_time; + shadow->row_count_func= thd->get_row_count_func(); } static void wsrep_return_from_bf_mode(THD *thd, struct wsrep_thd_shadow* shadow) @@ -192,6 +142,7 @@ thd->variables.tx_isolation = shadow->tx_isolation; thd->reset_db(shadow->db, shadow->db_length); thd->user_time = shadow->user_time; + thd->set_row_count_func(shadow->row_count_func); } void wsrep_replay_transaction(THD *thd) @@ -214,6 +165,25 @@ WSREP_WARN("dangling observer in replay transaction: (thr %lu %lld %s)", thd->thread_id, thd->query_id, thd->query()); } + + struct da_shadow + { + enum Diagnostics_area::enum_diagnostics_status status; + ulonglong affected_rows; + ulonglong last_insert_id; + char message[MYSQL_ERRMSG_SIZE]; + }; + struct da_shadow da_status; + da_status.status= thd->get_stmt_da()->status(); + if (da_status.status == Diagnostics_area::DA_OK) + { + da_status.affected_rows= thd->get_stmt_da()->affected_rows(); + da_status.last_insert_id= thd->get_stmt_da()->last_insert_id(); + strmake(da_status.message, + thd->get_stmt_da()->message(), + sizeof(da_status.message)-1); + } + thd->get_stmt_da()->reset_diagnostics_area(); thd->wsrep_conflict_state= REPLAYING; @@ -280,7 +250,17 @@ } else { - my_ok(thd); + if (da_status.status == Diagnostics_area::DA_OK) + { + my_ok(thd, + da_status.affected_rows, + da_status.last_insert_id, + da_status.message); + } + else + { + my_ok(thd); + } } break; case WSREP_TRX_FAIL: @@ -470,6 +450,11 @@ aborting->store_globals(); mysql_mutex_lock(&aborting->LOCK_wsrep_thd); + + /* prepare THD for rollback processing */ + mysql_reset_thd_for_next_command(aborting); + aborting->lex->sql_command= SQLCOM_ROLLBACK; + wsrep_client_rollback(aborting); WSREP_DEBUG("WSREP rollbacker aborted thd: (%lu %llu)", aborting->thread_id, (long long)aborting->real_id); @@ -528,9 +513,9 @@ { THD* thd = (THD*)thd_ptr; if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd); - + status = ((thd->wsrep_exec_mode == REPL_RECV) || - (thd->wsrep_exec_mode == TOTAL_ORDER)); + (thd->wsrep_exec_mode == TOTAL_ORDER)); if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); } return status; @@ -544,10 +529,10 @@ { THD* thd = (THD*)thd_ptr; if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd); - + status = ((thd->wsrep_exec_mode == REPL_RECV) || - (thd->wsrep_exec_mode == TOTAL_ORDER) || - (thd->wsrep_exec_mode == LOCAL_COMMIT)); + (thd->wsrep_exec_mode == TOTAL_ORDER) || + (thd->wsrep_exec_mode == LOCAL_COMMIT)); if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); } return status; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_utils.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_utils.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_utils.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_utils.cc 2017-10-19 04:25:29.000000000 +0000 @@ -933,3 +933,18 @@ return 0; } + +/* returns the length of the host part of the address string */ +size_t wsrep_host_len(const char* const addr, size_t const addr_len) +{ + // check for IPv6 notation first + const char* const bracket= ('[' == addr[0] ? strchr(addr, ']') : NULL); + + if (bracket) { // IPv6 + return (bracket - addr + 1); + } + else { // host part ends at ':' or end of string + const char* const colon= strchr(addr, ':'); + return (colon ? colon - addr : addr_len); + } +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_utils.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_utils.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_utils.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_utils.h 2017-10-19 04:25:29.000000000 +0000 @@ -21,6 +21,9 @@ unsigned int wsrep_check_ip (const char* addr); size_t wsrep_guess_ip (char* buf, size_t buf_len); +/* returns the length of the host part of the address string */ +size_t wsrep_host_len(const char* addr, size_t addr_len); + namespace wsp { class node_status { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_var.cc percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_var.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/wsrep_var.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/wsrep_var.cc 2017-10-19 04:25:29.000000000 +0000 @@ -37,6 +37,8 @@ const char* wsrep_start_position = 0; ulong wsrep_reject_queries; +static long wsrep_prev_slave_threads = wsrep_slave_threads; + int wsrep_init_vars() { wsrep_provider = my_strdup(WSREP_NONE, MYF(MY_WME)); @@ -598,18 +600,15 @@ wsrep_node_address = (value) ? my_strdup(value, MYF(0)) : NULL; } -bool wsrep_slave_threads_check (sys_var *self, THD* thd, set_var* var) +static void wsrep_slave_count_change_update () { - mysql_mutex_lock(&LOCK_wsrep_slave_threads); - wsrep_slave_count_change += (var->save_result.ulonglong_value - - wsrep_slave_threads); - mysql_mutex_unlock(&LOCK_wsrep_slave_threads); - - return false; + wsrep_slave_count_change += (wsrep_slave_threads - wsrep_prev_slave_threads); + wsrep_prev_slave_threads = wsrep_slave_threads; } bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type) { + wsrep_slave_count_change_update(); if (wsrep_slave_count_change > 0) { WSREP_DEBUG("Creating %d applier threads, total %ld", wsrep_slave_count_change, wsrep_slave_threads); @@ -634,6 +633,22 @@ } return false; } + + /* Setting desync to on/off signals participation of node in flow control. + It doesn't turn-off recieval of write-sets. + If the node is already in paused state due to some previous action like FTWRL + then avoid desync as superset action of pausing the node is already active. */ + + if (!thd->global_read_lock.provider_resumed()) + { + char message[1024]; + sprintf(message, + "Explictly desync/resync of already desynced/paused node" + " is prohibited"); + my_message(ER_UNKNOWN_ERROR, message, MYF(0)); + return true; + } + wsrep_status_t ret(WSREP_WARNING); if (new_wsrep_desync) { ret = wsrep->desync (wsrep); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql/xa.h percona-xtradb-cluster-5.6-5.6.37-26.21/sql/xa.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql/xa.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql/xa.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,108 @@ +/* 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, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef XA_H_INCLUDED +#define XA_H_INCLUDED + +#include +#include + +#include "mysqld.h" +#include "m_string.h" +#include "my_dbug.h" +#include "my_global.h" +#include "sql_cmd.h" // Sql_cmd + +typedef ulonglong my_xid; // this line is the same as in log_event.h +#define XIDDATASIZE 128 +#define MYSQL_XID_PREFIX "MySQLXid" +#define MYSQL_XID_PREFIX_LEN 8 +#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id)) +#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid)) + +/** + struct xid_t is binary compatible with the XID structure as + in the X/Open CAE Specification, Distributed Transaction Processing: + The XA Specification, X/Open Company Ltd., 1991. + http://www.opengroup.org/bookstore/catalog/c193.htm + + @see MYSQL_XID in mysql/plugin.h +*/ +struct xid_t { + long formatID; + long gtrid_length; + long bqual_length; + char data[XIDDATASIZE]; // not \0-terminated ! + + xid_t() {} /* Remove gcc warning */ + bool eq(struct xid_t *xid) + { return eq(xid->gtrid_length, xid->bqual_length, xid->data); } + bool eq(long g, long b, const char *d) + { return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); } + void set(struct xid_t *xid) + { memcpy(this, xid, xid->length()); } + void set(long f, const char *g, long gl, const char *b, long bl) + { + formatID= f; + memcpy(data, g, gtrid_length= gl); + memcpy(data+gl, b, bqual_length= bl); + } + void set(ulonglong xid) + { + my_xid tmp; + formatID= 1; + set(MYSQL_XID_PREFIX_LEN, 0, MYSQL_XID_PREFIX); + memcpy(data+MYSQL_XID_PREFIX_LEN, &server_id, sizeof(server_id)); + tmp= xid; + memcpy(data+MYSQL_XID_OFFSET, &tmp, sizeof(tmp)); + gtrid_length=MYSQL_XID_GTRID_LEN; + } + void set(long g, long b, const char *d) + { + formatID= 1; + gtrid_length= g; + bqual_length= b; + memcpy(data, d, g+b); + } + bool is_null() { return formatID == -1; } + void null() { formatID= -1; } + my_xid quick_get_my_xid() + { + my_xid tmp; + memcpy(&tmp, data+MYSQL_XID_OFFSET, sizeof(tmp)); + return tmp; + } + my_xid get_my_xid() + { + return gtrid_length == MYSQL_XID_GTRID_LEN && bqual_length == 0 && + !memcmp(data, MYSQL_XID_PREFIX, MYSQL_XID_PREFIX_LEN) ? + quick_get_my_xid() : 0; + } + uint length() + { + return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+ + gtrid_length+bqual_length; + } + uchar *key() + { + return (uchar *)>rid_length; + } + uint key_length() + { + return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length; + } +}; +typedef struct xid_t XID; +#endif diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql-common/client.c percona-xtradb-cluster-5.6-5.6.37-26.21/sql-common/client.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql-common/client.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql-common/client.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1038,6 +1038,7 @@ "multi-results", "multi-statements", "multi-queries", "secure-auth", "report-data-truncation", "plugin-dir", "default-auth", "bind-address", "ssl-crl", "ssl-crlpath", "enable-cleartext-plugin", + "ssl-mode", NullS }; enum option_id { @@ -1050,6 +1051,7 @@ OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth, OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth, OPT_bind_address, OPT_ssl_crl, OPT_ssl_crlpath, OPT_enable_cleartext_plugin, + OPT_ssl_mode, OPT_keep_this_one_last }; @@ -1269,6 +1271,19 @@ case OPT_ssl_crlpath: EXTENSION_SET_SSL_STRING(options, ssl_crlpath, opt_arg); break; + case OPT_ssl_mode: + if (opt_arg && + !my_strcasecmp(&my_charset_latin1, opt_arg, "required")) + { + ENSURE_EXTENSIONS_PRESENT(options); + options->extension->ssl_mode= SSL_MODE_REQUIRED; + } + else + { + fprintf(stderr, "Unknown option to ssl-mode: %s\n", opt_arg); + exit(1); + } + break; #else case OPT_ssl_key: case OPT_ssl_cert: @@ -1277,6 +1292,7 @@ case OPT_ssl_cipher: case OPT_ssl_crl: case OPT_ssl_crlpath: + case OPT_ssl_mode: break; #endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ case OPT_character_sets_dir: @@ -1798,6 +1814,7 @@ { mysql->options.extension->ssl_crl = 0; mysql->options.extension->ssl_crlpath = 0; + mysql->options.extension->ssl_mode= 0; } mysql->options.use_ssl = FALSE; mysql->connector_fd = 0; @@ -1828,6 +1845,198 @@ } +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + +#include + +#if defined(HAVE_X509_CHECK_HOST) && defined(HAVE_X509_CHECK_IP) + #define HAVE_X509_CHECK_FUNCTIONS 1 +#endif + +#if !defined(HAVE_X509_CHECK_FUNCTIONS) && !defined(HAVE_YASSL) + +/* + Compares the DNS entry from the Subject Alternative Names (SAN) list with + the provided host name + + SYNOPSIS + ssl_cmp_san_dns_name() + dns_name pointer to a SAN list DNS entry + host_name name of the server + errptr if we fail, we'll return (a pointer to a string + describing) the reason here + + RETURN VALUES + 0 Success + 1 Failed to validate server + +*/ + +static int ssl_cmp_san_dns_name(ASN1_STRING *dns_name, const char* host_name, + const char **errptr) +{ + const char *cn; + DBUG_ENTER("ssl_cmp_san_dns_name"); + *errptr= NULL; + if (dns_name == NULL) + { + *errptr= "Failed to get DNS name from SAN list item"; + DBUG_RETURN(1); + } +#if OPENSSL_VERSION_NUMBER < 0x10100000L + cn= (const char *)ASN1_STRING_data(dns_name); +#else + cn= (const char *)ASN1_STRING_get0_data(dns_name); +#endif + if (cn == NULL) + { + *errptr= "Failed to get data from SAN DNS name"; + DBUG_RETURN(1); + } + // There should not be any NULL embedded in the DNS name + if ((size_t)ASN1_STRING_length(dns_name) != strlen(cn)) + { + *errptr= "NULL embedded in the certificate SAN DNS name"; + DBUG_RETURN(1); + } + DBUG_PRINT("info", ("SAN DNS name in cert: %s", cn)); + if (!strcmp(cn, host_name)) + DBUG_RETURN(0); + + DBUG_RETURN(1); +} + +/* + Compares the IP address entry from the Subject Alternative Names (SAN) list + with the provided host IP address + + SYNOPSIS + ssl_cmp_san_ip_address() + ip_address pointer to a SAN list IP address entry + host_ip IP address of the server + host_ip_len server IP address length (must be either 4 or 16) + errptr if we fail, we'll return (a pointer to a string + describing) the reason here + + RETURN VALUES + 0 Success + 1 Failed to validate server + +*/ + +static int ssl_cmp_san_ip_address(ASN1_OCTET_STRING *ip_address, + const unsigned char* host_ip, + size_t host_ip_len, + const char **errptr) +{ + const unsigned char* ip; + size_t ip_address_len; + DBUG_ENTER("ssl_cmp_san_ip_address"); + *errptr= NULL; + if (ip_address == NULL) + { + *errptr= "Failed to get IP address from SAN list item"; + DBUG_RETURN(1); + } + ip_address_len= ASN1_STRING_length(ip_address); + /* IP address length must be either 4 (IPV4) or 16 (IPV6) */ + if (ip_address_len != 4 && ip_address_len != 16) + { + *errptr= "Invalid IP address embedded in the certificate SAN IP address"; + DBUG_RETURN(1); + } +#if OPENSSL_VERSION_NUMBER < 0x10100000L + ip= ASN1_STRING_data(ip_address); +#else + ip= ASN1_STRING_get0_data(ip_address); +#endif + if (ip == NULL) + { + *errptr= "Failed to get data from SAN IP address"; + DBUG_RETURN(1); + } + if (ip_address_len == host_ip_len && + memcmp(host_ip, ip, host_ip_len) == 0) + DBUG_RETURN(0); + + DBUG_RETURN(1); +} + +/* + Check the certificate's Subject Alternative Names (SAN) against the + hostname / IP address we connected to + + SYNOPSIS + ssl_verify_server_cert_san() + server_cert pointer to a X509 certificate + hostname_or_ip name of the server / pointer to a V4/V6 IP address + buffer + hostname_or_ip_len 0 for host name, 4/16 for ip address + errptr if we fail, we'll return (a pointer to a string + describing) the reason here + + RETURN VALUES + 0 Success + 1 Failed to validate server + +*/ + +static int ssl_verify_server_cert_san(X509 *server_cert, + const char* hostname_or_ip, + size_t hostname_or_ip_len, + const char **errptr) +{ + int ret_validation= 1; + int i, number_of_sans; + GENERAL_NAMES *sans; + + DBUG_ENTER("ssl_verify_server_cert_san"); + *errptr= NULL; + sans= X509_get_ext_d2i(server_cert, NID_subject_alt_name, NULL, NULL); + if (sans == NULL) + DBUG_RETURN(ret_validation); + + number_of_sans= sk_GENERAL_NAME_num(sans); + for (i= 0; ret_validation != 0 && i < number_of_sans; ++i) + { + GENERAL_NAME *san= sk_GENERAL_NAME_value(sans, i); + if (san == NULL) + { + *errptr= "Failed to get item from SAN list"; + goto error; + } + if (hostname_or_ip_len == 0) + { + /* server host name was provided, check only GEN_DNS entries */ + if (san->type == GEN_DNS) + { + ret_validation= ssl_cmp_san_dns_name(san->d.dNSName, hostname_or_ip, + errptr); + if (*errptr != NULL) + goto error; + } + } + else + { + /* server IP address was provided, check only GEN_IPADD entries */ + if (san->type == GEN_IPADD) + { + ret_validation= ssl_cmp_san_ip_address(san->d.iPAddress, + (const unsigned char *)hostname_or_ip, hostname_or_ip_len, errptr); + if (*errptr != NULL) + goto error; + } + } + } /* iterating over SAN enries */ + +error: + GENERAL_NAMES_free(sans); + + DBUG_RETURN(ret_validation); +} + +#endif /* !defined(HAVE_X509_CHECK_FUNCTIONS) && !defined(HAVE_YASSL) */ + /* Check the server's (subject) Common Name against the hostname we connected to @@ -1843,19 +2052,24 @@ 0 Success 1 Failed to validate server - */ - -#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) +*/ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const char **errptr) { SSL *ssl; X509 *server_cert= NULL; - char *cn= NULL; +#ifndef HAVE_X509_CHECK_FUNCTIONS + const char *cn= NULL; int cn_loc= -1; ASN1_STRING *cn_asn1= NULL; X509_NAME_ENTRY *cn_entry= NULL; X509_NAME *subject= NULL; +#endif +#ifndef HAVE_YASSL + ASN1_OCTET_STRING *server_ip_address= NULL; + const unsigned char *ipout= NULL; + size_t iplen= 0; +#endif int ret_validation= 1; DBUG_ENTER("ssl_verify_server_cert"); @@ -1890,58 +2104,98 @@ are what we expect. */ +#ifndef HAVE_YASSL + /* Checking if the provided server_hostname is a V4/V6 IP address */ + server_ip_address= a2i_IPADDRESS(server_hostname); + if(server_ip_address != NULL) + { + iplen= ASN1_STRING_length(server_ip_address); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + ipout= (const unsigned char *) ASN1_STRING_data(server_ip_address); +#else + ipout= (const unsigned char *) ASN1_STRING_get0_data(server_ip_address); +#endif + } +#endif + +#ifdef HAVE_X509_CHECK_FUNCTIONS + if (iplen == 0) + ret_validation= X509_check_host(server_cert, server_hostname, 0, 0, 0) != 1; + else + ret_validation= X509_check_ip(server_cert, ipout, iplen, 0) != 1; +#else /* - Some notes for future development - We should check host name in alternative name first and then if needed check in common name. - Currently yssl doesn't support alternative name. - openssl 1.0.2 support X509_check_host method for host name validation, we may need to start using - X509_check_host in the future. + YaSSL will always return NULL for any call to 'X509_get_ext_d2i()' + and therefore the whole SAN block will be skipped and only 'CN' + will be checked. */ - - subject= X509_get_subject_name((X509 *) server_cert); - // Find the CN location in the subject - cn_loc= X509_NAME_get_index_by_NID(subject, NID_commonName, -1); - if (cn_loc < 0) - { - *errptr= "Failed to get CN location in the certificate subject"; +#ifndef HAVE_YASSL + ret_validation= ssl_verify_server_cert_san(server_cert, + iplen != 0 ? (const char*)ipout : server_hostname, iplen, errptr); + if (*errptr != NULL) goto error; - } - - // Get the CN entry for given location - cn_entry= X509_NAME_get_entry(subject, cn_loc); - if (cn_entry == NULL) +#endif + if (ret_validation != 0) { - *errptr= "Failed to get CN entry using CN location"; - goto error; - } + subject= X509_get_subject_name(server_cert); + // Find the CN location in the subject + cn_loc= X509_NAME_get_index_by_NID(subject, NID_commonName, -1); + if (cn_loc < 0) + { + *errptr= "Failed to get CN location in the certificate subject"; + goto error; + } - // Get CN from common name entry - cn_asn1 = X509_NAME_ENTRY_get_data(cn_entry); - if (cn_asn1 == NULL) - { - *errptr= "Failed to get CN from CN entry"; - goto error; - } + // Get the CN entry for given location + cn_entry= X509_NAME_get_entry(subject, cn_loc); + if (cn_entry == NULL) + { + *errptr= "Failed to get CN entry using CN location"; + goto error; + } - cn= (char *) ASN1_STRING_data(cn_asn1); + // Get CN from common name entry + cn_asn1= X509_NAME_ENTRY_get_data(cn_entry); + if (cn_asn1 == NULL) + { + *errptr= "Failed to get CN from CN entry"; + goto error; + } - // There should not be any NULL embedded in the CN - if ((size_t)ASN1_STRING_length(cn_asn1) != strlen(cn)) - { - *errptr= "NULL embedded in the certificate CN"; - goto error; - } +#if OPENSSL_VERSION_NUMBER < 0x10100000L + cn= (const char *) ASN1_STRING_data(cn_asn1); +#else + cn= (const char *) ASN1_STRING_get0_data(cn_asn1); +#endif + if (cn == NULL) + { + *errptr= "Failed to get data from CN"; + goto error; + } - DBUG_PRINT("info", ("Server hostname in cert: %s", cn)); - if (!strcmp(cn, server_hostname)) - { - /* Success */ - ret_validation= 0; - } + // There should not be any NULL embedded in the CN + if ((size_t)ASN1_STRING_length(cn_asn1) != strlen(cn)) + { + *errptr= "NULL embedded in the certificate CN"; + goto error; + } - *errptr= "SSL certificate validation failure"; + DBUG_PRINT("info", ("Server hostname in cert: %s", cn)); + if (!strcmp(cn, server_hostname)) + { + /* Success */ + ret_validation= 0; + } + } +#endif + *errptr= ret_validation != 0 ? "SSL certificate validation failure" : ""; error: +#ifndef HAVE_YASSL + if(server_ip_address != NULL) + ASN1_OCTET_STRING_free(server_ip_address); +#endif + if (server_cert != NULL) X509_free (server_cert); DBUG_RETURN(ret_validation); @@ -2693,6 +2947,31 @@ end= buff+5; } #ifdef HAVE_OPENSSL + /* + If SSL connection is required we'll: + 1. check if the server supports SSL; + 2. check if the client is properly configured; + 3. try to use SSL no matter the other options given. + */ + if (mysql->options.extension && + mysql->options.extension->ssl_mode == SSL_MODE_REQUIRED) + { + if (!(mysql->server_capabilities & CLIENT_SSL)) + { + set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate, + ER(CR_SSL_CONNECTION_ERROR), + "Server doesn't support SSL"); + goto error; + } + if (!mysql->options.use_ssl) + { + set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate, + ER(CR_SSL_CONNECTION_ERROR), + "Client is not configured to use SSL"); + goto error; + } + mysql->client_flag|= CLIENT_SSL; + } if (mysql->client_flag & CLIENT_SSL) { /* Do the SSL layering. */ @@ -4599,6 +4878,13 @@ else mysql->options.client_flag&= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS; break; + case MYSQL_OPT_SSL_MODE: + if (*(uint *) arg == SSL_MODE_REQUIRED) + { + ENSURE_EXTENSIONS_PRESENT(&mysql->options); + mysql->options.extension->ssl_mode= SSL_MODE_REQUIRED; + } + break; default: DBUG_RETURN(1); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/sql-common/my_time.c percona-xtradb-cluster-5.6-5.6.37-26.21/sql-common/my_time.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/sql-common/my_time.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/sql-common/my_time.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2014, 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 @@ -64,8 +64,8 @@ @param tm[OUT] The value to set. @param time_type Timestasmp type */ -inline void set_zero_time(MYSQL_TIME *tm, - enum enum_mysql_timestamp_type time_type) +void set_zero_time(MYSQL_TIME *tm, + enum enum_mysql_timestamp_type time_type) { memset(tm, 0, sizeof(*tm)); tm->time_type= time_type; @@ -76,7 +76,7 @@ Set hour, minute and second of a MYSQL_TIME variable to maximum time value. Unlike set_max_time(), does not touch the other structure members. */ -inline void set_max_hhmmss(MYSQL_TIME *tm) +void set_max_hhmmss(MYSQL_TIME *tm) { tm->hour= TIME_MAX_HOUR; tm->minute= TIME_MAX_MINUTE; @@ -152,7 +152,7 @@ @retval TRUE if the value is fatally bad. @retval FALSE if the value is Ok. */ -inline my_bool check_time_mmssff_range(const MYSQL_TIME *ltime) +my_bool check_time_mmssff_range(const MYSQL_TIME *ltime) { return ltime->minute >= 60 || ltime->second >= 60 || ltime->second_part > 999999; @@ -171,7 +171,7 @@ @retval FALSE if value is Ok. @retval TRUE if value is out of range. */ -inline my_bool check_time_range_quick(const MYSQL_TIME *ltime) +my_bool check_time_range_quick(const MYSQL_TIME *ltime) { longlong hour= (longlong) ltime->hour + 24LL * ltime->day; /* The input value should not be fatally bad */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/blackhole/ha_blackhole.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/blackhole/ha_blackhole.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/blackhole/ha_blackhole.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/blackhole/ha_blackhole.h 2017-10-19 04:25:29.000000000 +0000 @@ -94,6 +94,7 @@ THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); + bool has_gap_locks() const { return true; } private: virtual int write_row(uchar *buf); virtual int update_row(const uchar *old_data, uchar *new_data); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/api/api0api.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/api/api0api.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/api/api0api.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/api/api0api.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2008, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2008, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1976,11 +1976,14 @@ page_format = static_cast( dict_table_is_comp(tuple->index->table)); + rec = btr_pcur_get_rec(pcur); - if (prebuilt->innodb_api_rec && - prebuilt->innodb_api_rec != rec) { - rec = prebuilt->innodb_api_rec; + if (!rec_get_deleted_flag(rec, page_format)) { + if (prebuilt->innodb_api && + prebuilt->innodb_api_rec != NULL) { + rec =prebuilt->innodb_api_rec; + } } if (!rec_get_deleted_flag(rec, page_format)) { @@ -2017,6 +2020,10 @@ buf = static_cast(mem_alloc(UNIV_PAGE_SIZE)); + if (prebuilt->innodb_api) { + prebuilt->cursor_heap = cursor->heap; + } + /* We want to position at one of the ends, row_search_for_mysql() uses the search_tuple fields to work out what to do. */ dtuple_set_n_fields(prebuilt->search_tuple, 0); @@ -2071,6 +2078,9 @@ row_prebuilt_t* prebuilt = cursor->prebuilt; byte buf[UNIV_PAGE_SIZE_MAX]; + if (prebuilt->innodb_api) { + prebuilt->cursor_heap = cursor->heap; + } /* We want to move to the next record */ dtuple_set_n_fields(prebuilt->search_tuple, 0); @@ -2123,6 +2133,9 @@ buf = static_cast(mem_alloc(UNIV_PAGE_SIZE)); + if (prebuilt->innodb_api) { + prebuilt->cursor_heap = cursor->heap; + } err = static_cast(row_search_for_mysql( buf, ib_srch_mode, prebuilt, cursor->match_mode, 0)); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/btr/btr0btr.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/btr/btr0btr.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/btr/btr0btr.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/btr/btr0btr.cc 2017-10-19 04:25:29.000000000 +0000 @@ -3400,7 +3400,7 @@ /*************************************************************//** Removes a page from the level list of pages. */ -static MY_ATTRIBUTE((nonnull)) +static void btr_level_list_remove_func( /*=======================*/ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/btr/btr0cur.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/btr/btr0cur.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/btr/btr0cur.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/btr/btr0cur.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1782,7 +1782,7 @@ /*************************************************************//** For an update, checks the locks and does the undo logging. @return DB_SUCCESS, DB_WAIT_LOCK, or error number */ -UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,6,7))) +UNIV_INLINE MY_ATTRIBUTE((warn_unused_result)) dberr_t btr_cur_upd_lock_and_undo( /*======================*/ @@ -3857,18 +3857,40 @@ return(n_rows); } -/*******************************************************************//** -Estimates the number of rows in a given index range. -@return estimated number of rows */ -UNIV_INTERN -ib_int64_t -btr_estimate_n_rows_in_range( -/*=========================*/ - dict_index_t* index, /*!< in: index */ - const dtuple_t* tuple1, /*!< in: range start, may also be empty tuple */ - ulint mode1, /*!< in: search mode for range start */ - const dtuple_t* tuple2, /*!< in: range end, may also be empty tuple */ - ulint mode2) /*!< in: search mode for range end */ +/** If the tree gets changed too much between the two dives for the left +and right boundary then btr_estimate_n_rows_in_range_low() will retry +that many times before giving up and returning the value stored in +rows_in_range_arbitrary_ret_val. */ +static const unsigned rows_in_range_max_retries = 4; + +/** We pretend that a range has that many records if the tree keeps changing +for rows_in_range_max_retries retries while we try to estimate the records +in a given range. */ +static const int64_t rows_in_range_arbitrary_ret_val = 10; + +/** Estimates the number of rows in a given index range. +@param[in] index index +@param[in] tuple1 range start, may also be empty tuple +@param[in] mode1 search mode for range start +@param[in] tuple2 range end, may also be empty tuple +@param[in] mode2 search mode for range end +@param[in] nth_attempt if the tree gets modified too much while +we are trying to analyze it, then we will retry (this function will call +itself, incrementing this parameter) +@return estimated number of rows; if after rows_in_range_max_retries +retries the tree keeps changing, then we will just return +rows_in_range_arbitrary_ret_val as a result (if +nth_attempt >= rows_in_range_max_retries and the tree is modified between +the two dives). */ +static +int64_t +btr_estimate_n_rows_in_range_low( + dict_index_t* index, + const dtuple_t* tuple1, + ulint mode1, + const dtuple_t* tuple2, + ulint mode2, + unsigned nth_attempt) { btr_path_t path1[BTR_PATH_ARRAY_N_SLOTS]; btr_path_t path2[BTR_PATH_ARRAY_N_SLOTS]; @@ -3904,6 +3926,12 @@ mtr_commit(&mtr); +#ifdef UNIV_DEBUG + if (!strcmp(index->name, "iC")) { + DEBUG_SYNC_C("btr_estimate_n_rows_in_range_between_dives"); + } +#endif + mtr_start(&mtr); cursor.path_arr = path2; @@ -3972,6 +4000,32 @@ if (!diverged && slot1->nth_rec != slot2->nth_rec) { + /* If both slots do not point to the same page or if + the paths have crossed and the same page on both + apparently contains a different number of records, + this means that the tree must have changed between + the dive for slot1 and the dive for slot2 at the + beginning of this function. */ + if (slot1->page_no != slot2->page_no + || slot1->page_level != slot2->page_level + || (slot1->nth_rec >= slot2->nth_rec + && slot1->n_recs != slot2->n_recs)) { + + /* If the tree keeps changing even after a + few attempts, then just return some arbitrary + number. */ + if (nth_attempt >= rows_in_range_max_retries) { + return(rows_in_range_arbitrary_ret_val); + } + + const int64_t ret = + btr_estimate_n_rows_in_range_low( + index, tuple1, mode1, + tuple2, mode2, nth_attempt + 1); + + return(ret); + } + diverged = TRUE; if (slot1->nth_rec < slot2->nth_rec) { @@ -3990,7 +4044,7 @@ in this case slot1->nth_rec will point to the supr record and slot2->nth_rec will point to 6 */ - n_rows = 0; + return(0); } } else if (diverged && !diverged_lot) { @@ -4021,6 +4075,27 @@ } } +/** Estimates the number of rows in a given index range. +@param[in] index index +@param[in] tuple1 range start, may also be empty tuple +@param[in] mode1 search mode for range start +@param[in] tuple2 range end, may also be empty tuple +@param[in] mode2 search mode for range end +@return estimated number of rows */ +int64_t +btr_estimate_n_rows_in_range( + dict_index_t* index, + const dtuple_t* tuple1, + ulint mode1, + const dtuple_t* tuple2, + ulint mode2) +{ + const int64_t ret = btr_estimate_n_rows_in_range_low( + index, tuple1, mode1, tuple2, mode2, 1 /* first attempt */); + + return(ret); +} + /*******************************************************************//** Record the number of non_null key values in a given index for each n-column prefix of the index where 1 <= n <= dict_index_get_n_unique(index). diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/btr/btr0sea.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/btr/btr0sea.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/btr/btr0sea.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/btr/btr0sea.cc 2017-10-19 04:25:29.000000000 +0000 @@ -199,7 +199,7 @@ &btr_search_latch_arr[i], SYNC_SEARCH_SYS); btr_search_sys->hash_tables[i] - = ha_create(hash_size, 0, MEM_HEAP_FOR_BTR_SEARCH, 0); + = ib_create(hash_size, 0, MEM_HEAP_FOR_BTR_SEARCH, 0); #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG btr_search_sys->hash_tables[i]->adaptive = TRUE; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0buf.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0buf.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0buf.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0buf.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1414,7 +1414,7 @@ ut_a(srv_n_page_hash_locks != 0); ut_a(srv_n_page_hash_locks <= MAX_PAGE_HASH_LOCKS); - buf_pool->page_hash = ha_create(2 * buf_pool->curr_size, + buf_pool->page_hash = ib_create(2 * buf_pool->curr_size, srv_n_page_hash_locks, MEM_HEAP_FOR_PAGE_HASH, SYNC_BUF_PAGE_HASH); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0dblwr.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0dblwr.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0dblwr.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0dblwr.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -355,7 +355,7 @@ void buf_dblwr_init_or_load_pages( /*=========================*/ - os_file_t file, + pfs_os_file_t file, char* path, bool load_corrupt_pages) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0dump.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0dump.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0dump.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0dump.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -40,6 +40,9 @@ #include "sync0rw.h" /* rw_lock_s_lock() */ #include "ut0byte.h" /* ut_ull_create() */ #include "ut0sort.h" /* UT_SORT_FUNCTION_BODY */ +#ifdef WITH_WSREP +extern my_bool wsrep_recovery; +#endif /* WITH_WSREP */ enum status_severity { STATUS_INFO, @@ -597,6 +600,7 @@ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); ut_ad(!srv_read_only_mode); srv_buf_dump_thread_active = TRUE; @@ -605,7 +609,13 @@ buf_load_status(STATUS_INFO, "not started"); if (srv_buffer_pool_load_at_startup) { +#ifdef WITH_WSREP + if (!wsrep_recovery) { +#endif /* WITH_WSREP */ buf_load(); +#ifdef WITH_WSREP + } +#endif /* WITH_WSREP */ } while (!SHUTTING_DOWN()) { @@ -626,12 +636,19 @@ } if (srv_buffer_pool_dump_at_shutdown && srv_fast_shutdown != 2) { +#ifdef WITH_WSREP + if (!wsrep_recovery) { +#endif /* WITH_WSREP */ buf_dump(FALSE /* ignore shutdown down flag, keep going even if we are in a shutdown state */); +#ifdef WITH_WSREP + } +#endif /* WITH_WSREP */ } srv_buf_dump_thread_active = FALSE; + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ os_thread_exit(NULL); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0flu.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0flu.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0flu.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0flu.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -356,6 +356,7 @@ buf_block_t* block, /*!< in/out: block which is modified */ lsn_t lsn) /*!< in: oldest modification */ { + ut_ad(srv_shutdown_state != SRV_SHUTDOWN_FLUSH_PHASE); ut_ad(log_flush_order_mutex_own()); ut_ad(mutex_own(&block->mutex)); @@ -414,6 +415,7 @@ buf_page_t* prev_b; buf_page_t* b; + ut_ad(srv_shutdown_state != SRV_SHUTDOWN_FLUSH_PHASE); ut_ad(log_flush_order_mutex_own()); ut_ad(mutex_own(&block->mutex)); ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); @@ -724,6 +726,7 @@ buf_page_set_io_fix(bpage, BUF_IO_NONE); buf_pool->n_flush[flush_type]--; + ut_ad(buf_pool->n_flush[flush_type] != ULINT_MAX); /* fprintf(stderr, "n pending flush %lu\n", buf_pool->n_flush[flush_type]); */ @@ -1061,6 +1064,7 @@ } ++buf_pool->n_flush[flush_type]; + ut_ad(buf_pool->n_flush[flush_type] != 0); mutex_exit(&buf_pool->flush_state_mutex); @@ -2206,13 +2210,14 @@ * Flush dirty pages at the tail of LRU to the disk The depth to which we scan each buffer pool is controlled by dynamic config parameter innodb_LRU_scan_depth. -@return number of pages flushed */ +@return number of flushed and evicted pages */ UNIV_INTERN ulint buf_flush_LRU_tail(void) /*====================*/ { ulint total_flushed = 0; + ulint total_evicted = 0; ulint start_time = ut_time_ms(); ulint scan_depth[MAX_BUFFER_POOLS]; ulint requested_pages[MAX_BUFFER_POOLS]; @@ -2278,6 +2283,7 @@ limited_scan[i] = (previous_evicted[i] > n.evicted); previous_evicted[i] = n.evicted; + total_evicted += n.evicted; requested_pages[i] += lru_chunk_size; @@ -2310,7 +2316,7 @@ MONITOR_LRU_BATCH_PAGES, total_flushed); } - return(total_flushed); + return(total_flushed + total_evicted); } /*********************************************************************//** @@ -2604,6 +2610,23 @@ return result; } +/** Returns the aggregate LRU list length over all buffer pool instances. +@return total LRU list length. */ +MY_ATTRIBUTE((warn_unused_result)) +static +ulint +buf_get_total_LRU_list_length(void) +{ + ulint result = 0; + + for (ulint i = 0; i < srv_buf_pool_instances; i++) { + + result += UT_LIST_GET_LEN(buf_pool_from_array(i)->LRU); + } + + return result; +} + /*********************************************************************//** Adjust the desired page cleaner thread sleep time for LRU flushes. */ MY_ATTRIBUTE((nonnull)) @@ -2616,8 +2639,9 @@ ulint lru_n_flushed) /*!< in: number of flushed in previous batch */ { - ulint free_len = buf_get_total_free_list_length(); - ulint max_free_len = srv_LRU_scan_depth * srv_buf_pool_instances; + ulint free_len = buf_get_total_free_list_length(); + ulint max_free_len = ut_min(buf_get_total_LRU_list_length(), + srv_LRU_scan_depth * srv_buf_pool_instances); if (free_len < max_free_len / 100 && lru_n_flushed) { @@ -2629,7 +2653,7 @@ /* Free lists filled more than 20% or no pages flushed in previous batch, sleep a bit more */ - *lru_sleep_time += 50; + *lru_sleep_time += 1; if (*lru_sleep_time > srv_cleaner_max_lru_time) *lru_sleep_time = srv_cleaner_max_lru_time; } else if (free_len < max_free_len / 20 && *lru_sleep_time >= 50) { @@ -2676,6 +2700,7 @@ /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); ulint next_loop_time = ut_time_ms() + 1000; ulint n_flushed = 0; ulint last_activity = srv_get_activity_count(); @@ -2764,7 +2789,10 @@ when SRV_SHUTDOWN_CLEANUP is set other threads like the master and the purge threads may be working as well. We start flushing the buffer pool but can't be sure that no new pages are being - dirtied until we enter SRV_SHUTDOWN_FLUSH_PHASE phase. */ + dirtied until we enter SRV_SHUTDOWN_FLUSH_PHASE phase. Because + the LRU manager thread is also flushing at SRV_SHUTDOWN_CLEANUP + but not SRV_SHUTDOWN_FLUSH_PHASE, we only leave the + SRV_SHUTDOWN_CLEANUP loop when the LRU manager quits. */ do { n_flushed = page_cleaner_do_flush_batch(PCT_IO(100), LSN_MAX); @@ -2773,7 +2801,10 @@ if (n_flushed == 0) { os_thread_sleep(100000); } - } while (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP); + + os_rmb; + } while (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP + || buf_lru_manager_is_active); /* At this point all threads including the master and the purge thread must have been suspended. */ @@ -2790,6 +2821,11 @@ buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST); buf_flush_wait_LRU_batch_end(); +#ifdef UNIV_DEBUG + os_rmb; + ut_ad(!buf_lru_manager_is_active); +#endif + bool success; do { @@ -2812,6 +2848,7 @@ thread_exit: buf_page_cleaner_is_active = FALSE; + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ os_thread_exit(NULL); @@ -2851,6 +2888,7 @@ #endif /* UNIV_DEBUG_THREAD_CREATION */ buf_lru_manager_is_active = true; + os_wmb; /* On server shutdown, the LRU manager thread runs through cleanup phase to provide free pages for the master and purge threads. */ @@ -2869,6 +2907,7 @@ } buf_lru_manager_is_active = false; + os_wmb; /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0lru.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0lru.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/buf/buf0lru.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/buf/buf0lru.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1301,6 +1301,71 @@ } } +/** Diagnose failure to get a free page and request InnoDB monitor output in +the error log if more than two seconds have been spent already. +@param[in] n_iterations how many buf_LRU_get_free_page iterations + already completed +@param[in] started_ms timestamp in ms of when the attempt to get the + free page started +@param[in] flush_failures how many times single-page flush, if allowed, + has failed +@param[out] mon_value_was previous srv_print_innodb_monitor value +@param[out] started_monitor whether InnoDB monitor print has been requested +*/ +static +void +buf_LRU_handle_lack_of_free_blocks(ulint n_iterations, ulint started_ms, + ulint flush_failures, + ibool *mon_value_was, + ibool *started_monitor) +{ + static ulint last_printout_ms = 0; + + /* Legacy algorithm started warning after at least 2 seconds, we + emulate this. */ + const ulint current_ms = ut_time_ms(); + + if ((current_ms > started_ms + 2000) + && (current_ms > last_printout_ms + 2000)) { + + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: Warning: difficult to find free blocks in\n" + "InnoDB: the buffer pool (%lu search iterations)!\n" + "InnoDB: %lu failed attempts to flush a page!" + " Consider\n" + "InnoDB: increasing the buffer pool size.\n" + "InnoDB: It is also possible that" + " in your Unix version\n" + "InnoDB: fsync is very slow, or" + " completely frozen inside\n" + "InnoDB: the OS kernel. Then upgrading to" + " a newer version\n" + "InnoDB: of your operating system may help." + " Look at the\n" + "InnoDB: number of fsyncs in diagnostic info below.\n" + "InnoDB: Pending flushes (fsync) log: %lu;" + " buffer pool: %lu\n" + "InnoDB: %lu OS file reads, %lu OS file writes," + " %lu OS fsyncs\n" + "InnoDB: Starting InnoDB Monitor to print further\n" + "InnoDB: diagnostics to the standard output.\n", + (ulong) n_iterations, + (ulong) flush_failures, + (ulong) fil_n_pending_log_flushes, + (ulong) fil_n_pending_tablespace_flushes, + (ulong) os_n_file_reads, (ulong) os_n_file_writes, + (ulong) os_n_fsyncs); + + last_printout_ms = current_ms; + *mon_value_was = srv_print_innodb_monitor; + *started_monitor = TRUE; + srv_print_innodb_monitor = TRUE; + os_event_set(lock_sys->timeout_event); + } + +} + /** The maximum allowed backoff sleep time duration, microseconds */ #define MAX_FREE_LIST_BACKOFF_SLEEP 10000 @@ -1348,6 +1413,7 @@ ulint flush_failures = 0; ibool mon_value_was = FALSE; ibool started_monitor = FALSE; + ulint started_ms = 0; ut_ad(!mutex_own(&buf_pool->LRU_list_mutex)); @@ -1356,7 +1422,24 @@ buf_LRU_check_size_of_non_data_objects(buf_pool); /* If there is a block in the free list, take it */ - block = buf_LRU_get_free_only(buf_pool); + if (DBUG_EVALUATE_IF("simulate_lack_of_pages", true, false)) { + + block = NULL; + + if (srv_debug_monitor_printed) + DBUG_SET("-d,simulate_lack_of_pages"); + + } else if (DBUG_EVALUATE_IF("simulate_recovery_lack_of_pages", + recv_recovery_on, false)) { + + block = NULL; + + if (srv_debug_monitor_printed) + DBUG_SUICIDE(); + } else { + + block = buf_LRU_get_free_only(buf_pool); + } if (block) { @@ -1371,6 +1454,9 @@ return(block); } + if (!started_ms) + started_ms = ut_time_ms(); + if (srv_empty_free_list_algorithm == SRV_EMPTY_FREE_LIST_BACKOFF && buf_lru_manager_is_active && (srv_shutdown_state == SRV_SHUTDOWN_NONE @@ -1408,11 +1494,17 @@ : FREE_LIST_BACKOFF_LOW_PRIO_DIVIDER)); } - /* In case of backoff, do not ever attempt single page flushes - and wait for the cleaner to free some pages instead. */ + buf_LRU_handle_lack_of_free_blocks(n_iterations, started_ms, + flush_failures, + &mon_value_was, + &started_monitor); n_iterations++; + srv_stats.buf_pool_wait_free.add(n_iterations, 1); + + /* In case of backoff, do not ever attempt single page flushes + and wait for the cleaner to free some pages instead. */ goto loop; } else { @@ -1444,6 +1536,12 @@ mutex_exit(&buf_pool->flush_state_mutex); + if (DBUG_EVALUATE_IF("simulate_recovery_lack_of_pages", true, false) + || DBUG_EVALUATE_IF("simulate_lack_of_pages", true, false)) { + + buf_pool->try_LRU_scan = false; + } + freed = FALSE; if (buf_pool->try_LRU_scan || n_iterations > 0) { @@ -1469,41 +1567,9 @@ } - if (n_iterations > 20) { - ut_print_timestamp(stderr); - fprintf(stderr, - " InnoDB: Warning: difficult to find free blocks in\n" - "InnoDB: the buffer pool (%lu search iterations)!\n" - "InnoDB: %lu failed attempts to flush a page!" - " Consider\n" - "InnoDB: increasing the buffer pool size.\n" - "InnoDB: It is also possible that" - " in your Unix version\n" - "InnoDB: fsync is very slow, or" - " completely frozen inside\n" - "InnoDB: the OS kernel. Then upgrading to" - " a newer version\n" - "InnoDB: of your operating system may help." - " Look at the\n" - "InnoDB: number of fsyncs in diagnostic info below.\n" - "InnoDB: Pending flushes (fsync) log: %lu;" - " buffer pool: %lu\n" - "InnoDB: %lu OS file reads, %lu OS file writes," - " %lu OS fsyncs\n" - "InnoDB: Starting InnoDB Monitor to print further\n" - "InnoDB: diagnostics to the standard output.\n", - (ulong) n_iterations, - (ulong) flush_failures, - (ulong) fil_n_pending_log_flushes, - (ulong) fil_n_pending_tablespace_flushes, - (ulong) os_n_file_reads, (ulong) os_n_file_writes, - (ulong) os_n_fsyncs); - - mon_value_was = srv_print_innodb_monitor; - started_monitor = TRUE; - srv_print_innodb_monitor = TRUE; - os_event_set(lock_sys->timeout_event); - } + buf_LRU_handle_lack_of_free_blocks(n_iterations, started_ms, + flush_failures, &mon_value_was, + &started_monitor); /* If we have scanned the whole LRU and still are unable to find a free block then we should sleep here to let the diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0boot.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0boot.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0boot.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0boot.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -464,7 +464,10 @@ dberr_t err = DB_SUCCESS; - if (srv_read_only_mode && !ibuf_is_empty()) { + /** If innodb_force_recovery is set to 6 then allow + the server to start even though ibuf is not empty. */ + if (srv_force_recovery != SRV_FORCE_NO_LOG_REDO + && srv_read_only_mode && !ibuf_is_empty()) { ib_logf(IB_LOG_LEVEL_ERROR, "Change buffer must be empty when --innodb-read-only " diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0dict.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0dict.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0dict.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0dict.cc 2017-10-19 04:25:29.000000000 +0000 @@ -835,16 +835,24 @@ /*=================================*/ const dict_index_t* index, /*!< in: index */ ulint n, /*!< in: column number */ - ibool inc_prefix) /*!< in: TRUE=consider + ibool inc_prefix, /*!< in: TRUE=consider column prefixes too */ + ulint* prefix_col_pos) /*!< out: col num if prefix */ { const dict_field_t* field; const dict_col_t* col; ulint pos; ulint n_fields; + ulint prefixed_pos_dummy; ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); + ut_ad((inc_prefix && !prefix_col_pos) || (!inc_prefix)); + + if (!prefix_col_pos) { + prefix_col_pos = &prefixed_pos_dummy; + } + *prefix_col_pos = ULINT_UNDEFINED; col = dict_table_get_nth_col(index->table, n); @@ -858,10 +866,11 @@ for (pos = 0; pos < n_fields; pos++) { field = dict_index_get_nth_field(index, pos); - if (col == field->col - && (inc_prefix || field->prefix_len == 0)) { - - return(pos); + if (col == field->col) { + *prefix_col_pos = pos; + if (inc_prefix || field->prefix_len == 0) { + return(pos); + } } } @@ -1005,7 +1014,7 @@ ulint n) /*!< in: column number */ { return(dict_index_get_nth_col_pos(dict_table_get_first_index(table), - n)); + n, NULL)); } /********************************************************************//** @@ -6291,6 +6300,20 @@ return(DB_ERROR); } + + /* check whether column has the same COMPRESSED attriute */ + if ((req_schema->columns[i].prtype_mask & DATA_COMPRESSED) != + (table->cols[j].prtype & DATA_COMPRESSED)) { + + ut_snprintf(errstr, errstr_sz, + "Column %s in table %s has " + "unexpected COMPRESSED attribute.", + req_schema->columns[i].name, + ut_format_name(req_schema->table_name, + TRUE, buf, sizeof(buf))); + + return(DB_ERROR); + } } if (req_schema->n_foreign != table->foreign_set.size()) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0stats_bg.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0stats_bg.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0stats_bg.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0stats_bg.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -334,6 +334,7 @@ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); ut_a(!srv_read_only_mode); srv_dict_stats_thread_active = TRUE; @@ -359,6 +360,7 @@ srv_dict_stats_thread_active = FALSE; + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit instead of return(). */ os_thread_exit(NULL); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0stats.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0stats.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/dict/dict0stats.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/dict/dict0stats.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2009, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2009, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -690,6 +690,9 @@ && (src_idx = dict_table_get_next_index(src_idx)))) { if (dict_stats_should_ignore_index(dst_idx)) { + if (!(dst_idx->type & DICT_FTS)) { + dict_stats_empty_index(dst_idx); + } continue; } @@ -1095,10 +1098,11 @@ them away) which brings non-determinism. We skip only leaf-level delete marks because delete marks on non-leaf level do not make sense. */ - if (level == 0 && + + if (level == 0 && (srv_stats_include_delete_marked ? 0: rec_get_deleted_flag( rec, - page_is_comp(btr_pcur_get_page(&pcur)))) { + page_is_comp(btr_pcur_get_page(&pcur))))) { if (rec_is_last_on_page && !prev_rec_is_copied @@ -1281,8 +1285,12 @@ the given page and count the number of distinct ones, also ignore delete marked records */ - QUIT_ON_FIRST_NON_BORING/* quit when the first record that differs + QUIT_ON_FIRST_NON_BORING,/* quit when the first record that differs from its right neighbor is found */ + COUNT_ALL_NON_BORING_INCLUDE_DEL_MARKED/* scan all records on + the given page and count the number of + distinct ones, include delete marked + records */ }; /* @} */ @@ -1558,6 +1566,8 @@ offsets_rec = dict_stats_scan_page( &rec, offsets1, offsets2, index, page, n_prefix, + srv_stats_include_delete_marked ? + COUNT_ALL_NON_BORING_INCLUDE_DEL_MARKED: COUNT_ALL_NON_BORING_AND_SKIP_DEL_MARKED, n_diff, n_external_pages); @@ -3222,12 +3232,6 @@ dict_table_stats_lock(table, RW_X_LATCH); - /* Initialize all stats to dummy values before - copying because dict_stats_table_clone_create() does - skip corrupted indexes so our dummy object 't' may - have less indexes than the real object 'table'. */ - dict_stats_empty_table(table); - dict_stats_copy(table, t); dict_stats_assert_initialized(table); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fil/fil0fil.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fil/fil0fil.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fil/fil0fil.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fil/fil0fil.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -146,7 +146,7 @@ belongs */ char* name; /*!< path to the file */ ibool open; /*!< TRUE if file open */ - os_file_t handle; /*!< OS handle to the file, if file open */ + pfs_os_file_t handle; /*!< OS handle to the file, if file open */ os_event_t sync_event;/*!< Condition event to group and serialize calls to fsync */ ibool is_raw_disk;/*!< TRUE if the 'file' is actually a raw @@ -317,7 +317,8 @@ static fil_system_t* fil_system = NULL; /** Determine if (i) is a user tablespace id or not. */ -# define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open) +# define fil_is_user_tablespace_id(i) (i != 0 \ + && !srv_is_undo_tablespace(i)) /** Determine if user has explicitly disabled fsync(). */ #ifndef __WIN__ @@ -2084,7 +2085,7 @@ const char* fil_read_first_page( /*================*/ - os_file_t data_file, /*!< in: open data file */ + pfs_os_file_t data_file, /*!< in: open data file */ ibool one_read_already, /*!< in: TRUE if min and max parameters below already contain sensible data */ @@ -3407,7 +3408,7 @@ /*===============*/ const char* tablename, /*!< in: database/tablename */ char** remote_filepath,/*!< out: remote filepath */ - os_file_t* remote_file) /*!< out: remote file handle */ + pfs_os_file_t* remote_file) /*!< out: remote file handle */ { ibool success; @@ -3467,7 +3468,8 @@ tablespace file in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE */ { - os_file_t file; + pfs_os_file_t file; + ibool ret; dberr_t err; byte* buf2; @@ -5206,8 +5208,8 @@ os_offset_t end_offset = (size_after_extend - file_start_page_no) * page_size; - success = (posix_fallocate(node->handle, start_offset, - end_offset) == 0); + success = (os_file_allocate(node->handle, start_offset, + end_offset) == 0); if (!success) { ib_logf(IB_LOG_LEVEL_ERROR, @@ -5960,7 +5962,7 @@ { fil_space_t* space; fil_node_t* node; - os_file_t file; + pfs_os_file_t file; mutex_enter(&fil_system->mutex); @@ -6319,7 +6321,7 @@ } struct fil_iterator_t { - os_file_t file; /*!< File handle */ + pfs_os_file_t file; /*!< File handle */ const char* filepath; /*!< File path name */ os_offset_t start; /*!< From where to start */ os_offset_t end; /*!< Where to stop */ @@ -6454,7 +6456,7 @@ PageCallback& callback) { dberr_t err; - os_file_t file; + pfs_os_file_t file; char* filepath; ut_a(n_io_buffers > 0); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fsp/fsp0fsp.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fsp/fsp0fsp.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fsp/fsp0fsp.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fsp/fsp0fsp.cc 2017-10-19 04:25:29.000000000 +0000 @@ -132,7 +132,7 @@ ulint space, /*!< in: space */ fsp_header_t* header, /*!< in/out: space header */ mtr_t* mtr) /*!< in/out: mini-transaction */ - UNIV_COLD MY_ATTRIBUTE((nonnull)); + UNIV_COLD; /**********************************************************************//** Allocates a single free page from a segment. This function implements the intelligent allocation strategy which tries to minimize file space @@ -161,7 +161,7 @@ in which the page should be initialized. If init_mtr!=mtr, but the page is already latched in mtr, do not initialize the page. */ - MY_ATTRIBUTE((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** @@ -1334,7 +1334,7 @@ @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 MY_ATTRIBUTE((nonnull, warn_unused_result)) +static MY_ATTRIBUTE((warn_unused_result)) buf_block_t* fsp_alloc_free_page( /*================*/ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fts/fts0opt.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fts/fts0opt.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fts/fts0opt.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fts/fts0opt.cc 2017-10-19 04:25:29.000000000 +0000 @@ -578,9 +578,6 @@ fts_zip_t* zip, /*!< in: Zip state + data */ fts_string_t* word) /*!< out: uncompressed word */ { -#ifdef UNIV_DEBUG - ulint i; -#endif short len = 0; void* null = NULL; byte* ptr = word->f_str; @@ -655,10 +652,9 @@ } } -#ifdef UNIV_DEBUG /* All blocks must be freed at end of inflate. */ if (zip->status != Z_OK) { - for (i = 0; i < ib_vector_size(zip->blocks); ++i) { + for (ulint i = 0; i < ib_vector_size(zip->blocks); ++i) { if (ib_vector_getp(zip->blocks, i)) { ut_free(ib_vector_getp(zip->blocks, i)); ib_vector_set(zip->blocks, i, &null); @@ -669,7 +665,6 @@ if (ptr != NULL) { ut_ad(word->f_len == strlen((char*) ptr)); } -#endif /* UNIV_DEBUG */ return(zip->status == Z_OK || zip->status == Z_STREAM_END ? ptr : NULL); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fts/fts0que.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fts/fts0que.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/fts/fts0que.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/fts/fts0que.cc 2017-10-19 04:25:29.000000000 +0000 @@ -953,6 +953,18 @@ query->total_size -= SIZEOF_RBT_CREATE; } +/** +Free the query intersection +@param[in] query query instance */ +static +void +fts_query_free_intersection( + fts_query_t* query) +{ + fts_query_free_doc_ids(query, query->intersection); + query->intersection = NULL; +} + /*******************************************************************//** Add the word to the documents "list" of matching words from the query. We make a copy of the word from the query heap. */ @@ -1311,6 +1323,7 @@ /* error is passed by 'query->error' */ if (query->error != DB_SUCCESS) { ut_ad(query->error == DB_FTS_EXCEED_RESULT_CACHE_LIMIT); + fts_query_free_intersection(query); return(query->error); } @@ -1339,6 +1352,8 @@ ut_a(!query->multi_exist || (query->multi_exist && rbt_size(query->doc_ids) <= n_doc_ids)); + } else if (query->intersection != NULL) { + fts_query_free_intersection(query); } } @@ -1557,6 +1572,11 @@ query, ranking->doc_id, ranking->rank); if (query->error != DB_SUCCESS) { + if (query->intersection != NULL) + { + ut_a(query->oper == FTS_EXIST); + fts_query_free_intersection(query); + } DBUG_RETURN(query->error); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/ha_innodb.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/ha_innodb.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/ha_innodb.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/ha_innodb.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. Copyright (c) 2012, Facebook Inc. @@ -733,6 +733,32 @@ THD* thd); /*!< in: MySQL thread handle of the user for whom the transaction is being committed */ +/** Empty free list algorithm. +Checks if buffer pool is big enough to enable backoff algorithm. +InnoDB empty free list algorithm backoff requires free pages +from LRU for the best performance. +buf_LRU_buf_pool_running_out cancels query if 1/4 of +buffer pool belongs to LRU or freelist. +At the same time buf_flush_LRU_list_batch +keeps up to BUF_LRU_MIN_LEN in LRU. +In order to avoid deadlock baclkoff requires buffer pool +to be at least 4*BUF_LRU_MIN_LEN, +but flush peformance is bad because of trashing +and additional BUF_LRU_MIN_LEN pages are requested. +@param[in] algorithm desired algorithm from srv_empty_free_list_t +@return true if it's possible to enable backoff. */ +static inline +bool +innodb_empty_free_list_algorithm_allowed( + srv_empty_free_list_t algorithm) +{ + long long buf_pool_pages = srv_buf_pool_size / srv_page_size + / srv_buf_pool_instances; + + return(buf_pool_pages >= BUF_LRU_MIN_LEN * (4 + 1) + || algorithm != SRV_EMPTY_FREE_LIST_BACKOFF); +} + /** Get the list of foreign keys referencing a specified table table. @param thd The thread handle @@ -996,6 +1022,10 @@ (char*) &export_vars.innodb_x_lock_spin_rounds, SHOW_LONGLONG}, {"x_lock_spin_waits", (char*) &export_vars.innodb_x_lock_spin_waits, SHOW_LONGLONG}, + {"secondary_index_triggered_cluster_reads", + (char*) &export_vars.innodb_sec_rec_cluster_reads, SHOW_LONG}, + {"secondary_index_triggered_cluster_reads_avoided", + (char*) &export_vars.innodb_sec_rec_cluster_reads_avoided, SHOW_LONG}, {NullS, NullS, SHOW_LONG} }; @@ -1411,28 +1441,6 @@ /*!< in/out: zip dictionary name length */ /*************************************************************//** -Checks if buffer pool is big enough to enable backoff algorithm. -InnoDB empty free list algorithm backoff requires free pages -from LRU for the best performance. -buf_LRU_buf_pool_running_out cancels query if 1/4 of -buffer pool belongs to LRU or freelist. -At the same time buf_flush_LRU_list_batch -keeps up to BUF_LRU_MIN_LEN in LRU. -In order to avoid deadlock baclkoff requires buffer pool -to be at least 4*BUF_LRU_MIN_LEN, -but flush peformance is bad because of trashing -and additional BUF_LRU_MIN_LEN pages are requested. -@return true if it's possible to enable backoff. */ -static -bool -innodb_empty_free_list_algorithm_backoff_allowed( - srv_empty_free_list_t - algorithm, /*!< in: desired algorithm - from srv_empty_free_list_t */ - long long buf_pool_pages); /*!< in: total number - of pages inside buffer pool */ - -/*************************************************************//** Removes old archived transaction log files. @return true on error */ static bool innobase_purge_archive_logs( @@ -1458,6 +1466,23 @@ return (err != DB_SUCCESS); } +/** Sync innodb_kill_idle_transaction and kill_idle_transaction values. + +@param[in,out] thd thread handle +@param[in] var pointer to system variable +@param[out] var_ptr where the formal string goes +@param[in] save immediate result from check function */ +static void innodb_kill_idle_transaction_update( + THD* thd, + struct st_mysql_sys_var* var, + void* var_ptr, + const void* save) +{ + ulong in_val = *static_cast(save); + kill_idle_transaction_timeout= in_val; + srv_kill_idle_transaction= in_val; +} + /*************************************************************//** Check for a valid value of innobase_commit_concurrency. @return 0 for valid innodb_commit_concurrency */ @@ -3470,7 +3495,8 @@ innobase_hton->flush_logs = innobase_flush_logs; innobase_hton->show_status = innobase_show_status; innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS | - HTON_SUPPORTS_ONLINE_BACKUPS | HTON_SUPPORTS_FOREIGN_KEYS; + HTON_SUPPORTS_ONLINE_BACKUPS | HTON_SUPPORTS_FOREIGN_KEYS | + HTON_SUPPORTS_COMPRESSED_COLUMNS; innobase_hton->release_temporary_latches = innobase_release_temporary_latches; @@ -3944,16 +3970,10 @@ innobase_commit_concurrency_init_default(); -#ifndef EXTENDED_FOR_KILLIDLE - srv_kill_idle_transaction = 0; -#endif - - /* Do not enable backoff algorithm for small buffer pool. */ - if (!innodb_empty_free_list_algorithm_backoff_allowed( + if (!innodb_empty_free_list_algorithm_allowed( static_cast( - srv_empty_free_list_algorithm), - innobase_buffer_pool_size / srv_page_size)) { + srv_empty_free_list_algorithm))) { sql_print_information( "InnoDB: innodb_empty_free_list_algorithm " "has been changed to legacy " @@ -4195,7 +4215,7 @@ if (UNIV_UNLIKELY(high_level_read_only)) { DBUG_RETURN(HA_CREATE_ZIP_DICT_READ_ONLY); } - + if (UNIV_UNLIKELY(*name_len > ZIP_DICT_MAX_NAME_LENGTH)) { *name_len = ZIP_DICT_MAX_NAME_LENGTH; DBUG_RETURN(HA_CREATE_ZIP_DICT_NAME_TOO_LONG); @@ -4213,6 +4233,15 @@ case DB_DUPLICATE_KEY: result = HA_CREATE_ZIP_DICT_ALREADY_EXISTS; break; + case DB_OUT_OF_MEMORY: + result = HA_CREATE_ZIP_DICT_OUT_OF_MEMORY; + break; + case DB_OUT_OF_FILE_SPACE: + result = HA_CREATE_ZIP_DICT_OUT_OF_FILE_SPACE; + break; + case DB_TOO_MANY_CONCURRENT_TRXS: + result = HA_CREATE_ZIP_DICT_TOO_MANY_CONCURRENT_TRXS; + break; default: ut_ad(0); result = HA_CREATE_ZIP_DICT_UNKNOWN_ERROR; @@ -4249,6 +4278,15 @@ case DB_ROW_IS_REFERENCED: result = HA_DROP_ZIP_DICT_IS_REFERENCED; break; + case DB_OUT_OF_MEMORY: + result = HA_DROP_ZIP_DICT_OUT_OF_MEMORY; + break; + case DB_OUT_OF_FILE_SPACE: + result = HA_DROP_ZIP_DICT_OUT_OF_FILE_SPACE; + break; + case DB_TOO_MANY_CONCURRENT_TRXS: + result = HA_DROP_ZIP_DICT_TOO_MANY_CONCURRENT_TRXS; + break; default: ut_ad(0); result = HA_DROP_ZIP_DICT_UNKNOWN_ERROR; @@ -6103,6 +6141,8 @@ prebuilt->default_rec = table->s->default_values; ut_ad(prebuilt->default_rec); + prebuilt->mysql_handler = this; + /* Looks like MySQL-3.23 sometimes has primary key number != 0 */ primary_key = table->s->primary_key; key_used_on_scan = primary_key; @@ -7665,9 +7705,31 @@ ut_a(templ->clust_rec_field_no != ULINT_UNDEFINED); if (dict_index_is_clust(index)) { + templ->rec_field_is_prefix = false; templ->rec_field_no = templ->clust_rec_field_no; + templ->rec_prefix_field_no = ULINT_UNDEFINED; } else { - templ->rec_field_no = dict_index_get_nth_col_pos(index, i); + /* If we're in a secondary index, keep track of the original + index position even if this is just a prefix index; we will use + this later to avoid a cluster index lookup in some cases.*/ + + templ->rec_field_no = dict_index_get_nth_col_pos(index, i, + &templ->rec_prefix_field_no); + templ->rec_field_is_prefix + = (templ->rec_field_no == ULINT_UNDEFINED) + && (templ->rec_prefix_field_no != ULINT_UNDEFINED); +#ifdef UNIV_DEBUG + if (templ->rec_prefix_field_no != ULINT_UNDEFINED) + { + const dict_field_t* field = dict_index_get_nth_field( + index, + templ->rec_prefix_field_no); + ut_ad(templ->rec_field_is_prefix + == (field->prefix_len != 0)); + } else { + ut_ad(!templ->rec_field_is_prefix); + } +#endif } if (field->real_maybe_null()) { @@ -7857,7 +7919,8 @@ } else { templ->icp_rec_field_no = dict_index_get_nth_col_pos( - prebuilt->index, i); + prebuilt->index, i, + NULL); } if (dict_index_is_clust(prebuilt->index)) { @@ -7887,7 +7950,7 @@ templ->icp_rec_field_no = dict_index_get_nth_col_or_prefix_pos( - prebuilt->index, i, TRUE); + prebuilt->index, i, TRUE, NULL); ut_ad(templ->icp_rec_field_no != ULINT_UNDEFINED); @@ -8463,6 +8526,8 @@ to fail as thd_binlog_format() will then return != ROW. In order to take care of this situation we ORed that condition with db_type + g. Added condition to avoid appending keys if statement is CTAS. + key is appended as part of select_create::send_eof. TODO: We allow replication even if binlog-format = STATEMENT. This is needed by pt-table-checksum. Now it is not a good idea to open this hook for pt-table-checksum but it exist like this for @@ -10140,6 +10205,27 @@ } /*****************************************************************//** +Copy a cached MySQL row. +If requested, also avoids overwriting non-read columns. +@param[out] buf Row in MySQL format. +@param[in] cached_row Which row to copy. +@param[in] rec_len Record length. */ +void +ha_innobase::copy_cached_row( + uchar* buf, + const uchar* cached_row, + uint rec_len) +{ + if (prebuilt->keep_other_fields_on_keyread) { + row_sel_copy_cached_fields_for_mysql(buf, cached_row, + prebuilt); + } else { + memcpy(buf, cached_row, rec_len); + } +} + + +/*****************************************************************//** Set up search tuple for a query through FTS_DOC_ID_INDEX on supplied Doc ID. This is used by MySQL to retrieve the documents once the search result (Doc IDs) is available */ @@ -10675,7 +10761,8 @@ /* !hasPK == table with no PK, must append all non-unique keys */ - if (!hasPK || key_info->flags & HA_NOSAME || + if ((!hasPK && wsrep_certify_nonPK) || + key_info->flags & HA_NOSAME || ((tab && wsrep_is_FK_index(tab, idx)) || (!tab && referenced_by_foreign_key()))) { @@ -12482,7 +12569,8 @@ extension, in contrast to ::create */ normalize_table_name(norm_name, name); - if (srv_read_only_mode) { + if (srv_read_only_mode + || srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN) { DBUG_RETURN(HA_ERR_TABLE_READONLY); } else if (row_is_magic_monitor_table(norm_name) && check_global_access(thd, PROCESS_ACL)) { @@ -13339,9 +13427,13 @@ /* If this table is already queued for background analyze, remove it from the queue as we are about to do the same */ - dict_mutex_enter_for_mysql(); - dict_stats_recalc_pool_del(ib_table); - dict_mutex_exit_for_mysql(); + if (!srv_read_only_mode) { + + dict_mutex_enter_for_mysql(); + dict_stats_recalc_pool_del( + ib_table); + dict_mutex_exit_for_mysql(); + } opt = DICT_STATS_RECALC_PERSISTENT; } else { @@ -15840,6 +15932,37 @@ ulonglong col_max_value = innobase_get_int_col_max_value( table->next_number_field); + /** The following logic is needed to avoid duplicate key error + for autoincrement column. + + (1) InnoDB gives the current autoincrement value with respect + to increment and offset value. + + (2) Basically it does compute_next_insert_id() logic inside InnoDB + to avoid the current auto increment value changed by handler layer. + + (3) It is restricted only for insert operations. */ + + if (increment > 1 && thd_sql_command(user_thd) != SQLCOM_ALTER_TABLE + && autoinc < col_max_value) { + + ulonglong prev_auto_inc = autoinc; + + autoinc = ((autoinc - 1) + increment - offset)/ increment; + + autoinc = autoinc * increment + offset; + + /* If autoinc exceeds the col_max_value then reset + to old autoinc value. Because in case of non-strict + sql mode, boundary value is not considered as error. */ + + if (autoinc >= col_max_value) { + autoinc = prev_auto_inc; + } + + ut_ad(autoinc > 0); + } + /* Called for the first time ? */ if (trx->n_autoinc_rows == 0) { @@ -16509,16 +16632,21 @@ COLUMN_FORMAT_TYPE_COMPRESSED flag and updates zip_dict_name / zip_dict_data for those which have associated compression dictionaries. + +@param part_name Full table name (including partition part). + Must be non-NULL only if called from ha_partition. */ UNIV_INTERN void -ha_innobase::update_field_defs_with_zip_dict_info() +ha_innobase::update_field_defs_with_zip_dict_info(const char *part_name) { DBUG_ENTER("update_field_defs_with_zip_dict_info"); ut_ad(!mutex_own(&dict_sys->mutex)); char norm_name[FN_REFLEN]; - normalize_table_name(norm_name, table_share->normalized_path.str); + normalize_table_name(norm_name, + part_name != 0 ? part_name : + table_share->normalized_path.str); dict_table_t* ib_table = dict_table_open_on_name( norm_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE); @@ -17895,15 +18023,17 @@ ut_ad(block->page.in_LRU_list); mutex_enter(&block->mutex); - if (!buf_LRU_free_page(&block->page, false)) { - mutex_exit(&block->mutex); - all_evicted = false; - } else { - mutex_exit(&block->mutex); + all_evicted = buf_LRU_free_page(&block->page, false); + mutex_exit(&block->mutex); + + if (all_evicted) { + mutex_enter(&buf_pool->LRU_list_mutex); - } + block = UT_LIST_GET_LAST(buf_pool->unzip_LRU); + } else { - block = prev_block; + block = prev_block; + } } mutex_exit(&buf_pool->LRU_list_mutex); @@ -18368,32 +18498,6 @@ } /*********************************************************************** -functions for kill session of idle transaction */ -ibool -innobase_thd_is_idle( -/*=================*/ - const void* thd) /*!< in: thread handle (THD*) */ -{ -#ifdef EXTENDED_FOR_KILLIDLE - return(thd_command((const THD*) thd) == COM_SLEEP); -#else - return(FALSE); -#endif -} - -ib_int64_t -innobase_thd_get_start_time( -/*========================*/ - const void* thd) /*!< in: thread handle (THD*) */ -{ -#ifdef EXTENDED_FOR_KILLIDLE - return((ib_int64_t)thd_start_time((const THD*) thd)); -#else - return(0); /*dummy value*/ -#endif -} - -/*********************************************************************** Free the memory for the FTS handler */ UNIV_INTERN void @@ -18412,19 +18516,6 @@ return; } -UNIV_INTERN -void -innobase_thd_kill( -/*==============*/ - ulong thd_id) -{ -#ifdef EXTENDED_FOR_KILLIDLE - thd_kill(thd_id); -#else - return; -#endif -} - /*********************************************************************** Find and Retrieve the FTS Relevance Ranking result for doc with doc_id of prebuilt->fts_doc_id @@ -18622,16 +18713,6 @@ } -ulong -innobase_thd_get_thread_id( -/*=======================*/ - const void* thd) -{ - return(thd_get_thread_id((const THD*) thd)); -} - - - /*********************************************************************** Find and retrieve the size of the current result @return number of matching rows */ @@ -18755,32 +18836,6 @@ } /*************************************************************//** -Empty free list algorithm. -Checks if buffer pool is big enough to enable backoff algorithm. -InnoDB empty free list algorithm backoff requires free pages -from LRU for the best performance. -buf_LRU_buf_pool_running_out cancels query if 1/4 of -buffer pool belongs to LRU or freelist. -At the same time buf_flush_LRU_list_batch -keeps up to BUF_LRU_MIN_LEN in LRU. -In order to avoid deadlock baclkoff requires buffer pool -to be at least 4*BUF_LRU_MIN_LEN, -but flush peformance is bad because of trashing -and additional BUF_LRU_MIN_LEN pages are requested. -@return true if it's possible to enable backoff. */ -static -bool -innodb_empty_free_list_algorithm_backoff_allowed( - srv_empty_free_list_t algorithm, /*!< in: desired algorithm - from srv_empty_free_list_t */ - long long buf_pool_pages) /*!< in: total number - of pages inside buffer pool */ -{ - return(buf_pool_pages >= BUF_LRU_MIN_LEN * (4 + 1) - || algorithm != SRV_EMPTY_FREE_LIST_BACKOFF); -} - -/*************************************************************//** Empty free list algorithm. This function is registered as a callback with MySQL. @return 0 for valid algorithm */ @@ -18821,13 +18876,11 @@ return(1); algorithm = static_cast(algo); - if (!innodb_empty_free_list_algorithm_backoff_allowed( - algorithm, - innobase_buffer_pool_size / srv_page_size)) { + if (!innodb_empty_free_list_algorithm_allowed(algorithm)) { sql_print_warning( "InnoDB: innodb_empty_free_list_algorithm " "= 'backoff' requires at least" - " 20MB buffer pool.\n"); + " 20MB buffer pool instances.\n"); return(1); } @@ -18893,8 +18946,10 @@ (long long)wsrep_thd_thread_id(thd), (long long)victim_trx->id); - WSREP_DEBUG("Aborting query: %s", - (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); + WSREP_DEBUG("Aborting query: %s conf %d trx: %llu", + (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void", + wsrep_thd_conflict_state(thd), + (unsigned long long) wsrep_thd_ws_handle(thd)->trx_id); wsrep_thd_LOCK(thd); DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock", @@ -18955,9 +19010,8 @@ } else { rcode = wsrep->abort_pre_commit( wsrep, bf_seqno, - (wsrep_trx_id_t)victim_trx->id + (wsrep_trx_id_t)wsrep_thd_ws_handle(thd)->trx_id ); - switch (rcode) { case WSREP_WARNING: WSREP_DEBUG("cancel commit warning: %llu", @@ -19080,9 +19134,10 @@ DBUG_ENTER("wsrep_innobase_abort_thd"); trx_t* victim_trx = thd_to_trx(victim_thd); trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL; - WSREP_DEBUG("abort transaction: BF: %s victim: %s", + WSREP_DEBUG("abort transaction: BF: %s victim: %s victim conf: %d", wsrep_thd_query(bf_thd), - wsrep_thd_query(victim_thd)); + wsrep_thd_query(victim_thd), + wsrep_thd_conflict_state(victim_thd)); if (victim_trx) { @@ -19134,8 +19189,12 @@ handlerton *hton, THD *thd) /*!< in: user thread handle */ { + mutex_enter(&trx_sys->mutex); trx_id_t trx_id = trx_sys_get_new_trx_id(); - + mutex_exit(&trx_sys->mutex); + WSREP_DEBUG("innodb fake trx id: %llu thd: %s", + (unsigned long long) trx_id, + wsrep_thd_query(thd)); (void *)wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id); } @@ -19218,6 +19277,12 @@ "Disable with --skip-innodb-doublewrite.", NULL, NULL, TRUE); +static MYSQL_SYSVAR_BOOL(stats_include_delete_marked, + srv_stats_include_delete_marked, + PLUGIN_VAR_OPCMDARG, + "Scan delete marked records for persistent stat", + NULL, NULL, FALSE); + static MYSQL_SYSVAR_BOOL(use_atomic_writes, innobase_use_atomic_writes, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, "Prevent partial page writes, via atomic writes (beta). " @@ -19747,12 +19812,8 @@ static MYSQL_SYSVAR_LONG(kill_idle_transaction, srv_kill_idle_transaction, PLUGIN_VAR_RQCMDARG, -#ifdef EXTENDED_FOR_KILLIDLE - "If non-zero value, the idle session with transaction which is idle over the value in seconds is killed by InnoDB.", -#else - "No effect for this build.", -#endif - NULL, NULL, 0, 0, LONG_MAX, 0); + "A deprecated alias of kill_idle_transaction server variable.", + NULL, innodb_kill_idle_transaction_update, 0, 0, LONG_TIMEOUT, 0); static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR, @@ -20295,6 +20356,7 @@ MYSQL_SYSVAR(data_file_path), MYSQL_SYSVAR(data_home_dir), MYSQL_SYSVAR(doublewrite), + MYSQL_SYSVAR(stats_include_delete_marked), MYSQL_SYSVAR(api_enable_binlog), MYSQL_SYSVAR(api_enable_mdl), MYSQL_SYSVAR(api_disable_rowlock), diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/ha_innodb.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/ha_innodb.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/ha_innodb.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/ha_innodb.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -148,6 +148,12 @@ int index_first(uchar * buf); int index_last(uchar * buf); + /* Copy a cached MySQL row. If requested, also avoids + overwriting non-read columns. */ + void copy_cached_row(uchar *to_rec, const uchar *from_rec, + uint rec_length); + bool has_gap_locks() const { return true; } + int rnd_init(bool scan); int rnd_end(); int rnd_next(uchar *buf); @@ -297,8 +303,12 @@ COLUMN_FORMAT_TYPE_COMPRESSED flag and updates zip_dict_name / zip_dict_data for those which have associated compression dictionaries. + + @param part_name Full table name (including partition part). + Must be non-NULL only if called from ha_partition. */ - virtual void update_field_defs_with_zip_dict_info(); + virtual void update_field_defs_with_zip_dict_info( + const char* part_name); private: /** Builds a 'template' to the prebuilt struct. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/handler0alter.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/handler0alter.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/handler0alter.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/handler0alter.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1076,15 +1076,6 @@ field->reset(); if (field->type() == MYSQL_TYPE_VARCHAR) { - if (field->column_format() == - COLUMN_FORMAT_TYPE_COMPRESSED) { - /* Skip compressed varchar column when - reporting an erroneous row - during index creation or table rebuild. */ - field->set_null(); - break; - } - /* This is a >= 5.0.3 type true VARCHAR. Store the length of the data to the first byte or the first two bytes of dest. */ @@ -1161,7 +1152,8 @@ field->reset(); - ipos = dict_index_get_nth_col_or_prefix_pos(index, i, TRUE); + ipos = dict_index_get_nth_col_or_prefix_pos(index, i, TRUE, + NULL); if (ipos == ULINT_UNDEFINED || rec_offs_nth_extern(offsets, ipos)) { @@ -1209,7 +1201,8 @@ field->reset(); - ipos = dict_index_get_nth_col_or_prefix_pos(index, i, TRUE); + ipos = dict_index_get_nth_col_or_prefix_pos(index, i, TRUE, + NULL); if (ipos == ULINT_UNDEFINED || dfield_is_ext(&fields[ipos]) @@ -1722,6 +1715,7 @@ return(FTS_NOT_EXIST_DOC_ID_INDEX); } + /*******************************************************************//** Create an index table where indexes are ordered as follows: @@ -1788,26 +1782,11 @@ (only prefix/part of the column is indexed), MySQL will treat the index as a PRIMARY KEY unless the table already has one. */ - if (n_add > 0 && !new_primary && got_default_clust - && (key_info[*add].flags & HA_NOSAME) - && !(key_info[*add].flags & HA_KEY_HAS_PART_KEY_SEG)) { - uint key_part = key_info[*add].user_defined_key_parts; - - new_primary = true; - - while (key_part--) { - const uint maybe_null - = key_info[*add].key_part[key_part].key_type - & FIELDFLAG_MAYBE_NULL; - DBUG_ASSERT(!maybe_null - == !key_info[*add].key_part[key_part]. - field->real_maybe_null()); + ut_ad(altered_table->s->primary_key == 0 + || altered_table->s->primary_key == MAX_KEY); - if (maybe_null) { - new_primary = false; - break; - } - } + if (got_default_clust && !new_primary) { + new_primary = (altered_table->s->primary_key != MAX_KEY); } const bool rebuild = new_primary || add_fts_doc_id @@ -1825,8 +1804,14 @@ ulint primary_key_number; if (new_primary) { - DBUG_ASSERT(n_add > 0); - primary_key_number = *add; + if (n_add == 0) { + DBUG_ASSERT(got_default_clust); + DBUG_ASSERT(altered_table->s->primary_key + == 0); + primary_key_number = 0; + } else { + primary_key_number = *add; + } } else if (got_default_clust) { /* Create the GEN_CLUST_INDEX */ index_def_t* index = indexdef++; @@ -2939,6 +2924,8 @@ ctx->add_cols = add_cols; } else { DBUG_ASSERT(!innobase_need_rebuild(ha_alter_info)); + DBUG_ASSERT(old_table->s->primary_key + == altered_table->s->primary_key); if (!ctx->new_table->fts && innobase_fulltext_exist(altered_table)) { @@ -3946,6 +3933,27 @@ add_fts_doc_id_idx, prebuilt)); } +/** Get the name of an erroneous key. +@param[in] error_key_num InnoDB number of the erroneus key +@param[in] ha_alter_info changes that were being performed +@param[in] table InnoDB table +@return the name of the erroneous key */ +static +const char* +get_error_key_name( + ulint error_key_num, + const Alter_inplace_info* ha_alter_info, + const dict_table_t* table) +{ + if (error_key_num == ULINT_UNDEFINED) { + return(FTS_DOC_ID_INDEX_NAME); + } else if (ha_alter_info->key_count == 0) { + return(dict_table_get_first_index(table)->name); + } else { + return(ha_alter_info->key_info_buffer[error_key_num].name); + } +} + /** Alter the table structure in-place with operations specified using Alter_inplace_info. The level of concurrency allowed during this operation depends @@ -4063,17 +4071,13 @@ case DB_ONLINE_LOG_TOO_BIG: DBUG_ASSERT(ctx->online); my_error(ER_INNODB_ONLINE_LOG_TOO_BIG, MYF(0), - (prebuilt->trx->error_key_num == ULINT_UNDEFINED) - ? FTS_DOC_ID_INDEX_NAME - : ha_alter_info->key_info_buffer[ - prebuilt->trx->error_key_num].name); + get_error_key_name(prebuilt->trx->error_key_num, + ha_alter_info, prebuilt->table)); break; case DB_INDEX_CORRUPT: my_error(ER_INDEX_CORRUPT, MYF(0), - (prebuilt->trx->error_key_num == ULINT_UNDEFINED) - ? FTS_DOC_ID_INDEX_NAME - : ha_alter_info->key_info_buffer[ - prebuilt->trx->error_key_num].name); + get_error_key_name(prebuilt->trx->error_key_num, + ha_alter_info, prebuilt->table)); break; default: my_error_innodb(error, @@ -4883,7 +4887,6 @@ "Foreign key constraints for table '%s'" " are loaded with charset check off", user_table->name); - } } @@ -4983,14 +4986,13 @@ DBUG_RETURN(true); case DB_ONLINE_LOG_TOO_BIG: my_error(ER_INNODB_ONLINE_LOG_TOO_BIG, MYF(0), - ha_alter_info->key_info_buffer[0].name); + get_error_key_name(err_key, ha_alter_info, + rebuilt_table)); DBUG_RETURN(true); case DB_INDEX_CORRUPT: my_error(ER_INDEX_CORRUPT, MYF(0), - (err_key == ULINT_UNDEFINED) - ? FTS_DOC_ID_INDEX_NAME - : ha_alter_info->key_info_buffer[err_key] - .name); + get_error_key_name(err_key, ha_alter_info, + rebuilt_table)); DBUG_RETURN(true); default: my_error_innodb(error, table_name, user_table->flags); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/i_s.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/i_s.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/handler/i_s.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/handler/i_s.cc 2017-10-19 04:25:29.000000000 +0000 @@ -8490,29 +8490,7 @@ while(log_online_bitmap_iterator_next(&i) && (!srv_max_changed_pages || - output_rows_num < srv_max_changed_pages) && - /* - There is no need to compare both start LSN and end LSN fields - with maximum value. It's enough to compare only start LSN. - Example: - - max_lsn = 100 - \\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1 - I------I I-------I I-------------I I----I - ////////////////// | - Query 2 - 1 2 3 4 - - Query 1: - SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100 - will select 1,2,3 bitmaps - Query 2: - SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100 - will select 1,2 bitmaps - - The condition start_lsn <= 100 will be false after reading - 1,2,3 bitmaps which suits for both cases. - */ - LOG_BITMAP_ITERATOR_START_LSN(i) <= max_lsn) + output_rows_num < srv_max_changed_pages)) { if (!LOG_BITMAP_ITERATOR_PAGE_CHANGED(i)) continue; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/btr0cur.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/btr0cur.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/btr0cur.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/btr0cur.h 2017-10-19 04:25:29.000000000 +0000 @@ -294,11 +294,7 @@ false=update-in-place */ mtr_t* mtr, /*!< in/out: mini-transaction */ trx_t* trx) /*!< in: NULL or transaction */ -#ifdef UNIV_DEBUG - MY_ATTRIBUTE((nonnull (1, 2, 3, 4, 7), warn_unused_result)); -#else - MY_ATTRIBUTE((nonnull (1, 2, 3, 6), warn_unused_result)); -#endif + MY_ATTRIBUTE((warn_unused_result)); #ifdef UNIV_DEBUG # define btr_cur_update_alloc_zip(page_zip,cursor,index,offsets,len,cr,mtr,trx) \ @@ -428,7 +424,7 @@ const ulint* offsets,/*!< in: rec_get_offsets(rec) */ que_thr_t* thr, /*!< in: query thread */ mtr_t* mtr) /*!< in/out: mini-transaction */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /***********************************************************//** Sets a secondary index record delete mark to TRUE or FALSE. @return DB_SUCCESS, DB_LOCK_WAIT, or error number */ @@ -441,7 +437,7 @@ ibool val, /*!< in: value to set */ que_thr_t* thr, /*!< in: query thread */ mtr_t* mtr) /*!< in/out: mini-transaction */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((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 @@ -608,8 +604,7 @@ dict_index_t* index, /*!< in: index of the page */ const ulint* offsets,/*!< in: array returned by rec_get_offsets() */ const upd_t* update, /*!< in: update vector */ - mtr_t* mtr) /*!< in/out: mini-transaction */ - MY_ATTRIBUTE((nonnull(2,3,4,5,6))); + mtr_t* mtr); /*!< in/out: mini-transaction */ /** Operation code for btr_store_big_rec_extern_fields(). */ enum blob_op { @@ -654,7 +649,7 @@ mtr_t* btr_mtr, /*!< in: mtr containing the latches to the clustered index */ enum blob_op op) /*! in: operation code */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************************//** Frees the space in an externally stored field to the file space @@ -747,8 +742,7 @@ /*==========================*/ dtuple_t* tuple, /*!< in/out: data tuple */ const upd_t* update, /*!< in: update vector */ - mem_heap_t* heap) /*!< in: memory heap */ - MY_ATTRIBUTE((nonnull)); + mem_heap_t* heap); /*!< in: memory heap */ /***********************************************************//** Sets a secondary index record's delete mark to the given value. This function is only used by the insert buffer merge mechanism. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/btr0sea.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/btr0sea.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/btr0sea.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/btr0sea.h 2017-10-19 04:25:29.000000000 +0000 @@ -200,7 +200,7 @@ btr_search_get_hash_table( /*======================*/ const dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((pure,warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Returns the adaptive hash index latch for a given index key. @@ -210,7 +210,7 @@ btr_search_get_latch( /*=================*/ const dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((pure,warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** Returns the AHI partition number corresponding to a given index ID. */ @@ -227,8 +227,7 @@ void btr_search_index_init( /*===============*/ - dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((nonnull)); + dict_index_t* index); /*!< in: index */ /********************************************************************//** Latches all adaptive hash index latches in exclusive mode. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/buf0buddy.ic percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/buf0buddy.ic --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/buf0buddy.ic 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/buf0buddy.ic 2017-10-19 04:25:29.000000000 +0000 @@ -50,7 +50,7 @@ allocated from the LRU list and buf_pool->LRU_list_mutex was temporarily released */ - MY_ATTRIBUTE((malloc, nonnull)); + MY_ATTRIBUTE((malloc)); /**********************************************************************//** Deallocate a block. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/buf0buf.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/buf0buf.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/buf0buf.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/buf0buf.h 2017-10-19 04:25:29.000000000 +0000 @@ -242,8 +242,7 @@ buf_page_t* bpage, /*!< in/out: control block being relocated; 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 */ - MY_ATTRIBUTE((nonnull)); + buf_page_t* dpage); /*!< in/out: destination control block */ /*********************************************************************//** Gets the current size of buffer buf_pool in bytes. @return size in bytes */ @@ -728,7 +727,7 @@ ulint flags) /*!< in: 0 or BUF_PAGE_PRINT_NO_CRASH or BUF_PAGE_PRINT_NO_FULL */ - UNIV_COLD MY_ATTRIBUTE((nonnull)); + UNIV_COLD; /********************************************************************//** Decompress a block. @return TRUE if successful */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/buf0dblwr.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/buf0dblwr.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/buf0dblwr.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/buf0dblwr.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -55,7 +55,7 @@ void buf_dblwr_init_or_load_pages( /*=========================*/ - os_file_t file, + pfs_os_file_t file, char* path, bool load_corrupt_pages); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dict0dict.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dict0dict.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dict0dict.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dict0dict.h 2017-10-19 04:25:29.000000000 +0000 @@ -720,7 +720,7 @@ dict_index_is_clust( /*================*/ const dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Check whether the index is unique. @return nonzero for unique index, zero for other indexes */ @@ -729,7 +729,7 @@ dict_index_is_unique( /*=================*/ const dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Check whether the index is the insert buffer tree. @return nonzero for insert buffer, zero for other indexes */ @@ -738,7 +738,7 @@ dict_index_is_ibuf( /*===============*/ const dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((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 */ @@ -747,7 +747,7 @@ dict_index_is_sec_or_ibuf( /*======================*/ const dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /************************************************************************ Gets the all the FTS indexes for the table. NOTE: must not be called for @@ -769,7 +769,7 @@ dict_table_get_n_user_cols( /*=======================*/ const dict_table_t* table) /*!< in: table */ - MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((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 */ @@ -788,7 +788,7 @@ dict_table_get_n_cols( /*==================*/ const dict_table_t* table) /*!< in: table */ - MY_ATTRIBUTE((nonnull, pure, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Gets the approximately estimated number of rows in the table. @return estimated number of rows */ @@ -1141,8 +1141,9 @@ dict_index_get_nth_col_pos( /*=======================*/ const dict_index_t* index, /*!< in: index */ - ulint n) /*!< in: column number */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + ulint n, /*!< in: column number */ + ulint* prefix_col_pos) /*!< out: col num if prefix */ + MY_ATTRIBUTE((nonnull(1), warn_unused_result)); /********************************************************************//** Looks for column n in an index. @return position in internal representation of the index; @@ -1153,9 +1154,11 @@ /*=================================*/ const dict_index_t* index, /*!< in: index */ ulint n, /*!< in: column number */ - ibool inc_prefix) /*!< in: TRUE=consider + ibool inc_prefix, /*!< in: TRUE=consider column prefixes too */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + ulint* prefix_col_pos) /*!< out: col num if prefix */ + + MY_ATTRIBUTE((nonnull(1), 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 */ @@ -1718,7 +1721,7 @@ dict_index_is_corrupted( /*====================*/ const dict_index_t* index) /*!< in: index */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); #endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** @@ -1731,7 +1734,7 @@ dict_index_t* index, /*!< in/out: index */ trx_t* trx, /*!< in/out: transaction */ const char* ctx) /*!< in: context */ - UNIV_COLD MY_ATTRIBUTE((nonnull)); + UNIV_COLD; /**********************************************************************//** Flags an index corrupted in the data dictionary cache only. This @@ -1742,8 +1745,7 @@ dict_set_corrupted_index_cache_only( /*================================*/ dict_index_t* index, /*!< in/out: index */ - dict_table_t* table) /*!< in/out: table */ - MY_ATTRIBUTE((nonnull)); + dict_table_t* table); /*!< in/out: table */ /**********************************************************************//** Flags a table with specified space_id corrupted in the table dictionary diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dict0dict.ic percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dict0dict.ic --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dict0dict.ic 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dict0dict.ic 2017-10-19 04:25:29.000000000 +0000 @@ -1049,7 +1049,8 @@ } return(dict_index_get_nth_col_pos( - index, dict_table_get_sys_col_no(index->table, type))); + index, dict_table_get_sys_col_no(index->table, type), + NULL)); } /*********************************************************************//** @@ -1101,9 +1102,11 @@ dict_index_get_nth_col_pos( /*=======================*/ const dict_index_t* index, /*!< in: index */ - ulint n) /*!< in: column number */ + ulint n, /*!< in: column number */ + ulint* prefix_col_pos) /*!< out: col num if prefix */ { - return(dict_index_get_nth_col_or_prefix_pos(index, n, FALSE)); + return(dict_index_get_nth_col_or_prefix_pos(index, n, FALSE, + prefix_col_pos)); } #ifndef UNIV_HOTBACKUP diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dyn0dyn.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dyn0dyn.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dyn0dyn.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dyn0dyn.h 2017-10-19 04:25:29.000000000 +0000 @@ -46,9 +46,8 @@ dyn_array_t* dyn_array_create( /*=============*/ - dyn_array_t* arr) /*!< in/out memory buffer of + dyn_array_t* arr); /*!< in/out memory buffer of size sizeof(dyn_array_t) */ - MY_ATTRIBUTE((nonnull)); /************************************************************//** Frees a dynamic array. */ UNIV_INLINE @@ -69,7 +68,7 @@ dyn_array_t* arr, /*!< in: dynamic array */ ulint size) /*!< in: size in bytes of the buffer; MUST be smaller than DYN_ARRAY_DATA_SIZE! */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************************//** Closes the buffer returned by dyn_array_open. */ UNIV_INLINE @@ -77,8 +76,7 @@ dyn_array_close( /*============*/ dyn_array_t* arr, /*!< in: dynamic array */ - const byte* ptr) /*!< in: end of used space */ - MY_ATTRIBUTE((nonnull)); + const byte* ptr); /*!< in: end of used space */ /*********************************************************************//** Makes room on top of a dyn array and returns a pointer to the added element. The caller must copy the element to @@ -90,7 +88,7 @@ /*===========*/ dyn_array_t* arr, /*!< in/out: dynamic array */ ulint size) /*!< in: size in bytes of the element */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /************************************************************//** Returns pointer to an element in dyn array. @return pointer to element */ @@ -101,7 +99,7 @@ const dyn_array_t* arr, /*!< in: dyn array */ ulint pos) /*!< in: position of element in bytes from array start */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /************************************************************//** Returns the size of stored data in a dyn array. @return data size in bytes */ @@ -110,7 +108,7 @@ dyn_array_get_data_size( /*====================*/ const dyn_array_t* arr) /*!< in: dyn array */ - MY_ATTRIBUTE((nonnull, warn_unused_result, pure)); + MY_ATTRIBUTE((warn_unused_result)); /************************************************************//** Gets the first block in a dyn array. @param arr dyn array @@ -144,7 +142,7 @@ dyn_block_get_used( /*===============*/ const dyn_block_t* block) /*!< in: dyn array block */ - MY_ATTRIBUTE((nonnull, warn_unused_result, pure)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Gets pointer to the start of data in a dyn array block. @return pointer to data */ @@ -153,7 +151,7 @@ dyn_block_get_data( /*===============*/ const dyn_block_t* block) /*!< in: dyn array block */ - MY_ATTRIBUTE((nonnull, warn_unused_result, pure)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************//** Pushes n bytes to a dyn array. */ UNIV_INLINE diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dyn0dyn.ic percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dyn0dyn.ic --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/dyn0dyn.ic 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/dyn0dyn.ic 2017-10-19 04:25:29.000000000 +0000 @@ -36,7 +36,7 @@ dyn_array_add_block( /*================*/ dyn_array_t* arr) /*!< in/out: dyn array */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /********************************************************************//** Gets the number of used bytes in a dyn array block. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/fil0fil.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/fil0fil.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/fil0fil.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/fil0fil.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -182,7 +182,7 @@ ibool success; /*!< Has the tablespace been opened? */ const char* check_msg; /*!< fil_check_first_page() message */ ibool valid; /*!< Is the tablespace valid? */ - os_file_t file; /*!< File handle */ + pfs_os_file_t file; /*!< File handle */ char* filepath; /*!< File path to open */ lsn_t lsn; /*!< Flushed LSN from header page */ ulint id; /*!< Space ID */ @@ -390,7 +390,7 @@ const char* fil_read_first_page( /*================*/ - os_file_t data_file, /*!< in: open data file */ + pfs_os_file_t data_file, /*!< in: open data file */ ibool one_read_already, /*!< in: TRUE if min and max parameters below already contain sensible data */ @@ -906,12 +906,12 @@ Called for every page in the tablespace. If the page was not updated then its state must be set to BUF_PAGE_NOT_USED. For compressed tables the page descriptor memory will be at offset: - block->frame + UNIV_PAGE_SIZE; + block->frame + UNIV_PAGE_SIZE; @param offset - physical offset within the file @param block - block read from file, note it is not from the buffer pool @retval DB_SUCCESS or error code. */ virtual dberr_t operator()( - os_offset_t offset, + os_offset_t offset, buf_block_t* block) UNIV_NOTHROW = 0; /** @@ -919,7 +919,7 @@ to open it for the file that is being iterated over. @param filename - then physical name of the tablespace file. @param file - OS file handle */ - void set_file(const char* filename, os_file_t file) UNIV_NOTHROW + void set_file(const char* filename, pfs_os_file_t file) UNIV_NOTHROW { m_file = file; m_filepath = filename; @@ -955,7 +955,7 @@ ulint m_page_size; /** File handle to the tablespace */ - os_file_t m_file; + pfs_os_file_t m_file; /** Physical file path. */ const char* m_filepath; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/ha0ha.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/ha0ha.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/ha0ha.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/ha0ha.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -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 @@ -107,7 +107,7 @@ @param level in: level of the mutexes in the latching order @param n_m in: number of mutexes to protect the hash table; must be a power of 2, or 0 */ -# define ha_create(n_c,n_m,type,level) ha_create_func(n_c,level,n_m,type) +# define ib_create(n_c,n_m,type,level) ha_create_func(n_c,level,n_m,type) #else /* UNIV_SYNC_DEBUG */ /** Creates a hash table. @return own: created table @@ -116,7 +116,7 @@ @param level in: level of the mutexes in the latching order @param n_m in: number of mutexes to protect the hash table; must be a power of 2, or 0 */ -# define ha_create(n_c,n_m,type,level) ha_create_func(n_c,n_m,type) +# define ib_create(n_c,n_m,type,level) ha_create_func(n_c,n_m,type) #endif /* UNIV_SYNC_DEBUG */ /*************************************************************//** diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/log0online.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/log0online.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/log0online.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/log0online.h 2017-10-19 04:25:29.000000000 +0000 @@ -38,19 +38,25 @@ /** An iterator over changed page info */ typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t; -/*********************************************************************//** -Initializes the online log following subsytem. */ +/** Initialize the constant part of the log tracking subsystem */ +UNIV_INTERN +void +log_online_init(void); + +/** Initialize the dynamic part of the log tracking subsystem */ UNIV_INTERN void log_online_read_init(void); -/*=======================*/ -/*********************************************************************//** -Shuts down the online log following subsystem. */ +/** Shut down the dynamic part of the log tracking subsystem */ UNIV_INTERN void log_online_read_shutdown(void); -/*===========================*/ + +/** Shut down the constant part of the log tracking subsystem */ +UNIV_INTERN +void +log_online_shutdown(void); /*********************************************************************//** Reads and parses the redo log up to last checkpoint LSN to build the changed @@ -124,7 +130,7 @@ /** Struct for single bitmap file information */ struct log_online_bitmap_file_struct { char name[FN_REFLEN]; /*!< Name with full path */ - os_file_t file; /*!< Handle to opened file */ + pfs_os_file_t file; /*!< Handle to opened file */ ib_uint64_t size; /*!< Size of the file */ os_offset_t offset; /*!< Offset of the next read, or count of already-read bytes @@ -147,6 +153,8 @@ /** Struct for an iterator through all bits of changed pages bitmap blocks */ struct log_bitmap_iterator_struct { + lsn_t max_lsn; /*!< End LSN of the + range */ ibool failed; /*!< Has the iteration stopped prematurely */ log_online_bitmap_file_range_t in_files; /*!< The bitmap files diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/mach0data.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/mach0data.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/mach0data.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/mach0data.h 2017-10-19 04:25:29.000000000 +0000 @@ -53,7 +53,7 @@ mach_read_from_1( /*=============*/ const byte* b) /*!< in: pointer to byte */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************//** The following function is used to store data in two consecutive bytes. We store the most significant byte to the lower address. */ @@ -114,7 +114,7 @@ mach_read_from_3( /*=============*/ const byte* b) /*!< in: pointer to 3 bytes */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************//** The following function is used to store data in four consecutive bytes. We store the most significant byte to the lowest address. */ @@ -133,7 +133,7 @@ mach_read_from_4( /*=============*/ const byte* b) /*!< in: pointer to four bytes */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************//** Writes a ulint in a compressed form (1..5 bytes). @return stored size in bytes */ @@ -160,7 +160,7 @@ mach_read_compressed( /*=================*/ const byte* b) /*!< in: pointer to memory from where to read */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************//** The following function is used to store data in 6 consecutive bytes. We store the most significant byte to the lowest address. */ @@ -179,7 +179,7 @@ mach_read_from_6( /*=============*/ const byte* b) /*!< in: pointer to 6 bytes */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************//** The following function is used to store data in 7 consecutive bytes. We store the most significant byte to the lowest address. */ @@ -198,7 +198,7 @@ mach_read_from_7( /*=============*/ const byte* b) /*!< in: pointer to 7 bytes */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*******************************************************//** The following function is used to store data in 8 consecutive bytes. We store the most significant byte to the lowest address. */ @@ -243,7 +243,7 @@ mach_ull_read_compressed( /*=====================*/ const byte* b) /*!< in: pointer to memory from where to read */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************//** Writes a 64-bit integer in a compressed form (1..11 bytes). @return size in bytes */ @@ -270,7 +270,7 @@ mach_ull_read_much_compressed( /*==========================*/ const byte* b) /*!< in: pointer to memory from where to read */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /*********************************************************//** 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 */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/mtr0mtr.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/mtr0mtr.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/mtr0mtr.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/mtr0mtr.h 2017-10-19 04:25:29.000000000 +0000 @@ -214,8 +214,7 @@ void mtr_commit( /*=======*/ - mtr_t* mtr) /*!< in/out: mini-transaction */ - MY_ATTRIBUTE((nonnull)); + mtr_t* mtr); /*!< in/out: mini-transaction */ /**********************************************************//** Sets and returns a savepoint in mtr. @return savepoint */ @@ -321,7 +320,7 @@ mtr_t* mtr, /*!< in: mtr */ const void* object, /*!< in: object to search */ ulint type) /*!< in: type of object */ - MY_ATTRIBUTE((warn_unused_result, nonnull)); + MY_ATTRIBUTE((warn_unused_result)); /**********************************************************//** Checks if memo contains the given page. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0file.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/os0file.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0file.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/os0file.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Portions of this file contain modifications contributed and copyrighted @@ -78,7 +78,6 @@ #define SRV_PATH_SEPARATOR '\\' /** File handle */ # define os_file_t HANDLE -# define os_file_invalid INVALID_HANDLE_VALUE /** Convert a C file descriptor to a native file handle @param fd file descriptor @return native file handle */ @@ -87,13 +86,22 @@ #define SRV_PATH_SEPARATOR '/' /** File handle */ typedef int os_file_t; -# define os_file_invalid (-1) /** Convert a C file descriptor to a native file handle @param fd file descriptor @return native file handle */ # define OS_FILE_FROM_FD(fd) fd #endif +/*Common file descriptor for file IO instrumentation with PFS +on windows and other platforms */ +struct pfs_os_file_t +{ + os_file_t m_file; +#ifdef UNIV_PFS_IO + struct PSI_file *m_psi; +#endif +}; + /** Umask for creating files */ extern ulint os_innodb_umask; @@ -129,6 +137,21 @@ ON_ERROR_NO_EXIT is set */ }; +/** Options for os_file_advise_func @{ */ +enum os_file_advise_t { + OS_FILE_ADVISE_NORMAL = 1, /*!< no advice on access pattern + (default) */ + OS_FILE_ADVISE_RANDOM = 2, /*!< access in random order */ + OS_FILE_ADVISE_SEQUENTIAL = 4, /*!< access the specified data + sequentially (with lower offsets read + before higher ones) */ + OS_FILE_ADVISE_WILLNEED = 8, /*!< specified data will be accessed + in the near future */ + OS_FILE_ADVISE_DONTNEED = 16, /*!< specified data will not be + accessed in the near future */ + OS_FILE_ADVISE_NOREUSE = 32 /*!< access only once */ +}; + #define OS_FILE_READ_ONLY 333 #define OS_FILE_READ_WRITE 444 #define OS_FILE_READ_ALLOW_DELETE 555 /* for mysqlbackup */ @@ -230,6 +253,8 @@ various file I/O operations with performance schema. 1) register_pfs_file_open_begin() and register_pfs_file_open_end() are used to register file creation, opening, closing and renaming. +2) register_pfs_file_rename_begin() and register_pfs_file_rename_end() +are used to register file renaming 2) register_pfs_file_io_begin() and register_pfs_file_io_end() are used to register actual file read, write and flush 3) register_pfs_file_close_begin() and register_pfs_file_close_end() @@ -239,17 +264,30 @@ do { \ locker = PSI_FILE_CALL(get_thread_file_name_locker)( \ state, key, op, name, &locker); \ - if (UNIV_LIKELY(locker != NULL)) { \ + if (locker != NULL) { \ PSI_FILE_CALL(start_file_open_wait)( \ locker, src_file, src_line); \ } \ } while (0) -# define register_pfs_file_open_end(locker, file) \ +# define register_pfs_file_open_end(locker, file, result) \ do { \ - if (UNIV_LIKELY(locker != NULL)) { \ - PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(\ - locker, file); \ + if (locker != NULL) { \ + file.m_psi = PSI_FILE_CALL( \ + end_file_open_wait)( \ + locker, result); \ + } \ +} while (0) + +# define register_pfs_file_rename_begin(state, locker, key, op, name, \ + src_file, src_line) \ + register_pfs_file_open_begin(state, locker, key, op, name, \ + src_file, src_line) \ + +# define register_pfs_file_rename_end(locker, result) \ +do { \ + if (locker != NULL) { \ + PSI_FILE_CALL(end_file_open_wait)(locker, result); \ } \ } while (0) @@ -275,9 +313,9 @@ # define register_pfs_file_io_begin(state, locker, file, count, op, \ src_file, src_line) \ do { \ - locker = PSI_FILE_CALL(get_thread_file_descriptor_locker)( \ - state, file, op); \ - if (UNIV_LIKELY(locker != NULL)) { \ + locker = PSI_FILE_CALL(get_thread_file_stream_locker)( \ + state, file.m_psi, op); \ + if (locker != NULL) { \ PSI_FILE_CALL(start_file_wait)( \ locker, count, src_file, src_line); \ } \ @@ -285,7 +323,7 @@ # define register_pfs_file_io_end(locker, count) \ do { \ - if (UNIV_LIKELY(locker != NULL)) { \ + if (locker != NULL) { \ PSI_FILE_CALL(end_file_wait)(locker, count); \ } \ } while (0) @@ -299,11 +337,16 @@ os_file_create_simple os_file_create_simple_no_error_handling os_file_close +os_file_close_no_error_handling os_file_rename os_aio os_file_read os_file_read_no_error_handling +os_file_read_no_error_handling_int_fd os_file_write +os_file_write_int_fd +os_file_set_eof_at +os_file_allocate The wrapper functions have the prefix of "innodb_". */ @@ -321,20 +364,23 @@ pfs_os_file_create_simple_no_error_handling_func( \ key, name, create_mode, access, success, __FILE__, __LINE__) -# define os_file_close(file) \ +# define os_file_close_pfs(file) \ pfs_os_file_close_func(file, __FILE__, __LINE__) +# define os_file_close_no_error_handling_pfs(file) \ + pfs_os_file_close_no_error_handling_func(file, __FILE__, __LINE__) + # define os_aio(type, mode, name, file, buf, offset, \ n, message1, message2, space_id, trx) \ pfs_os_aio_func(type, mode, name, file, buf, offset, \ n, message1, message2, space_id, trx, \ __FILE__, __LINE__) -# define os_file_read(file, buf, offset, n) \ +# define os_file_read_pfs(file, buf, offset, n) \ pfs_os_file_read_func(file, buf, offset, n, NULL, \ __FILE__, __LINE__) -# define os_file_read_trx(file, buf, offset, n, trx) \ +# define os_file_read_trx_pfs(file, buf, offset, n, trx) \ pfs_os_file_read_func(file, buf, offset, n, trx, \ __FILE__, __LINE__) @@ -342,11 +388,20 @@ pfs_os_file_read_no_error_handling_func(file, buf, offset, n, \ __FILE__, __LINE__) -# define os_file_write(name, file, buf, offset, n) \ +# define os_file_read_no_error_handling_int_fd( \ + file, buf, offset, n) \ + pfs_os_file_read_no_error_handling_int_fd_func( \ + file, buf, offset, n, __FILE__, __LINE__) + +# define os_file_write_pfs(name, file, buf, offset, n) \ pfs_os_file_write_func(name, file, buf, offset, \ n, __FILE__, __LINE__) -# define os_file_flush(file) \ +# define os_file_write_int_fd(name, file, buf, offset, n) \ + pfs_os_file_write_int_fd_func(name, file, buf, offset, \ + n, __FILE__, __LINE__) + +# define os_file_flush_pfs(file) \ pfs_os_file_flush_func(file, __FILE__, __LINE__) # define os_file_rename(key, oldpath, newpath) \ @@ -357,6 +412,15 @@ # define os_file_delete_if_exists(key, name) \ pfs_os_file_delete_if_exists_func(key, name, __FILE__, __LINE__) + +# define os_file_set_eof_at_pfs(file, new_len) \ + pfs_os_file_set_eof_at_func(file, new_len, __FILE__, __LINE__) + +# ifdef HAVE_POSIX_FALLOCATE +# define os_file_allocate_pfs(file, offset, len) \ + pfs_os_file_allocate_func(file, offset, len, __FILE__, __LINE__) +# endif + #else /* UNIV_PFS_IO */ /* If UNIV_PFS_IO is not defined, these I/O APIs point @@ -372,26 +436,36 @@ os_file_create_simple_no_error_handling_func( \ name, create_mode, access, success) -# define os_file_close(file) os_file_close_func(file) +# define os_file_close_pfs(file) \ + os_file_close_func(file) + +# define os_file_close_no_error_handling_pfs(file) \ + os_file_close_no_error_handling_func(file) # define os_aio(type, mode, name, file, buf, offset, n, message1, \ message2, space_id, trx) \ os_aio_func(type, mode, name, file, buf, offset, n, \ message1, message2, space_id, trx) -# define os_file_read(file, buf, offset, n) \ +# define os_file_read_pfs(file, buf, offset, n) \ os_file_read_func(file, buf, offset, n, NULL) -# define os_file_read_trx(file, buf, offset, n, trx) \ +# define os_file_read_trx_pfs(file, buf, offset, n, trx) \ os_file_read_func(file, buf, offset, n, trx) # define os_file_read_no_error_handling(file, buf, offset, n) \ os_file_read_no_error_handling_func(file, buf, offset, n) +# define os_file_read_no_error_handling_int_fd( \ + file, buf, offset, n) \ + os_file_read_no_error_handling_func(file, buf, offset, n) -# define os_file_write(name, file, buf, offset, n) \ +# define os_file_write_int_fd(name, file, buf, offset, n) \ os_file_write_func(name, file, buf, offset, n) +# define os_file_write_pfs(name, file, buf, offset, n) \ + os_file_write_func(name, file, buf, offset, n) + -# define os_file_flush(file) os_file_flush_func(file) +# define os_file_flush_pfs(file) os_file_flush_func(file) # define os_file_rename(key, oldpath, newpath) \ os_file_rename_func(oldpath, newpath) @@ -401,8 +475,78 @@ # define os_file_delete_if_exists(key, name) \ os_file_delete_if_exists_func(name) +# define os_file_set_eof_at_pfs(file, new_len) \ + os_file_set_eof_at_func(file, new_len) + +# ifdef HAVE_POSIX_FALLOCATE +# define os_file_allocate_pfs(file, offset, len) \ + os_file_allocate_func(file, offset, len) +# endif + #endif /* UNIV_PFS_IO */ +#ifdef UNIV_PFS_IO + #define os_file_close(file) os_file_close_pfs(file) +#else + #define os_file_close(file) os_file_close_pfs((file).m_file) +#endif + +#ifdef UNIV_PFS_IO + #define os_file_close_no_error_handling(file) \ + os_file_close_no_error_handling_pfs(file) +#else + #define os_file_close_no_error_handling(file) \ + os_file_close_no_error_handling_pfs((file).m_file) +#endif + +#ifdef UNIV_PFS_IO + #define os_file_read(file, buf, offset, n) \ + os_file_read_pfs(file, buf, offset, n) +#else + #define os_file_read(file, buf, offset, n) \ + os_file_read_pfs(file.m_file, buf, offset, n) +#endif + +#ifdef UNIV_PFS_IO + # define os_file_read_trx(file, buf, offset, n, trx) \ + os_file_read_trx_pfs(file, buf, offset, n, trx) +#else + # define os_file_read_trx(file, buf, offset, n, trx) \ + os_file_read_trx_pfs(file.m_file, buf, offset, n, trx) +#endif + +#ifdef UNIV_PFS_IO + #define os_file_flush(file) os_file_flush_pfs(file) +#else + #define os_file_flush(file) os_file_flush_pfs(file.m_file) +#endif + +#ifdef UNIV_PFS_IO + #define os_file_write(name, file, buf, offset, n) \ + os_file_write_pfs(name, file, buf, offset, n) +#else + #define os_file_write(name, file, buf, offset, n) \ + os_file_write_pfs(name, file.m_file, buf, offset, n) +#endif + +#ifdef UNIV_PFS_IO + #define os_file_set_eof_at(file, new_len) \ + os_file_set_eof_at_pfs(file, new_len) +#else + #define os_file_set_eof_at(file, new_len) \ + os_file_set_eof_at_pfs(file.m_file, new_len) +#endif + +#ifdef HAVE_POSIX_FALLOCATE +#ifdef UNIV_PFS_IO + #define os_file_allocate(file, offset, len) \ + os_file_allocate_pfs(file, offset, len) +#else + #define os_file_allocate(file, offset, len) \ + os_file_allocate_pfs(file.m_file, offset, len) +#endif +#endif + /* File types for directory entry data type */ enum os_file_type_t { @@ -536,7 +680,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INTERN -os_file_t +pfs_os_file_t os_file_create_simple_no_error_handling_func( /*=========================================*/ const char* name, /*!< in: name of the file or path as a @@ -551,9 +695,10 @@ ibool* success)/*!< out: TRUE if succeed, FALSE if error */ MY_ATTRIBUTE((nonnull, warn_unused_result)); /****************************************************************//** -Tries to disable OS caching on an opened file descriptor. */ +Tries to disable OS caching on an opened file descriptor. +@return true if operation is success and false otherwise */ UNIV_INTERN -void +bool os_file_set_nocache( /*================*/ int fd, /*!< in: file descriptor to alter */ @@ -568,7 +713,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INTERN -os_file_t +pfs_os_file_t os_file_create_func( /*================*/ const char* name, /*!< in: name of the file or path as a @@ -627,6 +772,42 @@ os_file_close_func( /*===============*/ os_file_t file); /*!< in, own: handle to a file */ +/***********************************************************************//** +NOTE! Use the corresponding macro os_file_close(), not directly this +function! +Closes a file handle. In case of error, error number can be retrieved with +os_file_get_last_error. +@return TRUE if success */ +UNIV_INTERN +bool +os_file_close_no_error_handling_func( +/*===============*/ + os_file_t file); /*!< in, own: handle to a file */ + +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_set_eof_at(), not +directly this function! +Truncates a file at the specified position. +@return TRUE if success */ +UNIV_INTERN +bool +os_file_set_eof_at_func( + os_file_t file, /*!< in: handle to a file */ + ib_uint64_t new_len);/*!< in: new file length */ + +#ifdef HAVE_POSIX_FALLOCATE +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_allocate(), not +directly this function! +Ensures that disk space is allocated for the file. +@return TRUE if success */ +UNIV_INTERN +bool +os_file_allocate_func( + os_file_t file, /*!< in, own: handle to a file */ + os_offset_t offset, /*!< in: file region offset */ + os_offset_t len); /*!< in: file region length */ +#endif #ifdef UNIV_PFS_IO /****************************************************************//** @@ -637,7 +818,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INLINE -os_file_t +pfs_os_file_t pfs_os_file_create_simple_func( /*===========================*/ mysql_pfs_key_t key, /*!< in: Performance Schema Key */ @@ -660,7 +841,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INLINE -os_file_t +pfs_os_file_t pfs_os_file_create_simple_no_error_handling_func( /*=============================================*/ mysql_pfs_key_t key, /*!< in: Performance Schema Key */ @@ -684,7 +865,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INLINE -os_file_t +pfs_os_file_t pfs_os_file_create_func( /*====================*/ mysql_pfs_key_t key, /*!< in: Performance Schema Key */ @@ -713,7 +894,20 @@ ibool pfs_os_file_close_func( /*===================*/ - os_file_t file, /*!< in, own: handle to a file */ + pfs_os_file_t file, /*!< in, own: handle to a file */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line);/*!< in: line where the func invoked */ +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_close_no_error_handling(), +not directly this function! +A performance schema instrumented wrapper function for +os_file_close_no_error_handling(). +@return TRUE if success */ +UNIV_INLINE +bool +pfs_os_file_close_no_error_handling_func( +/*===================*/ + pfs_os_file_t file, /*!< in, own: handle to a file */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ /*******************************************************************//** @@ -726,7 +920,7 @@ ibool pfs_os_file_read_func( /*==================*/ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ ulint n, /*!< in: number of bytes to read */ @@ -745,7 +939,7 @@ ibool pfs_os_file_read_no_error_handling_func( /*====================================*/ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ ulint n, /*!< in: number of bytes to read */ @@ -766,7 +960,7 @@ ulint mode, /*!< in: OS_AIO_NORMAL etc. I/O mode */ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read or from which to write */ os_offset_t offset, /*!< in: file offset where to read or write */ @@ -795,7 +989,7 @@ /*===================*/ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ const void* buf, /*!< in: buffer from which to write */ os_offset_t offset, /*!< in: file offset where to write */ ulint n, /*!< in: number of bytes to write */ @@ -812,7 +1006,7 @@ ibool pfs_os_file_flush_func( /*===================*/ - os_file_t file, /*!< in, own: handle to a file */ + pfs_os_file_t file, /*!< in, own: handle to a file */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ @@ -864,16 +1058,66 @@ string */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ + +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_set_eof_at(), not +directly this function! +This is the performance schema instrumented wrapper function for +os_file_set_eof_at() +@return TRUE if success */ +UNIV_INLINE +bool +pfs_os_file_set_eof_at_func( + pfs_os_file_t file, /*!< in: handle to a file */ + ib_uint64_t new_len,/*!< in: new file length */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line);/*!< in: line where the func invoked */ + +#ifdef HAVE_POSIX_FALLOCATE +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_allocate(), not +directly this function! +Ensures that disk space is allocated for the file. +@return TRUE if success */ +UNIV_INLINE +bool +pfs_os_file_allocate_func( + pfs_os_file_t file, /*!< in, own: handle to a file */ + os_offset_t offset, /*!< in: file region offset */ + os_offset_t len, /*!< in: file region length */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line);/*!< in: line where the func invoked */ +#endif + #endif /* UNIV_PFS_IO */ /***********************************************************************//** -Closes a file handle. -@return TRUE if success */ +Checks if the file is marked as invalid. +@return TRUE if invalid */ UNIV_INTERN -ibool -os_file_close_no_error_handling( -/*============================*/ - os_file_t file); /*!< in, own: handle to a file */ +bool +os_file_is_invalid( + pfs_os_file_t file); /*!< in, own: handle to a file */ + +/***********************************************************************//** +Marks the file as invalid. */ +UNIV_INTERN +void +os_file_mark_invalid( + pfs_os_file_t* file); /*!< out: pointer to a handle to a file */ + +/***********************************************************************//** +Announces an intention to access file data in a specific pattern in the +future. +@return TRUE if success */ +UNIV_INTERN +bool +os_file_advise( + pfs_os_file_t file, /*!< in, own: handle to a file */ + os_offset_t offset, /*!< in: file region offset */ + os_offset_t len, /*!< in: file region length */ + ulint advice);/*!< in: advice for access pattern */ + /***********************************************************************//** Gets a file size. @return file size, or (os_offset_t) -1 on failure */ @@ -881,7 +1125,7 @@ os_offset_t os_file_get_size( /*=============*/ - os_file_t file) /*!< in: handle to a file */ + pfs_os_file_t file) /*!< in: handle to a file */ MY_ATTRIBUTE((warn_unused_result)); /***********************************************************************//** Write the specified number of zeros to a newly created file. @@ -892,7 +1136,7 @@ /*=============*/ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ os_offset_t size) /*!< in: file size */ MY_ATTRIBUTE((nonnull, warn_unused_result)); /***********************************************************************//** @@ -904,14 +1148,6 @@ /*============*/ FILE* file); /*!< in: file to be truncated */ /***********************************************************************//** -Truncates a file at the specified position. -@return TRUE if success */ -UNIV_INTERN -ibool -os_file_set_eof_at( - os_file_t file, /*!< in: handle to a file */ - ib_uint64_t new_len);/*!< in: new file length */ -/***********************************************************************//** NOTE! Use the corresponding macro os_file_flush(), not directly this function! Flushes the write buffers of a given file to the disk. @return TRUE if success */ @@ -1139,7 +1375,7 @@ caution! */ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read or from which to write */ os_offset_t offset, /*!< in: file offset where to read or write */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0file.ic percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/os0file.ic --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0file.ic 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/os0file.ic 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2010, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2010, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -34,7 +34,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INLINE -os_file_t +pfs_os_file_t pfs_os_file_create_simple_func( /*===========================*/ mysql_pfs_key_t key, /*!< in: Performance Schema Key */ @@ -47,7 +47,7 @@ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ { - os_file_t file; + pfs_os_file_t file; struct PSI_file_locker* locker = NULL; PSI_file_locker_state state; @@ -58,11 +58,13 @@ : PSI_FILE_OPEN), name, src_file, src_line); - file = os_file_create_simple_func(name, create_mode, + file.m_file = os_file_create_simple_func(name, create_mode, access_type, success); + file.m_psi = NULL; - /* Regsiter the returning "file" value with the system */ - register_pfs_file_open_end(locker, file); + /* Regsiter psi value for the file */ + register_pfs_file_open_end(locker, file, + (*success == TRUE ? success : 0)); return(file); } @@ -76,7 +78,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INLINE -os_file_t +pfs_os_file_t pfs_os_file_create_simple_no_error_handling_func( /*=============================================*/ mysql_pfs_key_t key, /*!< in: Performance Schema Key */ @@ -91,7 +93,7 @@ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ { - os_file_t file; + pfs_os_file_t file; struct PSI_file_locker* locker = NULL; PSI_file_locker_state state; @@ -104,8 +106,10 @@ file = os_file_create_simple_no_error_handling_func( name, create_mode, access_type, success); + file.m_psi = NULL; - register_pfs_file_open_end(locker, file); + register_pfs_file_open_end(locker, file, + (*success == TRUE ? success : 0)); return(file); } @@ -118,7 +122,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INLINE -os_file_t +pfs_os_file_t pfs_os_file_create_func( /*====================*/ mysql_pfs_key_t key, /*!< in: Performance Schema Key */ @@ -137,7 +141,7 @@ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ { - os_file_t file; + pfs_os_file_t file; struct PSI_file_locker* locker = NULL; PSI_file_locker_state state; @@ -149,8 +153,10 @@ name, src_file, src_line); file = os_file_create_func(name, create_mode, purpose, type, success); + file.m_psi = NULL; - register_pfs_file_open_end(locker, file); + register_pfs_file_open_end(locker, file, + (*success == TRUE ? success : 0)); return(file); } @@ -164,7 +170,7 @@ ibool pfs_os_file_close_func( /*===================*/ - os_file_t file, /*!< in, own: handle to a file */ + pfs_os_file_t file, /*!< in, own: handle to a file */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ { @@ -176,7 +182,35 @@ register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_CLOSE, src_file, src_line); - result = os_file_close_func(file); + result = os_file_close_func(file.m_file); + + register_pfs_file_io_end(locker, 0); + + return(result); +} +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_close_no_error_handling(), +not directly this function! +A performance schema instrumented wrapper function for +os_file_close_no_error_handling(). +@return TRUE if success */ +UNIV_INLINE +bool +pfs_os_file_close_no_error_handling_func( +/*===================*/ + pfs_os_file_t file, /*!< in, own: handle to a file */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line)/*!< in: line where the func invoked */ +{ + bool result; + struct PSI_file_locker* locker = NULL; + PSI_file_locker_state state; + + /* register the file close */ + register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_CLOSE, + src_file, src_line); + + result = os_file_close_no_error_handling_func(file.m_file); register_pfs_file_io_end(locker, 0); @@ -197,7 +231,7 @@ ulint mode, /*!< in: OS_AIO_NORMAL etc. I/O mode */ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read or from which to write */ os_offset_t offset, /*!< in: file offset where to read or write */ @@ -244,7 +278,7 @@ ibool pfs_os_file_read_func( /*==================*/ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ ulint n, /*!< in: number of bytes to read */ @@ -259,7 +293,7 @@ register_pfs_file_io_begin(&state, locker, file, n, PSI_FILE_READ, src_file, src_line); - result = os_file_read_func(file, buf, offset, n, trx); + result = os_file_read_func(file.m_file, buf, offset, n, trx); register_pfs_file_io_end(locker, n); @@ -278,7 +312,7 @@ ibool pfs_os_file_read_no_error_handling_func( /*====================================*/ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read */ os_offset_t offset, /*!< in: file offset where to read */ ulint n, /*!< in: number of bytes to read */ @@ -292,13 +326,50 @@ register_pfs_file_io_begin(&state, locker, file, n, PSI_FILE_READ, src_file, src_line); - result = os_file_read_no_error_handling_func(file, buf, offset, n); + result = os_file_read_no_error_handling_func(file.m_file, buf, offset, n); register_pfs_file_io_end(locker, n); return(result); } +/** NOTE! Please use the corresponding macro +os_file_read_no_error_handling_int_fd(), not directly this function! +This is the performance schema instrumented wrapper function for +os_file_read_no_error_handling_int_fd_func() which requests a +synchronous read operation. +@return TRUE if request was successful, FALSE if fail */ +UNIV_INLINE +ibool +pfs_os_file_read_no_error_handling_int_fd_func( + int file, /*!< in: handle to a file */ + void* buf, /*!< in: buffer where to read */ + os_offset_t offset, /*!< in: file offset where to read */ + ulint n, /*!< in: number of bytes to read */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line)/*!< in: line where the func invoked */ +{ + + PSI_file_locker_state state; + struct PSI_file_locker* locker = NULL; + + locker = PSI_FILE_CALL(get_thread_file_descriptor_locker)( + &state, file, PSI_FILE_READ); + if (locker != NULL) { + PSI_FILE_CALL(start_file_wait)( + locker, n, + __FILE__, __LINE__); + } + ibool result = os_file_read_no_error_handling_func( + OS_FILE_FROM_FD(file), buf, offset, n); + + if (locker != NULL) { + PSI_FILE_CALL(end_file_wait)(locker, n); + } + + return(result); +} + /*******************************************************************//** NOTE! Please use the corresponding macro os_file_write(), not directly this function! @@ -311,7 +382,7 @@ /*===================*/ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ const void* buf, /*!< in: buffer from which to write */ os_offset_t offset, /*!< in: file offset where to write */ ulint n, /*!< in: number of bytes to write */ @@ -325,13 +396,50 @@ register_pfs_file_io_begin(&state, locker, file, n, PSI_FILE_WRITE, src_file, src_line); - result = os_file_write_func(name, file, buf, offset, n); + result = os_file_write_func(name, file.m_file, buf, offset, n); register_pfs_file_io_end(locker, n); return(result); } +/** NOTE! Please use the corresponding macro os_file_write(), not +directly this function! +This is the performance schema instrumented wrapper function for +os_file_write() which requests a synchronous write operation. +@return TRUE if request was successful, FALSE if fail */ +UNIV_INLINE +ibool +pfs_os_file_write_int_fd_func( + const char* name, /*!< in: name of the file or path as a + null-terminated string */ + int file, /*!< in: handle to a file */ + const void* buf, /*!< in: buffer from which to write */ + os_offset_t offset, /*!< in: file offset where to write */ + ulint n, /*!< in: number of bytes to write */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line)/*!< in: line where the func invoked */ +{ + PSI_file_locker_state state; + struct PSI_file_locker* locker = NULL; + + locker = PSI_FILE_CALL(get_thread_file_descriptor_locker)( + &state, file, PSI_FILE_WRITE); + if (locker != NULL) { + PSI_FILE_CALL(start_file_wait)( + locker, n, + __FILE__, __LINE__); + } + ibool result = os_file_write_func( + name, OS_FILE_FROM_FD(file), buf, offset, n); + + if (locker != NULL) { + PSI_FILE_CALL(end_file_wait)(locker, n); + } + + return(result); +} + /***********************************************************************//** NOTE! Please use the corresponding macro os_file_flush(), not directly this function! @@ -342,7 +450,7 @@ ibool pfs_os_file_flush_func( /*===================*/ - os_file_t file, /*!< in, own: handle to a file */ + pfs_os_file_t file, /*!< in, own: handle to a file */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ { @@ -352,7 +460,7 @@ register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_SYNC, src_file, src_line); - result = os_file_flush_func(file); + result = os_file_flush_func(file.m_file); register_pfs_file_io_end(locker, 0); @@ -380,12 +488,12 @@ struct PSI_file_locker* locker = NULL; PSI_file_locker_state state; - register_pfs_file_open_begin(&state, locker, key, PSI_FILE_RENAME, newpath, + register_pfs_file_rename_begin(&state, locker, key, PSI_FILE_RENAME, newpath, src_file, src_line); result = os_file_rename_func(oldpath, newpath); - register_pfs_file_open_end(locker, 0); + register_pfs_file_rename_end(locker, 0); return(result); } @@ -449,4 +557,61 @@ return(result); } + +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_set_eof_at(), not +directly this function! +This is the performance schema instrumented wrapper function for +os_file_set_eof_at() +@return TRUE if success */ +UNIV_INLINE +bool +pfs_os_file_set_eof_at_func( + pfs_os_file_t file, /*!< in: handle to a file */ + ib_uint64_t new_len,/*!< in: new file length */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line)/*!< in: line where the func invoked */ +{ + bool result; + struct PSI_file_locker* locker = NULL; + PSI_file_locker_state state; + + register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_CHSIZE, + src_file, src_line); + result = os_file_set_eof_at_func(file.m_file, new_len); + + register_pfs_file_io_end(locker, 0); + + return(result); +} + +#ifdef HAVE_POSIX_FALLOCATE +/***********************************************************************//** +NOTE! Please use the corresponding macro os_file_allocate(), not +directly this function! +Ensures that disk space is allocated for the file. +@return TRUE if success */ +UNIV_INLINE +bool +pfs_os_file_allocate_func( + pfs_os_file_t file, /*!< in, own: handle to a file */ + os_offset_t offset, /*!< in: file region offset */ + os_offset_t len, /*!< in: file region length */ + const char* src_file,/*!< in: file name where func invoked */ + ulint src_line)/*!< in: line where the func invoked */ +{ + bool result; + struct PSI_file_locker* locker = NULL; + PSI_file_locker_state state; + + register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_CHSIZE, + src_file, src_line); + result = os_file_allocate_func(file.m_file, offset, len); + + register_pfs_file_io_end(locker, 0); + + return(result); +} +#endif + #endif /* UNIV_PFS_IO */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0thread.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/os0thread.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/os0thread.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/os0thread.h 2017-10-19 04:25:29.000000000 +0000 @@ -131,11 +131,9 @@ os_thread_id_t* thread_id); /*!< out: id of the created thread, or NULL */ -/** -Waits until the specified thread completes and joins it. Its return value is -ignored. - -@param thread thread to join */ +/** Waits until the specified thread completes and joins it. +Its return value is ignored. +@param[in,out] thread thread to join */ UNIV_INTERN void os_thread_join( diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/page0page.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/page0page.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/page0page.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/page0page.h 2017-10-19 04:25:29.000000000 +0000 @@ -235,8 +235,7 @@ page_header_get_offs( /*=================*/ const page_t* page, /*!< in: page */ - ulint field) /*!< in: PAGE_FREE, ... */ - MY_ATTRIBUTE((nonnull, pure)); + ulint field); /*!< in: PAGE_FREE, ... */ /*************************************************************//** Returns the pointer stored in the given header field, or NULL. */ @@ -528,7 +527,7 @@ page_is_leaf( /*=========*/ const page_t* page) /*!< in: page */ - MY_ATTRIBUTE((nonnull, pure)); + MY_ATTRIBUTE((warn_unused_result)); /************************************************************//** Determine whether the page is empty. @return true if the page is empty (PAGE_N_RECS = 0) */ @@ -849,8 +848,7 @@ buf_block_t* block, /*!< in: index page containing rec */ rec_t* rec, /*!< in: record on page */ dict_index_t* index, /*!< in: record descriptor */ - mtr_t* mtr) /*!< in: mtr */ - MY_ATTRIBUTE((nonnull)); + mtr_t* mtr); /*!< in: mtr */ /*************************************************************//** Copies records from page to new_page, up to the given record, NOT including that record. Infimum and supremum records are not copied. @@ -871,8 +869,7 @@ buf_block_t* block, /*!< in: index page containing rec */ rec_t* rec, /*!< in: record on page */ dict_index_t* index, /*!< in: record descriptor */ - mtr_t* mtr) /*!< in: mtr */ - MY_ATTRIBUTE((nonnull)); + mtr_t* mtr); /*!< in: mtr */ /*************************************************************//** Deletes records from a page from a given record onward, including that record. The infimum and supremum records are not deleted. */ @@ -921,8 +918,7 @@ buf_block_t* block, /*!< in: index page from where to move */ rec_t* split_rec, /*!< in: first record to move */ dict_index_t* index, /*!< in: record descriptor */ - mtr_t* mtr) /*!< in: mtr */ - MY_ATTRIBUTE((nonnull(1, 2, 4, 5))); + mtr_t* mtr); /*!< in: mtr */ /*************************************************************//** Moves record list start to another page. Moved records do not include split_rec. @@ -952,8 +948,7 @@ page_t* page, /*!< in: index page */ 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 */ - MY_ATTRIBUTE((nonnull(1))); + ulint slot_no);/*!< in: the directory slot */ /*************************************************************//** Tries to balance the given directory slot with too few records with the upper neighbor, so that there are at least the minimum number @@ -965,8 +960,7 @@ /*==================*/ 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 */ - MY_ATTRIBUTE((nonnull(1))); + ulint slot_no);/*!< in: the directory slot */ /**********************************************************//** Parses a log record of a record list end or start deletion. @return end of log record or NULL */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/page0zip.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/page0zip.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/page0zip.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/page0zip.h 2017-10-19 04:25:29.000000000 +0000 @@ -132,7 +132,7 @@ dict_index_t* index, /*!< in: index of the B-tree node */ ulint level, /*!< in: compression level */ mtr_t* mtr) /*!< in: mini-transaction, or NULL */ - MY_ATTRIBUTE((nonnull(1,2,3))); + MY_ATTRIBUTE((warn_unused_result)); /**********************************************************************//** Decompress a page. This function should tolerate errors on the compressed @@ -424,8 +424,7 @@ out: data, n_blobs, m_start, m_end, m_nonempty */ dict_index_t* index, /*!< in: index of the B-tree node */ - mtr_t* mtr) /*!< in: mini-transaction */ - MY_ATTRIBUTE((nonnull)); + mtr_t* mtr); /*!< in: mini-transaction */ #ifndef UNIV_HOTBACKUP /**********************************************************************//** Copy the records of a page byte for byte. Do not copy the page header @@ -458,7 +457,7 @@ byte* end_ptr,/*!< in: buffer end */ page_t* page, /*!< out: uncompressed page */ page_zip_des_t* page_zip)/*!< out: compressed page */ - MY_ATTRIBUTE((nonnull(1,2))); + MY_ATTRIBUTE((warn_unused_result)); #endif /* !UNIV_INNOCHECKSUM */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/rem0rec.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/rem0rec.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/rem0rec.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/rem0rec.h 2017-10-19 04:25:29.000000000 +0000 @@ -747,8 +747,7 @@ /*=====*/ void* buf, /*!< in: buffer */ const rec_t* rec, /*!< in: physical record */ - const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ - MY_ATTRIBUTE((nonnull)); + const ulint* offsets);/*!< in: array returned by rec_get_offsets() */ #ifndef UNIV_HOTBACKUP /**********************************************************//** Determines the size of a data tuple prefix in a temporary file. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/row0mysql.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/row0mysql.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/row0mysql.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/row0mysql.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -681,6 +681,12 @@ Innobase record in the current index; not defined if template_type is ROW_MYSQL_WHOLE_ROW */ + bool rec_field_is_prefix; /* is this field in a prefix index? */ + ulint rec_prefix_field_no; /* record field, even if just a + prefix; same as rec_field_no when not a + prefix, otherwise rec_field_no is + ULINT_UNDEFINED but this is the true + field number*/ ulint clust_rec_field_no; /*!< field number of the column in an Innobase record in the clustered index; not defined if template_type is @@ -729,6 +735,8 @@ #define ROW_PREBUILT_ALLOCATED 78540783 #define ROW_PREBUILT_FREED 26423527 +class ha_innobase; + /** A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; these are used to save CPU time. */ @@ -784,7 +792,9 @@ columns through a secondary index and at least one column is not in the secondary index, then this is - set to TRUE */ + set to TRUE; note that sometimes this + is set but we later optimize out the + clustered index lookup */ unsigned templ_contains_blob:1;/*!< TRUE if the template contains a column with DATA_BLOB == get_innobase_type_from_mysql_type(); @@ -798,6 +808,8 @@ mem_heap_t* heap; /*!< memory heap from which these auxiliary structures are allocated when needed */ + mem_heap_t* cursor_heap; /*!< memory heap from which + innodb_api_buf is allocated per session*/ ins_node_t* ins_node; /*!< Innobase SQL insert node used to perform inserts to the table */ @@ -950,6 +962,9 @@ unsigned innodb_api:1; /*!< whether this is a InnoDB API query */ const rec_t* innodb_api_rec; /*!< InnoDB API search result */ + void* innodb_api_buf; /*!< Buffer holding copy of the physical + Innodb API search record */ + ulint innodb_api_rec_size; /*!< Size of the Innodb API record */ byte* srch_key_val1; /*!< buffer used in converting search key values from MySQL format to InnoDB format.*/ @@ -958,6 +973,12 @@ to InnoDB format.*/ uint srch_key_val_len; /*!< Size of search key */ + /** MySQL handler object. */ + ha_innobase* mysql_handler; + + /** True if exceeded the end_range while filling the prefetch cache. */ + bool end_range; + }; /** Callback for row_mysql_sys_index_iterate() */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/row0sel.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/row0sel.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/row0sel.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/row0sel.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -205,6 +205,18 @@ when data != NULL */ }; +/** Copy used fields from cached row. +Copy cache record field by field, don't touch fields that +are not covered by current key. +@param[out] buf Where to copy the MySQL row. +@param[in] cached_rec What to copy (in MySQL row format). +@param[in] prebuilt prebuilt struct. */ +void +row_sel_copy_cached_fields_for_mysql( + byte* buf, + const byte* cached_rec, + row_prebuilt_t* prebuilt); + /** Query plan */ struct plan_t{ dict_table_t* table; /*!< table struct in the dictionary diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/row0upd.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/row0upd.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/row0upd.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/row0upd.h 2017-10-19 04:25:29.000000000 +0000 @@ -248,9 +248,8 @@ /*!< in: if TRUE, limit the replacement to ordering fields of index; note that this does not work for non-clustered indexes. */ - mem_heap_t* heap) /*!< in: memory heap for allocating and + mem_heap_t* heap); /*!< in: memory heap for allocating and copying the new values */ - MY_ATTRIBUTE((nonnull)); /***********************************************************//** Replaces the new column values stored in the update vector to the index entry given. */ @@ -311,7 +310,7 @@ compile time */ const row_ext_t*ext) /*!< NULL, or prefixes of the externally stored columns in the old row */ - MY_ATTRIBUTE((nonnull(1,2), warn_unused_result)); + MY_ATTRIBUTE((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) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/srv0srv.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/srv0srv.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/srv0srv.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/srv0srv.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, 2009, Google Inc. Copyright (c) 2009, Percona Inc. @@ -422,6 +422,7 @@ extern my_bool srv_stats_persistent; extern unsigned long long srv_stats_persistent_sample_pages; extern my_bool srv_stats_auto_recalc; +extern my_bool srv_stats_include_delete_marked; extern ibool srv_use_doublewrite_buf; extern ulong srv_doublewrite_batch_size; @@ -591,6 +592,11 @@ extern my_bool srv_cmp_per_index_enabled; +/** Number of times secondary index lookup triggered cluster lookup */ +extern ulint srv_sec_rec_cluster_reads; +/** Number of times prefix optimization avoided triggering cluster lookup */ +extern ulint srv_sec_rec_cluster_reads_avoided; + /** Status variables to be passed to MySQL */ extern struct export_var_t export_vars; @@ -976,6 +982,13 @@ srv_purge_wakeup(void); /*==================*/ +/** Check whether given space id is undo tablespace id +@param[in] space_id space id to check +@return true if it is undo tablespace else false. */ +bool +srv_is_undo_tablespace( + ulint space_id); + /** Status variables to be passed to MySQL */ struct export_var_t{ ulint innodb_adaptive_hash_hash_searches; @@ -1088,6 +1101,9 @@ #endif /* UNIV_DEBUG */ ulint innodb_column_compressed; /*!< srv_column_compressed */ ulint innodb_column_decompressed; /*!< srv_column_decompressed */ + + ulint innodb_sec_rec_cluster_reads; /*!< srv_sec_rec_cluster_reads */ + ulint innodb_sec_rec_cluster_reads_avoided; /*!< srv_sec_rec_cluster_reads_avoided */ }; /** Thread slot in the thread table. */ @@ -1137,4 +1153,12 @@ thread */ #endif /* WITH_WSREP */ +#ifndef DBUG_OFF +/** false before InnoDB monitor has been printed at least once, true +afterwards */ +extern bool srv_debug_monitor_printed; +#else +#define srv_debug_monitor_printed false +#endif + #endif diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/srv0start.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/srv0start.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/srv0start.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/srv0start.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -139,6 +139,8 @@ /** TRUE if a raw partition is in use */ extern ibool srv_start_raw_disk_in_use; +/** Undo tablespaces starts with space_id. */ +extern ulint srv_undo_space_id_start; /** Shutdown state */ enum srv_shutdown_state { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/trx0trx.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/trx0trx.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/trx0trx.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/trx0trx.h 2017-10-19 04:25:29.000000000 +0000 @@ -105,7 +105,7 @@ trx_free_prepared( /*==============*/ trx_t* trx) /*!< in, own: trx object */ - UNIV_COLD MY_ATTRIBUTE((nonnull)); + UNIV_COLD; /********************************************************************//** Frees a transaction object for MySQL. */ UNIV_INTERN @@ -346,6 +346,23 @@ or 0 to use the default max length */ MY_ATTRIBUTE((nonnull)); +#ifdef WITH_WSREP +/**********************************************************************//** +Prints info about a transaction. +Transaction information may be retrieved without having trx_sys->mutex acquired +so it may not be completely accurate. The caller must own lock_sys->mutex +and the trx must have some locks to make sure that it does not escape +without locking lock_sys->mutex. */ +UNIV_INTERN +void +wsrep_trx_print_locking( +/*==============*/ + FILE* f, /*!< in: output stream */ + const trx_t* trx, /*!< in: transaction */ + ulint max_query_len) /*!< in: max query length to print, + or 0 to use the default max length */ + MY_ATTRIBUTE((nonnull)); +#endif /* WITH_WSREP */ /**********************************************************************//** Prints info about a transaction. Acquires and releases lock_sys->mutex and trx_sys->mutex. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/trx0xa.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/trx0xa.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/trx0xa.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/trx0xa.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -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 @@ -24,6 +24,8 @@ #ifndef XA_H #define XA_H +#include "xa.h" + /* * Transaction branch identification: XID and NULLXID: */ @@ -35,17 +37,6 @@ #define MAXGTRIDSIZE 64 /*!< maximum size in bytes of gtrid */ #define MAXBQUALSIZE 64 /*!< maximum size in bytes of bqual */ -/** X/Open XA distributed transaction identifier */ -struct xid_t { - long formatID; /*!< format identifier; -1 - means that the XID is null */ - long gtrid_length; /*!< value from 1 through 64 */ - long bqual_length; /*!< value from 1 through 64 */ - char data[XIDDATASIZE]; /*!< distributed transaction - identifier */ -}; -/** X/Open XA distributed transaction identifier */ -typedef struct xid_t XID; #endif /** X/Open XA distributed transaction status codes */ /* @{ */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/univ.i percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/univ.i --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/include/univ.i 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/include/univ.i 2017-10-19 04:25:29.000000000 +0000 @@ -47,7 +47,7 @@ #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 79.1 +#define PERCONA_INNODB_VERSION 82.2 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ @@ -145,14 +145,8 @@ #if defined HAVE_PSI_INTERFACE && !defined UNIV_HOTBACKUP # define UNIV_PFS_MUTEX # define UNIV_PFS_RWLOCK -/* For I/O instrumentation, performance schema rely -on a native descriptor to identify the file, this -descriptor could conflict with our OS level descriptor. -Disable IO instrumentation on Windows until this is -resolved */ -# ifndef __WIN__ -# define UNIV_PFS_IO -# endif + +# define UNIV_PFS_IO # define UNIV_PFS_THREAD /* There are mutexes/rwlocks that we want to exclude from diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/lock/lock0lock.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/lock/lock0lock.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/lock/lock0lock.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/lock/lock0lock.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1669,7 +1669,7 @@ else fputs("\n*** Victim TRANSACTION:\n", stderr); - trx_print_latched(stderr, trx, 3000); + wsrep_trx_print_locking(stderr, trx, 3000); if (bf_other) fputs("\n*** Priority TRANSACTION:\n", @@ -1677,7 +1677,7 @@ else fputs("\n*** Victim TRANSACTION:\n", stderr); - trx_print_latched(stderr, lock->trx, 3000); + wsrep_trx_print_locking(stderr, lock->trx, 3000); fputs("*** WAITING FOR THIS LOCK TO BE GRANTED:\n", stderr); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/log/log0log.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/log/log0log.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/log/log0log.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/log/log0log.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -2627,7 +2627,7 @@ /*==============*/ log_group_t* group) /*!< in: log group */ { - os_file_t file_handle; + pfs_os_file_t file_handle; lsn_t start_lsn; lsn_t end_lsn; char name[OS_FILE_MAX_PATH]; @@ -3499,6 +3499,7 @@ before proceeding further. */ srv_shutdown_state = SRV_SHUTDOWN_FLUSH_PHASE; count = 0; + os_rmb; while (buf_page_cleaner_is_active || buf_lru_manager_is_active) { if (srv_print_verbose_log && count == 0) { ib_logf(IB_LOG_LEVEL_INFO, @@ -3510,6 +3511,7 @@ if (count > 600) { count = 0; } + os_rmb; } mutex_enter(&log_sys->mutex); @@ -3607,9 +3609,15 @@ lsn = log_sys->lsn; - if (lsn != log_sys->last_checkpoint_lsn - || (srv_track_changed_pages - && (tracked_lsn != log_sys->last_checkpoint_lsn)) + const bool is_last = + ((srv_force_recovery == SRV_FORCE_NO_LOG_REDO + && lsn == log_sys->last_checkpoint_lsn + + LOG_BLOCK_HDR_SIZE) + || lsn == log_sys->last_checkpoint_lsn) + && (!srv_track_changed_pages + || tracked_lsn == log_sys->last_checkpoint_lsn); + + if (!is_last #ifdef UNIV_LOG_ARCHIVE || (srv_log_archive_on && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE) @@ -3675,7 +3683,8 @@ ut_a(freed); ut_a(lsn == log_sys->lsn); - ut_ad(lsn == log_sys->last_checkpoint_lsn); + ut_ad(srv_force_recovery >= SRV_FORCE_NO_LOG_REDO + || lsn == log_sys->last_checkpoint_lsn); if (lsn < srv_start_lsn) { ib_logf(IB_LOG_LEVEL_ERROR, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/log/log0online.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/log/log0online.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/log/log0online.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/log/log0online.cc 2017-10-19 04:25:29.000000000 +0000 @@ -84,12 +84,14 @@ both the correct type and the tree does not mind its overwrite during rbt_next() tree traversal. */ - ib_mutex_t mutex; /*!< mutex protecting all the fields.*/ }; /* The log parsing and bitmap output struct instance */ static struct log_bitmap_struct* log_bmp_sys; +/* Mutex protecting log_bmp_sys */ +static ib_mutex_t log_bmp_sys_mutex; + /** File name stem for bitmap files. */ static const char* bmp_file_name_stem = "ib_modified_log_"; @@ -181,28 +183,24 @@ ulint space, /*!mutex)); + ut_ad(mutex_own(&log_bmp_sys_mutex)); ut_a(space != ULINT_UNDEFINED); ut_a(page_no != ULINT_UNDEFINED); - block_start_page = page_no / MODIFIED_PAGE_BLOCK_ID_COUNT + ulint block_start_page = page_no / MODIFIED_PAGE_BLOCK_ID_COUNT * MODIFIED_PAGE_BLOCK_ID_COUNT; - block_pos = block_start_page ? (page_no % block_start_page / 8) + ulint block_pos = block_start_page ? (page_no % block_start_page / 8) : (page_no / 8); - bit_pos = page_no % 8; + uint bit_pos = page_no % 8; + byte search_page[MODIFIED_PAGE_BLOCK_SIZE]; mach_write_to_4(search_page + MODIFIED_PAGE_SPACE_ID, space); mach_write_to_4(search_page + MODIFIED_PAGE_1ST_PAGE_ID, block_start_page); + byte *page_ptr; + ib_rbt_bound_t tree_search_pos; if (!rbt_search(log_bmp_sys->modified_pages, &tree_search_pos, search_page)) { page_ptr = rbt_value(byte, tree_search_pos.last); @@ -338,7 +336,7 @@ lsn_t result; os_offset_t read_offset = log_bmp_sys->out.offset; - while (!checksum_ok && read_offset > 0 && !is_last_page) + while ((!checksum_ok || !is_last_page) && read_offset > 0) { read_offset -= MODIFIED_PAGE_BLOCK_SIZE; log_bmp_sys->out.offset = read_offset; @@ -566,9 +564,9 @@ lsn_t next_file_start_lsn) /*!out.file != os_file_invalid) { + if (!os_file_is_invalid(log_bmp_sys->out.file)) { os_file_close(log_bmp_sys->out.file); - log_bmp_sys->out.file = os_file_invalid; + os_file_mark_invalid(&log_bmp_sys->out.file); } log_bmp_sys->out_seq_num++; log_online_make_bitmap_name(next_file_start_lsn); @@ -604,12 +602,19 @@ && (!strcmp(stem, bmp_file_name_stem))); } -/*********************************************************************//** -Initialize the online log following subsytem. */ +/** Initialize the constant part of the log tracking subsystem */ +UNIV_INTERN +void +log_online_init(void) +{ + mutex_create(log_bmp_sys_mutex_key, &log_bmp_sys_mutex, + SYNC_LOG_ONLINE); +} + +/** Initialize the dynamic part of the log tracking subsystem */ UNIV_INTERN void log_online_read_init(void) -/*======================*/ { ibool success; lsn_t tracking_start_lsn @@ -633,9 +638,6 @@ log_bmp_sys->read_buf = static_cast (ut_align(log_bmp_sys->read_buf_ptr, OS_FILE_LOG_BLOCK_SIZE)); - mutex_create(log_bmp_sys_mutex_key, &log_bmp_sys->mutex, - SYNC_LOG_ONLINE); - /* Initialize bitmap file directory from srv_data_home and add a path separator if needed. */ srv_data_home_len = strlen(srv_data_home); @@ -734,7 +736,11 @@ } last_tracked_lsn = log_online_read_last_tracked_lsn(); + /* Do not rotate if we truncated the file to zero length - we + can just start writing there */ + const bool need_rotate = (last_tracked_lsn != 0); if (!last_tracked_lsn) { + last_tracked_lsn = last_file_start_lsn; } @@ -746,7 +752,10 @@ } else { file_start_lsn = tracking_start_lsn; } - if (!log_online_rotate_bitmap_file(file_start_lsn)) { + + if (need_rotate + && !log_online_rotate_bitmap_file(file_start_lsn)) { + exit(1); } @@ -775,18 +784,20 @@ log_set_tracked_lsn(tracking_start_lsn); } -/*********************************************************************//** -Shut down the online log following subsystem. */ +/** Shut down the dynamic part of the log tracking subsystem */ UNIV_INTERN void log_online_read_shutdown(void) -/*==========================*/ { + mutex_enter(&log_bmp_sys_mutex); + + srv_track_changed_pages = FALSE; + ib_rbt_node_t *free_list_node = log_bmp_sys->page_free_list; - if (log_bmp_sys->out.file != os_file_invalid) { + if (!os_file_is_invalid(log_bmp_sys->out.file)) { os_file_close(log_bmp_sys->out.file); - log_bmp_sys->out.file = os_file_invalid; + os_file_mark_invalid(&log_bmp_sys->out.file); } rbt_free(log_bmp_sys->modified_pages); @@ -797,10 +808,21 @@ free_list_node = next; } - mutex_free(&log_bmp_sys->mutex); - ut_free(log_bmp_sys->read_buf_ptr); ut_free(log_bmp_sys); + log_bmp_sys = NULL; + + srv_redo_log_thread_started = false; + + mutex_exit(&log_bmp_sys_mutex); +} + +/** Shut down the constant part of the log tracking subsystem */ +UNIV_INTERN +void +log_online_shutdown(void) +{ + mutex_free(&log_bmp_sys_mutex); } /*********************************************************************//** @@ -846,13 +868,12 @@ log_online_parse_redo_log(void) /*===========================*/ { + ut_ad(mutex_own(&log_bmp_sys_mutex)); + byte *ptr = log_bmp_sys->parse_buf; byte *end = log_bmp_sys->parse_buf_end; - ulint len = 0; - ut_ad(mutex_own(&log_bmp_sys->mutex)); - while (ptr != end && log_bmp_sys->next_parse_lsn < log_bmp_sys->end_lsn) { @@ -934,6 +955,8 @@ ulint skip_len) /*!< in: how much of log data to skip */ { + ut_ad(mutex_own(&log_bmp_sys_mutex)); + ulint start_offset = skip_len ? skip_len : LOG_BLOCK_HDR_SIZE; ulint end_offset = (data_len == OS_FILE_LOG_BLOCK_SIZE) @@ -942,8 +965,6 @@ ulint actual_data_len = (end_offset >= start_offset) ? end_offset - start_offset : 0; - ut_ad(mutex_own(&log_bmp_sys->mutex)); - ut_memcpy(log_bmp_sys->parse_buf_end, log_block + start_offset, actual_data_len); @@ -966,11 +987,9 @@ log data should be skipped as they were parsed before */ { - ulint block_data_len; + ut_ad(mutex_own(&log_bmp_sys_mutex)); - ut_ad(mutex_own(&log_bmp_sys->mutex)); - - block_data_len = log_block_get_data_len(log_block); + ulint block_data_len = log_block_get_data_len(log_block); ut_ad(block_data_len % OS_FILE_LOG_BLOCK_SIZE == 0 || block_data_len < OS_FILE_LOG_BLOCK_SIZE); @@ -990,14 +1009,14 @@ lsn_t block_start_lsn, /*!< in: the LSN to read from */ lsn_t block_end_lsn) /*!< in: the LSN to read to */ { + ut_ad(mutex_own(&log_bmp_sys_mutex)); + /* Pointer to the current OS_FILE_LOG_BLOCK-sized chunk of the read log data to parse */ byte* log_block = log_bmp_sys->read_buf; byte* log_block_end = log_bmp_sys->read_buf + (block_end_lsn - block_start_lsn); - ut_ad(mutex_own(&log_bmp_sys->mutex)); - mutex_enter(&log_sys->mutex); log_group_read_log_seg(LOG_RECOVER, log_bmp_sys->read_buf, group, block_start_lsn, block_end_lsn, TRUE); @@ -1057,11 +1076,11 @@ lsn_t contiguous_lsn) /*!< in: the LSN of log block start containing the log_parse_start_lsn */ { + ut_ad(mutex_own(&log_bmp_sys_mutex)); + lsn_t block_start_lsn = contiguous_lsn; lsn_t block_end_lsn; - ut_ad(mutex_own(&log_bmp_sys->mutex)); - log_bmp_sys->next_parse_lsn = log_bmp_sys->start_lsn; log_bmp_sys->parse_buf_end = log_bmp_sys->parse_buf; @@ -1098,20 +1117,40 @@ /*=========================*/ const byte *block) /*!< in: block to write */ { - ibool success; - - ut_ad(srv_track_changed_pages); - ut_ad(mutex_own(&log_bmp_sys->mutex)); + ut_ad(mutex_own(&log_bmp_sys_mutex)); /* Simulate a write error */ DBUG_EXECUTE_IF("bitmap_page_write_error", - ib_logf(IB_LOG_LEVEL_ERROR, - "simulating bitmap write error in " - "log_online_write_bitmap_page"); - return FALSE;); + { + ulint space_id + = mach_read_from_4(block + + MODIFIED_PAGE_SPACE_ID); + if (space_id > 0) { + ib_logf(IB_LOG_LEVEL_ERROR, + "simulating bitmap write " + "error in " + "log_online_write_bitmap_page " + "for space ID %lu", + space_id); + return FALSE; + } + }); - success = os_file_write(log_bmp_sys->out.name, log_bmp_sys->out.file, - block, log_bmp_sys->out.offset, + /* A crash injection site that ensures last checkpoint LSN > last + tracked LSN, so that LSN tracking for this interval is tested. */ + DBUG_EXECUTE_IF("crash_before_bitmap_write", + { + ulint space_id + = mach_read_from_4(block + + MODIFIED_PAGE_SPACE_ID); + if (space_id > 0) + DBUG_SUICIDE(); + }); + + + ibool success = os_file_write(log_bmp_sys->out.name, + log_bmp_sys->out.file, block, + log_bmp_sys->out.offset, MODIFIED_PAGE_BLOCK_SIZE); if (UNIV_UNLIKELY(!success)) { @@ -1132,10 +1171,8 @@ return FALSE; } -#ifdef UNIV_LINUX - posix_fadvise(log_bmp_sys->out.file, log_bmp_sys->out.offset, - MODIFIED_PAGE_BLOCK_SIZE, POSIX_FADV_DONTNEED); -#endif + os_file_advise(log_bmp_sys->out.file, log_bmp_sys->out.offset, + MODIFIED_PAGE_BLOCK_SIZE, OS_FILE_ADVISE_DONTNEED); log_bmp_sys->out.offset += MODIFIED_PAGE_BLOCK_SIZE; return TRUE; @@ -1151,11 +1188,7 @@ log_online_write_bitmap(void) /*=========================*/ { - ib_rbt_node_t *bmp_tree_node; - const ib_rbt_node_t *last_bmp_tree_node; - ibool success = TRUE; - - ut_ad(mutex_own(&log_bmp_sys->mutex)); + ut_ad(mutex_own(&log_bmp_sys_mutex)); if (log_bmp_sys->out.offset >= srv_max_bitmap_file_size) { if (!log_online_rotate_bitmap_file(log_bmp_sys->start_lsn)) { @@ -1163,9 +1196,12 @@ } } - bmp_tree_node = (ib_rbt_node_t *) - rbt_first(log_bmp_sys->modified_pages); - last_bmp_tree_node = rbt_last(log_bmp_sys->modified_pages); + ib_rbt_node_t *bmp_tree_node + = (ib_rbt_node_t *)rbt_first(log_bmp_sys->modified_pages); + const ib_rbt_node_t * const last_bmp_tree_node + = rbt_last(log_bmp_sys->modified_pages); + + ibool success = TRUE; while (bmp_tree_node) { @@ -1198,9 +1234,11 @@ rbt_next(log_bmp_sys->modified_pages, bmp_tree_node); DBUG_EXECUTE_IF("bitmap_page_2_write_error", - ut_ad(bmp_tree_node); /* 2nd page must exist */ - DBUG_SET("+d,bitmap_page_write_error"); - DBUG_SET("-d,bitmap_page_2_write_error");); + if (bmp_tree_node) + { + DBUG_SET("+d,bitmap_page_write_error"); + DBUG_SET("-d,bitmap_page_2_write_error"); + }); } rbt_reset(log_bmp_sys->modified_pages); @@ -1221,10 +1259,19 @@ log_group_t* group; ibool result; - ut_ad(srv_track_changed_pages); ut_ad(!srv_read_only_mode); - mutex_enter(&log_bmp_sys->mutex); + if (!srv_track_changed_pages) + return TRUE; + + DEBUG_SYNC_C("log_online_follow_redo_log"); + + mutex_enter(&log_bmp_sys_mutex); + + if (!srv_track_changed_pages) { + mutex_exit(&log_bmp_sys_mutex); + return TRUE; + } /* Grab the LSN of the last checkpoint, we will parse up to it */ mutex_enter(&(log_sys->mutex)); @@ -1232,7 +1279,7 @@ mutex_exit(&(log_sys->mutex)); if (log_bmp_sys->end_lsn == log_bmp_sys->start_lsn) { - mutex_exit(&log_bmp_sys->mutex); + mutex_exit(&log_bmp_sys_mutex); return TRUE; } @@ -1247,15 +1294,11 @@ group = UT_LIST_GET_NEXT(log_groups, group); } - /* A crash injection site that ensures last checkpoint LSN > last - tracked LSN, so that LSN tracking for this interval is tested. */ - DBUG_EXECUTE_IF("crash_before_bitmap_write", DBUG_SUICIDE();); - result = log_online_write_bitmap(); log_bmp_sys->start_lsn = log_bmp_sys->end_lsn; log_set_tracked_lsn(log_bmp_sys->start_lsn); - mutex_exit(&log_bmp_sys->mutex); + mutex_exit(&log_bmp_sys_mutex); return result; } @@ -1520,10 +1563,8 @@ bitmap_file->size = os_file_get_size(bitmap_file->file); bitmap_file->offset = 0; -#ifdef UNIV_LINUX - posix_fadvise(bitmap_file->file, 0, 0, POSIX_FADV_SEQUENTIAL); - posix_fadvise(bitmap_file->file, 0, 0, POSIX_FADV_NOREUSE); -#endif + os_file_advise(bitmap_file->file, 0, 0, OS_FILE_ADVISE_SEQUENTIAL); + os_file_advise(bitmap_file->file, 0, 0, OS_FILE_ADVISE_NOREUSE); return TRUE; } @@ -1602,12 +1643,14 @@ { ut_a(i); + i->max_lsn = max_lsn; + if (UNIV_UNLIKELY(min_lsn > max_lsn)) { /* Empty range */ i->in_files.count = 0; i->in_files.files = NULL; - i->in.file = os_file_invalid; + os_file_mark_invalid(&i->in.file); i->page = NULL; i->failed = FALSE; return TRUE; @@ -1625,7 +1668,7 @@ if (i->in_files.count == 0) { /* Empty range */ - i->in.file = os_file_invalid; + os_file_mark_invalid(&i->in.file); i->page = NULL; i->failed = FALSE; return TRUE; @@ -1664,10 +1707,10 @@ { ut_a(i); - if (i->in.file != os_file_invalid) { + if (!os_file_is_invalid(i->in.file)) { os_file_close(i->in.file); - i->in.file = os_file_invalid; + os_file_mark_invalid(&i->in.file); } if (i->in_files.files) { @@ -1710,6 +1753,9 @@ return TRUE; } + if (i->end_lsn >= i->max_lsn && i->last_page_in_run) + return FALSE; + while (!checksum_ok) { while (i->in.size < MODIFIED_PAGE_BLOCK_SIZE @@ -1718,8 +1764,9 @@ /* Advance file */ i->in_i++; - success = os_file_close_no_error_handling(i->in.file); - i->in.file = os_file_invalid; + success = os_file_close_no_error_handling( + i->in.file); + os_file_mark_invalid(&i->in.file); if (UNIV_UNLIKELY(!success)) { os_file_get_last_error(TRUE); @@ -1805,15 +1852,21 @@ lsn = LSN_MAX; } + bool log_bmp_sys_inited = false; if (srv_redo_log_thread_started) { /* User requests might happen with both enabled and disabled tracking */ - mutex_enter(&log_bmp_sys->mutex); + log_bmp_sys_inited = true; + mutex_enter(&log_bmp_sys_mutex); + if (!srv_redo_log_thread_started) { + log_bmp_sys_inited = false; + mutex_exit(&log_bmp_sys_mutex); + } } if (!log_online_setup_bitmap_file_range(&bitmap_files, 0, LSN_MAX)) { - if (srv_redo_log_thread_started) { - mutex_exit(&log_bmp_sys->mutex); + if (log_bmp_sys_inited) { + mutex_exit(&log_bmp_sys_mutex); } return TRUE; } @@ -1822,7 +1875,7 @@ /* If we have to delete the current output file, close it first. */ os_file_close(log_bmp_sys->out.file); - log_bmp_sys->out.file = os_file_invalid; + os_file_mark_invalid(&log_bmp_sys->out.file); } for (i = 0; i < bitmap_files.count; i++) { @@ -1851,7 +1904,7 @@ } } - if (srv_redo_log_thread_started) { + if (log_bmp_sys_inited) { if (lsn > log_bmp_sys->end_lsn) { lsn_t new_file_lsn; if (lsn == LSN_MAX) { @@ -1867,7 +1920,7 @@ } } - mutex_exit(&log_bmp_sys->mutex); + mutex_exit(&log_bmp_sys_mutex); } free(bitmap_files.files); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/log/log0recv.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/log/log0recv.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/log/log0recv.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/log/log0recv.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2017, 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 @@ -324,6 +324,7 @@ /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); ut_ad(!srv_read_only_mode); #ifdef UNIV_PFS_THREAD @@ -356,6 +357,7 @@ recv_writer_thread_active = false; + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/mach/mach0data.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/mach/mach0data.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/mach/mach0data.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/mach/mach0data.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -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 @@ -55,7 +55,6 @@ if (flag < 0x80UL) { *val = flag; return(ptr + 1); - } /* Workaround GCC bug @@ -64,7 +63,11 @@ function, causing and out-of-bounds read if we are reading a short integer close to the end of buffer. */ #if defined(__GNUC__) && (__GNUC__ >= 5) && !defined(__clang__) - asm volatile("": : :"memory"); +#define DEPLOY_FENCE +#endif + +#ifdef DEPLOY_FENCE + __atomic_thread_fence(__ATOMIC_ACQUIRE); #endif if (flag < 0xC0UL) { @@ -75,8 +78,13 @@ *val = mach_read_from_2(ptr) & 0x7FFFUL; return(ptr + 2); + } - } else if (flag < 0xE0UL) { +#ifdef DEPLOY_FENCE + __atomic_thread_fence(__ATOMIC_ACQUIRE); +#endif + + if (flag < 0xE0UL) { if (end_ptr < ptr + 3) { return(NULL); } @@ -84,7 +92,13 @@ *val = mach_read_from_3(ptr) & 0x3FFFFFUL; return(ptr + 3); - } else if (flag < 0xF0UL) { + } + +#ifdef DEPLOY_FENCE + __atomic_thread_fence(__ATOMIC_ACQUIRE); +#endif + + if (flag < 0xF0UL) { if (end_ptr < ptr + 4) { return(NULL); } @@ -92,14 +106,20 @@ *val = mach_read_from_4(ptr) & 0x1FFFFFFFUL; return(ptr + 4); - } else { - ut_ad(flag == 0xF0UL); + } - if (end_ptr < ptr + 5) { - return(NULL); - } +#ifdef DEPLOY_FENCE + __atomic_thread_fence(__ATOMIC_ACQUIRE); +#endif - *val = mach_read_from_4(ptr + 1); - return(ptr + 5); +#undef DEPLOY_FENCE + + ut_ad(flag == 0xF0UL); + + if (end_ptr < ptr + 5) { + return(NULL); } + + *val = mach_read_from_4(ptr + 1); + return(ptr + 5); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/os/os0file.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/os/os0file.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/os/os0file.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/os/os0file.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. Portions of this file contain modifications contributed and copyrighted @@ -82,9 +82,11 @@ #ifndef __WIN__ /** Umask for creating files */ UNIV_INTERN ulint os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; +# define os_file_invalid (-1) #else /** Umask for creating files */ UNIV_INTERN ulint os_innodb_umask = 0; +# define os_file_invalid INVALID_HANDLE_VALUE #endif /* __WIN__ */ #ifndef UNIV_HOTBACKUP @@ -179,7 +181,7 @@ byte* buf; /*!< buffer used in i/o */ ulint type; /*!< OS_FILE_READ or OS_FILE_WRITE */ os_offset_t offset; /*!< file offset in bytes */ - os_file_t file; /*!< file where to read or write */ + pfs_os_file_t file; /*!< file where to read or write */ const char* name; /*!< file name or path */ ibool io_already_done;/*!< used only in simulated aio: TRUE if the physical i/o already @@ -1008,50 +1010,15 @@ char* full_path; int ret; struct stat statinfo; -#ifdef HAVE_READDIR_R - char dirent_buf[sizeof(struct dirent) - + _POSIX_PATH_MAX + 100]; - /* In /mysys/my_lib.c, _POSIX_PATH_MAX + 1 is used as - the max file name len; but in most standards, the - length is NAME_MAX; we add 100 to be even safer */ -#endif next_file: -#ifdef HAVE_READDIR_R - ret = readdir_r(dir, (struct dirent*) dirent_buf, &ent); - - if (ret != 0 -#ifdef UNIV_AIX - /* On AIX, only if we got non-NULL 'ent' (result) value and - a non-zero 'ret' (return) value, it indicates a failed - readdir_r() call. An NULL 'ent' with an non-zero 'ret' - would indicate the "end of the directory" is reached. */ - && ent != NULL -#endif - ) { - fprintf(stderr, - "InnoDB: cannot read directory %s, error %lu\n", - dirname, (ulong) ret); - - return(-1); - } - - if (ent == NULL) { - /* End of directory */ - - return(1); - } - - ut_a(strlen(ent->d_name) < _POSIX_PATH_MAX + 100 - 1); -#else ent = readdir(dir); if (ent == NULL) { return(1); } -#endif ut_a(strlen(ent->d_name) < OS_FILE_MAX_PATH); if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) { @@ -1378,7 +1345,11 @@ && (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT || (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT_NO_FSYNC)))) - os_file_set_nocache(file, name, mode_str); + /* Do fsync() on log files when setting O_DIRECT fails. + See log_io_complete() */ + if (!os_file_set_nocache(file, name, mode_str) + && srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT) + srv_unix_file_flush_method = SRV_UNIX_O_DIRECT; } /****************************************************************//** @@ -1388,7 +1359,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INTERN -os_file_t +pfs_os_file_t os_file_create_simple_no_error_handling_func( /*=========================================*/ const char* name, /*!< in: name of the file or path as a @@ -1402,7 +1373,7 @@ if it would be enabled otherwise) */ ibool* success)/*!< out: TRUE if succeed, FALSE if error */ { - os_file_t file; + pfs_os_file_t file; *success = FALSE; #ifdef __WIN__ @@ -1410,7 +1381,6 @@ DWORD create_flag; DWORD attributes = 0; DWORD share_mode = FILE_SHARE_READ; - ut_a(name); ut_a(!(create_mode & OS_FILE_ON_ERROR_SILENT)); @@ -1427,8 +1397,8 @@ ib_logf(IB_LOG_LEVEL_ERROR, "Unknown file create mode (%lu) for file '%s'", create_mode, name); - - return((os_file_t) -1); + file.m_file = (os_file_t)-1; + return(file); } if (access_type == OS_FILE_READ_ONLY) { @@ -1452,11 +1422,11 @@ ib_logf(IB_LOG_LEVEL_ERROR, "Unknown file access type (%lu) for file '%s'", access_type, name); - - return((os_file_t) -1); + file.m_file = (os_file_t)-1; + return(file); } - file = CreateFile((LPCTSTR) name, + file.m_file = CreateFile((LPCTSTR) name, access, share_mode, NULL, // Security attributes @@ -1464,11 +1434,10 @@ attributes, NULL); // No template file - *success = (file != INVALID_HANDLE_VALUE); + *success = (file.m_file != INVALID_HANDLE_VALUE); #else /* __WIN__ */ int create_flag; const char* mode_str = NULL; - ut_a(name); if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) WAIT_ALLOW_WRITES(); @@ -1513,19 +1482,19 @@ ib_logf(IB_LOG_LEVEL_ERROR, "Unknown file create mode (%lu) for file '%s'", create_mode, name); - - return((os_file_t) -1); + file.m_file = -1; + return(file); } - file = ::open(name, create_flag, os_innodb_umask); + file.m_file = ::open(name, create_flag, os_innodb_umask); - *success = file == -1 ? FALSE : TRUE; + *success = file.m_file == -1 ? FALSE : TRUE; /* This function is always called for data files, we should disable OS caching (O_DIRECT) here as we do in os_file_create_func(), so we open the same file in the same mode, see man page of open(2). */ if (*success) { - os_file_set_nocache_if_needed(file, name, mode_str, + os_file_set_nocache_if_needed(file.m_file, name, mode_str, OS_DATA_FILE, access_type); } @@ -1534,11 +1503,11 @@ && *success && (access_type == OS_FILE_READ_WRITE || access_type == OS_FILE_READ_WRITE_CACHED) - && os_file_lock(file, name)) { + && os_file_lock(file.m_file, name)) { *success = FALSE; - close(file); - file = -1; + close(file.m_file); + file.m_file = -1; } #endif /* USE_FILE_LOCK */ @@ -1549,9 +1518,10 @@ } /****************************************************************//** -Tries to disable OS caching on an opened file descriptor. */ +Tries to disable OS caching on an opened file descriptor. +@return TRUE if operation is success and FALSE otherwise */ UNIV_INTERN -void +bool os_file_set_nocache( /*================*/ int fd /*!< in: file descriptor to alter */ @@ -1572,6 +1542,7 @@ "Failed to set DIRECTIO_ON on file %s: %s: %s, " "continuing anyway.", file_name, operation_name, strerror(errno_save)); + return false; } #elif defined(O_DIRECT) if (fcntl(fd, F_SETFL, O_DIRECT) == -1) { @@ -1602,8 +1573,10 @@ "continuing anyway.", file_name, operation_name, strerror(errno_save)); } + return false; } #endif /* defined(UNIV_SOLARIS) && defined(DIRECTIO_ON) */ + return true; } /****************************************************************//** @@ -1645,7 +1618,7 @@ @return own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error */ UNIV_INTERN -os_file_t +pfs_os_file_t os_file_create_func( /*================*/ const char* name, /*!< in: name of the file or path as a @@ -1661,24 +1634,25 @@ ulint type, /*!< in: OS_DATA_FILE or OS_LOG_FILE */ ibool* success)/*!< out: TRUE if succeed, FALSE if error */ { - os_file_t file; + pfs_os_file_t file; ibool retry; ibool on_error_no_exit; ibool on_error_silent; - #ifdef __WIN__ DBUG_EXECUTE_IF( "ib_create_table_fail_disk_full", *success = FALSE; SetLastError(ERROR_DISK_FULL); - return((os_file_t) -1); + file.m_file = (os_file_t)-1; + return(file); ); #else /* __WIN__ */ DBUG_EXECUTE_IF( "ib_create_table_fail_disk_full", *success = FALSE; errno = ENOSPC; - return((os_file_t) -1); + file.m_file = -1; + return(file); ); #endif /* __WIN__ */ @@ -1729,7 +1703,8 @@ "Unknown file create mode (%lu) for file '%s'", create_mode, name); - return((os_file_t) -1); + file.m_file = (os_file_t)-1; + return(file); } DWORD attributes = 0; @@ -1754,8 +1729,8 @@ ib_logf(IB_LOG_LEVEL_ERROR, "Unknown purpose flag (%lu) while opening file '%s'", purpose, name); - - return((os_file_t)(-1)); + file.m_file = (os_file_t)-1; + return(file); } #ifdef UNIV_NON_BUFFERED_IO @@ -1782,11 +1757,11 @@ do { /* Use default security attributes and no template file. */ - file = CreateFile( + file.m_file = CreateFile( (LPCTSTR) name, access, share_mode, NULL, create_flag, attributes, NULL); - if (file == INVALID_HANDLE_VALUE) { + if (file.m_file == INVALID_HANDLE_VALUE) { const char* operation; operation = (create_mode == OS_FILE_CREATE @@ -1851,7 +1826,8 @@ "Unknown file create mode (%lu) for file '%s'", create_mode, name); - return((os_file_t) -1); + file.m_file = -1; + return(file); } ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE); @@ -1871,9 +1847,9 @@ #endif /* O_SYNC */ do { - file = ::open(name, create_flag, os_innodb_umask); + file.m_file = ::open(name, create_flag, os_innodb_umask); - if (file == -1) { + if (file.m_file == -1) { const char* operation; operation = (create_mode == OS_FILE_CREATE @@ -1897,14 +1873,15 @@ if (*success) { - os_file_set_nocache_if_needed(file, name, mode_str, type, 0); + os_file_set_nocache_if_needed(file.m_file, name, mode_str, + type, 0); } #ifdef USE_FILE_LOCK if (!srv_read_only_mode && *success && create_mode != OS_FILE_OPEN_RAW - && os_file_lock(file, name)) { + && os_file_lock(file.m_file, name)) { if (create_mode == OS_FILE_OPEN_RETRY) { @@ -1916,7 +1893,7 @@ for (int i = 0; i < 100; i++) { os_thread_sleep(1000000); - if (!os_file_lock(file, name)) { + if (!os_file_lock(file.m_file, name)) { *success = TRUE; return(file); } @@ -1927,17 +1904,18 @@ } *success = FALSE; - close(file); - file = -1; + close(file.m_file); + file.m_file = -1; } #endif /* USE_FILE_LOCK */ if (srv_use_atomic_writes && type == OS_DATA_FILE - && file != -1 && !os_file_set_atomic_writes(name, file)) { + && file.m_file != -1 + && !os_file_set_atomic_writes(name, file.m_file)) { *success = FALSE; - close(file); - file = -1; + close(file.m_file); + file.m_file = -1; } #endif /* __WIN__ */ @@ -2171,8 +2149,8 @@ Closes a file handle. @return TRUE if success */ UNIV_INTERN -ibool -os_file_close_no_error_handling( +bool +os_file_close_no_error_handling_func( /*============================*/ os_file_t file) /*!< in, own: handle to a file */ { @@ -2184,10 +2162,10 @@ ret = CloseHandle(file); if (ret) { - return(TRUE); + return(true); } - return(FALSE); + return(false); #else int ret; @@ -2195,10 +2173,83 @@ if (ret == -1) { - return(FALSE); + return(false); } - return(TRUE); + return(true); +#endif /* __WIN__ */ +} + +#ifdef HAVE_POSIX_FALLOCATE +/***********************************************************************//** +Ensures that disk space is allocated for the file. +@return TRUE if success */ +UNIV_INTERN +bool +os_file_allocate_func( + os_file_t file, /*!< in, own: handle to a file */ + os_offset_t offset, /*!< in: file region offset */ + os_offset_t len) /*!< in: file region length */ +{ + return(posix_fallocate(file, offset, len) == 0); +} +#endif + +/***********************************************************************//** +Checks if the file is marked as invalid. +@return TRUE if invalid */ +UNIV_INTERN +bool +os_file_is_invalid( + pfs_os_file_t file) /*!< in, own: handle to a file */ +{ + return(file.m_file == os_file_invalid); +} + +/***********************************************************************//** +Marks the file as invalid. */ +UNIV_INTERN +void +os_file_mark_invalid( + pfs_os_file_t* file) /*!< out: pointer to a handle to a file */ +{ + file->m_file = os_file_invalid; +} + +/***********************************************************************//** +Announces an intention to access file data in a specific pattern in the +future. +@return TRUE if success */ +UNIV_INTERN +bool +os_file_advise( + pfs_os_file_t file, /*!< in, own: handle to a file */ + os_offset_t offset, /*!< in: file region offset */ + os_offset_t len, /*!< in: file region length */ + ulint advice)/*!< in: advice for access pattern */ +{ +#ifdef __WIN__ + return(true); +#else +#ifdef UNIV_LINUX + int native_advice = 0; + if ((advice & OS_FILE_ADVISE_NORMAL) != 0) + native_advice |= POSIX_FADV_NORMAL; + if ((advice & OS_FILE_ADVISE_RANDOM) != 0) + native_advice |= POSIX_FADV_RANDOM; + if ((advice & OS_FILE_ADVISE_SEQUENTIAL) != 0) + native_advice |= POSIX_FADV_SEQUENTIAL; + if ((advice & OS_FILE_ADVISE_WILLNEED) != 0) + native_advice |= POSIX_FADV_WILLNEED; + if ((advice & OS_FILE_ADVISE_DONTNEED) != 0) + native_advice |= POSIX_FADV_DONTNEED; + if ((advice & OS_FILE_ADVISE_NOREUSE) != 0) + native_advice |= POSIX_FADV_NOREUSE; + + return(posix_fadvise(file.m_file, offset, len, native_advice) == 0); +#else + return(true); +#endif #endif /* __WIN__ */ } @@ -2209,14 +2260,14 @@ os_offset_t os_file_get_size( /*=============*/ - os_file_t file) /*!< in: handle to a file */ + pfs_os_file_t file) /*!< in: handle to a file */ { #ifdef __WIN__ os_offset_t offset; DWORD high; DWORD low; - low = GetFileSize(file, &high); + low = GetFileSize(file.m_file, &high); if ((low == 0xFFFFFFFF) && (GetLastError() != NO_ERROR)) { return((os_offset_t) -1); @@ -2226,7 +2277,8 @@ return(offset); #else - return((os_offset_t) lseek(file, 0, SEEK_END)); + return((os_offset_t) lseek(file.m_file, 0, SEEK_END)); + #endif /* __WIN__ */ } @@ -2239,7 +2291,7 @@ /*=============*/ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ os_offset_t size) /*!< in: file size */ { os_offset_t current_size; @@ -2253,7 +2305,7 @@ #ifdef HAVE_POSIX_FALLOCATE if (srv_use_posix_fallocate) { - if (posix_fallocate(file, current_size, size) == -1) { + if (posix_fallocate(file.m_file, current_size, size) == -1) { ib_logf(IB_LOG_LEVEL_ERROR, "preallocating file " "space for file \'%s\' failed. Current size " @@ -2349,8 +2401,8 @@ Truncates a file at the specified position. @return TRUE if success */ UNIV_INTERN -ibool -os_file_set_eof_at( +bool +os_file_set_eof_at_func( os_file_t file, /*!< in: handle to a file */ ib_uint64_t new_len)/*!< in: new file length */ { @@ -4447,7 +4499,7 @@ the aio operation */ void* message2,/*!< in: message to be passed along with the aio operation */ - os_file_t file, /*!< in: file handle */ + pfs_os_file_t file, /*!< in: file handle */ const char* name, /*!< in: name of the file or path as a null-terminated string */ void* buf, /*!< in: buffer where to read or from which @@ -4569,10 +4621,10 @@ iocb = &slot->control; if (type == OS_FILE_READ) { - io_prep_pread(iocb, file, buf, len, aio_offset); + io_prep_pread(iocb, file.m_file, buf, len, aio_offset); } else { ut_a(type == OS_FILE_WRITE); - io_prep_pwrite(iocb, file, buf, len, aio_offset); + io_prep_pwrite(iocb, file.m_file, buf, len, aio_offset); } iocb->data = (void*) slot; @@ -4810,7 +4862,7 @@ caution! */ const char* name, /*!< in: name of the file or path as a null-terminated string */ - os_file_t file, /*!< in: handle to a file */ + pfs_os_file_t file, /*!< in: handle to a file */ void* buf, /*!< in: buffer where to read or from which to write */ os_offset_t offset, /*!< in: file offset where to read or write */ @@ -4837,8 +4889,7 @@ ulint dummy_type; #endif /* WIN_ASYNC_IO */ ulint wake_later; - - ut_ad(file); + ut_ad(file.m_file); ut_ad(buf); ut_ad(n > 0); ut_ad(n % OS_MIN_LOG_BLOCK_SIZE == 0); @@ -4870,13 +4921,12 @@ and os_file_write_func() */ if (type == OS_FILE_READ) { - return(os_file_read_func(file, buf, offset, n, trx)); + return(os_file_read_func(file.m_file, buf, offset, n, + trx)); } - ut_ad(!srv_read_only_mode); ut_a(type == OS_FILE_WRITE); - - return(os_file_write_func(name, file, buf, offset, n)); + return(os_file_write_func(name, file.m_file, buf, offset, n)); } try_again: @@ -4933,9 +4983,8 @@ os_n_file_reads++; os_bytes_read_since_printout += n; #ifdef WIN_ASYNC_IO - ret = ReadFile(file, buf, (DWORD) n, &len, + ret = ReadFile(file.m_file, buf, (DWORD) n, &len, &(slot->control)); - #elif defined(LINUX_NATIVE_AIO) if (!os_aio_linux_dispatch(array, slot)) { goto err_exit; @@ -4953,9 +5002,8 @@ if (srv_use_native_aio) { os_n_file_writes++; #ifdef WIN_ASYNC_IO - ret = WriteFile(file, buf, (DWORD) n, &len, + ret = WriteFile(file.m_file, buf, (DWORD) n, &len, &(slot->control)); - #elif defined(LINUX_NATIVE_AIO) if (!os_aio_linux_dispatch(array, slot)) { goto err_exit; @@ -5110,8 +5158,7 @@ srv_set_io_thread_op_info( orig_seg, "get windows aio return value"); } - - ret = GetOverlappedResult(slot->file, &(slot->control), &len, TRUE); + ret = GetOverlappedResult(slot->file.m_file, &(slot->control), &len, TRUE); *message1 = slot->message1; *message2 = slot->message2; @@ -5141,7 +5188,8 @@ and os_file_write APIs, need to register with performance schema explicitly here. */ struct PSI_file_locker* locker = NULL; - register_pfs_file_io_begin(locker, slot->file, slot->len, + PSI_file_locker_state state; + register_pfs_file_io_begin(&state, locker, slot->file, slot->len, (slot->type == OS_FILE_WRITE) ? PSI_FILE_WRITE : PSI_FILE_READ, @@ -5152,16 +5200,14 @@ switch (slot->type) { case OS_FILE_WRITE: - ret = WriteFile(slot->file, slot->buf, + ret = WriteFile(slot->file.m_file, slot->buf, (DWORD) slot->len, &len, &(slot->control)); - break; case OS_FILE_READ: - ret = ReadFile(slot->file, slot->buf, + ret = ReadFile(slot->file.m_file, slot->buf, (DWORD) slot->len, &len, &(slot->control)); - break; default: ut_error; @@ -5177,8 +5223,7 @@ file where we also use async i/o: in Windows we must use the same wait mechanism as for async i/o */ - - ret = GetOverlappedResult(slot->file, + ret = GetOverlappedResult(slot->file.m_file, &(slot->control), &len, TRUE); } @@ -5432,12 +5477,14 @@ iocb = &(slot->control); if (slot->type == OS_FILE_READ) { - io_prep_pread(&slot->control, slot->file, slot->buf, - slot->len, (off_t) slot->offset); + io_prep_pread(&slot->control, slot->file.m_file, + slot->buf, slot->len, + (off_t) slot->offset); } else { ut_a(slot->type == OS_FILE_WRITE); - io_prep_pwrite(&slot->control, slot->file, slot->buf, - slot->len, (off_t) slot->offset); + io_prep_pwrite(&slot->control, slot->file.m_file, + slot->buf, slot->len, + (off_t) slot->offset); } /* Resubmit an I/O request */ submit_ret = io_submit(array->aio_ctx[segment], 1, &iocb); @@ -5664,12 +5711,11 @@ os_aio_slot_t* slot; slot = os_aio_array_get_nth_slot(array, i + segment * n); - if (slot->reserved && slot != aio_slot && slot->offset == aio_slot->offset + aio_slot->len && slot->type == aio_slot->type - && slot->file == aio_slot->file) { + && slot->file.m_file == aio_slot->file.m_file) { /* Found a consecutive i/o request */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/os/os0thread.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/os/os0thread.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/os/os0thread.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/os/os0thread.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -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 @@ -210,20 +210,25 @@ #endif } -/** -Waits until the specified thread completes and joins it. Its return value is -ignored. - -@param thread thread to join */ +/** Waits until the specified thread completes and joins it. +Its return value is ignored. +@param[in,out] thread thread to join */ UNIV_INTERN void os_thread_join( os_thread_t thread) { - int ret MY_ATTRIBUTE((unused)) = pthread_join(thread, NULL); +#ifdef __WIN__ + /* Do nothing. */ +#else +#ifdef UNIV_DEBUG + const int ret = +#endif /* UNIV_DEBUG */ + pthread_join(thread, NULL); - /* Waiting on already-quit threads is allowed */ + /* Waiting on already-quit threads is allowed. */ ut_ad(ret == 0 || ret == ESRCH); +#endif /* __WIN__ */ } /*****************************************************************//** @@ -252,8 +257,9 @@ #ifdef __WIN__ ExitThread((DWORD) exit_value); #else - if (detach) + if (detach) { pthread_detach(pthread_self()); + } pthread_exit(exit_value); #endif } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/page/page0zip.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/page/page0zip.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/page/page0zip.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/page/page0zip.cc 2017-10-19 04:25:29.000000000 +0000 @@ -527,7 +527,8 @@ const dict_col_t* column = dict_field_get_col(field); - if (UNIV_UNLIKELY(column->len > 255) + if (UNIV_UNLIKELY(column->len > 255 - + prtype_get_compression_extra(column->prtype)) || UNIV_UNLIKELY(column->mtype == DATA_BLOB)) { val |= 0x7e; /* max > 255 bytes */ } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/pars/pars0opt.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/pars/pars0opt.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/pars/pars0opt.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/pars/pars0opt.cc 2017-10-19 04:25:29.000000000 +0000 @@ -948,12 +948,14 @@ /* Fill in the field_no fields in sym_node */ sym_node->field_nos[SYM_CLUST_FIELD_NO] = dict_index_get_nth_col_pos( - dict_table_get_first_index(index->table), sym_node->col_no); + dict_table_get_first_index(index->table), sym_node->col_no, + NULL); if (!dict_index_is_clust(index)) { ut_a(plan); - col_pos = dict_index_get_nth_col_pos(index, sym_node->col_no); + col_pos = dict_index_get_nth_col_pos(index, sym_node->col_no, + NULL); if (col_pos == ULINT_UNDEFINED) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/pars/pars0pars.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/pars/pars0pars.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/pars/pars0pars.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/pars/pars0pars.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1232,7 +1232,8 @@ col_sym = assign_node->col; upd_field_set_field_no(upd_field, dict_index_get_nth_col_pos( - clust_index, col_sym->col_no), + clust_index, col_sym->col_no, + NULL), clust_index, NULL); upd_field->exp = assign_node->val; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/rem/rem0rec.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/rem/rem0rec.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/rem/rem0rec.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/rem/rem0rec.cc 2017-10-19 04:25:29.000000000 +0000 @@ -789,7 +789,7 @@ /**********************************************************//** Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT. @return total size */ -UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(1,2))) +UNIV_INLINE MY_ATTRIBUTE((warn_unused_result)) ulint rec_get_converted_size_comp_prefix_low( /*===================================*/ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0ins.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0ins.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0ins.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0ins.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1287,11 +1287,12 @@ #ifdef WITH_WSREP err = wsrep_append_foreign_key( - thr_get_trx(thr), - foreign, - clust_rec, - clust_index, - FALSE, FALSE); + thr_get_trx(thr), + foreign, + clust_rec, + clust_index, + FALSE, + (node) ? TRUE : FALSE); if (err != DB_SUCCESS) { fprintf(stderr, "WSREP: foreign key append failed: %d\n", err); @@ -1452,6 +1453,9 @@ ulint* offsets = offsets_; rec_offs_init(offsets_); +#ifdef WITH_WSREP + upd_node= NULL; +#endif /* WITH_WSREP */ run_again: #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED)); @@ -1639,9 +1643,10 @@ err = wsrep_append_foreign_key( thr_get_trx(thr), foreign, - rec, - check_index, - check_ref, TRUE); + rec, + check_index, + check_ref, + (upd_node) ? TRUE : FALSE); #endif /* WITH_WSREP */ goto end_scan; } else if (foreign->type != 0) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0log.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0log.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0log.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0log.cc 2017-10-19 04:25:29.000000000 +0000 @@ -363,9 +363,9 @@ goto err_exit; } - ret = os_file_write( + ret = os_file_write_int_fd( "(modification log)", - OS_FILE_FROM_FD(log->fd), + log->fd, log->tail.block, byte_offset, srv_sort_buf_size); log->tail.blocks++; if (!ret) { @@ -479,9 +479,9 @@ goto err_exit; } - ret = os_file_write( + ret = os_file_write_int_fd( "(modification log)", - OS_FILE_FROM_FD(log->fd), + log->fd, log->tail.block, byte_offset, srv_sort_buf_size); log->tail.blocks++; if (!ret) { @@ -2610,11 +2610,10 @@ goto func_exit; } - success = os_file_read_no_error_handling( - OS_FILE_FROM_FD(index->online_log->fd), + success = os_file_read_no_error_handling_int_fd( + index->online_log->fd, index->online_log->head.block, ofs, srv_sort_buf_size); - if (!success) { fprintf(stderr, "InnoDB: unable to read temporary file" " for table %s\n", index->table_name); @@ -3438,8 +3437,8 @@ goto func_exit; } - success = os_file_read_no_error_handling( - OS_FILE_FROM_FD(index->online_log->fd), + success = os_file_read_no_error_handling_int_fd( + index->online_log->fd, index->online_log->head.block, ofs, srv_sort_buf_size); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0merge.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0merge.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0merge.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0merge.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -876,8 +876,9 @@ } #endif /* UNIV_DEBUG */ - success = os_file_read_no_error_handling(OS_FILE_FROM_FD(fd), buf, + success = os_file_read_no_error_handling_int_fd(fd, buf, ofs, srv_sort_buf_size); + #ifdef POSIX_FADV_DONTNEED /* Each block is read exactly once. Free up the file cache. */ posix_fadvise(fd, ofs, srv_sort_buf_size, POSIX_FADV_DONTNEED); @@ -911,7 +912,7 @@ DBUG_EXECUTE_IF("row_merge_write_failure", return(FALSE);); - ret = os_file_write("(merge)", OS_FILE_FROM_FD(fd), buf, ofs, buf_len); + ret = os_file_write_int_fd("(merge)", fd, buf, ofs, buf_len); #ifdef UNIV_DEBUG if (row_merge_print_block_write) { @@ -1468,6 +1469,8 @@ row_ext_t* ext; page_cur_t* cur = btr_pcur_get_page_cur(&pcur); + mem_heap_empty(row_heap); + page_cur_move_to_next(cur); if (page_cur_is_after_last(cur)) { @@ -1897,8 +1900,6 @@ if (err != DB_SUCCESS) { goto func_exit; } - - mem_heap_empty(row_heap); } func_exit: @@ -3134,14 +3135,21 @@ performance schema */ struct PSI_file_locker* locker = NULL; PSI_file_locker_state state; - register_pfs_file_open_begin(&state, locker, innodb_file_temp_key, - PSI_FILE_OPEN, - "Innodb Merge Temp File", - __FILE__, __LINE__); + locker = PSI_FILE_CALL(get_thread_file_name_locker)( + &state, innodb_file_temp_key, PSI_FILE_OPEN, + "Innodb Merge Temp File", &locker); + if (locker != NULL) { + PSI_FILE_CALL(start_file_open_wait)(locker, + __FILE__, + __LINE__); + } #endif fd = innobase_mysql_tmpfile(path); #ifdef UNIV_PFS_IO - register_pfs_file_open_end(locker, fd); + if (locker != NULL) { + PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)( + locker, fd); + } #endif if (fd < 0) { @@ -3188,15 +3196,20 @@ #ifdef UNIV_PFS_IO struct PSI_file_locker* locker = NULL; PSI_file_locker_state state; - register_pfs_file_io_begin(&state, locker, - fd, 0, PSI_FILE_CLOSE, - __FILE__, __LINE__); + locker = PSI_FILE_CALL(get_thread_file_descriptor_locker)( + &state, fd, PSI_FILE_CLOSE); + if (locker != NULL) { + PSI_FILE_CALL(start_file_wait)( + locker, 0, __FILE__, __LINE__); + } #endif if (fd >= 0) { close(fd); } #ifdef UNIV_PFS_IO - register_pfs_file_io_end(locker, 0); + if (locker != NULL) { + PSI_FILE_CALL(end_file_wait)(locker, 0); + } #endif } /*********************************************************************//** @@ -3791,8 +3804,8 @@ for (j = 0; j < FTS_NUM_AUX_INDEX; j++) { - os_thread_join(merge_info[j] - .thread_hdl); + os_thread_join(merge_info[j] + .thread_hdl); } } } else { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0mysql.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0mysql.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0mysql.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0mysql.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1907,6 +1907,8 @@ row_ins_step(thr); + DEBUG_SYNC_C("ib_after_row_insert_step"); + err = trx->error_state; if (err != DB_SUCCESS) { diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0purge.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0purge.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0purge.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0purge.cc 2017-10-19 04:25:29.000000000 +0000 @@ -897,7 +897,7 @@ 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 MY_ATTRIBUTE((nonnull)) +static void row_purge( /*======*/ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0sel.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0sel.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0sel.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0sel.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -62,6 +62,9 @@ #include "my_sys.h" /* DEBUG_SYNC_C */ #include "my_compare.h" /* enum icp_result */ +#include "thr_lock.h" +#include "handler.h" +#include "ha_innodb.h" /* Maximum number of rows to prefetch; MySQL interface has another parameter */ #define SEL_MAX_N_PREFETCH 16 @@ -2558,53 +2561,56 @@ #ifdef UNIV_DEBUG /** Convert a non-SQL-NULL field from Innobase format to MySQL format. */ # define row_sel_field_store_in_mysql_format( \ - dest,templ,idx,field,src,len,prebuilt) \ + dest,templ,idx,field,src,len,sec,prebuilt) \ row_sel_field_store_in_mysql_format_func \ - (dest,templ,idx,field,src,len, prebuilt) + (dest,templ,idx,field,src,len,sec,prebuilt) #else /* UNIV_DEBUG */ /** Convert a non-SQL-NULL field from Innobase format to MySQL format. */ # define row_sel_field_store_in_mysql_format( \ - dest,templ,idx,field,src,len,prebuilt) \ + dest,templ,idx,field,src,len,sec,prebuilt) \ row_sel_field_store_in_mysql_format_func \ - (dest,templ,src,len, prebuilt) + (dest,templ,src,len,sec,prebuilt) #endif /* UNIV_DEBUG */ -/**************************************************************//** -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. */ +/** 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. +@param[in,out] dest buffer where to store; NOTE + that BLOBs are not in themselves stored + here: the caller must allocate and copy + the BLOB into buffer before, and pass + the pointer to the BLOB in 'data' +@param[in] templ MySQL column template. Its following fields + are referenced: type, is_unsigned, mysql_col_len, + mbminlen, mbmaxlen +@param[in] index InnoDB index +@param[in] field_no templ->rec_field_no or templ->clust_rec_field_no + or templ->icp_rec_field_no +@param[in] data data to store +@param[in] len length of the data +@param[in] sec_field secondary index field no if the secondary index + record but the prebuilt template is in + clustered index format and used only for end + range comparison. +@param[in[ prebuilt needed to access compress_heap */ static MY_ATTRIBUTE((nonnull)) void row_sel_field_store_in_mysql_format_func( -/*=====================================*/ - byte* dest, /*!< in/out: buffer where to store; NOTE - that BLOBs are not in themselves - stored here: the caller must allocate - and copy the BLOB into buffer before, - and pass the pointer to the BLOB in - 'data' */ + byte* dest, const mysql_row_templ_t* templ, - /*!< in: MySQL column template. - Its following fields are referenced: - type, is_unsigned, mysql_col_len, - mbminlen, mbmaxlen */ #ifdef UNIV_DEBUG const dict_index_t* index, - /*!< in: InnoDB index */ ulint field_no, - /*!< in: templ->rec_field_no or - templ->clust_rec_field_no or - templ->icp_rec_field_no */ #endif /* UNIV_DEBUG */ - const byte* data, /*!< in: data to store */ - ulint len, /*!< in: length of the data */ + const byte* data, + ulint len, + ulint sec_field, row_prebuilt_t* prebuilt) - /*!< in: use prebuilt->compress_heap - only here */ { byte* ptr; #ifdef UNIV_DEBUG const dict_field_t* field = dict_index_get_nth_field(index, field_no); + bool clust_templ_for_sec = (sec_field != ULINT_UNDEFINED); #endif /* UNIV_DEBUG */ ut_ad(len != UNIV_SQL_NULL); @@ -2731,9 +2737,11 @@ containing UTF-8 ENUM columns due to Bug #9526. */ ut_ad(!templ->mbmaxlen || !(templ->mysql_col_len % templ->mbmaxlen)); - ut_ad(len * templ->mbmaxlen >= templ->mysql_col_len + ut_ad(clust_templ_for_sec + || len * templ->mbmaxlen >= templ->mysql_col_len || (field_no == templ->icp_rec_field_no - && field->prefix_len > 0)); + && field->prefix_len > 0) + || templ->rec_field_is_prefix); ut_ad(!(field->prefix_len % templ->mbmaxlen)); if (templ->mbminlen == 1 && templ->mbmaxlen != 1) { @@ -2759,55 +2767,80 @@ case DATA_DECIMAL: /* Above are the valid column types for MySQL data. */ #endif /* UNIV_DEBUG */ + /* If sec_field value is present then mapping of + secondary index records to clustered index template + happens for end range comparison. So length can + vary according to secondary index record length. */ ut_ad(field->prefix_len ? field->prefix_len == len - : templ->mysql_col_len == len); + : (clust_templ_for_sec ? + 1 : (templ->mysql_col_len == len))); memcpy(dest, data, len); } } #ifdef UNIV_DEBUG /** Convert a field from Innobase format to MySQL format. */ -# define row_sel_store_mysql_field(m,p,r,i,o,f,t) \ - row_sel_store_mysql_field_func(m,p,r,i,o,f,t) +# define row_sel_store_mysql_field(m,p,r,i,o,f,t,s) \ + row_sel_store_mysql_field_func(m,p,r,i,o,f,t,s) #else /* UNIV_DEBUG */ /** Convert a field from Innobase format to MySQL format. */ -# define row_sel_store_mysql_field(m,p,r,i,o,f,t) \ - row_sel_store_mysql_field_func(m,p,r,o,f,t) +# define row_sel_store_mysql_field(m,p,r,i,o,f,t,s) \ + row_sel_store_mysql_field_func(m,p,r,o,f,t,s) #endif /* UNIV_DEBUG */ -/**************************************************************//** -Convert a field in the Innobase format to a field in the MySQL format. */ +/** Convert a field in the Innobase format to a field in the MySQL format. +@param[out] mysql_rec record in the MySQL format +@param[in,out] prebuilt prebuilt struct +@param[in] rec InnoDB record; must be protected + by a page latch +@param[in] index index of rec +@param[in] offsets array returned by rec_get_offsets() +@param[in] field_no templ->rec_field_no or + templ->clust_rec_field_no + or templ->icp_rec_field_no + or sec field no if clust_templ_for_sec + is TRUE +@param[in] templ row template +@param[in] sec_field_no field_no if rec belongs to secondary index + but prebuilt template is in clustered + index format and used only for end + range comparison. */ static MY_ATTRIBUTE((warn_unused_result)) ibool row_sel_store_mysql_field_func( -/*===========================*/ - byte* mysql_rec, /*!< out: record in the - MySQL format */ - row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct */ - const rec_t* rec, /*!< in: InnoDB record; - must be protected by - a page latch */ + byte* mysql_rec, + row_prebuilt_t* prebuilt, + const rec_t* rec, #ifdef UNIV_DEBUG - const dict_index_t* index, /*!< in: index of rec */ + const dict_index_t* index, #endif - const ulint* offsets, /*!< in: array returned by - rec_get_offsets() */ - ulint field_no, /*!< in: templ->rec_field_no or - templ->clust_rec_field_no or - templ->icp_rec_field_no */ - const mysql_row_templ_t*templ) /*!< in: row template */ + const ulint* offsets, + ulint field_no, + const mysql_row_templ_t*templ, + ulint sec_field_no) { const byte* data; ulint len; + ulint clust_field_no; + bool clust_templ_for_sec = (sec_field_no != ULINT_UNDEFINED); ut_ad(prebuilt->default_rec); ut_ad(templ); ut_ad(templ >= prebuilt->mysql_template); ut_ad(templ < &prebuilt->mysql_template[prebuilt->n_template]); - ut_ad(field_no == templ->clust_rec_field_no + ut_ad(clust_templ_for_sec + || field_no == templ->clust_rec_field_no || field_no == templ->rec_field_no || field_no == templ->icp_rec_field_no); - ut_ad(rec_offs_validate(rec, index, offsets)); + ut_ad(rec_offs_validate(rec, + clust_templ_for_sec ? prebuilt->index : index, offsets)); + + /* If sec_field_no is present then extract the data from record + using secondary field no. */ + if (clust_templ_for_sec) { + clust_field_no = field_no; + field_no = sec_field_no; + } if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets, field_no))) { @@ -2859,7 +2892,8 @@ row_sel_field_store_in_mysql_format( mysql_rec + templ->mysql_col_offset, - templ, index, field_no, data, len, prebuilt); + templ, index, field_no, data, len, + ULINT_UNDEFINED, prebuilt); if (heap != prebuilt->blob_heap) { mem_heap_free(heap); @@ -2907,9 +2941,15 @@ mem_heap_dup(prebuilt->blob_heap, data, len)); } + /* Reassign the clustered index field no. */ + if (clust_templ_for_sec) { + field_no = clust_field_no; + } + row_sel_field_store_in_mysql_format( mysql_rec + templ->mysql_col_offset, - templ, index, field_no, data, len, prebuilt); + templ, index, field_no, data, len, sec_field_no, + prebuilt); } ut_ad(len != UNIV_SQL_NULL); @@ -2924,30 +2964,37 @@ return(TRUE); } -/**************************************************************//** -Convert a row in the Innobase format to a row in the MySQL format. +/** Convert a row in the Innobase format to a row in the MySQL format. Note that the template in prebuilt may advise us to copy only a few columns to mysql_rec, other columns are left blank. All columns may not be needed in the query. +@param[out] mysql_rec row in the MySQL format +@param[in] prebuilt prebuilt structure +@param[in] rec Innobase record in the index + which was described in prebuilt's + template, or in the clustered index; + must be protected by a page latch +@param[in] rec_clust TRUE if the rec in the clustered index +@param[in] index index of rec +@param[in] offsets array returned by rec_get_offsets(rec) +@param[in] clust_templ_for_sec TRUE if rec belongs to secondary index + but the prebuilt->template is in + clustered index format and it is + used only for end range comparison @return TRUE on success, FALSE if not all columns could be retrieved */ static MY_ATTRIBUTE((warn_unused_result)) ibool row_sel_store_mysql_rec( -/*====================*/ - byte* mysql_rec, /*!< out: row in the MySQL format */ - row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */ - const rec_t* rec, /*!< in: Innobase record in the index - which was described in prebuilt's - template, or in the clustered index; - must be protected by a page latch */ - ibool rec_clust, /*!< in: TRUE if rec is in the - clustered index instead of - prebuilt->index */ - const dict_index_t* index, /*!< in: index of rec */ - const ulint* offsets) /*!< in: array returned by - rec_get_offsets(rec) */ + byte* mysql_rec, + row_prebuilt_t* prebuilt, + const rec_t* rec, + ibool rec_clust, + const dict_index_t* index, + const ulint* offsets, + bool clust_templ_for_sec) { - ulint i; + ulint i; + std::vector template_col; ut_ad(rec_clust || index == prebuilt->index); ut_ad(!rec_clust || dict_index_is_clust(index)); @@ -2960,20 +3007,50 @@ if (UNIV_LIKELY_NULL(prebuilt->compress_heap)) mem_heap_empty(prebuilt->compress_heap); + if (clust_templ_for_sec) { + /* Store all clustered index field of + secondary index record. */ + for (i = 0; i < dict_index_get_n_fields( + prebuilt->index); i++) { + ulint sec_field = dict_index_get_nth_field_pos( + index, prebuilt->index, i); + template_col.push_back(sec_field); + } + } + for (i = 0; i < prebuilt->n_template; i++) { const mysql_row_templ_t*templ = &prebuilt->mysql_template[i]; - const ulint field_no + ulint field_no = rec_clust ? templ->clust_rec_field_no : templ->rec_field_no; + ulint sec_field_no = ULINT_UNDEFINED; + /* We should never deliver column prefixes to MySQL, - except for evaluating innobase_index_cond(). */ + except for evaluating innobase_index_cond() and if the prefix + index is longer than the actual row data. */ + ut_ad(dict_index_get_nth_field(index, field_no)->prefix_len - == 0); + == 0 || templ->rec_field_is_prefix); + + if (clust_templ_for_sec) { + std::vector::iterator it; + it = std::find(template_col.begin(), + template_col.end(), field_no); + + if (it == template_col.end()) { + continue; + } + + ut_ad(templ->rec_field_no == templ->clust_rec_field_no); + + sec_field_no = it - template_col.begin(); + } if (!row_sel_store_mysql_field(mysql_rec, prebuilt, rec, index, offsets, - field_no, templ)) { + field_no, templ, + sec_field_no)) { return(FALSE); } } @@ -2983,7 +3060,8 @@ NOTE, the record must be cluster index record. Secondary index might not have the Doc ID */ if (dict_table_has_fts_index(prebuilt->table) - && dict_index_is_clust(index)) { + && dict_index_is_clust(index) + && !clust_templ_for_sec) { prebuilt->fts_doc_id = fts_get_doc_id_from_rec( prebuilt->table, rec, NULL); @@ -3063,6 +3141,8 @@ dberr_t err; trx_t* trx; + os_atomic_increment_ulint(&srv_sec_rec_cluster_reads, 1); + *out_rec = NULL; trx = thr_get_trx(thr); @@ -3354,6 +3434,36 @@ ut_memcpy(buf, cache, len); } +/** Copy used fields from cached row. +Copy cache record field by field, don't touch fields that +are not covered by current key. +@param[out] buf Where to copy the MySQL row. +@param[in] cached_rec What to copy (in MySQL row format). +@param[in] prebuilt prebuilt struct. */ +void +row_sel_copy_cached_fields_for_mysql( + byte* buf, + const byte* cached_rec, + row_prebuilt_t* prebuilt) +{ + const mysql_row_templ_t*templ; + ulint i; + for (i = 0; i < prebuilt->n_template; i++) { + templ = prebuilt->mysql_template + i; + + row_sel_copy_cached_field_for_mysql( + buf, cached_rec, templ); + /* Copy NULL bit of the current field from cached_rec + to buf */ + if (templ->mysql_null_bit_mask) { + buf[templ->mysql_null_byte_offset] + ^= (buf[templ->mysql_null_byte_offset] + ^ cached_rec[templ->mysql_null_byte_offset]) + & (byte) templ->mysql_null_bit_mask; + } + } +} + /********************************************************************//** Pops a cached row for MySQL from the fetch cache. */ UNIV_INLINE @@ -3613,7 +3723,7 @@ if (!row_sel_store_mysql_field(mysql_rec, prebuilt, rec, prebuilt->index, offsets, templ->icp_rec_field_no, - templ)) { + templ, ULINT_UNDEFINED)) { return(ICP_NO_MATCH); } } @@ -3634,7 +3744,7 @@ || dict_index_is_clust(prebuilt->index)) { if (!row_sel_store_mysql_rec( mysql_rec, prebuilt, rec, FALSE, - prebuilt->index, offsets)) { + prebuilt->index, offsets, false)) { ut_ad(dict_index_is_clust(prebuilt->index)); return(ICP_NO_MATCH); } @@ -3653,6 +3763,50 @@ return(result); } +/** Check the pushed down end range condition to avoid extra traversal +if records are not within view and also to avoid prefetching in the +cache buffer. +@param[in] mysql_rec record in MySQL format +@param[in,out] handler the MySQL handler performing the scan +@retval true if the row in mysql_rec is out of range +@retval false if the row in mysql_rec is in range */ +static +bool +row_search_end_range_check( + const byte* mysql_rec, + ha_innobase* handler) +{ + if (handler->end_range && + handler->compare_key_in_buffer(mysql_rec) > 0) { + return(true); + } + + return(false); +} + +/** Return the record field length in characters. +@param[in] col table column of the field +@param[in] field_no field number +@param[in] rec physical record +@param[in] offsets field offsets in the physical record + +@return field length in characters */ +static +size_t +rec_field_len_in_chars(const dict_col_t &col, + const ulint field_no, + const rec_t *rec, + const ulint *offsets) +{ + const ulint cset = dtype_get_charset_coll(col.prtype); + const CHARSET_INFO* cs = all_charsets[cset]; + ulint rec_field_len; + const char* rec_field = reinterpret_cast( + rec_get_nth_field( + rec, offsets, field_no, &rec_field_len)); + return(cs->cset->numchars(cs, rec_field, rec_field + rec_field_len)); +} + /********************************************************************//** Searches for rows in the database. This is used in the interface to MySQL. This function opens a cursor, and also implements fetch next @@ -3690,7 +3844,9 @@ trx_t* trx = prebuilt->trx; dict_index_t* clust_index; que_thr_t* thr; - const rec_t* rec; + const rec_t* prev_rec = NULL; + const rec_t* rec = NULL; + byte* end_range_cache = NULL; const rec_t* result_rec = NULL; const rec_t* clust_rec; dberr_t err = DB_SUCCESS; @@ -3715,6 +3871,8 @@ ulint* offsets = offsets_; ibool table_lock_waited = FALSE; byte* next_buf = 0; + ulint end_loop = 0; + bool use_clustered_index = false; rec_offs_init(offsets_); @@ -3838,6 +3996,10 @@ err = DB_SUCCESS; goto func_exit; + } else if (prebuilt->end_range == true) { + prebuilt->end_range = false; + err = DB_RECORD_NOT_FOUND; + goto func_exit; } if (prebuilt->fetch_cache_first > 0 @@ -3970,7 +4132,8 @@ if (!row_sel_store_mysql_rec( buf, prebuilt, - rec, FALSE, index, offsets)) { + rec, FALSE, index, + offsets, false)) { /* Only fresh inserts may contain incomplete externally stored columns. Pretend that such @@ -4224,11 +4387,62 @@ and neither can a record lock be placed on it: we skip such a record. */ + prev_rec = NULL; goto next_rec; } if (page_rec_is_supremum(rec)) { + /** Compare the last record of the page with end range + passed to InnoDB when there is no ICP and number of loops + in row_search_for_mysql for rows found but not + reporting due to search views etc. */ + if (prev_rec != NULL + && prebuilt->mysql_handler->end_range != NULL + && prebuilt->idx_cond == NULL + && end_loop >= 100) { + + dict_index_t* key_index = prebuilt->index; + bool clust_templ_for_sec = false; + + if (end_range_cache == NULL) { + end_range_cache = static_cast( + ut_malloc(prebuilt->mysql_row_len)); + } + + if (index != clust_index + && prebuilt->need_to_access_clustered) { + /** Secondary index record but the template + based on PK. */ + key_index = clust_index; + clust_templ_for_sec = true; + } + + /** Create offsets based on prebuilt index. */ + offsets = rec_get_offsets(prev_rec, prebuilt->index, + offsets, ULINT_UNDEFINED, &heap); + + if (row_sel_store_mysql_rec( + end_range_cache, prebuilt, prev_rec, + clust_templ_for_sec, key_index, offsets, + clust_templ_for_sec)) { + + if (row_search_end_range_check( + end_range_cache, + prebuilt->mysql_handler)) { + + /** In case of prebuilt->fetch, + set the error in prebuilt->end_range. */ + if (prebuilt->n_fetch_cached > 0) { + prebuilt->end_range = true; + } + + err = DB_RECORD_NOT_FOUND; + goto normal_return; + } + } + } + if (set_also_gap_locks && !(srv_locks_unsafe_for_binlog || trx->isolation_level <= TRX_ISO_READ_COMMITTED) @@ -4260,6 +4474,7 @@ /* A page supremum record cannot be in the result set: skip it now that we have placed a possible lock on it */ + prev_rec = NULL; goto next_rec; } @@ -4334,6 +4549,7 @@ btr_pcur_move_to_last_on_page(pcur, &mtr); + prev_rec = NULL; goto next_rec; } } @@ -4362,10 +4578,13 @@ fputs(". We try to skip the record.\n", stderr); + prev_rec = NULL; goto next_rec; } } + prev_rec = rec; + /* Note that we cannot trust the up_match value in the cursor at this place because we can arrive here after moving the cursor! Thus we have to recompare rec and search_tuple to determine if they @@ -4590,6 +4809,7 @@ did_semi_consistent_read = TRUE; rec = old_vers; + prev_rec = rec; break; default: @@ -4636,6 +4856,7 @@ } rec = old_vers; + prev_rec = rec; } } else { /* We are looking into a non-clustered index, @@ -4729,10 +4950,97 @@ } /* Get the clustered index record if needed, if we did not do the - search using the clustered index. */ + search using the clustered index... */ + + use_clustered_index = + (index != clust_index && prebuilt->need_to_access_clustered); - if (index != clust_index && prebuilt->need_to_access_clustered) { + if (use_clustered_index && prebuilt->n_template <= index->n_fields) { + /* ...but, perhaps avoid the clustered index lookup if + all of the following are true: + 1) all columns are in the secondary index + 2) all values for columns that are prefix-only + indexes are shorter than the prefix size + This optimization can avoid many IOs for certain schemas. + */ + bool row_contains_all_values = true; + unsigned int i; + for (i = 0; i < prebuilt->n_template; i++) { + /* Condition (1) from above: is the field in the + index (prefix or not)? */ + const mysql_row_templ_t* templ = + prebuilt->mysql_template + i; + ulint secondary_index_field_no = + templ->rec_prefix_field_no; + if (secondary_index_field_no == ULINT_UNDEFINED) { + row_contains_all_values = false; + break; + } + /* Condition (2) from above: if this is a + prefix, is this row's value size shorter + than the prefix? */ + if (templ->rec_field_is_prefix) { + ulint record_size = rec_offs_nth_size( + offsets, + secondary_index_field_no); + const dict_field_t *field = + dict_index_get_nth_field( + index, + secondary_index_field_no); + ut_a(field->prefix_len > 0); + if (record_size + < field->prefix_len / templ->mbmaxlen) { + + /* Record in bytes shorter than the + index prefix length in characters */ + continue; + + } else if (record_size * templ->mbminlen + >= field->prefix_len) { + + /* The shortest represantable string by + the byte length of the record is longer + than the maximum possible index + prefix. */ + row_contains_all_values = false; + break; + } else { + + /* The record could or could not fit + into the index prefix, calculate length + to find out */ + + if (rec_field_len_in_chars( + *field->col, + secondary_index_field_no, + rec, offsets) + >= (field->prefix_len + / templ->mbmaxlen)) { + + row_contains_all_values = false; + break; + } + } + } + } + /* If (1) and (2) were true for all columns above, use + rec_prefix_field_no instead of rec_field_no, and skip + the clustered lookup below. */ + if (row_contains_all_values) { + for (i = 0; i < prebuilt->n_template; i++) { + mysql_row_templ_t* templ = + prebuilt->mysql_template + i; + templ->rec_field_no = + templ->rec_prefix_field_no; + ut_a(templ->rec_field_no != ULINT_UNDEFINED); + } + use_clustered_index = false; + os_atomic_increment_ulint( + &srv_sec_rec_cluster_reads_avoided, 1); + } + } + if (use_clustered_index) { requires_clust_rec: ut_ad(index != clust_index); /* We use a 'goto' to the preceding label if a consistent @@ -4813,7 +5121,7 @@ appropriate version of the clustered index record. */ if (!row_sel_store_mysql_rec( buf, prebuilt, result_rec, - TRUE, clust_index, offsets)) { + TRUE, clust_index, offsets, false)) { goto next_rec; } } @@ -4881,7 +5189,7 @@ next_buf, prebuilt, result_rec, result_rec != rec, result_rec != rec ? clust_index : index, - offsets)) { + offsets, false)) { if (next_buf == buf) { ut_a(prebuilt->n_fetch_cached == 0); @@ -4936,7 +5244,7 @@ buf, prebuilt, result_rec, result_rec != rec, result_rec != rec ? clust_index : index, - offsets)) { + offsets, false)) { /* Only fresh inserts may contain incomplete externally stored columns. Pretend that such records do @@ -4980,14 +5288,27 @@ btr_pcur_store_position(pcur, &mtr); - if (prebuilt->innodb_api) { - prebuilt->innodb_api_rec = result_rec; + if (prebuilt->innodb_api + && (btr_pcur_get_rec(pcur) != result_rec)) { + ulint rec_size = rec_offs_size(offsets); + if (!prebuilt->innodb_api_rec_size || + (prebuilt->innodb_api_rec_size < rec_size)) { + prebuilt->innodb_api_buf = + static_cast + (mem_heap_alloc(prebuilt->cursor_heap,rec_size)); + prebuilt->innodb_api_rec_size = rec_size; + } + prebuilt->innodb_api_rec = + rec_copy( + prebuilt->innodb_api_buf, result_rec, offsets); } } goto normal_return; next_rec: + end_loop++; + /* Reset the old and new "did semi-consistent read" flags. */ if (UNIV_UNLIKELY(prebuilt->row_read_type == ROW_READ_DID_SEMI_CONSISTENT)) { @@ -5174,6 +5495,11 @@ func_exit: trx->op_info = ""; + + if (end_range_cache != NULL) { + ut_free(end_range_cache); + } + if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0upd.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0upd.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/row/row0upd.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/row/row0upd.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1982,7 +1982,9 @@ index, offsets, thr, &mtr); } #ifdef WITH_WSREP - if (err == DB_SUCCESS && !referenced && + if (wsrep_on(trx->mysql_thd) && + !wsrep_thd_is_BF(trx->mysql_thd, FALSE) && + err == DB_SUCCESS && !referenced && !(parent && que_node_get_type(parent) == QUE_NODE_UPDATE && ((upd_node_t*)parent)->cascade_node == node) && diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/srv/srv0srv.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/srv/srv0srv.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/srv/srv0srv.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/srv/srv0srv.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. @@ -73,12 +73,6 @@ #include "mysql/plugin.h" #include "mysql/service_thd_wait.h" -/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */ -ibool innobase_thd_is_idle(const void* thd); -ib_int64_t innobase_thd_get_start_time(const void* thd); -void innobase_thd_kill(ulong thd_id); -ulong innobase_thd_get_thread_id(const void* thd); - /* prototypes for new functions added to ha_innodb.cc */ ibool innobase_get_slow_log(); @@ -165,7 +159,8 @@ OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads. Currently we support native aio on windows and linux */ -UNIV_INTERN my_bool srv_use_native_aio = TRUE; +/* make srv_use_native_aio to be visible for other plugins */ +my_bool srv_use_native_aio = TRUE; UNIV_INTERN my_bool srv_numa_interleave = FALSE; #ifdef __WIN__ @@ -461,6 +456,7 @@ table/index are not found in the innodb database */ UNIV_INTERN unsigned long long srv_stats_transient_sample_pages = 8; UNIV_INTERN my_bool srv_stats_persistent = TRUE; +UNIV_INTERN my_bool srv_stats_include_delete_marked = FALSE; UNIV_INTERN unsigned long long srv_stats_persistent_sample_pages = 20; UNIV_INTERN my_bool srv_stats_auto_recalc = TRUE; @@ -587,6 +583,12 @@ /** Log writes involving flush. */ static ulint srv_log_writes_and_flush = 0; +/** Number of times secondary index lookup triggered cluster lookup */ +ulint srv_sec_rec_cluster_reads = 0; + +/** Number of times prefix optimization avoided triggering cluster lookup */ +ulint srv_sec_rec_cluster_reads_avoided = 0; + /* This is only ever touched by the master thread. It records the time when the last flush of log file has happened. The master thread ensures that we flush the log files at least once per @@ -1361,22 +1363,26 @@ low level 135. Therefore we can reserve the latter mutex here without a danger of a deadlock of threads. */ - mutex_enter(&dict_foreign_err_mutex); + if (!recv_recovery_on) { - if (!srv_read_only_mode && ftell(dict_foreign_err_file) != 0L) { - fputs("------------------------\n" - "LATEST FOREIGN KEY ERROR\n" - "------------------------\n", file); - ut_copy_file(file, dict_foreign_err_file); - } + mutex_enter(&dict_foreign_err_mutex); - mutex_exit(&dict_foreign_err_mutex); + if (!srv_read_only_mode + && ftell(dict_foreign_err_file) != 0L) { + fputs("------------------------\n" + "LATEST FOREIGN KEY ERROR\n" + "------------------------\n", file); + ut_copy_file(file, dict_foreign_err_file); + } + + mutex_exit(&dict_foreign_err_mutex); + } /* Only if lock_print_info_summary proceeds correctly, before we call the lock_print_info_all_transactions to print all the lock information. IMPORTANT NOTE: This function acquires the lock mutex on success. */ - ret = lock_print_info_summary(file, nowait); + ret = recv_recovery_on ? FALSE : lock_print_info_summary(file, nowait); if (ret) { if (trx_start_pos) { @@ -1409,10 +1415,13 @@ "--------\n", file); os_aio_print(file); - fputs("-------------------------------------\n" - "INSERT BUFFER AND ADAPTIVE HASH INDEX\n" - "-------------------------------------\n", file); - ibuf_print(file); + if (!recv_recovery_on) { + + fputs("-------------------------------------\n" + "INSERT BUFFER AND ADAPTIVE HASH INDEX\n" + "-------------------------------------\n", file); + ibuf_print(file); + } fprintf(file, @@ -1424,10 +1433,13 @@ btr_cur_n_sea_old = btr_cur_n_sea; btr_cur_n_non_sea_old = btr_cur_n_non_sea; - fputs("---\n" - "LOG\n" - "---\n", file); - log_print(file); + if (!recv_recovery_on) { + + fputs("---\n" + "LOG\n" + "---\n", file); + log_print(file); + } fputs("----------------------\n" "BUFFER POOL AND MEMORY\n" @@ -1522,8 +1534,9 @@ ? (recv_sys->addr_hash->n_cells * sizeof(hash_cell_t)) : 0), recv_sys_subtotal); + fprintf(file, "Dictionary memory allocated " ULINTPF "\n", - dict_sys->size); + dict_sys ? dict_sys->size : 0); buf_print_io(file); @@ -1609,6 +1622,10 @@ mutex_exit(&srv_innodb_monitor_mutex); fflush(file); +#ifndef DBUG_OFF + srv_debug_monitor_printed = true; +#endif + return(ret); } @@ -1905,9 +1922,21 @@ } #endif /* UNIV_DEBUG */ + os_rmb; + export_vars.innodb_sec_rec_cluster_reads = + srv_sec_rec_cluster_reads; + export_vars.innodb_sec_rec_cluster_reads_avoided = + srv_sec_rec_cluster_reads_avoided; + mutex_exit(&srv_innodb_monitor_mutex); } +#ifndef DBUG_OFF +/** false before InnoDB monitor has been printed at least once, true +afterwards */ +bool srv_debug_monitor_printed = false; +#endif + /*********************************************************************//** A thread which prints the info output by various InnoDB monitors. @return a dummy parameter */ @@ -2192,36 +2221,6 @@ old_sema = sema; } - if (srv_kill_idle_transaction && trx_sys) { - trx_t* trx; - time_t now; -rescan_idle: - now = time(NULL); - mutex_enter(&trx_sys->mutex); - trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list); - while (trx) { - if (trx->state == TRX_STATE_ACTIVE - && trx->mysql_thd - && innobase_thd_is_idle(trx->mysql_thd)) { - ib_int64_t start_time = innobase_thd_get_start_time(trx->mysql_thd); - ulong thd_id = innobase_thd_get_thread_id(trx->mysql_thd); - - if (trx->last_stmt_start != start_time) { - trx->idle_start = now; - trx->last_stmt_start = start_time; - } else if (difftime(now, trx->idle_start) - > srv_kill_idle_transaction) { - /* kill the session */ - mutex_exit(&trx_sys->mutex); - innobase_thd_kill(thd_id); - goto rescan_idle; - } - } - trx = UT_LIST_GET_NEXT(mysql_trx_list, trx); - } - mutex_exit(&trx_sys->mutex); - } - /* Flush stderr so that a database user gets the output to possible MySQL error file */ @@ -2377,10 +2376,8 @@ } while (srv_shutdown_state < SRV_SHUTDOWN_LAST_PHASE); - srv_track_changed_pages = FALSE; log_online_read_shutdown(); os_event_set(srv_redo_log_tracked_event); - srv_redo_log_thread_started = false; /* Defensive, not required */ my_thread_end(); os_thread_exit(NULL); @@ -3005,6 +3002,8 @@ /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); + srv_slot_t* slot; ulint old_activity_count = srv_get_activity_count(); ulint old_ibuf_merge_activity_count @@ -3078,6 +3077,7 @@ os_event_wait(slot->event); if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) { + my_thread_end(); os_thread_exit(NULL); } @@ -3164,6 +3164,8 @@ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); + srv_slot_t* slot; ulint tid_i = os_atomic_increment_ulint(&purge_tid_i, 1); @@ -3230,6 +3232,7 @@ os_thread_pf(os_thread_get_curr_id())); #endif /* UNIV_DEBUG_THREAD_CREATION */ + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ os_thread_exit(NULL); @@ -3432,6 +3435,8 @@ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); + srv_slot_t* slot; ulint n_total_purged = ULINT_UNDEFINED; @@ -3544,6 +3549,7 @@ srv_release_threads(SRV_WORKER, srv_n_purge_threads - 1); } + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ os_thread_exit(NULL); @@ -3612,3 +3618,18 @@ } } +/** Check whether given space id is undo tablespace id +@param[in] space_id space id to check +@return true if it is undo tablespace else false. */ +bool +srv_is_undo_tablespace( + ulint space_id) +{ + if (srv_undo_space_id_start == 0) { + return (false); + } + + return(space_id >= srv_undo_space_id_start + && space_id < (srv_undo_space_id_start + + srv_undo_tablespaces_open)); +} diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/srv/srv0start.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/srv/srv0start.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/srv/srv0start.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/srv/srv0start.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2009, Percona Inc. @@ -110,6 +110,9 @@ /** TRUE if a raw partition is in use */ UNIV_INTERN ibool srv_start_raw_disk_in_use = FALSE; +/** UNDO tablespaces starts with space id. */ +ulint srv_undo_space_id_start; + /** TRUE if the server is being started, before rolling back any incomplete transactions */ UNIV_INTERN ibool srv_startup_is_before_trx_rollback_phase = FALSE; @@ -125,7 +128,7 @@ UNIV_INTERN enum srv_shutdown_state srv_shutdown_state = SRV_SHUTDOWN_NONE; /** Files comprising the system tablespace */ -static os_file_t files[1000]; +static pfs_os_file_t files[1000]; /** io_handler_thread parameters for thread identification */ static ulint n[SRV_MAX_N_IO_THREADS]; @@ -556,7 +559,7 @@ dberr_t create_log_file( /*============*/ - os_file_t* file, /*!< out: file handle */ + pfs_os_file_t* file, /*!< out: file handle */ const char* name) /*!< in: log file name */ { ibool ret; @@ -773,7 +776,7 @@ dberr_t open_log_file( /*==========*/ - os_file_t* file, /*!< out: file handle */ + pfs_os_file_t* file, /*!< out: file handle */ const char* name, /*!< in: log file name */ os_offset_t* size) /*!< out: file size */ { @@ -889,7 +892,7 @@ && os_file_get_last_error(false) != OS_FILE_ALREADY_EXISTS #ifdef UNIV_AIX - /* AIX 5.1 after security patch ML7 may have + /* AIX 5.1 after security patch ML7 may have errno set to 0 here, which causes our function to return 100; work around that AIX problem */ @@ -1186,7 +1189,7 @@ const char* name, /*!< in: tablespace name */ ulint size) /*!< in: tablespace size in pages */ { - os_file_t fh; + pfs_os_file_t fh; ibool ret; dberr_t err = DB_SUCCESS; @@ -1263,7 +1266,7 @@ const char* name, /*!< in: tablespace name */ ulint space) /*!< in: tablespace id */ { - os_file_t fh; + pfs_os_file_t fh; dberr_t err = DB_ERROR; ibool ret; ulint flags; @@ -1362,13 +1365,23 @@ for (i = 0; create_new_db && i < n_conf_tablespaces; ++i) { char name[OS_FILE_MAX_PATH]; + ulint space_id = i + 1; + + DBUG_EXECUTE_IF("innodb_undo_upgrade", + space_id = i + 3;); ut_snprintf( name, sizeof(name), "%s%cundo%03lu", - srv_undo_dir, SRV_PATH_SEPARATOR, i + 1); + srv_undo_dir, SRV_PATH_SEPARATOR, space_id); + + if (i == 0) { + srv_undo_space_id_start = space_id; + prev_space_id = srv_undo_space_id_start - 1; + } + + undo_tablespace_ids[i] = space_id; - /* Undo space ids start from 1. */ err = srv_undo_tablespace_create( name, SRV_UNDO_TABLESPACE_SIZE_IN_PAGES); @@ -1390,14 +1403,16 @@ if (!create_new_db) { n_undo_tablespaces = trx_rseg_get_n_undo_tablespaces( undo_tablespace_ids); - } else { - n_undo_tablespaces = n_conf_tablespaces; - for (i = 1; i <= n_undo_tablespaces; ++i) { - undo_tablespace_ids[i - 1] = i; + if (n_undo_tablespaces != 0) { + srv_undo_space_id_start = undo_tablespace_ids[0]; + prev_space_id = srv_undo_space_id_start - 1; } - undo_tablespace_ids[i] = ULINT_UNDEFINED; + } else { + n_undo_tablespaces = n_conf_tablespaces; + + undo_tablespace_ids[n_conf_tablespaces] = ULINT_UNDEFINED; } /* Open all the undo tablespaces that are currently in use. If we @@ -1421,8 +1436,6 @@ ut_a(undo_tablespace_ids[i] != 0); ut_a(undo_tablespace_ids[i] != ULINT_UNDEFINED); - /* Undo space ids start from 1. */ - err = srv_undo_tablespace_open(name, undo_tablespace_ids[i]); if (err != DB_SUCCESS) { @@ -1457,11 +1470,23 @@ break; } + /** Note the first undo tablespace id in case of + no active undo tablespace. */ + if (n_undo_tablespaces == 0) { + srv_undo_space_id_start = i; + } + ++n_undo_tablespaces; ++*n_opened; } + /** Explictly specify the srv_undo_space_id_start + as zero when there are no undo tablespaces. */ + if (n_undo_tablespaces == 0) { + srv_undo_space_id_start = 0; + } + /* If the user says that there are fewer than what we find we tolerate that discrepancy but not the inverse. Because there could be unused undo tablespaces for future use. */ @@ -1506,10 +1531,11 @@ mtr_start(&mtr); /* The undo log tablespace */ - for (i = 1; i <= n_undo_tablespaces; ++i) { + for (i = 0; i < n_undo_tablespaces; ++i) { fsp_header_init( - i, SRV_UNDO_TABLESPACE_SIZE_IN_PAGES, &mtr); + undo_tablespace_ids[i], + SRV_UNDO_TABLESPACE_SIZE_IN_PAGES, &mtr); } mtr_commit(&mtr); @@ -1607,6 +1633,10 @@ char* logfile0 = NULL; size_t dirnamelen; + if (srv_force_recovery == SRV_FORCE_NO_LOG_REDO) { + srv_read_only_mode = 1; + } + high_level_read_only = srv_read_only_mode || srv_force_recovery > SRV_FORCE_NO_TRX_UNDO; @@ -2060,6 +2090,7 @@ fsp_init(); log_init(); + log_online_init(); lock_sys_create(srv_lock_table_size); @@ -2365,6 +2396,8 @@ trx_sys_create(); + bool srv_monitor_thread_started = false; + if (create_new_db) { ut_a(!srv_read_only_mode); @@ -2440,6 +2473,20 @@ and there must be no page in the buf_flush list. */ buf_pool_invalidate(); + /* Start monitor thread early enough so that e.g. crash + recovery failing to find free pages in the buffer pool is + diagnosed. */ + if (!srv_read_only_mode) + { + /* Create the thread which prints InnoDB monitor + info */ + os_thread_create( + srv_monitor_thread, + NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS); + + srv_monitor_thread_started = true; + } + /* We always try to do a recovery, even if the database had been shut down normally: this is the normal startup path */ @@ -2700,9 +2747,14 @@ NULL, thread_ids + 3 + SRV_MAX_N_IO_THREADS); /* Create the thread which prints InnoDB monitor info */ - os_thread_create( - srv_monitor_thread, - NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS); + if (!srv_monitor_thread_started) { + + os_thread_create( + srv_monitor_thread, + NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS); + + srv_monitor_thread_started = true; + } } /* Create the SYS_FOREIGN and SYS_FOREIGN_COLS system tables */ @@ -3097,6 +3149,7 @@ btr_search_disable(); ibuf_close(); + log_online_shutdown(); log_shutdown(); trx_sys_file_format_close(); trx_sys_close(); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0purge.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0purge.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0purge.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0purge.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -696,7 +696,8 @@ /* We assume in purge of externally stored fields that space id is in the range of UNDO tablespace space ids */ - ut_a(purge_sys->rseg->space <= srv_undo_tablespaces_open); + ut_a(purge_sys->rseg->space == 0 + || srv_is_undo_tablespace(purge_sys->rseg->space)); zip_size = purge_sys->rseg->zip_size; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0rec.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0rec.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0rec.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0rec.cc 2017-10-19 04:25:29.000000000 +0000 @@ -781,7 +781,8 @@ } pos = dict_index_get_nth_col_pos(index, - col_no); + col_no, + NULL); ptr += mach_write_compressed(ptr, pos); /* Save the old value of field */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0roll.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0roll.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0roll.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0roll.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -808,6 +808,7 @@ /*!< in: a dummy parameter required by os_thread_create */ { + my_thread_init(); ut_ad(!srv_read_only_mode); #ifdef UNIV_PFS_THREAD @@ -818,6 +819,7 @@ trx_rollback_or_clean_is_active = false; + my_thread_end(); /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0sys.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0sys.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0sys.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0sys.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1052,18 +1052,12 @@ ulint new_rsegs = n_rsegs - n_used; for (i = 0; i < new_rsegs; ++i) { - ulint space; + ulint space_id; + space_id = (n_spaces == 0) ? 0 + : (srv_undo_space_id_start + i % n_spaces); - /* Tablespace 0 is the system tablespace. All UNDO - log tablespaces start from 1. */ - - if (n_spaces > 0) { - space = (i % n_spaces) + 1; - } else { - space = 0; /* System tablespace */ - } - - if (trx_rseg_create(space) != NULL) { + /* Tablespace 0 is the system tablespace. */ + if (trx_rseg_create(space_id) != NULL) { ++n_used; } else { break; @@ -1379,6 +1373,33 @@ trx_sys = NULL; } +/** @brief Convert an undo log to TRX_UNDO_PREPARED state on shutdown. + +If any prepared ACTIVE transactions exist, and their rollback was +prevented by innodb_force_recovery, we convert these transactions to +XA PREPARE state in the main-memory data structures, so that shutdown +will proceed normally. These transactions will again recover as ACTIVE +on the next restart, and they will be rolled back unless +innodb_force_recovery prevents it again. + +@param[in] trx transaction +@param[in,out] undo undo log to convert to TRX_UNDO_PREPARED */ +static +void +trx_undo_fake_prepared( + const trx_t* trx, + trx_undo_t* undo) +{ + ut_ad(srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO); + ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE)); + ut_ad(trx->is_recovered); + + if (undo != NULL) { + ut_ad(undo->state == TRX_UNDO_ACTIVE); + undo->state = TRX_UNDO_PREPARED; + } +} + /********************************************************************* Check if there are any active (non-prepared) transactions. @return total number of active transactions or 0 if none */ @@ -1387,15 +1408,42 @@ trx_sys_any_active_transactions(void) /*=================================*/ { - ulint total_trx = 0; - mutex_enter(&trx_sys->mutex); - total_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list) - + UT_LIST_GET_LEN(trx_sys->mysql_trx_list); + ulint total_trx = UT_LIST_GET_LEN(trx_sys->mysql_trx_list); - ut_a(total_trx >= trx_sys->n_prepared_trx); - total_trx -= trx_sys->n_prepared_trx; + if (total_trx == 0) { + total_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list); + ut_a(total_trx >= trx_sys->n_prepared_trx); + + if (total_trx > trx_sys->n_prepared_trx + && srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO) { + for (trx_t* trx = UT_LIST_GET_FIRST( + trx_sys->rw_trx_list); + trx != NULL; + trx = UT_LIST_GET_NEXT(trx_list, trx)) { + if (!trx_state_eq(trx, TRX_STATE_ACTIVE) + || !trx->is_recovered) { + continue; + } + /* This was a recovered transaction + whose rollback was disabled by + the innodb_force_recovery setting. + Pretend that it is in XA PREPARE + state so that shutdown will work. */ + trx_undo_fake_prepared( + trx, trx->insert_undo); + trx_undo_fake_prepared( + trx, trx->update_undo); + trx->state = TRX_STATE_PREPARED; + trx_sys->n_prepared_trx++; + trx_sys->n_prepared_recovered_trx++; + } + } + + ut_a(total_trx >= trx_sys->n_prepared_trx); + total_trx -= trx_sys->n_prepared_trx; + } mutex_exit(&trx_sys->mutex); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0trx.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0trx.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/innobase/trx/trx0trx.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/innobase/trx/trx0trx.cc 2017-10-19 04:25:29.000000000 +0000 @@ -2131,6 +2131,118 @@ mem_heap_get_size(trx->lock.lock_heap)); } +#ifdef WITH_WSREP +/**********************************************************************//** +Prints info about a transaction. +Transaction information may be retrieved without having trx_sys->mutex acquired +so it may not be completely accurate. The caller must own lock_sys->mutex +and the trx must have some locks to make sure that it does not escape +without locking lock_sys->mutex. */ +UNIV_INTERN +void +wsrep_trx_print_locking( +/*==========*/ + FILE* f, + /*!< in: output stream */ + const trx_t* trx, + /*!< in: transaction */ + ulint max_query_len) + /*!< in: max query length to print, + or 0 to use the default max length */ +{ + ibool newline; + const char* op_info; + + ut_ad(lock_mutex_own()); + ut_ad(trx->lock.trx_locks.count > 0); + + fprintf(f, "TRANSACTION " TRX_ID_FMT, trx->id); + + /* trx->state may change since trx_sys->mutex is not required */ + switch (trx->state) { + case TRX_STATE_NOT_STARTED: + fputs(", not started", f); + goto state_ok; + case TRX_STATE_ACTIVE: + fprintf(f, ", ACTIVE %lu sec", + (ulong) difftime(time(NULL), trx->start_time)); + goto state_ok; + case TRX_STATE_PREPARED: + fprintf(f, ", ACTIVE (PREPARED) %lu sec", + (ulong) difftime(time(NULL), trx->start_time)); + goto state_ok; + case TRX_STATE_COMMITTED_IN_MEMORY: + fputs(", COMMITTED IN MEMORY", f); + goto state_ok; + } + fprintf(f, ", state %lu", (ulong) trx->state); + ut_ad(0); +state_ok: + + /* prevent a race condition */ + op_info = trx->op_info; + + if (*op_info) { + putc(' ', f); + fputs(op_info, f); + } + + if (trx->is_recovered) { + fputs(" recovered trx", f); + } + + if (trx->declared_to_be_inside_innodb) { + fprintf(f, ", thread declared inside InnoDB %lu", + (ulong) trx->n_tickets_to_enter_innodb); + } + + putc('\n', f); + + if (trx->n_mysql_tables_in_use > 0 || trx->mysql_n_tables_locked > 0) { + fprintf(f, "mysql tables in use %lu, locked %lu\n", + (ulong) trx->n_mysql_tables_in_use, + (ulong) trx->mysql_n_tables_locked); + } + + newline = TRUE; + + /* trx->lock.que_state of an ACTIVE transaction may change + while we are not holding trx->mutex. We perform a dirty read + for performance reasons. */ + + switch (trx->lock.que_state) { + case TRX_QUE_RUNNING: + newline = FALSE; break; + case TRX_QUE_LOCK_WAIT: + fputs("LOCK WAIT ", f); break; + case TRX_QUE_ROLLING_BACK: + fputs("ROLLING BACK ", f); break; + case TRX_QUE_COMMITTING: + fputs("COMMITTING ", f); break; + default: + fprintf(f, "que state %lu ", (ulong) trx->lock.que_state); + } + + if (trx->has_search_latch) { + newline = TRUE; + fputs(", holds adaptive hash latch", f); + } + + if (trx->undo_no != 0) { + newline = TRUE; + fprintf(f, ", undo log entries " TRX_ID_FMT, trx->undo_no); + } + + if (newline) { + putc('\n', f); + } + + if (trx->mysql_thd != NULL) { + innobase_mysql_print_thd( + f, trx->mysql_thd, static_cast(max_query_len)); + } +} +#endif /* WITH_WSREP */ /**********************************************************************//** Prints info about a transaction. Acquires and releases lock_sys->mutex and trx_sys->mutex. */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/myisam/mi_delete_table.c percona-xtradb-cluster-5.6-5.6.37-26.21/storage/myisam/mi_delete_table.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/myisam/mi_delete_table.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/myisam/mi_delete_table.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #endif fn_format(from,name,"",MI_NAME_IEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); - if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from)) + if (my_is_symlink(from, NULL) && (*myisam_test_invalid_symlink)(from)) { /* Symlink is pointing to file in data directory. @@ -44,7 +44,7 @@ DBUG_RETURN(my_errno); } fn_format(from,name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); - if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from)) + if (my_is_symlink(from, NULL) && (*myisam_test_invalid_symlink)(from)) { /* Symlink is pointing to file in data directory. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/myisam/mi_open.c percona-xtradb-cluster-5.6-5.6.37-26.21/storage/myisam/mi_open.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/myisam/mi_open.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/myisam/mi_open.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -90,6 +90,7 @@ ulong rec_per_key_part[HA_MAX_POSSIBLE_KEY*MI_MAX_KEY_SEG]; my_off_t key_root[HA_MAX_POSSIBLE_KEY],key_del[MI_MAX_KEY_BLOCK_SIZE]; ulonglong max_key_file_length, max_data_file_length; + ST_FILE_ID file_id= {0, 0}; DBUG_ENTER("mi_open"); LINT_INIT(m_info); @@ -101,11 +102,15 @@ realpath_err= my_realpath(name_buff, fn_format(org_name,name,"",MI_NAME_IEXT,4),MYF(0)); - if (my_is_symlink(org_name) && - (realpath_err || (*myisam_test_invalid_symlink)(name_buff))) + if (my_is_symlink(name_buff, &file_id)) { - my_errno= HA_WRONG_CREATE_OPTION; - DBUG_RETURN (NULL); + if (realpath_err || + (*myisam_test_invalid_symlink)(name_buff) || + my_is_symlink(name_buff, &file_id)) + { + my_errno= HA_WRONG_CREATE_OPTION; + DBUG_RETURN (NULL); + } } if (!internal_table) @@ -130,17 +135,28 @@ my_errno= HA_ERR_CRASHED; goto err; }); + DEBUG_SYNC_C("before_opening_indexfile"); if ((kfile= mysql_file_open(mi_key_file_kfile, name_buff, - (open_mode= O_RDWR) | O_SHARE, MYF(0))) < 0) + (open_mode= O_RDWR) | O_SHARE | O_NOFOLLOW, + MYF(0))) < 0) { if ((errno != EROFS && errno != EACCES) || mode != O_RDONLY || (kfile= mysql_file_open(mi_key_file_kfile, name_buff, - (open_mode= O_RDONLY) | O_SHARE, MYF(0))) < 0) + (open_mode= O_RDONLY) | O_SHARE | O_NOFOLLOW, + MYF(0))) < 0) goto err; } + + if (!my_is_same_file(kfile, &file_id)) + { + mysql_file_close(kfile, MYF(0)); + my_errno= HA_WRONG_CREATE_OPTION; + goto err; + } + share->mode=open_mode; errpos=1; if (mysql_file_read(kfile, share->state.header.file_version, head_length, @@ -1233,14 +1249,16 @@ { char *data_name= share->data_file_name; char real_data_name[FN_REFLEN]; + ST_FILE_ID file_id= {0, 0}; if (org_name) { fn_format(real_data_name,org_name,"",MI_NAME_DEXT,4); - if (my_is_symlink(real_data_name)) + if (my_is_symlink(real_data_name, &file_id)) { if (my_realpath(real_data_name, real_data_name, MYF(0)) || - (*myisam_test_invalid_symlink)(real_data_name)) + (*myisam_test_invalid_symlink)(real_data_name) || + my_is_symlink(real_data_name, &file_id)) { my_errno= HA_WRONG_CREATE_OPTION; return 1; @@ -1248,9 +1266,19 @@ data_name= real_data_name; } } + DEBUG_SYNC_C("before_opening_datafile"); info->dfile= mysql_file_open(mi_key_file_dfile, - data_name, share->mode | O_SHARE, MYF(MY_WME)); - return info->dfile >= 0 ? 0 : 1; + data_name, share->mode | O_SHARE | O_NOFOLLOW, + MYF(MY_WME)); + if (info->dfile < 0) + return 1; + if (org_name && !my_is_same_file(info->dfile, &file_id)) + { + mysql_file_close(info->dfile, MYF(0)); + my_errno= HA_WRONG_CREATE_OPTION; + return 1; + } + return 0; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -2560,10 +2560,7 @@ if (! pfs_table->m_io_enabled) return NULL; - PFS_thread *pfs_thread= pfs_table->m_thread_owner; - - DBUG_ASSERT(pfs_thread == - my_pthread_getspecific_ptr(PFS_thread*, THR_PFS)); + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); register uint flags; ulonglong timer_start= 0; @@ -2666,7 +2663,7 @@ if (! pfs_table->m_lock_enabled) return NULL; - PFS_thread *pfs_thread= pfs_table->m_thread_owner; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); PFS_TL_LOCK_TYPE lock_type; @@ -3068,7 +3065,12 @@ if (flag_thread_instrumentation) { - PFS_thread *pfs_thread= pfs_socket->m_thread_owner; + /* + Do not use pfs_socket->m_thread_owner here, + as different threads may use concurrently the same socket, + for example during a KILL. + */ + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); if (unlikely(pfs_thread == NULL)) return NULL; @@ -3436,6 +3438,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } @@ -3517,6 +3521,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } } @@ -3596,6 +3602,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } } @@ -3668,6 +3676,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } } @@ -3732,6 +3742,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } } @@ -3826,6 +3838,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } @@ -3895,6 +3909,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } @@ -3935,9 +3951,11 @@ switch (state->m_operation) { case PSI_FILE_STAT: + case PSI_FILE_RENAME: break; case PSI_FILE_STREAM_OPEN: case PSI_FILE_CREATE: + case PSI_FILE_OPEN: if (result != NULL) { PFS_file_class *klass= reinterpret_cast (state->m_class); @@ -3948,7 +3966,6 @@ state->m_file= reinterpret_cast (pfs_file); } break; - case PSI_FILE_OPEN: default: DBUG_ASSERT(false); break; @@ -4143,6 +4160,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } } @@ -5070,6 +5089,8 @@ if (flag_events_waits_history_long) insert_events_waits_history_long(wait); thread->m_events_waits_current--; + + DBUG_ASSERT(wait == thread->m_events_waits_current); } } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs_digest.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs_digest.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs_digest.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs_digest.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ Current index in Stat array where new record is to be inserted. index 0 is reserved for "all else" case when entire array is full. */ -volatile uint32 digest_index; +volatile uint32 PFS_ALIGNED digest_monotonic_index; bool digest_full= false; LF_HASH digest_hash; @@ -63,7 +63,7 @@ */ digest_max= param->m_digest_sizing; digest_lost= 0; - digest_index= 1; + PFS_atomic::store_u32(& digest_monotonic_index, 1); digest_full= false; if (digest_max == 0) @@ -105,6 +105,9 @@ + index * pfs_max_digest_length, pfs_max_digest_length); } + /* Set record[0] as allocated. */ + statements_digest_stat_array[0].m_lock.set_allocated(); + return 0; } @@ -207,9 +210,10 @@ memcpy(hash_key.m_schema_name, schema_name, schema_name_length); int res; - ulong safe_index; uint retry_count= 0; const uint retry_max= 3; + size_t safe_index; + size_t attempts= 0; PFS_statements_digest_stat **entry; PFS_statements_digest_stat *pfs= NULL; @@ -245,55 +249,71 @@ return & pfs->m_stat; } - safe_index= PFS_atomic::add_u32(& digest_index, 1); - if (safe_index >= digest_max) + while (++attempts <= digest_max) { - /* The digest array is now full. */ - digest_full= true; - pfs= &statements_digest_stat_array[0]; - - if (pfs->m_first_seen == 0) - pfs->m_first_seen= now; - pfs->m_last_seen= now; - return & pfs->m_stat; - } - - /* Add a new record in digest stat array. */ - pfs= &statements_digest_stat_array[safe_index]; - - /* Copy digest hash/LF Hash search key. */ - memcpy(& pfs->m_digest_key, &hash_key, sizeof(PFS_digest_key)); - - /* - Copy digest storage to statement_digest_stat_array so that it could be - used later to generate digest text. - */ - pfs->m_digest_storage.copy(digest_storage); - - pfs->m_first_seen= now; - pfs->m_last_seen= now; + safe_index= PFS_atomic::add_u32(& digest_monotonic_index, 1) % digest_max; + if (safe_index == 0) + { + /* Record [0] is reserved. */ + continue; + } - res= lf_hash_insert(&digest_hash, pins, &pfs); - if (likely(res == 0)) - { - return & pfs->m_stat; - } + /* Add a new record in digest stat array. */ + DBUG_ASSERT(safe_index < digest_max); + pfs= &statements_digest_stat_array[safe_index]; - if (res > 0) - { - /* Duplicate insert by another thread */ - if (++retry_count > retry_max) + if (pfs->m_lock.is_free()) { - /* Avoid infinite loops */ - digest_lost++; - return NULL; + if (pfs->m_lock.free_to_dirty()) + { + /* Copy digest hash/LF Hash search key. */ + memcpy(& pfs->m_digest_key, &hash_key, sizeof(PFS_digest_key)); + + /* + Copy digest storage to statement_digest_stat_array so that it could be + used later to generate digest text. + */ + pfs->m_digest_storage.copy(digest_storage); + + pfs->m_first_seen= now; + pfs->m_last_seen= now; + + res= lf_hash_insert(&digest_hash, pins, &pfs); + if (likely(res == 0)) + { + pfs->m_lock.dirty_to_allocated(); + return & pfs->m_stat; + } + + pfs->m_lock.dirty_to_free(); + + if (res > 0) + { + /* Duplicate insert by another thread */ + if (++retry_count > retry_max) + { + /* Avoid infinite loops */ + digest_lost++; + return NULL; + } + goto search; + } + + /* OOM in lf_hash_insert */ + digest_lost++; + return NULL; + } } - goto search; } - /* OOM in lf_hash_insert */ - digest_lost++; - return NULL; + /* The digest array is now full. */ + digest_full= true; + pfs= &statements_digest_stat_array[0]; + + if (pfs->m_first_seen == 0) + pfs->m_first_seen= now; + pfs->m_last_seen= now; + return & pfs->m_stat; } void purge_digest(PFS_thread* thread, PFS_digest_key *hash_key) @@ -320,10 +340,12 @@ void PFS_statements_digest_stat::reset_data(unsigned char *token_array, uint length) { + m_lock.set_dirty(); m_digest_storage.reset(token_array, length); m_stat.reset(); m_first_seen= 0; m_last_seen= 0; + m_lock.dirty_to_free(); } void PFS_statements_digest_stat::reset_index(PFS_thread *thread) @@ -351,11 +373,14 @@ statements_digest_stat_array[index].reset_data(statements_digest_token_array + index * pfs_max_digest_length, pfs_max_digest_length); } + /* Mark record[0] as allocated again. */ + statements_digest_stat_array[0].m_lock.set_allocated(); + /* Reset index which indicates where the next calculated digest information to be inserted in statements_digest_stat_array. */ - digest_index= 1; + PFS_atomic::store_u32(& digest_monotonic_index, 1); digest_full= false; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs_digest.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs_digest.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs_digest.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs_digest.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -44,6 +44,9 @@ /** A statement digest stat record. */ struct PFS_ALIGNED PFS_statements_digest_stat { + /** Internal lock. */ + pfs_lock m_lock; + /** Digest Schema + MD5 Hash. */ PFS_digest_key m_digest_key; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs_lock.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs_lock.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/pfs_lock.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/pfs_lock.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 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 @@ -155,6 +155,18 @@ PFS_atomic::store_u32(&m_version_state, new_val); } + /** + Initialize a lock to dirty. + */ + void set_dirty(void) + { + /* Do not set the version to 0, read the previous value. */ + uint32 copy= PFS_atomic::load_u32(&m_version_state); + /* Increment the version, set the DIRTY state */ + uint32 new_val= (copy & VERSION_MASK) + VERSION_INC + PFS_LOCK_DIRTY; + PFS_atomic::store_u32(&m_version_state, new_val); + } + /** Execute a dirty to free transition. This transition should be executed by the writer that owns the record. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/table_esms_by_digest.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/table_esms_by_digest.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/table_esms_by_digest.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/table_esms_by_digest.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -238,11 +238,14 @@ m_pos.next()) { digest_stat= &statements_digest_stat_array[m_pos.m_index]; - if (digest_stat->m_first_seen != 0) + if (digest_stat->m_lock.is_populated()) { - make_row(digest_stat); - m_next_pos.set_after(&m_pos); - return 0; + if (digest_stat->m_first_seen != 0) + { + make_row(digest_stat); + m_next_pos.set_after(&m_pos); + return 0; + } } } @@ -260,10 +263,13 @@ set_position(pos); digest_stat= &statements_digest_stat_array[m_pos.m_index]; - if (digest_stat->m_first_seen != 0) + if (digest_stat->m_lock.is_populated()) { - make_row(digest_stat); - return 0; + if (digest_stat->m_first_seen != 0) + { + make_row(digest_stat); + return 0; + } } return HA_ERR_RECORD_DELETED; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_account-oom-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_account-oom-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_account-oom-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_account-oom-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -111,6 +111,6 @@ plan(6); MY_INIT("pfs_account-oom-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_connect_attr-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_connect_attr-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_connect_attr-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_connect_attr-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -341,5 +341,5 @@ diag("skipping the cp1251 tests : missing character set"); plan(59 + (cs_cp1251 ? 10 : 0)); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_host-oom-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_host-oom-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_host-oom-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_host-oom-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -111,6 +111,6 @@ plan(6); MY_INIT("pfs_host-oom-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr_class-oom-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr_class-oom-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr_class-oom-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr_class-oom-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,6 +67,6 @@ plan(9); MY_INIT("pfs_instr_info-oom-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr_class-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr_class-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr_class-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr_class-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -673,6 +673,6 @@ plan(181); MY_INIT("pfs_instr_info-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr-oom-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr-oom-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr-oom-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr-oom-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -354,6 +354,10 @@ init_event_name_sizing(& param); rc= init_instruments(& param); ok(rc == 1, "oom (per thread wait)"); + + cleanup_sync_class(); + cleanup_thread_class(); + cleanup_file_class(); cleanup_instruments(); param.m_enabled= true; @@ -433,6 +437,8 @@ init_event_name_sizing(& param); rc= init_instruments(& param); ok(rc == 1, "oom (thread stages history sizing)"); + + cleanup_thread_class(); cleanup_instruments(); param.m_enabled= true; @@ -468,6 +474,9 @@ init_event_name_sizing(& param); rc= init_instruments(& param); ok(rc == 1, "oom (per thread stages)"); + + cleanup_stage_class(); + cleanup_thread_class(); cleanup_instruments(); param.m_enabled= true; @@ -503,6 +512,8 @@ init_event_name_sizing(& param); rc= init_instruments(& param); ok(rc == 1, "oom (thread statements history sizing)"); + + cleanup_thread_class(); cleanup_instruments(); param.m_enabled= true; @@ -538,6 +549,9 @@ init_event_name_sizing(& param); rc= init_instruments(& param); ok(rc == 1, "oom (per thread statements)"); + + cleanup_statement_class(); + cleanup_thread_class(); cleanup_instruments(); param.m_enabled= true; @@ -573,6 +587,8 @@ init_event_name_sizing(& param); rc= init_instruments(& param); ok(rc == 1, "oom (global waits)"); + + cleanup_sync_class(); cleanup_instruments(); param.m_enabled= true; @@ -610,8 +626,10 @@ ok(rc == 0, "init stage class"); rc= init_instruments(& param); ok(rc == 1, "oom (global stages)"); - cleanup_instruments(); + + cleanup_sync_class(); cleanup_stage_class(); + cleanup_instruments(); param.m_enabled= true; param.m_mutex_class_sizing= 10; @@ -648,8 +666,10 @@ ok(rc == 0, "init statement class"); rc= init_instruments(& param); ok(rc == 1, "oom (global statements)"); - cleanup_instruments(); + + cleanup_sync_class(); cleanup_statement_class(); + cleanup_instruments(); } void do_all_tests() @@ -666,6 +686,6 @@ plan(20); MY_INIT("pfs_instr-oom-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_instr-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_instr-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,10 +23,11 @@ #include +PFS_global_param param; + void test_no_instruments() { int rc; - PFS_global_param param; memset(& param, 0xFF, sizeof(param)); param.m_enabled= true; @@ -86,7 +87,6 @@ PFS_file *file; PFS_socket *socket; PFS_table *table; - PFS_global_param param; memset(& param, 0xFF, sizeof(param)); param.m_enabled= true; @@ -227,7 +227,6 @@ PFS_socket *socket_2; PFS_table *table_1; PFS_table *table_2; - PFS_global_param param; memset(& param, 0xFF, sizeof(param)); param.m_enabled= true; @@ -417,6 +416,6 @@ plan(103); MY_INIT("pfs_instr-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_misc-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_misc-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_misc-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_misc-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,6 +66,6 @@ plan(2); MY_INIT("pfs_misc-t"); do_all_tests(); - return exit_status(); + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,8 @@ #include "stub_print_error.h" #include "stub_pfs_defaults.h" +void unload_performance_schema(); + /* test helpers, to simulate the setup */ void setup_thread(PSI_thread *t, bool enabled) @@ -126,7 +128,7 @@ psi_2= boot->get_interface(PSI_VERSION_2); ok(psi_2 == NULL, "version 2"); - shutdown_performance_schema(); + unload_performance_schema(); } /* @@ -183,19 +185,25 @@ return (PSI*) psi; } -static -void close_perfschema() +void unload_performance_schema() { - // A lot of PFS cleanup is disabled due to bug 56666 in - // shutdown_performance_schema. This bug does not apply - // for a single-threaded unit test, thus cleanup manually here. cleanup_table_share(); cleanup_instruments(); - cleanup_socket_class(); - cleanup_file_class(); cleanup_sync_class(); cleanup_thread_class(); + cleanup_table_share(); + cleanup_file_class(); + cleanup_stage_class(); + cleanup_statement_class(); + cleanup_socket_class(); cleanup_events_waits_history_long(); + cleanup_events_stages_history_long(); + cleanup_events_statements_history_long(); + cleanup_table_share_hash(); + cleanup_file_hash(); + cleanup_digest(); + PFS_atomic::cleanup(); + shutdown_performance_schema(); } @@ -597,8 +605,7 @@ psi->register_socket("X", bad_socket_3, 1); ok(dummy_socket_key == 2, "assigned key"); - - close_perfschema(); + unload_performance_schema(); } void test_init_disabled() @@ -1032,7 +1039,7 @@ socket_A1= psi->init_socket(99, NULL, NULL, 0); ok(socket_A1 == NULL, "broken socket key not instrumented"); - close_perfschema(); + unload_performance_schema(); } void test_locker_disabled() @@ -1337,8 +1344,9 @@ ok(socket_A1 != NULL, "instrumented"); /* Socket thread owner has not been set */ socket_locker= psi->start_socket_wait(&socket_state, socket_A1, PSI_SOCKET_SEND, 12, "foo.cc", 12); - ok(socket_locker == NULL, "no locker (no thread owner)"); - + ok(socket_locker != NULL, "locker (owner not used)"); + psi->end_socket_wait(socket_locker, 10); + /* Pretend the running thread is not instrumented */ /* ---------------------------------------------- */ @@ -1366,7 +1374,7 @@ socket_locker= psi->start_socket_wait(&socket_state, socket_A1, PSI_SOCKET_SEND, 12, "foo.cc", 12); ok(socket_locker == NULL, "no locker"); - close_perfschema(); + unload_performance_schema(); } void test_file_instrumentation_leak() @@ -1453,7 +1461,7 @@ file_locker= psi->get_thread_file_descriptor_locker(&file_state, (File) 12, PSI_FILE_WRITE); ok(file_locker == NULL, "no locker, no leak"); - close_perfschema(); + unload_performance_schema(); } void test_enabled() @@ -1489,7 +1497,7 @@ { & cond_key_B, "C-B", 0} }; - close_perfschema(); + unload_performance_schema(); #endif } @@ -1658,6 +1666,6 @@ plan(216); MY_INIT("pfs-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_timer-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_timer-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_timer-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_timer-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -117,6 +117,6 @@ plan(5); MY_INIT("pfs_timer-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_user-oom-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_user-oom-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/perfschema/unittest/pfs_user-oom-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/perfschema/unittest/pfs_user-oom-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -110,6 +110,6 @@ plan(6); MY_INIT("pfs_user-oom-t"); do_all_tests(); - return 0; + return (exit_status()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -11,6 +11,11 @@ MESSAGE(SEND_ERROR "Missing Makefile in rocksdb directory. Try \"git submodule update\".") ENDIF() +CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) +IF(HAVE_SCHED_GETCPU) + ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1) +ENDIF() + ## adds a compiler flag if the compiler supports it INCLUDE(CheckCCompilerFlag) INCLUDE(CheckCXXCompilerFlag) @@ -36,11 +41,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/include + ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/include/rocksdb ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/third-party/gtest-1.7.0/fused-src ) ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_LINUX - -DZLIB -DPERCONA_SERVER) + -DZLIB) SET(ROCKSDB_SOURCES ha_rocksdb.cc ha_rocksdb.h ha_rocksdb_proto.h @@ -115,19 +121,18 @@ ADD_SUBDIRECTORY(unittest) ENDIF() -IF (WITH_ROCKSDB_SE_STORAGE_ENGINE) - # TODO: read this file list from src.mk:TOOL_SOURCES - SET(ROCKSDB_TOOL_SOURCES - ${CMAKE_SOURCE_DIR}/rocksdb/tools/ldb_tool.cc - ${CMAKE_SOURCE_DIR}/rocksdb/tools/ldb_cmd.cc - ${CMAKE_SOURCE_DIR}/rocksdb/tools/sst_dump_tool.cc - ) - MYSQL_ADD_EXECUTABLE(sst_dump ${CMAKE_SOURCE_DIR}/rocksdb/tools/sst_dump.cc ${ROCKSDB_TOOL_SOURCES}) - TARGET_LINK_LIBRARIES(sst_dump rocksdb) +# TODO: read this file list from src.mk:TOOL_SOURCES +SET(ROCKSDB_TOOL_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/tools/ldb_tool.cc + ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/tools/ldb_cmd.cc + ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/tools/sst_dump_tool.cc + ${ROCKSDB_LIB_SOURCES} +) +MYSQL_ADD_EXECUTABLE(sst_dump ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/tools/sst_dump.cc ${ROCKSDB_TOOL_SOURCES}) +TARGET_LINK_LIBRARIES(sst_dump ${rocksdb_static_libs}) - MYSQL_ADD_EXECUTABLE(ldb ${CMAKE_SOURCE_DIR}/rocksdb/tools/ldb.cc ${ROCKSDB_TOOL_SOURCES}) - TARGET_LINK_LIBRARIES(ldb rocksdb) +MYSQL_ADD_EXECUTABLE(ldb ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/tools/ldb.cc ${ROCKSDB_TOOL_SOURCES}) +TARGET_LINK_LIBRARIES(ldb ${rocksdb_static_libs}) - MYSQL_ADD_EXECUTABLE(mysql_ldb ${CMAKE_SOURCE_DIR}/storage/rocksdb/tools/mysql_ldb.cc ${ROCKSDB_TOOL_SOURCES}) - TARGET_LINK_LIBRARIES(mysql_ldb rocksdb) -ENDIF() +MYSQL_ADD_EXECUTABLE(mysql_ldb ${CMAKE_CURRENT_SOURCE_DIR}/tools/mysql_ldb.cc ${ROCKSDB_TOOL_SOURCES}) +TARGET_LINK_LIBRARIES(mysql_ldb ${rocksdb_static_libs}) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/event_listener.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/event_listener.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/event_listener.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/event_listener.cc 2017-10-19 04:25:29.000000000 +0000 @@ -22,8 +22,8 @@ #include /* MySQL includes */ -#include #include +#include /* MyRocks includes */ #include "./ha_rocksdb.h" @@ -33,13 +33,11 @@ namespace myrocks { static std::vector -extract_index_stats( - const std::vector& files, - const rocksdb::TablePropertiesCollection& props -) { +extract_index_stats(const std::vector &files, + const rocksdb::TablePropertiesCollection &props) { std::vector ret; for (auto fn : files) { - auto it = props.find(fn); + const auto it = props.find(fn); DBUG_ASSERT(it != props.end()); std::vector stats; Rdb_tbl_prop_coll::read_stats_from_tbl_props(it->second, &stats); @@ -48,33 +46,39 @@ return ret; } +void Rdb_event_listener::update_index_stats( + const rocksdb::TableProperties &props) { + DBUG_ASSERT(m_ddl_manager != nullptr); + const auto tbl_props = + std::make_shared(props); + + std::vector stats; + Rdb_tbl_prop_coll::read_stats_from_tbl_props(tbl_props, &stats); + + m_ddl_manager->adjust_stats(stats); +} + void Rdb_event_listener::OnCompactionCompleted( - rocksdb::DB *db, - const rocksdb::CompactionJobInfo& ci -) { + rocksdb::DB *db, const rocksdb::CompactionJobInfo &ci) { DBUG_ASSERT(db != nullptr); DBUG_ASSERT(m_ddl_manager != nullptr); if (ci.status.ok()) { m_ddl_manager->adjust_stats( - extract_index_stats(ci.output_files, ci.table_properties), - extract_index_stats(ci.input_files, ci.table_properties)); + extract_index_stats(ci.output_files, ci.table_properties), + extract_index_stats(ci.input_files, ci.table_properties)); } } void Rdb_event_listener::OnFlushCompleted( - rocksdb::DB* db, - const rocksdb::FlushJobInfo& flush_job_info -) { + rocksdb::DB *db, const rocksdb::FlushJobInfo &flush_job_info) { DBUG_ASSERT(db != nullptr); - DBUG_ASSERT(m_ddl_manager != nullptr); - - auto tbl_props = std::make_shared( - flush_job_info.table_properties); - - std::vector stats; - Rdb_tbl_prop_coll::read_stats_from_tbl_props(tbl_props, &stats); - m_ddl_manager->adjust_stats(stats); + update_index_stats(flush_job_info.table_properties); } -} // namespace myrocks +void Rdb_event_listener::OnExternalFileIngested( + rocksdb::DB *db, const rocksdb::ExternalFileIngestionInfo &info) { + DBUG_ASSERT(db != nullptr); + update_index_stats(info.table_properties); +} +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/event_listener.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/event_listener.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/event_listener.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/event_listener.h 2017-10-19 04:25:29.000000000 +0000 @@ -21,20 +21,26 @@ class Rdb_ddl_manager; -class Rdb_event_listener : public rocksdb::EventListener -{ - public: - explicit Rdb_event_listener(Rdb_ddl_manager* ddl_manager) : - m_ddl_manager(ddl_manager) { - } - - void OnCompactionCompleted( - rocksdb::DB *db, const rocksdb::CompactionJobInfo& ci) override; - void OnFlushCompleted( - rocksdb::DB* db, const rocksdb::FlushJobInfo& flush_job_info) override; +class Rdb_event_listener : public rocksdb::EventListener { +public: + Rdb_event_listener(const Rdb_event_listener &) = delete; + Rdb_event_listener &operator=(const Rdb_event_listener &) = delete; - private: - Rdb_ddl_manager* m_ddl_manager; + explicit Rdb_event_listener(Rdb_ddl_manager *const ddl_manager) + : m_ddl_manager(ddl_manager) {} + + void OnCompactionCompleted(rocksdb::DB *db, + const rocksdb::CompactionJobInfo &ci) override; + void OnFlushCompleted(rocksdb::DB *db, + const rocksdb::FlushJobInfo &flush_job_info) override; + void OnExternalFileIngested( + rocksdb::DB *db, + const rocksdb::ExternalFileIngestionInfo &ingestion_info) override; + +private: + Rdb_ddl_manager *m_ddl_manager; + + void update_index_stats(const rocksdb::TableProperties &props); }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ha_rocksdb.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ha_rocksdb.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ha_rocksdb.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ha_rocksdb.cc 2017-10-19 04:25:29.000000000 +0000 @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif #define MYSQL_SERVER 1 @@ -24,8 +24,9 @@ #include "./ha_rocksdb.h" /* C++ standard header files */ -#include +#include #include +#include #include #include @@ -33,13 +34,15 @@ #include "./debug_sync.h" #include "./my_bit.h" #include "./my_stacktrace.h" +#include "./sql_audit.h" #include "./sql_table.h" -#include #include #include +#include /* RocksDB includes */ #include "rocksdb/compaction_filter.h" +#include "rocksdb/persistent_cache.h" #include "rocksdb/rate_limiter.h" #include "rocksdb/slice_transform.h" #include "rocksdb/utilities/checkpoint.h" @@ -59,8 +62,7 @@ #include "./rdb_threads.h" // Internal MySQL APIs not exposed in any header. -extern "C" -{ +extern "C" { /** Mark transaction to rollback and mark error as fatal to a sub-statement. @param thd Thread handle @@ -91,7 +93,7 @@ /** Updates row counters based on the table type and operation type. */ -void ha_rocksdb::update_row_stats(operation_type type) { +void ha_rocksdb::update_row_stats(const operation_type &type) { DBUG_ASSERT(type < ROWS_MAX); // Find if we are modifying system databases. if (table->s && m_tbl_def->m_is_mysql_system_table) @@ -105,17 +107,15 @@ my_core::TABLE_SHARE *table_arg, my_core::MEM_ROOT *mem_root); -bool can_use_bloom_filter(THD *thd, - const std::shared_ptr& kd, +bool can_use_bloom_filter(THD *thd, const Rdb_key_def &kd, const rocksdb::Slice &eq_cond, - const bool use_all_keys, - bool is_ascending); + const bool use_all_keys, bool is_ascending); /////////////////////////////////////////////////////////// // Parameters and settings /////////////////////////////////////////////////////////// -static char * rocksdb_default_cf_options; -static char * rocksdb_override_cf_options; +static char *rocksdb_default_cf_options; +static char *rocksdb_override_cf_options; Rdb_cf_options rocksdb_cf_options_map; /////////////////////////////////////////////////////////// @@ -123,17 +123,14 @@ /////////////////////////////////////////////////////////// handlerton *rocksdb_hton; -rocksdb::TransactionDB *rdb= nullptr; +rocksdb::TransactionDB *rdb = nullptr; static std::shared_ptr rocksdb_stats; -static std::shared_ptr - properties_collector_factory; +static std::shared_ptr properties_collector_factory; Rdb_dict_manager dict_manager; Rdb_cf_manager cf_manager; Rdb_ddl_manager ddl_manager; -Rdb_binlog_manager binlog_manager; - /** MyRocks background thread control @@ -143,122 +140,108 @@ static Rdb_background_thread rdb_bg_thread; - // List of table names (using regex) that are exceptions to the strict // collation check requirement. -Regex_list_handler *rdb_collation_exceptions; +Regex *rdb_collation_exceptions; -static const char* const ERRSTR_ROLLBACK_ONLY - = "This transaction was rolled back and cannot be " +static const char *const ERRSTR_ROLLBACK_ONLY = + "This transaction was rolled back and cannot be " "committed. Only supported operation is to roll it back, " "so all pending changes will be discarded. " "Please restart another transaction."; - -static void -rocksdb_flush_all_memtables() -{ - Rdb_cf_manager& cf_manager= rdb_get_cf_manager(); - for (auto cf_handle : cf_manager.get_all_cf()) { +static void rocksdb_flush_all_memtables() { + const Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); + for (const auto &cf_handle : cf_manager.get_all_cf()) { rdb->Flush(rocksdb::FlushOptions(), cf_handle); } } -static void -rocksdb_compact_column_family_stub(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save) -{ -} - -static int -rocksdb_compact_column_family(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - struct st_mysql_value* value) -{ +static void rocksdb_compact_column_family_stub( + THD *const thd, struct st_mysql_sys_var *const var, void *const var_ptr, + const void *const save) {} + +static int rocksdb_compact_column_family(THD *const thd, + struct st_mysql_sys_var *const var, + void *const var_ptr, + struct st_mysql_value *const value) { char buff[STRING_BUFFER_USUAL_SIZE]; - int len = sizeof(buff); + int len = sizeof(buff); + + DBUG_ASSERT(value != nullptr); - if (const char* cf = value->val_str(value, buff, &len)) { + if (const char *const cf = value->val_str(value, buff, &len)) { bool is_automatic; auto cfh = cf_manager.get_cf(cf, "", nullptr, &is_automatic); if (cfh != nullptr && rdb != nullptr) { - sql_print_information("RocksDB: Manual compaction of column family: %s\n", cf); + sql_print_information("RocksDB: Manual compaction of column family: %s\n", + cf); rdb->CompactRange(rocksdb::CompactRangeOptions(), cfh, nullptr, nullptr); } } - return 0; + return HA_EXIT_SUCCESS; } /////////////////////////////////////////////////////////// // Hash map: table name => open table handler /////////////////////////////////////////////////////////// -namespace // anonymous namespace = not visible outside this source file +namespace // anonymous namespace = not visible outside this source file { -struct Rdb_open_tables_map -{ +const ulong TABLE_HASH_SIZE = 32; + +struct Rdb_open_tables_map { /* Hash table used to track the handlers of open tables */ - my_core::HASH m_hash; + my_core::HASH m_hash; /* The mutex used to protect the hash table */ mutable mysql_mutex_t m_mutex; - void init_hash(void) - { - (void) my_hash_init(&m_hash, my_core::system_charset_info, 32, 0, 0, - (my_hash_get_key) Rdb_open_tables_map::get_hash_key, - 0, 0); + void init_hash(void) { + (void)my_hash_init(&m_hash, my_core::system_charset_info, TABLE_HASH_SIZE, + 0, 0, (my_hash_get_key)Rdb_open_tables_map::get_hash_key, + 0, 0); } - void free_hash(void) - { - my_hash_free(&m_hash); - } + void free_hash(void) { my_hash_free(&m_hash); } - static uchar* get_hash_key(Rdb_table_handler *table_handler, - size_t *length, + static uchar *get_hash_key(Rdb_table_handler *const table_handler, + size_t *const length, my_bool not_used __attribute__((__unused__))); - Rdb_table_handler* get_table_handler(const char *table_name); - void release_table_handler(Rdb_table_handler *table_handler); + Rdb_table_handler *get_table_handler(const char *const table_name); + void release_table_handler(Rdb_table_handler *const table_handler); std::vector get_table_names(void) const; }; -} // anonymous namespace +} // anonymous namespace static Rdb_open_tables_map rdb_open_tables; - -static std::string rdb_normalize_dir(std::string dir) -{ - while (dir.size() > 0 && dir.back() == '/') - { +static std::string rdb_normalize_dir(std::string dir) { + while (dir.size() > 0 && dir.back() == '/') { dir.resize(dir.size() - 1); } return dir; } - -static int rocksdb_create_checkpoint( - THD* thd __attribute__((__unused__)), - struct st_mysql_sys_var* var __attribute__((__unused__)), - void* save __attribute__((__unused__)), - struct st_mysql_value* value) -{ - char buf[512]; +static int rocksdb_create_checkpoint(THD *const thd __attribute__((__unused__)), + struct st_mysql_sys_var *const var + __attribute__((__unused__)), + void *const save + __attribute__((__unused__)), + struct st_mysql_value *const value) { + char buf[FN_REFLEN]; int len = sizeof(buf); - const char* checkpoint_dir_raw= value->val_str(value, buf, &len); + const char *const checkpoint_dir_raw = value->val_str(value, buf, &len); if (checkpoint_dir_raw) { if (rdb != nullptr) { - std::string checkpoint_dir= rdb_normalize_dir(checkpoint_dir_raw); + std::string checkpoint_dir = rdb_normalize_dir(checkpoint_dir_raw); // NO_LINT_DEBUG sql_print_information("RocksDB: creating checkpoint in directory : %s\n", - checkpoint_dir.c_str()); - rocksdb::Checkpoint* checkpoint; + checkpoint_dir.c_str()); + rocksdb::Checkpoint *checkpoint; auto status = rocksdb::Checkpoint::Create(rdb, &checkpoint); if (status.ok()) { status = checkpoint->CreateCheckpoint(checkpoint_dir.c_str()); @@ -274,568 +257,613 @@ } delete checkpoint; } else { - std::string err_text(status.ToString()); - my_printf_error(ER_UNKNOWN_ERROR, - "RocksDB: failed to initialize checkpoint. status %d %s\n", - MYF(0), status.code(), err_text.c_str()); + const std::string err_text(status.ToString()); + my_printf_error( + ER_UNKNOWN_ERROR, + "RocksDB: failed to initialize checkpoint. status %d %s\n", MYF(0), + status.code(), err_text.c_str()); } return status.code(); - } + } } return HA_ERR_INTERNAL_ERROR; } /* This method is needed to indicate that the ROCKSDB_CREATE_CHECKPOINT command is not read-only */ -static void -rocksdb_create_checkpoint_stub(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save) -{ -} - -static void -rocksdb_force_flush_memtable_now_stub(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save) -{ -} - -static int -rocksdb_force_flush_memtable_now(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - struct st_mysql_value* value) -{ +static void rocksdb_create_checkpoint_stub(THD *const thd, + struct st_mysql_sys_var *const var, + void *const var_ptr, + const void *const save) {} + +static void rocksdb_force_flush_memtable_now_stub( + THD *const thd, struct st_mysql_sys_var *const var, void *const var_ptr, + const void *const save) {} + +static int rocksdb_force_flush_memtable_now( + THD *const thd, struct st_mysql_sys_var *const var, void *const var_ptr, + struct st_mysql_value *const value) { sql_print_information("RocksDB: Manual memtable flush\n"); rocksdb_flush_all_memtables(); - return 0; + return HA_EXIT_SUCCESS; } static void rocksdb_drop_index_wakeup_thread( - my_core::THD* thd __attribute__((__unused__)), - struct st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr __attribute__((__unused__)), - const void* save); + my_core::THD *const thd __attribute__((__unused__)), + struct st_mysql_sys_var *const var __attribute__((__unused__)), + void *const var_ptr __attribute__((__unused__)), const void *const save); -static my_bool rocksdb_pause_background_work= 0; +static my_bool rocksdb_pause_background_work = 0; static mysql_mutex_t rdb_sysvars_mutex; static void rocksdb_set_pause_background_work( - my_core::THD* thd __attribute__((__unused__)), - struct st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr __attribute__((__unused__)), - const void* save) -{ + my_core::THD *const thd __attribute__((__unused__)), + struct st_mysql_sys_var *const var __attribute__((__unused__)), + void *const var_ptr __attribute__((__unused__)), const void *const save) { mysql_mutex_lock(&rdb_sysvars_mutex); - bool pause_requested= *static_cast(save); + const bool pause_requested = *static_cast(save); if (rocksdb_pause_background_work != pause_requested) { if (pause_requested) { rdb->PauseBackgroundWork(); } else { rdb->ContinueBackgroundWork(); } - rocksdb_pause_background_work= pause_requested; + rocksdb_pause_background_work = pause_requested; } mysql_mutex_unlock(&rdb_sysvars_mutex); } -static void -rocksdb_set_compaction_options(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save); - -static void -rocksdb_set_table_stats_sampling_pct(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save); - -static void -rocksdb_set_rate_limiter_bytes_per_sec(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save); +static void rocksdb_set_compaction_options(THD *thd, + struct st_mysql_sys_var *var, + void *var_ptr, const void *save); + +static void rocksdb_set_table_stats_sampling_pct(THD *thd, + struct st_mysql_sys_var *var, + void *var_ptr, + const void *save); + +static void rocksdb_set_rate_limiter_bytes_per_sec(THD *thd, + struct st_mysql_sys_var *var, + void *var_ptr, + const void *save); static void rdb_set_collation_exception_list(const char *exception_list); -static void -rocksdb_set_collation_exception_list(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save); - -static void -rocksdb_set_bulk_load(THD* thd, - struct st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr, - const void* save); +static void rocksdb_set_collation_exception_list(THD *thd, + struct st_mysql_sys_var *var, + void *var_ptr, + const void *save); + +static void rocksdb_set_bulk_load(THD *thd, struct st_mysql_sys_var *var + __attribute__((__unused__)), + void *var_ptr, const void *save); + +static void rocksdb_set_max_background_compactions( + THD *thd, struct st_mysql_sys_var *const var, void *const var_ptr, + const void *const save); ////////////////////////////////////////////////////////////////////////////// // Options definitions ////////////////////////////////////////////////////////////////////////////// static long long rocksdb_block_cache_size; /* Use unsigned long long instead of uint64_t because of MySQL compatibility */ -static unsigned long long // NOLINT(runtime/int) +static unsigned long long // NOLINT(runtime/int) rocksdb_rate_limiter_bytes_per_sec; +static unsigned long // NOLINT(runtime/int) + rocksdb_persistent_cache_size; static uint64_t rocksdb_info_log_level; -static char * rocksdb_wal_dir; +static char *rocksdb_wal_dir; +static char *rocksdb_persistent_cache_path; static uint64_t rocksdb_index_type; static char rocksdb_background_sync; static uint32_t rocksdb_debug_optimizer_n_rows; static my_bool rocksdb_debug_optimizer_no_zero_cardinality; static uint32_t rocksdb_wal_recovery_mode; static uint32_t rocksdb_access_hint_on_compaction_start; -static char * rocksdb_compact_cf_name; -static char * rocksdb_checkpoint_name; +static char *rocksdb_compact_cf_name; +static char *rocksdb_checkpoint_name; static my_bool rocksdb_signal_drop_index_thread; -static my_bool rocksdb_strict_collation_check= 1; -static my_bool rocksdb_disable_2pc= 0; -static char * rocksdb_strict_collation_exceptions; -static my_bool rocksdb_collect_sst_properties= 1; -static my_bool rocksdb_force_flush_memtable_now_var= 0; -static uint64_t rocksdb_number_stat_computes= 0; -static uint32_t rocksdb_seconds_between_stat_computes= 3600; -static long long rocksdb_compaction_sequential_deletes= 0l; -static long long rocksdb_compaction_sequential_deletes_window= 0l; -static long long rocksdb_compaction_sequential_deletes_file_size= 0l; +static my_bool rocksdb_strict_collation_check = 1; +static my_bool rocksdb_enable_2pc = 0; +static char *rocksdb_strict_collation_exceptions; +static my_bool rocksdb_collect_sst_properties = 1; +static my_bool rocksdb_force_flush_memtable_now_var = 0; +static uint64_t rocksdb_number_stat_computes = 0; +static uint32_t rocksdb_seconds_between_stat_computes = 3600; +static long long rocksdb_compaction_sequential_deletes = 0l; +static long long rocksdb_compaction_sequential_deletes_window = 0l; +static long long rocksdb_compaction_sequential_deletes_file_size = 0l; static uint32_t rocksdb_validate_tables = 1; -static char * rocksdb_datadir; +static char *rocksdb_datadir; static uint32_t rocksdb_table_stats_sampling_pct; -static my_bool rocksdb_enable_bulk_load_api= 1; -static my_bool rpl_skip_tx_api_var= 0; +static my_bool rocksdb_enable_bulk_load_api = 1; +static my_bool rpl_skip_tx_api_var = 0; +static my_bool rocksdb_print_snapshot_conflict_queries = 0; std::atomic rocksdb_snapshot_conflict_errors(0); +std::atomic rocksdb_wal_group_syncs(0); -static rocksdb::DBOptions rdb_init_rocksdb_db_options(void) -{ +static rocksdb::DBOptions rdb_init_rocksdb_db_options(void) { rocksdb::DBOptions o; - o.create_if_missing= true; + o.create_if_missing = true; o.listeners.push_back(std::make_shared(&ddl_manager)); - o.info_log_level= rocksdb::InfoLogLevel::INFO_LEVEL; - o.max_subcompactions= DEFAULT_SUBCOMPACTIONS; + o.info_log_level = rocksdb::InfoLogLevel::INFO_LEVEL; + o.max_subcompactions = DEFAULT_SUBCOMPACTIONS; return o; } -static rocksdb::DBOptions rocksdb_db_options= rdb_init_rocksdb_db_options(); +static rocksdb::DBOptions rocksdb_db_options = rdb_init_rocksdb_db_options(); static rocksdb::BlockBasedTableOptions rocksdb_tbl_options; static std::shared_ptr rocksdb_rate_limiter; /* This enum needs to be kept up to date with rocksdb::InfoLogLevel */ -static const char* info_log_level_names[] = { - "debug_level", - "info_level", - "warn_level", - "error_level", - "fatal_level", - NullS -}; +static const char *info_log_level_names[] = {"debug_level", "info_level", + "warn_level", "error_level", + "fatal_level", NullS}; static TYPELIB info_log_level_typelib = { - array_elements(info_log_level_names) - 1, - "info_log_level_typelib", - info_log_level_names, - nullptr -}; + array_elements(info_log_level_names) - 1, "info_log_level_typelib", + info_log_level_names, nullptr}; + +static void rocksdb_set_rocksdb_info_log_level( + THD *const thd, struct st_mysql_sys_var *const var, void *const var_ptr, + const void *const save) { + DBUG_ASSERT(save != nullptr); -static void -rocksdb_set_rocksdb_info_log_level(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save) -{ mysql_mutex_lock(&rdb_sysvars_mutex); - rocksdb_info_log_level = *static_cast(save); + rocksdb_info_log_level = *static_cast(save); rocksdb_db_options.info_log->SetInfoLogLevel( static_cast(rocksdb_info_log_level)); mysql_mutex_unlock(&rdb_sysvars_mutex); } -static const char* index_type_names[] = { - "kBinarySearch", - "kHashSearch", - NullS -}; +static const char *index_type_names[] = {"kBinarySearch", "kHashSearch", NullS}; -static TYPELIB index_type_typelib = { - array_elements(index_type_names) - 1, - "index_type_typelib", - index_type_names, - nullptr -}; +static TYPELIB index_type_typelib = {array_elements(index_type_names) - 1, + "index_type_typelib", index_type_names, + nullptr}; + +const ulong RDB_MAX_LOCK_WAIT_SECONDS = 1024 * 1024 * 1024; +const ulong RDB_MAX_ROW_LOCKS = 1024 * 1024 * 1024; +const ulong RDB_DEFAULT_BULK_LOAD_SIZE = 1000; +const ulong RDB_MAX_BULK_LOAD_SIZE = 1024 * 1024 * 1024; +const size_t RDB_DEFAULT_MERGE_BUF_SIZE = 64 * 1024 * 1024; +const size_t RDB_MIN_MERGE_BUF_SIZE = 100; +const size_t RDB_DEFAULT_MERGE_COMBINE_READ_SIZE = 1024 * 1024 * 1024; +const size_t RDB_MIN_MERGE_COMBINE_READ_SIZE = 100; +const int64 RDB_DEFAULT_BLOCK_CACHE_SIZE = 512 * 1024 * 1024; +const int64 RDB_MIN_BLOCK_CACHE_SIZE = 1024; +const int RDB_MAX_CHECKSUMS_PCT = 100; -//TODO: 0 means don't wait at all, and we don't support it yet? +// TODO: 0 means don't wait at all, and we don't support it yet? static MYSQL_THDVAR_ULONG(lock_wait_timeout, PLUGIN_VAR_RQCMDARG, - "Number of seconds to wait for lock", - nullptr, nullptr, /*default*/ 1, /*min*/ 1, /*max*/ 1024*1024*1024, 0); + "Number of seconds to wait for lock", nullptr, + nullptr, /*default*/ 1, /*min*/ 1, + /*max*/ RDB_MAX_LOCK_WAIT_SECONDS, 0); + +static MYSQL_THDVAR_BOOL(deadlock_detect, PLUGIN_VAR_RQCMDARG, + "Enables deadlock detection", nullptr, nullptr, FALSE); + +static MYSQL_THDVAR_BOOL( + trace_sst_api, PLUGIN_VAR_RQCMDARG, + "Generate trace output in the log for each call to the SstFileWriter", + nullptr, nullptr, FALSE); + +static MYSQL_THDVAR_BOOL( + bulk_load, PLUGIN_VAR_RQCMDARG, + "Use bulk-load mode for inserts. This disables " + "unique_checks and enables rocksdb_commit_in_the_middle.", + nullptr, rocksdb_set_bulk_load, FALSE); + +static MYSQL_SYSVAR_BOOL(enable_bulk_load_api, rocksdb_enable_bulk_load_api, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Enables using SstFileWriter for bulk loading", + nullptr, nullptr, rocksdb_enable_bulk_load_api); + +static MYSQL_THDVAR_STR(tmpdir, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_MEMALLOC, + "Directory for temporary files during DDL operations.", + nullptr, nullptr, ""); -static MYSQL_THDVAR_BOOL(bulk_load, PLUGIN_VAR_RQCMDARG, - "Use bulk-load mode for inserts. This enables both " - "rocksdb_skip_unique_check and rocksdb_commit_in_the_middle.", - nullptr, rocksdb_set_bulk_load, FALSE); - -static MYSQL_SYSVAR_BOOL(enable_bulk_load_api, - rocksdb_enable_bulk_load_api, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "Enables using SstFileWriter for bulk loading", - nullptr, nullptr, rocksdb_enable_bulk_load_api); - -static MYSQL_THDVAR_STR(skip_unique_check_tables, - PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, - "Skip unique constraint checking for the specified tables", nullptr, nullptr, - ".*"); - -static MYSQL_THDVAR_BOOL(skip_unique_check, PLUGIN_VAR_RQCMDARG, - "Skip unique constraint checking for all tables", nullptr, nullptr, FALSE); - -static MYSQL_THDVAR_BOOL(commit_in_the_middle, PLUGIN_VAR_RQCMDARG, - "Commit rows implicitly every rocksdb_bulk_load_size, on bulk load/insert, " - "update and delete", - nullptr, nullptr, FALSE); - -static MYSQL_THDVAR_STR(read_free_rpl_tables, - PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, - "List of tables that will use read-free replication on the slave " - "(i.e. not lookup a row during replication)", nullptr, nullptr, ""); +static MYSQL_THDVAR_BOOL( + commit_in_the_middle, PLUGIN_VAR_RQCMDARG, + "Commit rows implicitly every rocksdb_bulk_load_size, on bulk load/insert, " + "update and delete", + nullptr, nullptr, FALSE); + +static MYSQL_THDVAR_STR( + read_free_rpl_tables, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "Regex that describes set of tables that will use read-free replication " + "on the slave (i.e. not lookup a row during replication)", + nullptr, nullptr, ""); static MYSQL_SYSVAR_BOOL( - rpl_skip_tx_api, - rpl_skip_tx_api_var, - PLUGIN_VAR_RQCMDARG, - "Use write batches for replication thread instead of tx api", nullptr, - nullptr, FALSE); + rpl_skip_tx_api, rpl_skip_tx_api_var, PLUGIN_VAR_RQCMDARG, + "Use write batches for replication thread instead of tx api", nullptr, + nullptr, FALSE); static MYSQL_THDVAR_BOOL(skip_bloom_filter_on_read, PLUGIN_VAR_RQCMDARG, - "Skip using bloom filter for reads", nullptr, nullptr, FALSE); + "Skip using bloom filter for reads", nullptr, nullptr, + FALSE); static MYSQL_THDVAR_ULONG(max_row_locks, PLUGIN_VAR_RQCMDARG, - "Maximum number of locks a transaction can have", - nullptr, nullptr, /*default*/ 1024*1024*1024, /*min*/ 1, - /*max*/ 1024*1024*1024, 0); - -static MYSQL_THDVAR_BOOL(lock_scanned_rows, PLUGIN_VAR_RQCMDARG, - "Take and hold locks on rows that are scanned but not updated", - nullptr, nullptr, FALSE); + "Maximum number of locks a transaction can have", + nullptr, nullptr, + /*default*/ RDB_MAX_ROW_LOCKS, + /*min*/ 1, + /*max*/ RDB_MAX_ROW_LOCKS, 0); + +static MYSQL_THDVAR_BOOL( + lock_scanned_rows, PLUGIN_VAR_RQCMDARG, + "Take and hold locks on rows that are scanned but not updated", nullptr, + nullptr, FALSE); static MYSQL_THDVAR_ULONG(bulk_load_size, PLUGIN_VAR_RQCMDARG, - "Max #records in a batch for bulk-load mode", - nullptr, nullptr, /*default*/ 1000, /*min*/ 1, /*max*/ 1024*1024*1024, 0); + "Max #records in a batch for bulk-load mode", nullptr, + nullptr, + /*default*/ RDB_DEFAULT_BULK_LOAD_SIZE, + /*min*/ 1, + /*max*/ RDB_MAX_BULK_LOAD_SIZE, 0); + +static MYSQL_THDVAR_ULONGLONG( + merge_buf_size, PLUGIN_VAR_RQCMDARG, + "Size to allocate for merge sort buffers written out to disk " + "during inplace index creation.", + nullptr, nullptr, + /* default (64MB) */ RDB_DEFAULT_MERGE_BUF_SIZE, + /* min (100B) */ RDB_MIN_MERGE_BUF_SIZE, + /* max */ SIZE_T_MAX, 1); + +static MYSQL_THDVAR_ULONGLONG( + merge_combine_read_size, PLUGIN_VAR_RQCMDARG, + "Size that we have to work with during combine (reading from disk) phase " + "of " + "external sort during fast index creation.", + nullptr, nullptr, + /* default (1GB) */ RDB_DEFAULT_MERGE_COMBINE_READ_SIZE, + /* min (100B) */ RDB_MIN_MERGE_COMBINE_READ_SIZE, + /* max */ SIZE_T_MAX, 1); + +static MYSQL_SYSVAR_BOOL( + create_if_missing, + *reinterpret_cast(&rocksdb_db_options.create_if_missing), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::create_if_missing for RocksDB", nullptr, nullptr, + rocksdb_db_options.create_if_missing); + +static MYSQL_SYSVAR_BOOL( + create_missing_column_families, + *reinterpret_cast( + &rocksdb_db_options.create_missing_column_families), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::create_missing_column_families for RocksDB", nullptr, nullptr, + rocksdb_db_options.create_missing_column_families); + +static MYSQL_SYSVAR_BOOL( + error_if_exists, + *reinterpret_cast(&rocksdb_db_options.error_if_exists), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::error_if_exists for RocksDB", nullptr, nullptr, + rocksdb_db_options.error_if_exists); + +static MYSQL_SYSVAR_BOOL( + paranoid_checks, + *reinterpret_cast(&rocksdb_db_options.paranoid_checks), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::paranoid_checks for RocksDB", nullptr, nullptr, + rocksdb_db_options.paranoid_checks); + +static MYSQL_SYSVAR_ULONGLONG( + rate_limiter_bytes_per_sec, rocksdb_rate_limiter_bytes_per_sec, + PLUGIN_VAR_RQCMDARG, "DBOptions::rate_limiter bytes_per_sec for RocksDB", + nullptr, rocksdb_set_rate_limiter_bytes_per_sec, /* default */ 0L, + /* min */ 0L, /* max */ MAX_RATE_LIMITER_BYTES_PER_SEC, 0); + +static MYSQL_SYSVAR_ENUM( + info_log_level, rocksdb_info_log_level, PLUGIN_VAR_RQCMDARG, + "Filter level for info logs to be written mysqld error log. " + "Valid values include 'debug_level', 'info_level', 'warn_level'" + "'error_level' and 'fatal_level'.", + nullptr, rocksdb_set_rocksdb_info_log_level, + rocksdb::InfoLogLevel::ERROR_LEVEL, &info_log_level_typelib); + +static MYSQL_THDVAR_INT( + perf_context_level, PLUGIN_VAR_RQCMDARG, + "Perf Context Level for rocksdb internal timer stat collection", nullptr, + nullptr, + /* default */ rocksdb::PerfLevel::kUninitialized, + /* min */ rocksdb::PerfLevel::kUninitialized, + /* max */ rocksdb::PerfLevel::kOutOfBounds - 1, 0); -static MYSQL_THDVAR_ULONGLONG(merge_buf_size, PLUGIN_VAR_RQCMDARG, - "Size to allocate for merge sort buffers written out to disk " - "during inplace index creation.", - nullptr, nullptr, - /* default (64MB) */ (ulonglong) 67108864, - /* min (100B) */ 100, - /* max */ SIZE_T_MAX, 1); - -static MYSQL_THDVAR_ULONGLONG(merge_combine_read_size, PLUGIN_VAR_RQCMDARG, - "Size that we have to work with during combine (reading from disk) phase of " - "external sort during fast index creation.", - nullptr, nullptr, - /* default (1GB) */ (ulonglong) 1073741824, - /* min (100B) */ 100, - /* max */ SIZE_T_MAX, 1); - -static MYSQL_SYSVAR_BOOL(create_if_missing, - *reinterpret_cast(&rocksdb_db_options.create_if_missing), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::create_if_missing for RocksDB", - nullptr, nullptr, rocksdb_db_options.create_if_missing); - -static MYSQL_SYSVAR_BOOL(create_missing_column_families, - *reinterpret_cast( - &rocksdb_db_options.create_missing_column_families), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::create_missing_column_families for RocksDB", - nullptr, nullptr, rocksdb_db_options.create_missing_column_families); - -static MYSQL_SYSVAR_BOOL(error_if_exists, - *reinterpret_cast(&rocksdb_db_options.error_if_exists), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::error_if_exists for RocksDB", - nullptr, nullptr, rocksdb_db_options.error_if_exists); - -static MYSQL_SYSVAR_BOOL(paranoid_checks, - *reinterpret_cast(&rocksdb_db_options.paranoid_checks), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::paranoid_checks for RocksDB", - nullptr, nullptr, rocksdb_db_options.paranoid_checks); - -static MYSQL_SYSVAR_ULONGLONG(rate_limiter_bytes_per_sec, - rocksdb_rate_limiter_bytes_per_sec, - PLUGIN_VAR_RQCMDARG, - "DBOptions::rate_limiter bytes_per_sec for RocksDB", - nullptr, rocksdb_set_rate_limiter_bytes_per_sec, /* default */ 0L, - /* min */ 0L, /* max */ MAX_RATE_LIMITER_BYTES_PER_SEC, 0); - -static MYSQL_SYSVAR_ENUM(info_log_level, - rocksdb_info_log_level, - PLUGIN_VAR_RQCMDARG, - "Filter level for info logs to be written mysqld error log. " - "Valid values include 'debug_level', 'info_level', 'warn_level'" - "'error_level' and 'fatal_level'.", - nullptr, rocksdb_set_rocksdb_info_log_level, - rocksdb::InfoLogLevel::ERROR_LEVEL, &info_log_level_typelib); - -static MYSQL_THDVAR_INT(perf_context_level, - PLUGIN_VAR_RQCMDARG, - "Perf Context Level for rocksdb internal timer stat collection", - nullptr, nullptr, - /* default */ rocksdb::PerfLevel::kUninitialized, - /* min */ rocksdb::PerfLevel::kUninitialized, - /* max */ rocksdb::PerfLevel::kOutOfBounds - 1, 0); - -static MYSQL_SYSVAR_UINT(wal_recovery_mode, - rocksdb_wal_recovery_mode, - PLUGIN_VAR_RQCMDARG, - "DBOptions::wal_recovery_mode for RocksDB", - nullptr, nullptr, 2, - /* min */ 0L, /* max */ 3, 0); +static MYSQL_SYSVAR_UINT( + wal_recovery_mode, rocksdb_wal_recovery_mode, PLUGIN_VAR_RQCMDARG, + "DBOptions::wal_recovery_mode for RocksDB", nullptr, nullptr, + /* default */ (uint)rocksdb::WALRecoveryMode::kPointInTimeRecovery, + /* min */ (uint)rocksdb::WALRecoveryMode::kTolerateCorruptedTailRecords, + /* max */ (uint)rocksdb::WALRecoveryMode::kSkipAnyCorruptedRecords, 0); static MYSQL_SYSVAR_ULONG(compaction_readahead_size, - rocksdb_db_options.compaction_readahead_size, - PLUGIN_VAR_RQCMDARG, - "DBOptions::compaction_readahead_size for RocksDB", - nullptr, nullptr, rocksdb_db_options.compaction_readahead_size, - /* min */ 0L, /* max */ ULONG_MAX, 0); - -static MYSQL_SYSVAR_BOOL(new_table_reader_for_compaction_inputs, - *reinterpret_cast - (&rocksdb_db_options.new_table_reader_for_compaction_inputs), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::new_table_reader_for_compaction_inputs for RocksDB", - nullptr, nullptr, rocksdb_db_options.new_table_reader_for_compaction_inputs); - -static MYSQL_SYSVAR_UINT(access_hint_on_compaction_start, - rocksdb_access_hint_on_compaction_start, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::access_hint_on_compaction_start for RocksDB", - nullptr, nullptr, 1, - /* min */ 0L, /* max */ 3, 0); - -static MYSQL_SYSVAR_BOOL(allow_concurrent_memtable_write, - *reinterpret_cast( - &rocksdb_db_options.allow_concurrent_memtable_write), - PLUGIN_VAR_RQCMDARG, - "DBOptions::allow_concurrent_memtable_write for RocksDB", - nullptr, nullptr, rocksdb_db_options.allow_concurrent_memtable_write); - -static MYSQL_SYSVAR_BOOL(enable_write_thread_adaptive_yield, - *reinterpret_cast( - &rocksdb_db_options.enable_write_thread_adaptive_yield), - PLUGIN_VAR_RQCMDARG, - "DBOptions::enable_write_thread_adaptive_yield for RocksDB", - nullptr, nullptr, rocksdb_db_options.enable_write_thread_adaptive_yield); - -static MYSQL_SYSVAR_INT(max_open_files, - rocksdb_db_options.max_open_files, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::max_open_files for RocksDB", - nullptr, nullptr, rocksdb_db_options.max_open_files, - /* min */ -1, /* max */ INT_MAX, 0); + rocksdb_db_options.compaction_readahead_size, + PLUGIN_VAR_RQCMDARG, + "DBOptions::compaction_readahead_size for RocksDB", + nullptr, nullptr, + rocksdb_db_options.compaction_readahead_size, + /* min */ 0L, /* max */ ULONG_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + new_table_reader_for_compaction_inputs, + *reinterpret_cast( + &rocksdb_db_options.new_table_reader_for_compaction_inputs), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::new_table_reader_for_compaction_inputs for RocksDB", nullptr, + nullptr, rocksdb_db_options.new_table_reader_for_compaction_inputs); + +static MYSQL_SYSVAR_UINT( + access_hint_on_compaction_start, rocksdb_access_hint_on_compaction_start, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::access_hint_on_compaction_start for RocksDB", nullptr, nullptr, + /* default */ (uint)rocksdb::Options::AccessHint::NORMAL, + /* min */ (uint)rocksdb::Options::AccessHint::NONE, + /* max */ (uint)rocksdb::Options::AccessHint::WILLNEED, 0); + +static MYSQL_SYSVAR_BOOL( + allow_concurrent_memtable_write, + *reinterpret_cast( + &rocksdb_db_options.allow_concurrent_memtable_write), + PLUGIN_VAR_RQCMDARG, + "DBOptions::allow_concurrent_memtable_write for RocksDB", nullptr, nullptr, + false); + +static MYSQL_SYSVAR_BOOL( + enable_write_thread_adaptive_yield, + *reinterpret_cast( + &rocksdb_db_options.enable_write_thread_adaptive_yield), + PLUGIN_VAR_RQCMDARG, + "DBOptions::enable_write_thread_adaptive_yield for RocksDB", nullptr, + nullptr, false); + +static MYSQL_SYSVAR_INT(max_open_files, rocksdb_db_options.max_open_files, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::max_open_files for RocksDB", nullptr, + nullptr, rocksdb_db_options.max_open_files, + /* min */ -1, /* max */ INT_MAX, 0); static MYSQL_SYSVAR_ULONG(max_total_wal_size, - rocksdb_db_options.max_total_wal_size, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::max_total_wal_size for RocksDB", - nullptr, nullptr, rocksdb_db_options.max_total_wal_size, - /* min */ 0L, /* max */ LONG_MAX, 0); - -static MYSQL_SYSVAR_BOOL(disabledatasync, - *reinterpret_cast(&rocksdb_db_options.disableDataSync), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::disableDataSync for RocksDB", - nullptr, nullptr, rocksdb_db_options.disableDataSync); - -static MYSQL_SYSVAR_BOOL(use_fsync, - *reinterpret_cast(&rocksdb_db_options.use_fsync), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::use_fsync for RocksDB", - nullptr, nullptr, rocksdb_db_options.use_fsync); + rocksdb_db_options.max_total_wal_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::max_total_wal_size for RocksDB", nullptr, + nullptr, rocksdb_db_options.max_total_wal_size, + /* min */ 0L, /* max */ LONG_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + disabledatasync, + *reinterpret_cast(&rocksdb_db_options.disableDataSync), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::disableDataSync for RocksDB", nullptr, nullptr, + rocksdb_db_options.disableDataSync); + +static MYSQL_SYSVAR_BOOL( + use_fsync, *reinterpret_cast(&rocksdb_db_options.use_fsync), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::use_fsync for RocksDB", nullptr, nullptr, + rocksdb_db_options.use_fsync); static MYSQL_SYSVAR_STR(wal_dir, rocksdb_wal_dir, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::wal_dir for RocksDB", - nullptr, nullptr, rocksdb_db_options.wal_dir.c_str()); - -static MYSQL_SYSVAR_ULONG(delete_obsolete_files_period_micros, - rocksdb_db_options.delete_obsolete_files_period_micros, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::delete_obsolete_files_period_micros for RocksDB", - nullptr, nullptr, rocksdb_db_options.delete_obsolete_files_period_micros, - /* min */ 0L, /* max */ LONG_MAX, 0); + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::wal_dir for RocksDB", nullptr, nullptr, + rocksdb_db_options.wal_dir.c_str()); + +static MYSQL_SYSVAR_STR( + persistent_cache_path, rocksdb_persistent_cache_path, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Path for BlockBasedTableOptions::persistent_cache for RocksDB", nullptr, + nullptr, ""); + +static MYSQL_SYSVAR_ULONG( + persistent_cache_size, rocksdb_persistent_cache_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Size of cache for BlockBasedTableOptions::persistent_cache for RocksDB", + nullptr, nullptr, rocksdb_persistent_cache_size, + /* min */ 0L, /* max */ ULONG_MAX, 0); + +static MYSQL_SYSVAR_ULONG( + delete_obsolete_files_period_micros, + rocksdb_db_options.delete_obsolete_files_period_micros, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::delete_obsolete_files_period_micros for RocksDB", nullptr, + nullptr, rocksdb_db_options.delete_obsolete_files_period_micros, + /* min */ 0L, /* max */ LONG_MAX, 0); static MYSQL_SYSVAR_INT(base_background_compactions, - rocksdb_db_options.base_background_compactions, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::base_background_compactions for RocksDB", - nullptr, nullptr, rocksdb_db_options.base_background_compactions, - /* min */ -1, /* max */ MAX_BACKGROUND_COMPACTIONS, 0); + rocksdb_db_options.base_background_compactions, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::base_background_compactions for RocksDB", + nullptr, nullptr, + rocksdb_db_options.base_background_compactions, + /* min */ -1, /* max */ MAX_BACKGROUND_COMPACTIONS, 0); static MYSQL_SYSVAR_INT(max_background_compactions, - rocksdb_db_options.max_background_compactions, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::max_background_compactions for RocksDB", - nullptr, nullptr, rocksdb_db_options.max_background_compactions, - /* min */ 1, /* max */ MAX_BACKGROUND_COMPACTIONS, 0); + rocksdb_db_options.max_background_compactions, + PLUGIN_VAR_RQCMDARG, + "DBOptions::max_background_compactions for RocksDB", + nullptr, rocksdb_set_max_background_compactions, + rocksdb_db_options.max_background_compactions, + /* min */ 1, /* max */ MAX_BACKGROUND_COMPACTIONS, 0); static MYSQL_SYSVAR_INT(max_background_flushes, - rocksdb_db_options.max_background_flushes, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::max_background_flushes for RocksDB", - nullptr, nullptr, rocksdb_db_options.max_background_flushes, - /* min */ 1, /* max */ MAX_BACKGROUND_FLUSHES, 0); + rocksdb_db_options.max_background_flushes, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::max_background_flushes for RocksDB", + nullptr, nullptr, + rocksdb_db_options.max_background_flushes, + /* min */ 1, /* max */ MAX_BACKGROUND_FLUSHES, 0); static MYSQL_SYSVAR_UINT(max_subcompactions, - rocksdb_db_options.max_subcompactions, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::max_subcompactions for RocksDB", - nullptr, nullptr, rocksdb_db_options.max_subcompactions, - /* min */ 1, /* max */ MAX_SUBCOMPACTIONS, 0); + rocksdb_db_options.max_subcompactions, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::max_subcompactions for RocksDB", nullptr, + nullptr, rocksdb_db_options.max_subcompactions, + /* min */ 1, /* max */ MAX_SUBCOMPACTIONS, 0); static MYSQL_SYSVAR_ULONG(max_log_file_size, - rocksdb_db_options.max_log_file_size, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::max_log_file_size for RocksDB", - nullptr, nullptr, rocksdb_db_options.max_log_file_size, - /* min */ 0L, /* max */ LONG_MAX, 0); + rocksdb_db_options.max_log_file_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::max_log_file_size for RocksDB", nullptr, + nullptr, rocksdb_db_options.max_log_file_size, + /* min */ 0L, /* max */ LONG_MAX, 0); static MYSQL_SYSVAR_ULONG(log_file_time_to_roll, - rocksdb_db_options.log_file_time_to_roll, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::log_file_time_to_roll for RocksDB", - nullptr, nullptr, rocksdb_db_options.log_file_time_to_roll, - /* min */ 0L, /* max */ LONG_MAX, 0); + rocksdb_db_options.log_file_time_to_roll, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::log_file_time_to_roll for RocksDB", + nullptr, nullptr, + rocksdb_db_options.log_file_time_to_roll, + /* min */ 0L, /* max */ LONG_MAX, 0); static MYSQL_SYSVAR_ULONG(keep_log_file_num, - rocksdb_db_options.keep_log_file_num, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::keep_log_file_num for RocksDB", - nullptr, nullptr, rocksdb_db_options.keep_log_file_num, - /* min */ 0L, /* max */ LONG_MAX, 0); + rocksdb_db_options.keep_log_file_num, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::keep_log_file_num for RocksDB", nullptr, + nullptr, rocksdb_db_options.keep_log_file_num, + /* min */ 0L, /* max */ LONG_MAX, 0); static MYSQL_SYSVAR_ULONG(max_manifest_file_size, - rocksdb_db_options.max_manifest_file_size, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::max_manifest_file_size for RocksDB", - nullptr, nullptr, rocksdb_db_options.max_manifest_file_size, - /* min */ 0L, /* max */ ULONG_MAX, 0); + rocksdb_db_options.max_manifest_file_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::max_manifest_file_size for RocksDB", + nullptr, nullptr, + rocksdb_db_options.max_manifest_file_size, + /* min */ 0L, /* max */ ULONG_MAX, 0); static MYSQL_SYSVAR_INT(table_cache_numshardbits, - rocksdb_db_options.table_cache_numshardbits, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::table_cache_numshardbits for RocksDB", - nullptr, nullptr, rocksdb_db_options.table_cache_numshardbits, - /* min */ 0, /* max */ INT_MAX, 0); - -static MYSQL_SYSVAR_ULONG(wal_ttl_seconds, - rocksdb_db_options.WAL_ttl_seconds, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::WAL_ttl_seconds for RocksDB", - nullptr, nullptr, rocksdb_db_options.WAL_ttl_seconds, - /* min */ 0L, /* max */ LONG_MAX, 0); + rocksdb_db_options.table_cache_numshardbits, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::table_cache_numshardbits for RocksDB", + nullptr, nullptr, + rocksdb_db_options.table_cache_numshardbits, + /* min */ 0, /* max */ INT_MAX, 0); + +static MYSQL_SYSVAR_ULONG(wal_ttl_seconds, rocksdb_db_options.WAL_ttl_seconds, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::WAL_ttl_seconds for RocksDB", nullptr, + nullptr, rocksdb_db_options.WAL_ttl_seconds, + /* min */ 0L, /* max */ LONG_MAX, 0); static MYSQL_SYSVAR_ULONG(wal_size_limit_mb, - rocksdb_db_options.WAL_size_limit_MB, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::WAL_size_limit_MB for RocksDB", - nullptr, nullptr, rocksdb_db_options.WAL_size_limit_MB, - /* min */ 0L, /* max */ LONG_MAX, 0); + rocksdb_db_options.WAL_size_limit_MB, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::WAL_size_limit_MB for RocksDB", nullptr, + nullptr, rocksdb_db_options.WAL_size_limit_MB, + /* min */ 0L, /* max */ LONG_MAX, 0); static MYSQL_SYSVAR_ULONG(manifest_preallocation_size, - rocksdb_db_options.manifest_preallocation_size, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::manifest_preallocation_size for RocksDB", - nullptr, nullptr, rocksdb_db_options.manifest_preallocation_size, - /* min */ 0L, /* max */ LONG_MAX, 0); - -static MYSQL_SYSVAR_BOOL(allow_os_buffer, - *reinterpret_cast(&rocksdb_db_options.allow_os_buffer), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::allow_os_buffer for RocksDB", - nullptr, nullptr, rocksdb_db_options.allow_os_buffer); - -static MYSQL_SYSVAR_BOOL(allow_mmap_reads, - *reinterpret_cast(&rocksdb_db_options.allow_mmap_reads), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::allow_mmap_reads for RocksDB", - nullptr, nullptr, rocksdb_db_options.allow_mmap_reads); - -static MYSQL_SYSVAR_BOOL(allow_mmap_writes, - *reinterpret_cast(&rocksdb_db_options.allow_mmap_writes), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::allow_mmap_writes for RocksDB", - nullptr, nullptr, rocksdb_db_options.allow_mmap_writes); - -static MYSQL_SYSVAR_BOOL(is_fd_close_on_exec, - *reinterpret_cast(&rocksdb_db_options.is_fd_close_on_exec), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::is_fd_close_on_exec for RocksDB", - nullptr, nullptr, rocksdb_db_options.is_fd_close_on_exec); + rocksdb_db_options.manifest_preallocation_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::manifest_preallocation_size for RocksDB", + nullptr, nullptr, + rocksdb_db_options.manifest_preallocation_size, + /* min */ 0L, /* max */ LONG_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + use_direct_reads, + *reinterpret_cast(&rocksdb_db_options.use_direct_reads), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::use_direct_reads for RocksDB", nullptr, nullptr, + rocksdb_db_options.use_direct_reads); + +static MYSQL_SYSVAR_BOOL( + use_direct_writes, + *reinterpret_cast(&rocksdb_db_options.use_direct_writes), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::use_direct_writes for RocksDB", nullptr, nullptr, + rocksdb_db_options.use_direct_writes); + +static MYSQL_SYSVAR_BOOL( + allow_mmap_reads, + *reinterpret_cast(&rocksdb_db_options.allow_mmap_reads), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::allow_mmap_reads for RocksDB", nullptr, nullptr, + rocksdb_db_options.allow_mmap_reads); + +static MYSQL_SYSVAR_BOOL( + allow_mmap_writes, + *reinterpret_cast(&rocksdb_db_options.allow_mmap_writes), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::allow_mmap_writes for RocksDB", nullptr, nullptr, + rocksdb_db_options.allow_mmap_writes); + +static MYSQL_SYSVAR_BOOL( + is_fd_close_on_exec, + *reinterpret_cast(&rocksdb_db_options.is_fd_close_on_exec), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::is_fd_close_on_exec for RocksDB", nullptr, nullptr, + rocksdb_db_options.is_fd_close_on_exec); static MYSQL_SYSVAR_UINT(stats_dump_period_sec, - rocksdb_db_options.stats_dump_period_sec, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::stats_dump_period_sec for RocksDB", - nullptr, nullptr, rocksdb_db_options.stats_dump_period_sec, - /* min */ 0, /* max */ INT_MAX, 0); - -static MYSQL_SYSVAR_BOOL(advise_random_on_open, - *reinterpret_cast(&rocksdb_db_options.advise_random_on_open), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::advise_random_on_open for RocksDB", - nullptr, nullptr, rocksdb_db_options.advise_random_on_open); + rocksdb_db_options.stats_dump_period_sec, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::stats_dump_period_sec for RocksDB", + nullptr, nullptr, + rocksdb_db_options.stats_dump_period_sec, + /* min */ 0, /* max */ INT_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + advise_random_on_open, + *reinterpret_cast(&rocksdb_db_options.advise_random_on_open), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::advise_random_on_open for RocksDB", nullptr, nullptr, + rocksdb_db_options.advise_random_on_open); static MYSQL_SYSVAR_ULONG(db_write_buffer_size, - rocksdb_db_options.db_write_buffer_size, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::db_write_buffer_size for RocksDB", - nullptr, nullptr, rocksdb_db_options.db_write_buffer_size, - /* min */ 0L, /* max */ LONG_MAX, 0); - -static MYSQL_SYSVAR_BOOL(use_adaptive_mutex, - *reinterpret_cast(&rocksdb_db_options.use_adaptive_mutex), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::use_adaptive_mutex for RocksDB", - nullptr, nullptr, rocksdb_db_options.use_adaptive_mutex); - -static MYSQL_SYSVAR_ULONG(bytes_per_sync, - rocksdb_db_options.bytes_per_sync, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::bytes_per_sync for RocksDB", - nullptr, nullptr, rocksdb_db_options.bytes_per_sync, - /* min */ 0L, /* max */ LONG_MAX, 0); + rocksdb_db_options.db_write_buffer_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::db_write_buffer_size for RocksDB", + nullptr, nullptr, + rocksdb_db_options.db_write_buffer_size, + /* min */ 0L, /* max */ LONG_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + use_adaptive_mutex, + *reinterpret_cast(&rocksdb_db_options.use_adaptive_mutex), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::use_adaptive_mutex for RocksDB", nullptr, nullptr, + rocksdb_db_options.use_adaptive_mutex); + +static MYSQL_SYSVAR_ULONG(bytes_per_sync, rocksdb_db_options.bytes_per_sync, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::bytes_per_sync for RocksDB", nullptr, + nullptr, rocksdb_db_options.bytes_per_sync, + /* min */ 0L, /* max */ LONG_MAX, 0); static MYSQL_SYSVAR_ULONG(wal_bytes_per_sync, - rocksdb_db_options.wal_bytes_per_sync, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::wal_bytes_per_sync for RocksDB", - nullptr, nullptr, rocksdb_db_options.wal_bytes_per_sync, - /* min */ 0L, /* max */ LONG_MAX, 0); - -static MYSQL_SYSVAR_BOOL(enable_thread_tracking, - *reinterpret_cast(&rocksdb_db_options.enable_thread_tracking), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "DBOptions::enable_thread_tracking for RocksDB", - nullptr, nullptr, rocksdb_db_options.enable_thread_tracking); + rocksdb_db_options.wal_bytes_per_sync, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::wal_bytes_per_sync for RocksDB", nullptr, + nullptr, rocksdb_db_options.wal_bytes_per_sync, + /* min */ 0L, /* max */ LONG_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + enable_thread_tracking, + *reinterpret_cast(&rocksdb_db_options.enable_thread_tracking), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "DBOptions::enable_thread_tracking for RocksDB", nullptr, nullptr, + rocksdb_db_options.enable_thread_tracking); static MYSQL_SYSVAR_LONGLONG(block_cache_size, rocksdb_block_cache_size, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "block_cache size for RocksDB", - nullptr, nullptr, /* RocksDB's default is 8 MB: */ 8*1024*1024L, - /* min */ 1024L, /* max */ LONGLONG_MAX, /* Block size */1024L); - -static MYSQL_SYSVAR_BOOL(cache_index_and_filter_blocks, - *reinterpret_cast( - &rocksdb_tbl_options.cache_index_and_filter_blocks), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::cache_index_and_filter_blocks for RocksDB", - nullptr, nullptr, true); + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "block_cache size for RocksDB", nullptr, nullptr, + /* default */ RDB_DEFAULT_BLOCK_CACHE_SIZE, + /* min */ RDB_MIN_BLOCK_CACHE_SIZE, + /* max */ LONGLONG_MAX, + /* Block size */ RDB_MIN_BLOCK_CACHE_SIZE); + +static MYSQL_SYSVAR_BOOL( + cache_index_and_filter_blocks, + *reinterpret_cast( + &rocksdb_tbl_options.cache_index_and_filter_blocks), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::cache_index_and_filter_blocks for RocksDB", + nullptr, nullptr, true); // When pin_l0_filter_and_index_blocks_in_cache is true, RocksDB will use the // LRU cache, but will always keep the filter & idndex block's handle checked @@ -845,395 +873,402 @@ // This fixes the mutex contention between :ShardedLRUCache::Lookup and // ShardedLRUCache::Release which reduced the QPS ratio (QPS using secondary // index / QPS using PK). -static MYSQL_SYSVAR_BOOL(pin_l0_filter_and_index_blocks_in_cache, - *reinterpret_cast( - &rocksdb_tbl_options.pin_l0_filter_and_index_blocks_in_cache), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "pin_l0_filter_and_index_blocks_in_cache for RocksDB", - nullptr, nullptr, true); - -static MYSQL_SYSVAR_ENUM(index_type, - rocksdb_index_type, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::index_type for RocksDB", - nullptr, nullptr, - (uint64_t)rocksdb_tbl_options.index_type, &index_type_typelib); - -static MYSQL_SYSVAR_BOOL(hash_index_allow_collision, - *reinterpret_cast(&rocksdb_tbl_options.hash_index_allow_collision), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::hash_index_allow_collision for RocksDB", - nullptr, nullptr, rocksdb_tbl_options.hash_index_allow_collision); - -static MYSQL_SYSVAR_BOOL(no_block_cache, - *reinterpret_cast(&rocksdb_tbl_options.no_block_cache), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::no_block_cache for RocksDB", - nullptr, nullptr, rocksdb_tbl_options.no_block_cache); - -static MYSQL_SYSVAR_ULONG(block_size, - rocksdb_tbl_options.block_size, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::block_size for RocksDB", - nullptr, nullptr, rocksdb_tbl_options.block_size, - /* min */ 1L, /* max */ LONG_MAX, 0); - -static MYSQL_SYSVAR_INT(block_size_deviation, - rocksdb_tbl_options.block_size_deviation, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::block_size_deviation for RocksDB", - nullptr, nullptr, rocksdb_tbl_options.block_size_deviation, - /* min */ 0, /* max */ INT_MAX, 0); - -static MYSQL_SYSVAR_INT(block_restart_interval, - rocksdb_tbl_options.block_restart_interval, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::block_restart_interval for RocksDB", - nullptr, nullptr, rocksdb_tbl_options.block_restart_interval, - /* min */ 1, /* max */ INT_MAX, 0); - -static MYSQL_SYSVAR_BOOL(whole_key_filtering, - *reinterpret_cast(&rocksdb_tbl_options.whole_key_filtering), - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "BlockBasedTableOptions::whole_key_filtering for RocksDB", - nullptr, nullptr, rocksdb_tbl_options.whole_key_filtering); +static MYSQL_SYSVAR_BOOL( + pin_l0_filter_and_index_blocks_in_cache, + *reinterpret_cast( + &rocksdb_tbl_options.pin_l0_filter_and_index_blocks_in_cache), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "pin_l0_filter_and_index_blocks_in_cache for RocksDB", nullptr, nullptr, + true); + +static MYSQL_SYSVAR_ENUM(index_type, rocksdb_index_type, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::index_type for RocksDB", + nullptr, nullptr, + (uint64_t)rocksdb_tbl_options.index_type, + &index_type_typelib); + +static MYSQL_SYSVAR_BOOL( + hash_index_allow_collision, + *reinterpret_cast( + &rocksdb_tbl_options.hash_index_allow_collision), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::hash_index_allow_collision for RocksDB", nullptr, + nullptr, rocksdb_tbl_options.hash_index_allow_collision); + +static MYSQL_SYSVAR_BOOL( + no_block_cache, + *reinterpret_cast(&rocksdb_tbl_options.no_block_cache), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::no_block_cache for RocksDB", nullptr, nullptr, + rocksdb_tbl_options.no_block_cache); + +static MYSQL_SYSVAR_ULONG(block_size, rocksdb_tbl_options.block_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::block_size for RocksDB", + nullptr, nullptr, rocksdb_tbl_options.block_size, + /* min */ 1L, /* max */ LONG_MAX, 0); + +static MYSQL_SYSVAR_INT( + block_size_deviation, rocksdb_tbl_options.block_size_deviation, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::block_size_deviation for RocksDB", nullptr, + nullptr, rocksdb_tbl_options.block_size_deviation, + /* min */ 0, /* max */ INT_MAX, 0); + +static MYSQL_SYSVAR_INT( + block_restart_interval, rocksdb_tbl_options.block_restart_interval, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::block_restart_interval for RocksDB", nullptr, + nullptr, rocksdb_tbl_options.block_restart_interval, + /* min */ 1, /* max */ INT_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + whole_key_filtering, + *reinterpret_cast(&rocksdb_tbl_options.whole_key_filtering), + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "BlockBasedTableOptions::whole_key_filtering for RocksDB", nullptr, nullptr, + rocksdb_tbl_options.whole_key_filtering); static MYSQL_SYSVAR_STR(default_cf_options, rocksdb_default_cf_options, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "default cf options for RocksDB", - nullptr, nullptr, ""); + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "default cf options for RocksDB", nullptr, nullptr, ""); static MYSQL_SYSVAR_STR(override_cf_options, rocksdb_override_cf_options, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "option overrides per cf for RocksDB", - nullptr, nullptr, ""); - -static MYSQL_SYSVAR_BOOL(background_sync, - rocksdb_background_sync, - PLUGIN_VAR_RQCMDARG, - "turns on background syncs for RocksDB", - nullptr, nullptr, FALSE); - -static MYSQL_THDVAR_BOOL(write_sync, - PLUGIN_VAR_RQCMDARG, - "WriteOptions::sync for RocksDB", - nullptr, nullptr, rocksdb::WriteOptions().sync); - -static MYSQL_THDVAR_BOOL(write_disable_wal, - PLUGIN_VAR_RQCMDARG, - "WriteOptions::disableWAL for RocksDB", - nullptr, nullptr, rocksdb::WriteOptions().disableWAL); - -static MYSQL_THDVAR_BOOL(write_ignore_missing_column_families, - PLUGIN_VAR_RQCMDARG, - "WriteOptions::ignore_missing_column_families for RocksDB", - nullptr, nullptr, rocksdb::WriteOptions().ignore_missing_column_families); - -static MYSQL_THDVAR_BOOL(skip_fill_cache, - PLUGIN_VAR_RQCMDARG, - "Skip filling block cache on read requests", - nullptr, nullptr, FALSE); - -static MYSQL_THDVAR_BOOL(unsafe_for_binlog, - PLUGIN_VAR_RQCMDARG, - "Allowing statement based binary logging which may break consistency", - nullptr, nullptr, FALSE); - -static MYSQL_THDVAR_UINT(records_in_range, - PLUGIN_VAR_RQCMDARG, - "Used to override the result of records_in_range(). Set to a positive number to override", - nullptr, nullptr, 0, - /* min */ 0, /* max */ INT_MAX, 0); - -static MYSQL_THDVAR_UINT(force_index_records_in_range, - PLUGIN_VAR_RQCMDARG, - "Used to override the result of records_in_range() when FORCE INDEX is used.", - nullptr, nullptr, 0, - /* min */ 0, /* max */ INT_MAX, 0); - -static MYSQL_SYSVAR_UINT(debug_optimizer_n_rows, - rocksdb_debug_optimizer_n_rows, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR, - "Test only to override rocksdb estimates of table size in a memtable", - nullptr, nullptr, 0, /* min */ 0, /* max */ INT_MAX, 0); - -static MYSQL_SYSVAR_BOOL(debug_optimizer_no_zero_cardinality, - rocksdb_debug_optimizer_no_zero_cardinality, - PLUGIN_VAR_RQCMDARG, - "In case if cardinality is zero, overrides it with some value", - nullptr, nullptr, TRUE); + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "option overrides per cf for RocksDB", nullptr, nullptr, + ""); + +static MYSQL_SYSVAR_BOOL(background_sync, rocksdb_background_sync, + PLUGIN_VAR_RQCMDARG, + "turns on background syncs for RocksDB", nullptr, + nullptr, FALSE); + +static MYSQL_THDVAR_BOOL(write_sync, PLUGIN_VAR_RQCMDARG, + "WriteOptions::sync for RocksDB", nullptr, nullptr, + rocksdb::WriteOptions().sync); + +static MYSQL_THDVAR_BOOL(write_disable_wal, PLUGIN_VAR_RQCMDARG, + "WriteOptions::disableWAL for RocksDB", nullptr, + nullptr, rocksdb::WriteOptions().disableWAL); + +static MYSQL_THDVAR_BOOL( + write_ignore_missing_column_families, PLUGIN_VAR_RQCMDARG, + "WriteOptions::ignore_missing_column_families for RocksDB", nullptr, + nullptr, rocksdb::WriteOptions().ignore_missing_column_families); + +static MYSQL_THDVAR_BOOL(skip_fill_cache, PLUGIN_VAR_RQCMDARG, + "Skip filling block cache on read requests", nullptr, + nullptr, FALSE); + +static MYSQL_THDVAR_BOOL( + unsafe_for_binlog, PLUGIN_VAR_RQCMDARG, + "Allowing statement based binary logging which may break consistency", + nullptr, nullptr, FALSE); + +static MYSQL_THDVAR_UINT(records_in_range, PLUGIN_VAR_RQCMDARG, + "Used to override the result of records_in_range(). " + "Set to a positive number to override", + nullptr, nullptr, 0, + /* min */ 0, /* max */ INT_MAX, 0); + +static MYSQL_THDVAR_UINT(force_index_records_in_range, PLUGIN_VAR_RQCMDARG, + "Used to override the result of records_in_range() " + "when FORCE INDEX is used.", + nullptr, nullptr, 0, + /* min */ 0, /* max */ INT_MAX, 0); + +static MYSQL_SYSVAR_UINT( + debug_optimizer_n_rows, rocksdb_debug_optimizer_n_rows, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR, + "Test only to override rocksdb estimates of table size in a memtable", + nullptr, nullptr, 0, /* min */ 0, /* max */ INT_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + debug_optimizer_no_zero_cardinality, + rocksdb_debug_optimizer_no_zero_cardinality, PLUGIN_VAR_RQCMDARG, + "In case if cardinality is zero, overrides it with some value", nullptr, + nullptr, TRUE); static MYSQL_SYSVAR_STR(compact_cf, rocksdb_compact_cf_name, - PLUGIN_VAR_RQCMDARG, - "Compact column family", - rocksdb_compact_column_family, rocksdb_compact_column_family_stub, ""); + PLUGIN_VAR_RQCMDARG, "Compact column family", + rocksdb_compact_column_family, + rocksdb_compact_column_family_stub, ""); static MYSQL_SYSVAR_STR(create_checkpoint, rocksdb_checkpoint_name, - PLUGIN_VAR_RQCMDARG, - "Checkpoint directory", - rocksdb_create_checkpoint, rocksdb_create_checkpoint_stub, ""); + PLUGIN_VAR_RQCMDARG, "Checkpoint directory", + rocksdb_create_checkpoint, + rocksdb_create_checkpoint_stub, ""); static MYSQL_SYSVAR_BOOL(signal_drop_index_thread, - rocksdb_signal_drop_index_thread, - PLUGIN_VAR_RQCMDARG, - "Wake up drop index thread", - nullptr, rocksdb_drop_index_wakeup_thread, FALSE); - -static MYSQL_SYSVAR_BOOL(pause_background_work, - rocksdb_pause_background_work, - PLUGIN_VAR_RQCMDARG, - "Disable all rocksdb background operations", - nullptr, rocksdb_set_pause_background_work, FALSE); - -static MYSQL_SYSVAR_BOOL(disable_2pc, - rocksdb_disable_2pc, - PLUGIN_VAR_RQCMDARG, - "Disable two phase commit for MyRocks", - nullptr, nullptr, TRUE); - -static MYSQL_SYSVAR_BOOL(strict_collation_check, - rocksdb_strict_collation_check, - PLUGIN_VAR_RQCMDARG, - "Enforce case sensitive collation for MyRocks indexes", - nullptr, nullptr, TRUE); + rocksdb_signal_drop_index_thread, PLUGIN_VAR_RQCMDARG, + "Wake up drop index thread", nullptr, + rocksdb_drop_index_wakeup_thread, FALSE); + +static MYSQL_SYSVAR_BOOL(pause_background_work, rocksdb_pause_background_work, + PLUGIN_VAR_RQCMDARG, + "Disable all rocksdb background operations", nullptr, + rocksdb_set_pause_background_work, FALSE); + +static MYSQL_SYSVAR_BOOL(enable_2pc, rocksdb_enable_2pc, PLUGIN_VAR_RQCMDARG, + "Enable two phase commit for MyRocks", nullptr, + nullptr, TRUE); + +static MYSQL_SYSVAR_BOOL(strict_collation_check, rocksdb_strict_collation_check, + PLUGIN_VAR_RQCMDARG, + "Enforce case sensitive collation for MyRocks indexes", + nullptr, nullptr, TRUE); static MYSQL_SYSVAR_STR(strict_collation_exceptions, - rocksdb_strict_collation_exceptions, - PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, - "List of tables (using regex) that are excluded " - "from the case sensitive collation enforcement", - nullptr, rocksdb_set_collation_exception_list, ""); - -static MYSQL_SYSVAR_BOOL(collect_sst_properties, - rocksdb_collect_sst_properties, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "Enables collecting SST file properties on each flush", - nullptr, nullptr, rocksdb_collect_sst_properties); + rocksdb_strict_collation_exceptions, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + "Regex that describes set of tables that are excluded " + "from the case sensitive collation enforcement", + nullptr, rocksdb_set_collation_exception_list, ""); + +static MYSQL_SYSVAR_BOOL(collect_sst_properties, rocksdb_collect_sst_properties, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Enables collecting SST file properties on each flush", + nullptr, nullptr, rocksdb_collect_sst_properties); static MYSQL_SYSVAR_BOOL( - force_flush_memtable_now, - rocksdb_force_flush_memtable_now_var, - PLUGIN_VAR_RQCMDARG, - "Forces memstore flush which may block all write requests so be careful", - rocksdb_force_flush_memtable_now, - rocksdb_force_flush_memtable_now_stub, FALSE); + force_flush_memtable_now, rocksdb_force_flush_memtable_now_var, + PLUGIN_VAR_RQCMDARG, + "Forces memstore flush which may block all write requests so be careful", + rocksdb_force_flush_memtable_now, rocksdb_force_flush_memtable_now_stub, + FALSE); static MYSQL_THDVAR_BOOL( - flush_memtable_on_analyze, - PLUGIN_VAR_RQCMDARG, - "Forces memtable flush on ANALZYE table to get accurate cardinality", - nullptr, nullptr, true); - -static MYSQL_SYSVAR_UINT(seconds_between_stat_computes, - rocksdb_seconds_between_stat_computes, - PLUGIN_VAR_RQCMDARG, - "Sets a number of seconds to wait between optimizer stats recomputation. " - "Only changed indexes will be refreshed.", - nullptr, nullptr, rocksdb_seconds_between_stat_computes, - /* min */ 0L, /* max */ UINT_MAX, 0); + flush_memtable_on_analyze, PLUGIN_VAR_RQCMDARG, + "Forces memtable flush on ANALZYE table to get accurate cardinality", + nullptr, nullptr, true); -static MYSQL_SYSVAR_LONGLONG( - compaction_sequential_deletes, - rocksdb_compaction_sequential_deletes, - PLUGIN_VAR_RQCMDARG, - "RocksDB will trigger compaction for the file if it has more than this number sequential deletes per window", - nullptr, rocksdb_set_compaction_options, - DEFAULT_COMPACTION_SEQUENTIAL_DELETES, - /* min */ 0L, /* max */ MAX_COMPACTION_SEQUENTIAL_DELETES, 0); +static MYSQL_SYSVAR_UINT( + seconds_between_stat_computes, rocksdb_seconds_between_stat_computes, + PLUGIN_VAR_RQCMDARG, + "Sets a number of seconds to wait between optimizer stats recomputation. " + "Only changed indexes will be refreshed.", + nullptr, nullptr, rocksdb_seconds_between_stat_computes, + /* min */ 0L, /* max */ UINT_MAX, 0); + +static MYSQL_SYSVAR_LONGLONG(compaction_sequential_deletes, + rocksdb_compaction_sequential_deletes, + PLUGIN_VAR_RQCMDARG, + "RocksDB will trigger compaction for the file if " + "it has more than this number sequential deletes " + "per window", + nullptr, rocksdb_set_compaction_options, + DEFAULT_COMPACTION_SEQUENTIAL_DELETES, + /* min */ 0L, + /* max */ MAX_COMPACTION_SEQUENTIAL_DELETES, 0); static MYSQL_SYSVAR_LONGLONG( - compaction_sequential_deletes_window, - rocksdb_compaction_sequential_deletes_window, - PLUGIN_VAR_RQCMDARG, - "Size of the window for counting rocksdb_compaction_sequential_deletes", - nullptr, rocksdb_set_compaction_options, - DEFAULT_COMPACTION_SEQUENTIAL_DELETES_WINDOW, - /* min */ 0L, /* max */ MAX_COMPACTION_SEQUENTIAL_DELETES_WINDOW, 0); + compaction_sequential_deletes_window, + rocksdb_compaction_sequential_deletes_window, PLUGIN_VAR_RQCMDARG, + "Size of the window for counting rocksdb_compaction_sequential_deletes", + nullptr, rocksdb_set_compaction_options, + DEFAULT_COMPACTION_SEQUENTIAL_DELETES_WINDOW, + /* min */ 0L, /* max */ MAX_COMPACTION_SEQUENTIAL_DELETES_WINDOW, 0); static MYSQL_SYSVAR_LONGLONG( - compaction_sequential_deletes_file_size, - rocksdb_compaction_sequential_deletes_file_size, - PLUGIN_VAR_RQCMDARG, - "Minimum file size required for compaction_sequential_deletes", - nullptr, rocksdb_set_compaction_options, 0L, - /* min */ -1L, /* max */ LONGLONG_MAX, 0); - -static MYSQL_SYSVAR_BOOL(compaction_sequential_deletes_count_sd, - rocksdb_compaction_sequential_deletes_count_sd, - PLUGIN_VAR_RQCMDARG, - "Counting SingleDelete as rocksdb_compaction_sequential_deletes", - nullptr, nullptr, rocksdb_compaction_sequential_deletes_count_sd); - -static MYSQL_THDVAR_INT(checksums_pct, - PLUGIN_VAR_RQCMDARG, - "How many percentages of rows to be checksummed", - nullptr, nullptr, 100, - /* min */ 0, /* max */ 100, 0); - -static MYSQL_THDVAR_BOOL(store_checksums, - PLUGIN_VAR_RQCMDARG, - "Include checksums when writing index/table records", - nullptr, nullptr, false /* default value */); - -static MYSQL_THDVAR_BOOL(verify_checksums, - PLUGIN_VAR_RQCMDARG, - "Verify checksums when reading index/table records", - nullptr, nullptr, false /* default value */); - -static MYSQL_SYSVAR_UINT(validate_tables, - rocksdb_validate_tables, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, - "Verify all .frm files match all RocksDB tables (0 means no verification, " - "1 means verify and fail on error, and 2 means verify but continue", - nullptr, nullptr, 1 /* default value */, 0 /* min value */, - 2 /* max value */, 0); - -static MYSQL_SYSVAR_STR(datadir, - rocksdb_datadir, - PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, - "RocksDB data directory", - nullptr, nullptr, "./.rocksdb"); + compaction_sequential_deletes_file_size, + rocksdb_compaction_sequential_deletes_file_size, PLUGIN_VAR_RQCMDARG, + "Minimum file size required for compaction_sequential_deletes", nullptr, + rocksdb_set_compaction_options, 0L, + /* min */ -1L, /* max */ LONGLONG_MAX, 0); + +static MYSQL_SYSVAR_BOOL( + compaction_sequential_deletes_count_sd, + rocksdb_compaction_sequential_deletes_count_sd, PLUGIN_VAR_RQCMDARG, + "Counting SingleDelete as rocksdb_compaction_sequential_deletes", nullptr, + nullptr, rocksdb_compaction_sequential_deletes_count_sd); + +static MYSQL_SYSVAR_BOOL( + print_snapshot_conflict_queries, rocksdb_print_snapshot_conflict_queries, + PLUGIN_VAR_RQCMDARG, + "Logging queries that got snapshot conflict errors into *.err log", nullptr, + nullptr, rocksdb_print_snapshot_conflict_queries); + +static MYSQL_THDVAR_INT(checksums_pct, PLUGIN_VAR_RQCMDARG, + "How many percentages of rows to be checksummed", + nullptr, nullptr, RDB_MAX_CHECKSUMS_PCT, + /* min */ 0, /* max */ RDB_MAX_CHECKSUMS_PCT, 0); + +static MYSQL_THDVAR_BOOL(store_row_debug_checksums, PLUGIN_VAR_RQCMDARG, + "Include checksums when writing index/table records", + nullptr, nullptr, false /* default value */); + +static MYSQL_THDVAR_BOOL(verify_row_debug_checksums, PLUGIN_VAR_RQCMDARG, + "Verify checksums when reading index/table records", + nullptr, nullptr, false /* default value */); static MYSQL_SYSVAR_UINT( - table_stats_sampling_pct, - rocksdb_table_stats_sampling_pct, - PLUGIN_VAR_RQCMDARG, - "Percentage of entries to sample when collecting statistics about table " - "properties. Specify either 0 to sample everything or percentage [" - STRINGIFY_ARG(RDB_TBL_STATS_SAMPLE_PCT_MIN) ".." - STRINGIFY_ARG(RDB_TBL_STATS_SAMPLE_PCT_MAX) "]. " "By default " - STRINGIFY_ARG(RDB_DEFAULT_TBL_STATS_SAMPLE_PCT) "% of entries are " - "sampled.", - nullptr, rocksdb_set_table_stats_sampling_pct, /* default */ - RDB_DEFAULT_TBL_STATS_SAMPLE_PCT, /* everything */ 0, - /* max */ RDB_TBL_STATS_SAMPLE_PCT_MAX, 0); - -static const longlong ROCKSDB_WRITE_BUFFER_SIZE_DEFAULT= 4194304; -static const int ROCKSDB_ASSUMED_KEY_VALUE_DISK_SIZE= 100; - -static struct st_mysql_sys_var* rocksdb_system_variables[]= { - MYSQL_SYSVAR(lock_wait_timeout), - MYSQL_SYSVAR(max_row_locks), - MYSQL_SYSVAR(lock_scanned_rows), - MYSQL_SYSVAR(bulk_load), - MYSQL_SYSVAR(skip_unique_check_tables), - MYSQL_SYSVAR(skip_unique_check), - MYSQL_SYSVAR(commit_in_the_middle), - MYSQL_SYSVAR(read_free_rpl_tables), - MYSQL_SYSVAR(rpl_skip_tx_api), - MYSQL_SYSVAR(bulk_load_size), - MYSQL_SYSVAR(merge_buf_size), - MYSQL_SYSVAR(enable_bulk_load_api), - MYSQL_SYSVAR(merge_combine_read_size), - MYSQL_SYSVAR(skip_bloom_filter_on_read), - - MYSQL_SYSVAR(create_if_missing), - MYSQL_SYSVAR(create_missing_column_families), - MYSQL_SYSVAR(error_if_exists), - MYSQL_SYSVAR(paranoid_checks), - MYSQL_SYSVAR(rate_limiter_bytes_per_sec), - MYSQL_SYSVAR(info_log_level), - MYSQL_SYSVAR(max_open_files), - MYSQL_SYSVAR(max_total_wal_size), - MYSQL_SYSVAR(disabledatasync), - MYSQL_SYSVAR(use_fsync), - MYSQL_SYSVAR(wal_dir), - MYSQL_SYSVAR(delete_obsolete_files_period_micros), - MYSQL_SYSVAR(base_background_compactions), - MYSQL_SYSVAR(max_background_compactions), - MYSQL_SYSVAR(max_background_flushes), - MYSQL_SYSVAR(max_log_file_size), - MYSQL_SYSVAR(max_subcompactions), - MYSQL_SYSVAR(log_file_time_to_roll), - MYSQL_SYSVAR(keep_log_file_num), - MYSQL_SYSVAR(max_manifest_file_size), - MYSQL_SYSVAR(table_cache_numshardbits), - MYSQL_SYSVAR(wal_ttl_seconds), - MYSQL_SYSVAR(wal_size_limit_mb), - MYSQL_SYSVAR(manifest_preallocation_size), - MYSQL_SYSVAR(allow_os_buffer), - MYSQL_SYSVAR(allow_mmap_reads), - MYSQL_SYSVAR(allow_mmap_writes), - MYSQL_SYSVAR(is_fd_close_on_exec), - MYSQL_SYSVAR(stats_dump_period_sec), - MYSQL_SYSVAR(advise_random_on_open), - MYSQL_SYSVAR(db_write_buffer_size), - MYSQL_SYSVAR(use_adaptive_mutex), - MYSQL_SYSVAR(bytes_per_sync), - MYSQL_SYSVAR(wal_bytes_per_sync), - MYSQL_SYSVAR(enable_thread_tracking), - MYSQL_SYSVAR(perf_context_level), - MYSQL_SYSVAR(wal_recovery_mode), - MYSQL_SYSVAR(access_hint_on_compaction_start), - MYSQL_SYSVAR(new_table_reader_for_compaction_inputs), - MYSQL_SYSVAR(compaction_readahead_size), - MYSQL_SYSVAR(allow_concurrent_memtable_write), - MYSQL_SYSVAR(enable_write_thread_adaptive_yield), - - MYSQL_SYSVAR(block_cache_size), - MYSQL_SYSVAR(cache_index_and_filter_blocks), - MYSQL_SYSVAR(pin_l0_filter_and_index_blocks_in_cache), - MYSQL_SYSVAR(index_type), - MYSQL_SYSVAR(hash_index_allow_collision), - MYSQL_SYSVAR(no_block_cache), - MYSQL_SYSVAR(block_size), - MYSQL_SYSVAR(block_size_deviation), - MYSQL_SYSVAR(block_restart_interval), - MYSQL_SYSVAR(whole_key_filtering), - - MYSQL_SYSVAR(default_cf_options), - MYSQL_SYSVAR(override_cf_options), - - MYSQL_SYSVAR(background_sync), - - MYSQL_SYSVAR(write_sync), - MYSQL_SYSVAR(write_disable_wal), - MYSQL_SYSVAR(write_ignore_missing_column_families), - - MYSQL_SYSVAR(skip_fill_cache), - MYSQL_SYSVAR(unsafe_for_binlog), - - MYSQL_SYSVAR(records_in_range), - MYSQL_SYSVAR(force_index_records_in_range), - MYSQL_SYSVAR(debug_optimizer_n_rows), - MYSQL_SYSVAR(debug_optimizer_no_zero_cardinality), - - MYSQL_SYSVAR(compact_cf), - MYSQL_SYSVAR(signal_drop_index_thread), - MYSQL_SYSVAR(pause_background_work), - MYSQL_SYSVAR(disable_2pc), - MYSQL_SYSVAR(strict_collation_check), - MYSQL_SYSVAR(strict_collation_exceptions), - MYSQL_SYSVAR(collect_sst_properties), - MYSQL_SYSVAR(force_flush_memtable_now), - MYSQL_SYSVAR(flush_memtable_on_analyze), - MYSQL_SYSVAR(seconds_between_stat_computes), - - MYSQL_SYSVAR(compaction_sequential_deletes), - MYSQL_SYSVAR(compaction_sequential_deletes_window), - MYSQL_SYSVAR(compaction_sequential_deletes_file_size), - MYSQL_SYSVAR(compaction_sequential_deletes_count_sd), - - MYSQL_SYSVAR(datadir), - MYSQL_SYSVAR(create_checkpoint), - - MYSQL_SYSVAR(checksums_pct), - MYSQL_SYSVAR(store_checksums), - MYSQL_SYSVAR(verify_checksums), - - MYSQL_SYSVAR(validate_tables), - MYSQL_SYSVAR(table_stats_sampling_pct), - nullptr -}; + validate_tables, rocksdb_validate_tables, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "Verify all .frm files match all RocksDB tables (0 means no verification, " + "1 means verify and fail on error, and 2 means verify but continue", + nullptr, nullptr, 1 /* default value */, 0 /* min value */, + 2 /* max value */, 0); + +static MYSQL_SYSVAR_STR(datadir, rocksdb_datadir, + PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, + "RocksDB data directory", nullptr, nullptr, + "./.rocksdb"); +static MYSQL_SYSVAR_UINT( + table_stats_sampling_pct, rocksdb_table_stats_sampling_pct, + PLUGIN_VAR_RQCMDARG, + "Percentage of entries to sample when collecting statistics about table " + "properties. Specify either 0 to sample everything or percentage " + "[" STRINGIFY_ARG(RDB_TBL_STATS_SAMPLE_PCT_MIN) ".." STRINGIFY_ARG( + RDB_TBL_STATS_SAMPLE_PCT_MAX) "]. " + "By default " STRINGIFY_ARG( + RDB_DEFAULT_TBL_STATS_SAMPLE_PCT) "% " + "of" + " e" + "nt" + "ri" + "es" + " a" + "re" + " " + "sa" + "mp" + "le" + "d" + ".", + nullptr, rocksdb_set_table_stats_sampling_pct, /* default */ + RDB_DEFAULT_TBL_STATS_SAMPLE_PCT, /* everything */ 0, + /* max */ RDB_TBL_STATS_SAMPLE_PCT_MAX, 0); + +static const int ROCKSDB_ASSUMED_KEY_VALUE_DISK_SIZE = 100; + +static struct st_mysql_sys_var *rocksdb_system_variables[] = { + MYSQL_SYSVAR(lock_wait_timeout), + MYSQL_SYSVAR(deadlock_detect), + MYSQL_SYSVAR(max_row_locks), + MYSQL_SYSVAR(lock_scanned_rows), + MYSQL_SYSVAR(bulk_load), + MYSQL_SYSVAR(trace_sst_api), + MYSQL_SYSVAR(commit_in_the_middle), + MYSQL_SYSVAR(read_free_rpl_tables), + MYSQL_SYSVAR(rpl_skip_tx_api), + MYSQL_SYSVAR(bulk_load_size), + MYSQL_SYSVAR(merge_buf_size), + MYSQL_SYSVAR(enable_bulk_load_api), + MYSQL_SYSVAR(tmpdir), + MYSQL_SYSVAR(merge_combine_read_size), + MYSQL_SYSVAR(skip_bloom_filter_on_read), + + MYSQL_SYSVAR(create_if_missing), + MYSQL_SYSVAR(create_missing_column_families), + MYSQL_SYSVAR(error_if_exists), + MYSQL_SYSVAR(paranoid_checks), + MYSQL_SYSVAR(rate_limiter_bytes_per_sec), + MYSQL_SYSVAR(info_log_level), + MYSQL_SYSVAR(max_open_files), + MYSQL_SYSVAR(max_total_wal_size), + MYSQL_SYSVAR(disabledatasync), + MYSQL_SYSVAR(use_fsync), + MYSQL_SYSVAR(wal_dir), + MYSQL_SYSVAR(persistent_cache_path), + MYSQL_SYSVAR(persistent_cache_size), + MYSQL_SYSVAR(delete_obsolete_files_period_micros), + MYSQL_SYSVAR(base_background_compactions), + MYSQL_SYSVAR(max_background_compactions), + MYSQL_SYSVAR(max_background_flushes), + MYSQL_SYSVAR(max_log_file_size), + MYSQL_SYSVAR(max_subcompactions), + MYSQL_SYSVAR(log_file_time_to_roll), + MYSQL_SYSVAR(keep_log_file_num), + MYSQL_SYSVAR(max_manifest_file_size), + MYSQL_SYSVAR(table_cache_numshardbits), + MYSQL_SYSVAR(wal_ttl_seconds), + MYSQL_SYSVAR(wal_size_limit_mb), + MYSQL_SYSVAR(manifest_preallocation_size), + MYSQL_SYSVAR(use_direct_reads), + MYSQL_SYSVAR(use_direct_writes), + MYSQL_SYSVAR(allow_mmap_reads), + MYSQL_SYSVAR(allow_mmap_writes), + MYSQL_SYSVAR(is_fd_close_on_exec), + MYSQL_SYSVAR(stats_dump_period_sec), + MYSQL_SYSVAR(advise_random_on_open), + MYSQL_SYSVAR(db_write_buffer_size), + MYSQL_SYSVAR(use_adaptive_mutex), + MYSQL_SYSVAR(bytes_per_sync), + MYSQL_SYSVAR(wal_bytes_per_sync), + MYSQL_SYSVAR(enable_thread_tracking), + MYSQL_SYSVAR(perf_context_level), + MYSQL_SYSVAR(wal_recovery_mode), + MYSQL_SYSVAR(access_hint_on_compaction_start), + MYSQL_SYSVAR(new_table_reader_for_compaction_inputs), + MYSQL_SYSVAR(compaction_readahead_size), + MYSQL_SYSVAR(allow_concurrent_memtable_write), + MYSQL_SYSVAR(enable_write_thread_adaptive_yield), + + MYSQL_SYSVAR(block_cache_size), + MYSQL_SYSVAR(cache_index_and_filter_blocks), + MYSQL_SYSVAR(pin_l0_filter_and_index_blocks_in_cache), + MYSQL_SYSVAR(index_type), + MYSQL_SYSVAR(hash_index_allow_collision), + MYSQL_SYSVAR(no_block_cache), + MYSQL_SYSVAR(block_size), + MYSQL_SYSVAR(block_size_deviation), + MYSQL_SYSVAR(block_restart_interval), + MYSQL_SYSVAR(whole_key_filtering), + + MYSQL_SYSVAR(default_cf_options), + MYSQL_SYSVAR(override_cf_options), + + MYSQL_SYSVAR(background_sync), + + MYSQL_SYSVAR(write_sync), + MYSQL_SYSVAR(write_disable_wal), + MYSQL_SYSVAR(write_ignore_missing_column_families), + + MYSQL_SYSVAR(skip_fill_cache), + MYSQL_SYSVAR(unsafe_for_binlog), + + MYSQL_SYSVAR(records_in_range), + MYSQL_SYSVAR(force_index_records_in_range), + MYSQL_SYSVAR(debug_optimizer_n_rows), + MYSQL_SYSVAR(debug_optimizer_no_zero_cardinality), + + MYSQL_SYSVAR(compact_cf), + MYSQL_SYSVAR(signal_drop_index_thread), + MYSQL_SYSVAR(pause_background_work), + MYSQL_SYSVAR(enable_2pc), + MYSQL_SYSVAR(strict_collation_check), + MYSQL_SYSVAR(strict_collation_exceptions), + MYSQL_SYSVAR(collect_sst_properties), + MYSQL_SYSVAR(force_flush_memtable_now), + MYSQL_SYSVAR(flush_memtable_on_analyze), + MYSQL_SYSVAR(seconds_between_stat_computes), + + MYSQL_SYSVAR(compaction_sequential_deletes), + MYSQL_SYSVAR(compaction_sequential_deletes_window), + MYSQL_SYSVAR(compaction_sequential_deletes_file_size), + MYSQL_SYSVAR(compaction_sequential_deletes_count_sd), + MYSQL_SYSVAR(print_snapshot_conflict_queries), + + MYSQL_SYSVAR(datadir), + MYSQL_SYSVAR(create_checkpoint), + + MYSQL_SYSVAR(checksums_pct), + MYSQL_SYSVAR(store_row_debug_checksums), + MYSQL_SYSVAR(verify_row_debug_checksums), + + MYSQL_SYSVAR(validate_tables), + MYSQL_SYSVAR(table_stats_sampling_pct), + nullptr}; -static rocksdb::WriteOptions rdb_get_rocksdb_write_options(my_core::THD* thd) -{ +static rocksdb::WriteOptions +rdb_get_rocksdb_write_options(my_core::THD *const thd) { rocksdb::WriteOptions opt; - opt.sync= THDVAR(thd, write_sync); - opt.disableWAL= THDVAR(thd, write_disable_wal); - opt.ignore_missing_column_families= + opt.sync = THDVAR(thd, write_sync); + opt.disableWAL = THDVAR(thd, write_disable_wal); + opt.ignore_missing_column_families = THDVAR(thd, write_ignore_missing_column_families); return opt; @@ -1246,104 +1281,89 @@ Function we use in the creation of our hash to get key. */ -uchar* Rdb_open_tables_map::get_hash_key( - Rdb_table_handler *table_handler, size_t *length, - my_bool not_used __attribute__((__unused__))) -{ - *length= table_handler->m_table_name_length; - return reinterpret_cast(table_handler->m_table_name); +uchar *Rdb_open_tables_map::get_hash_key(Rdb_table_handler *const table_handler, + size_t *const length, my_bool not_used + __attribute__((__unused__))) { + *length = table_handler->m_table_name_length; + return reinterpret_cast(table_handler->m_table_name); } - /* The following is needed as an argument for mysql_stage_register, irrespectively of whether we're compiling with P_S or not. */ -PSI_stage_info stage_waiting_on_row_lock= { 0, "Waiting for row lock", 0}; +PSI_stage_info stage_waiting_on_row_lock = {0, "Waiting for row lock", 0}; #ifdef HAVE_PSI_INTERFACE static PSI_thread_key rdb_background_psi_thread_key; static PSI_thread_key rdb_drop_idx_psi_thread_key; -static PSI_stage_info *all_rocksdb_stages[]= -{ - & stage_waiting_on_row_lock -}; - +static PSI_stage_info *all_rocksdb_stages[] = {&stage_waiting_on_row_lock}; static my_core::PSI_mutex_key rdb_psi_open_tbls_mutex_key, - rdb_signal_bg_psi_mutex_key, rdb_signal_drop_idx_psi_mutex_key, - rdb_collation_data_mutex_key, - rdb_mem_cmp_space_mutex_key, - key_mutex_tx_list, rdb_sysvars_psi_mutex_key; - -static PSI_mutex_info all_rocksdb_mutexes[]= -{ - { &rdb_psi_open_tbls_mutex_key, "open tables", PSI_FLAG_GLOBAL}, - { &rdb_signal_bg_psi_mutex_key, "stop background", PSI_FLAG_GLOBAL}, - { &rdb_signal_drop_idx_psi_mutex_key, "signal drop index", PSI_FLAG_GLOBAL}, - { &rdb_collation_data_mutex_key, "collation data init", PSI_FLAG_GLOBAL}, - { &rdb_mem_cmp_space_mutex_key, "collation space char data init", - PSI_FLAG_GLOBAL}, - { &key_mutex_tx_list, "tx_list", PSI_FLAG_GLOBAL}, - { &rdb_sysvars_psi_mutex_key, "setting sysvar", PSI_FLAG_GLOBAL}, + rdb_signal_bg_psi_mutex_key, rdb_signal_drop_idx_psi_mutex_key, + rdb_collation_data_mutex_key, rdb_mem_cmp_space_mutex_key, + key_mutex_tx_list, rdb_sysvars_psi_mutex_key; + +static PSI_mutex_info all_rocksdb_mutexes[] = { + {&rdb_psi_open_tbls_mutex_key, "open tables", PSI_FLAG_GLOBAL}, + {&rdb_signal_bg_psi_mutex_key, "stop background", PSI_FLAG_GLOBAL}, + {&rdb_signal_drop_idx_psi_mutex_key, "signal drop index", PSI_FLAG_GLOBAL}, + {&rdb_collation_data_mutex_key, "collation data init", PSI_FLAG_GLOBAL}, + {&rdb_mem_cmp_space_mutex_key, "collation space char data init", + PSI_FLAG_GLOBAL}, + {&key_mutex_tx_list, "tx_list", PSI_FLAG_GLOBAL}, + {&rdb_sysvars_psi_mutex_key, "setting sysvar", PSI_FLAG_GLOBAL}, }; static PSI_rwlock_key key_rwlock_collation_exception_list; static PSI_rwlock_key key_rwlock_read_free_rpl_tables; -static PSI_rwlock_key key_rwlock_skip_unique_check_tables; -static PSI_rwlock_info all_rocksdb_rwlocks[]= -{ - { &key_rwlock_collation_exception_list, "collation_exception_list", - PSI_FLAG_GLOBAL}, - { &key_rwlock_read_free_rpl_tables, "read_free_rpl_tables", PSI_FLAG_GLOBAL}, - { &key_rwlock_skip_unique_check_tables, "skip_unique_check_tables", - PSI_FLAG_GLOBAL}, +static PSI_rwlock_info all_rocksdb_rwlocks[] = { + {&key_rwlock_collation_exception_list, "collation_exception_list", + PSI_FLAG_GLOBAL}, + {&key_rwlock_read_free_rpl_tables, "read_free_rpl_tables", PSI_FLAG_GLOBAL} }; PSI_cond_key rdb_signal_bg_psi_cond_key, rdb_signal_drop_idx_psi_cond_key; -static PSI_cond_info all_rocksdb_conds[]= -{ - { &rdb_signal_bg_psi_cond_key, "cond signal background", PSI_FLAG_GLOBAL}, - { &rdb_signal_drop_idx_psi_cond_key, "cond signal drop index", - PSI_FLAG_GLOBAL}, +static PSI_cond_info all_rocksdb_conds[] = { + {&rdb_signal_bg_psi_cond_key, "cond signal background", PSI_FLAG_GLOBAL}, + {&rdb_signal_drop_idx_psi_cond_key, "cond signal drop index", + PSI_FLAG_GLOBAL}, }; -static PSI_thread_info all_rocksdb_threads[]= -{ - { &rdb_background_psi_thread_key, "background", PSI_FLAG_GLOBAL}, - { &rdb_drop_idx_psi_thread_key, "drop index", PSI_FLAG_GLOBAL}, +static PSI_thread_info all_rocksdb_threads[] = { + {&rdb_background_psi_thread_key, "background", PSI_FLAG_GLOBAL}, + {&rdb_drop_idx_psi_thread_key, "drop index", PSI_FLAG_GLOBAL}, }; -static void init_rocksdb_psi_keys() -{ - const char* category= "rocksdb"; +static void init_rocksdb_psi_keys() { + const char *const category = "rocksdb"; int count; if (PSI_server == nullptr) return; - count= array_elements(all_rocksdb_mutexes); + count = array_elements(all_rocksdb_mutexes); PSI_server->register_mutex(category, all_rocksdb_mutexes, count); - count= array_elements(all_rocksdb_rwlocks); + count = array_elements(all_rocksdb_rwlocks); PSI_server->register_rwlock(category, all_rocksdb_rwlocks, count); - count= array_elements(all_rocksdb_conds); - // TODO Disabling PFS for conditions due to the bug https://github.com/MySQLOnRocksDB/mysql-5.6/issues/92 + count = array_elements(all_rocksdb_conds); + // TODO Disabling PFS for conditions due to the bug + // https://github.com/MySQLOnRocksDB/mysql-5.6/issues/92 // PSI_server->register_cond(category, all_rocksdb_conds, count); - count= array_elements(all_rocksdb_stages); + count = array_elements(all_rocksdb_stages); mysql_stage_register(category, all_rocksdb_stages, count); - count= array_elements(all_rocksdb_threads); + count = array_elements(all_rocksdb_threads); mysql_thread_register(category, all_rocksdb_threads, count); } #endif - /* Drop index thread's control */ @@ -1351,21 +1371,18 @@ static Rdb_drop_index_thread rdb_drop_idx_thread; static void rocksdb_drop_index_wakeup_thread( - my_core::THD* thd __attribute__((__unused__)), - struct st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr __attribute__((__unused__)), - const void* save) -{ - if (*static_cast(save)) { + my_core::THD *const thd __attribute__((__unused__)), + struct st_mysql_sys_var *const var __attribute__((__unused__)), + void *const var_ptr __attribute__((__unused__)), const void *const save) { + if (*static_cast(save)) { rdb_drop_idx_thread.signal(); } } -static inline uint32_t rocksdb_perf_context_level(THD* thd) -{ +static inline uint32_t rocksdb_perf_context_level(THD *const thd) { DBUG_ASSERT(thd != nullptr); - int session_perf_context_level= THDVAR(thd, perf_context_level); + const int session_perf_context_level = THDVAR(thd, perf_context_level); if (session_perf_context_level > rocksdb::PerfLevel::kUninitialized) { return session_perf_context_level; } @@ -1375,7 +1392,7 @@ value. */ - int global_perf_context_level= THDVAR(nullptr, perf_context_level); + const int global_perf_context_level = THDVAR(nullptr, perf_context_level); if (global_perf_context_level > rocksdb::PerfLevel::kUninitialized) { return global_perf_context_level; } @@ -1388,10 +1405,9 @@ Rdb_transaction::walk_tx_list() */ -interface Rdb_tx_list_walker -{ +interface Rdb_tx_list_walker { virtual ~Rdb_tx_list_walker() {} - virtual void process_tran(const Rdb_transaction*) = 0; + virtual void process_tran(const Rdb_transaction *const) = 0; }; /* @@ -1399,98 +1415,94 @@ a snapshot gets created. */ -class Rdb_snapshot_notifier : public rocksdb::TransactionNotifier -{ - Rdb_transaction* m_owning_tx; +class Rdb_snapshot_notifier : public rocksdb::TransactionNotifier { + Rdb_transaction *m_owning_tx; void SnapshotCreated(const rocksdb::Snapshot *snapshot) override; - public: - explicit Rdb_snapshot_notifier(Rdb_transaction* owning_tx) - : m_owning_tx(owning_tx) {} +public: + Rdb_snapshot_notifier(const Rdb_snapshot_notifier &) = delete; + Rdb_snapshot_notifier &operator=(const Rdb_snapshot_notifier &) = delete; + + explicit Rdb_snapshot_notifier(Rdb_transaction *const owning_tx) + : m_owning_tx(owning_tx) {} // If the owning Rdb_transaction gets destructed we need to not reference // it anymore. - void detach() - { - m_owning_tx = nullptr; - } + void detach() { m_owning_tx = nullptr; } }; /* This is the base class for transactions when interacting with rocksdb. */ -class Rdb_transaction -{ - protected: - ulonglong m_write_count= 0; - ulonglong m_lock_count= 0; +class Rdb_transaction { +protected: + ulonglong m_write_count = 0; + ulonglong m_lock_count = 0; - bool m_is_delayed_snapshot= false; - bool m_is_two_phase= false; + bool m_is_delayed_snapshot = false; + bool m_is_two_phase = false; - THD* m_thd= nullptr; + THD *m_thd = nullptr; rocksdb::ReadOptions m_read_opts; - static std::multiset s_tx_list; + static std::multiset s_tx_list; static mysql_mutex_t s_tx_list_mutex; - Rdb_io_perf* m_tbl_io_perf; + Rdb_io_perf *m_tbl_io_perf; - bool m_tx_read_only= false; + bool m_tx_read_only = false; int m_timeout_sec; /* Cached value of @@rocksdb_lock_wait_timeout */ /* Maximum number of locks the transaction can have */ ulonglong m_max_row_locks; - bool m_is_tx_failed= false; - bool m_rollback_only= false; + bool m_is_tx_failed = false; + bool m_rollback_only = false; std::shared_ptr m_notifier; // This should be used only when updating binlog information. - virtual rocksdb::WriteBatchBase* get_write_batch()= 0; - virtual bool commit_no_binlog()= 0; - virtual rocksdb::Iterator *get_iterator( - const rocksdb::ReadOptions &options, - rocksdb::ColumnFamilyHandle* column_family)= 0; - + virtual bool commit_no_binlog() = 0; + virtual rocksdb::Iterator * + get_iterator(const rocksdb::ReadOptions &options, + rocksdb::ColumnFamilyHandle *column_family) = 0; public: - const char* m_mysql_log_file_name; - my_off_t m_mysql_log_offset; - const char* m_mysql_gtid; - int64_t m_snapshot_timestamp= 0; + int64_t m_snapshot_timestamp = 0; bool m_ddl_transaction; - static void init_mutex() - { + /* + for distinction between rdb_transaction_impl and rdb_writebatch_impl + when using walk tx list + */ + virtual bool is_writebatch_trx() const = 0; + + static void init_mutex() { mysql_mutex_init(key_mutex_tx_list, &s_tx_list_mutex, MY_MUTEX_INIT_FAST); } - static void term_mutex() - { + static void term_mutex() { DBUG_ASSERT(s_tx_list.size() == 0); mysql_mutex_destroy(&s_tx_list_mutex); } - static void walk_tx_list(Rdb_tx_list_walker* walker) - { + static void walk_tx_list(Rdb_tx_list_walker *walker) { + DBUG_ASSERT(walker != nullptr); + mysql_mutex_lock(&s_tx_list_mutex); for (auto it : s_tx_list) walker->process_tran(it); mysql_mutex_unlock(&s_tx_list_mutex); } - int set_status_error(THD *thd, const rocksdb::Status &s, - const std::shared_ptr& kd, - Rdb_tbl_def *tbl_def) - { + int set_status_error(THD *const thd, const rocksdb::Status &s, + const Rdb_key_def &kd, Rdb_tbl_def *const tbl_def) { DBUG_ASSERT(!s.ok()); + DBUG_ASSERT(tbl_def != nullptr); - if (s.IsTimedOut()) - { + if (s.IsTimedOut()) { /* SQL layer has weird expectations. If we return an error when doing a read in DELETE IGNORE, it will ignore the error ("because it's @@ -1503,22 +1515,39 @@ return HA_ERR_LOCK_WAIT_TIMEOUT; } - if (s.IsBusy()) - { + + if (s.IsDeadlock()) { + my_core::thd_mark_transaction_to_rollback(thd, + false /* just statement */); + return HA_ERR_LOCK_DEADLOCK; + } else if (s.IsBusy()) { rocksdb_snapshot_conflict_errors++; + if (rocksdb_print_snapshot_conflict_queries) { + char user_host_buff[MAX_USER_HOST_SIZE + 1]; + make_user_name(thd, user_host_buff); + // NO_LINT_DEBUG + sql_print_warning("Got snapshot conflict errors: User: %s " + "Query: %s", + user_host_buff, thd->query()); + } return HA_ERR_LOCK_DEADLOCK; } - /* TODO: who returns HA_ERR_ROCKSDB_TOO_MANY_LOCKS now?? */ + if (s.IsLockLimit()) { + return HA_ERR_ROCKSDB_TOO_MANY_LOCKS; + } + + if (s.IsIOError() || s.IsCorruption()) { + rdb_handle_io_error(s, RDB_IO_ERROR_GENERAL); + } my_error(ER_INTERNAL_ERROR, MYF(0), s.ToString().c_str()); return HA_ERR_INTERNAL_ERROR; } - THD* get_thd() const { return m_thd; } + THD *get_thd() const { return m_thd; } /* Used for tracking io_perf counters */ - void io_perf_start(Rdb_io_perf *io_perf) - { + void io_perf_start(Rdb_io_perf *const io_perf) { /* Since perf_context is tracked per thread, it is difficult and expensive to maintain perf_context on a per table basis. Therefore, roll all @@ -1535,129 +1564,106 @@ gather stats during commit/rollback is needed. */ if (m_tbl_io_perf == nullptr && - io_perf->start(rocksdb_perf_context_level(m_thd))) - { - m_tbl_io_perf= io_perf; + io_perf->start(rocksdb_perf_context_level(m_thd))) { + m_tbl_io_perf = io_perf; } } - void io_perf_end_and_record(void) - { - if (m_tbl_io_perf != nullptr) - { + void io_perf_end_and_record(void) { + if (m_tbl_io_perf != nullptr) { m_tbl_io_perf->end_and_record(rocksdb_perf_context_level(m_thd)); - m_tbl_io_perf= nullptr; + m_tbl_io_perf = nullptr; } } - void io_perf_end_and_record(Rdb_io_perf *io_perf) - { - if (m_tbl_io_perf == io_perf) - { + void io_perf_end_and_record(Rdb_io_perf *const io_perf) { + if (m_tbl_io_perf == io_perf) { io_perf_end_and_record(); } } - void set_params(int timeout_sec_arg, int max_row_locks_arg) - { - m_timeout_sec= timeout_sec_arg; - m_max_row_locks= max_row_locks_arg; + void set_params(int timeout_sec_arg, int max_row_locks_arg) { + m_timeout_sec = timeout_sec_arg; + m_max_row_locks = max_row_locks_arg; set_lock_timeout(timeout_sec_arg); } - virtual void set_lock_timeout(int timeout_sec_arg)= 0; + virtual void set_lock_timeout(int timeout_sec_arg) = 0; ulonglong get_write_count() const { return m_write_count; } + int get_timeout_sec() const { return m_timeout_sec; } + ulonglong get_lock_count() const { return m_lock_count; } - virtual void set_sync(bool sync)= 0; + virtual void set_sync(bool sync) = 0; - virtual void release_lock(rocksdb::ColumnFamilyHandle* column_family, - const std::string& rowkey)= 0; + virtual void release_lock(rocksdb::ColumnFamilyHandle *const column_family, + const std::string &rowkey) = 0; - virtual bool prepare(const rocksdb::TransactionName& name)= 0; + virtual bool prepare(const rocksdb::TransactionName &name) = 0; - bool commit_or_rollback() - { + bool commit_or_rollback() { bool res; - if (m_is_tx_failed) - { + if (m_is_tx_failed) { rollback(); - res= false; - } - else - res= commit(); + res = false; + } else + res = commit(); return res; } - bool commit() - { - if (get_write_count() == 0) - { + bool commit() { + if (get_write_count() == 0) { rollback(); return false; - } - else if (m_rollback_only) - { - /* - Transactions marked as rollback_only are expected to be rolled back at - prepare(). But there are some exceptions like below that prepare() is - never called and commit() is called instead. - 1. Binlog is disabled - 2. No modification exists in binlog cache for the transaction (#195) - In both cases, rolling back transaction is safe. Nothing is written to - binlog. - */ + } else if (m_rollback_only) { + /* + Transactions marked as rollback_only are expected to be rolled back at + prepare(). But there are some exceptions like below that prepare() is + never called and commit() is called instead. + 1. Binlog is disabled + 2. No modification exists in binlog cache for the transaction (#195) + In both cases, rolling back transaction is safe. Nothing is written to + binlog. + */ my_printf_error(ER_UNKNOWN_ERROR, ERRSTR_ROLLBACK_ONLY, MYF(0)); rollback(); return true; - } - else - { - my_core::thd_binlog_pos(m_thd, &m_mysql_log_file_name, - &m_mysql_log_offset, &m_mysql_gtid); - binlog_manager.update(m_mysql_log_file_name, - m_mysql_log_offset, - m_mysql_gtid, get_write_batch()); + } else { return commit_no_binlog(); } } - virtual void rollback()= 0; + virtual void rollback() = 0; + + void snapshot_created(const rocksdb::Snapshot *const snapshot) { + DBUG_ASSERT(snapshot != nullptr); - void snapshot_created(const rocksdb::Snapshot *snapshot) - { m_read_opts.snapshot = snapshot; rdb->GetEnv()->GetCurrentTime(&m_snapshot_timestamp); m_is_delayed_snapshot = false; } - virtual void acquire_snapshot(bool acquire_now)= 0; - virtual void release_snapshot()= 0; + virtual void acquire_snapshot(bool acquire_now) = 0; + virtual void release_snapshot() = 0; - bool has_snapshot() const - { - return m_read_opts.snapshot != nullptr; - } + bool has_snapshot() const { return m_read_opts.snapshot != nullptr; } - private: +private: // The tables we are currently loading. In a partitioned table this can // have more than one entry - std::vector m_curr_bulk_load; + std::vector m_curr_bulk_load; - public: - int finish_bulk_load() - { - int rc= 0; +public: + int finish_bulk_load() { + int rc = 0; - std::vector::iterator it; - while ((it = m_curr_bulk_load.begin()) != m_curr_bulk_load.end()) - { - int rc2= (*it)->finalize_bulk_load(); - if (rc2 != 0 && rc == 0) - { - rc= rc2; + std::vector::iterator it; + while ((it = m_curr_bulk_load.begin()) != m_curr_bulk_load.end()) { + int rc2 = (*it)->finalize_bulk_load(); + if (rc2 != 0 && rc == 0) { + rc = rc2; } } @@ -1666,31 +1672,28 @@ return rc; } - void start_bulk_load(ha_rocksdb* bulk_load) - { + void start_bulk_load(ha_rocksdb *const bulk_load) { /* If we already have an open bulk load of a table and the name doesn't match the current one, close out the currently running one. This allows multiple bulk loads to occur on a partitioned table, but then closes them all out when we switch to another table. */ + DBUG_ASSERT(bulk_load != nullptr); + if (!m_curr_bulk_load.empty() && - !bulk_load->same_table(*m_curr_bulk_load[0])) - { - auto res= finish_bulk_load(); + !bulk_load->same_table(*m_curr_bulk_load[0])) { + const auto res = finish_bulk_load(); SHIP_ASSERT(res == 0); } m_curr_bulk_load.push_back(bulk_load); } - void end_bulk_load(ha_rocksdb* bulk_load) - { + void end_bulk_load(ha_rocksdb *const bulk_load) { for (auto it = m_curr_bulk_load.begin(); it != m_curr_bulk_load.end(); - it++) - { - if (*it == bulk_load) - { + it++) { + if (*it == bulk_load) { m_curr_bulk_load.erase(it); return; } @@ -1700,6 +1703,8 @@ SHIP_ASSERT(0); } + int num_ongoing_bulk_load() const { return m_curr_bulk_load.size(); } + /* Flush the data accumulated so far. This assumes we're doing a bulk insert. @@ -1713,8 +1718,7 @@ Add test coverage for what happens when somebody attempts to do bulk inserts while inside a multi-statement transaction. */ - bool flush_batch() - { + bool flush_batch() { if (get_write_count() == 0) return false; @@ -1727,98 +1731,90 @@ return false; } - virtual rocksdb::Status put(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - const rocksdb::Slice& value)= 0; - virtual rocksdb::Status delete_key(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key)= 0; - virtual rocksdb::Status single_delete( - rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key)= 0; + virtual rocksdb::Status put(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, + const rocksdb::Slice &value) = 0; + virtual rocksdb::Status + delete_key(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key) = 0; + virtual rocksdb::Status + single_delete(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key) = 0; - virtual bool has_modifications() const= 0; + virtual bool has_modifications() const = 0; - virtual rocksdb::WriteBatchBase* get_indexed_write_batch()= 0; + virtual rocksdb::WriteBatchBase *get_indexed_write_batch() = 0; /* Return a WriteBatch that one can write to. The writes will skip any transaction locking. The writes will NOT be visible to the transaction. */ - rocksdb::WriteBatchBase* get_blind_write_batch() - { + rocksdb::WriteBatchBase *get_blind_write_batch() { return get_indexed_write_batch()->GetWriteBatch(); } - virtual rocksdb::Status get(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - std::string* value) const= 0; - virtual rocksdb::Status get_for_update( - rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, std::string* value)= 0; - - rocksdb::Iterator *get_iterator(rocksdb::ColumnFamilyHandle* column_family, - bool skip_bloom_filter, - bool fill_cache, - bool read_current= false, - bool create_snapshot= true) - { + virtual rocksdb::Status get(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, + std::string *value) const = 0; + virtual rocksdb::Status + get_for_update(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, std::string *const value, + bool exclusive) = 0; + + rocksdb::Iterator * + get_iterator(rocksdb::ColumnFamilyHandle *const column_family, + bool skip_bloom_filter, bool fill_cache, + bool read_current = false, bool create_snapshot = true) { // Make sure we are not doing both read_current (which implies we don't // want a snapshot) and create_snapshot which makes sure we create // a snapshot + DBUG_ASSERT(column_family != nullptr); DBUG_ASSERT(!read_current || !create_snapshot); if (create_snapshot) acquire_snapshot(true); - rocksdb::ReadOptions options= m_read_opts; + rocksdb::ReadOptions options = m_read_opts; - if (skip_bloom_filter) - { - options.total_order_seek= true; - } - else - { + if (skip_bloom_filter) { + options.total_order_seek = true; + } else { // With this option, Iterator::Valid() returns false if key // is outside of the prefix bloom filter range set at Seek(). // Must not be set to true if not using bloom filter. - options.prefix_same_as_start= true; + options.prefix_same_as_start = true; } - options.fill_cache= fill_cache; - if (read_current) - { - options.snapshot= nullptr; + options.fill_cache = fill_cache; + if (read_current) { + options.snapshot = nullptr; } return get_iterator(options, column_family); } - virtual bool is_tx_started() const= 0; - virtual void start_tx()= 0; - virtual void start_stmt()= 0; - virtual void rollback_stmt()= 0; + virtual bool is_tx_started() const = 0; + virtual void start_tx() = 0; + virtual void start_stmt() = 0; + virtual void rollback_stmt() = 0; - void set_tx_failed(bool failed_arg) { m_is_tx_failed= failed_arg; } + void set_tx_failed(bool failed_arg) { m_is_tx_failed = failed_arg; } - bool can_prepare() const - { - if (m_rollback_only) - { + bool can_prepare() const { + if (m_rollback_only) { my_printf_error(ER_UNKNOWN_ERROR, ERRSTR_ROLLBACK_ONLY, MYF(0)); return false; } return true; } - int rollback_to_savepoint(void *savepoint) - { - if (has_modifications()) - { + int rollback_to_savepoint(void *const savepoint) { + if (has_modifications()) { my_printf_error(ER_UNKNOWN_ERROR, "MyRocks currently does not support ROLLBACK TO " "SAVEPOINT if modifying rows.", MYF(0)); - m_rollback_only= true; - return 1; + m_rollback_only = true; + return HA_EXIT_FAILURE; } - return 0; + return HA_EXIT_SUCCESS; } /* @@ -1827,23 +1823,14 @@ snapshot has to be created via DB::GetSnapshot(), not via Transaction API. */ - bool is_tx_read_only() const - { - return m_tx_read_only; - } + bool is_tx_read_only() const { return m_tx_read_only; } - bool is_two_phase() const - { - return m_is_two_phase; - } + bool is_two_phase() const { return m_is_two_phase; } - void set_tx_read_only(bool val) - { - m_tx_read_only= val; - } + void set_tx_read_only(bool val) { m_tx_read_only = val; } - explicit Rdb_transaction(THD *thd): m_thd(thd), m_tbl_io_perf(nullptr) - { + explicit Rdb_transaction(THD *const thd) + : m_thd(thd), m_tbl_io_perf(nullptr) { mysql_mutex_lock(&s_tx_list_mutex); s_tx_list.insert(this); mysql_mutex_unlock(&s_tx_list_mutex); @@ -1865,90 +1852,79 @@ The changes are made to individual tables, which store them here and then this object commits them on commit. */ -class Rdb_transaction_impl : public Rdb_transaction -{ - rocksdb::Transaction *m_rocksdb_tx= nullptr; - rocksdb::Transaction *m_rocksdb_reuse_tx= nullptr; +class Rdb_transaction_impl : public Rdb_transaction { + rocksdb::Transaction *m_rocksdb_tx = nullptr; + rocksdb::Transaction *m_rocksdb_reuse_tx = nullptr; - public: - void set_lock_timeout(int timeout_sec_arg) override - { +public: + void set_lock_timeout(int timeout_sec_arg) override { if (m_rocksdb_tx) - m_rocksdb_tx->SetLockTimeout(m_timeout_sec * 1000); + m_rocksdb_tx->SetLockTimeout(rdb_convert_sec_to_ms(m_timeout_sec)); } - void set_sync(bool sync) override - { - m_rocksdb_tx->GetWriteOptions()->sync= sync; + void set_sync(bool sync) override { + m_rocksdb_tx->GetWriteOptions()->sync = sync; } - void release_lock(rocksdb::ColumnFamilyHandle* column_family, - const std::string &rowkey) override - { - if (!THDVAR(m_thd, lock_scanned_rows)) - { + void release_lock(rocksdb::ColumnFamilyHandle *const column_family, + const std::string &rowkey) override { + if (!THDVAR(m_thd, lock_scanned_rows)) { m_rocksdb_tx->UndoGetForUpdate(column_family, rocksdb::Slice(rowkey)); } } - private: - void release_tx(void) - { + virtual bool is_writebatch_trx() const override { return false; } + +private: + void release_tx(void) { // We are done with the current active transaction object. Preserve it // for later reuse. DBUG_ASSERT(m_rocksdb_reuse_tx == nullptr); - m_rocksdb_reuse_tx= m_rocksdb_tx; - m_rocksdb_tx= nullptr; + m_rocksdb_reuse_tx = m_rocksdb_tx; + m_rocksdb_tx = nullptr; } - bool prepare(const rocksdb::TransactionName& name) override - { + bool prepare(const rocksdb::TransactionName &name) override { rocksdb::Status s; - s= m_rocksdb_tx->SetName(name); - if (!s.ok()) - { + s = m_rocksdb_tx->SetName(name); + if (!s.ok()) { rdb_handle_io_error(s, RDB_IO_ERROR_TX_COMMIT); return false; } - s= m_rocksdb_tx->Prepare(); - if (!s.ok()) - { + s = m_rocksdb_tx->Prepare(); + if (!s.ok()) { rdb_handle_io_error(s, RDB_IO_ERROR_TX_COMMIT); return false; } return true; } - bool commit_no_binlog() override - { - bool res= false; + bool commit_no_binlog() override { + bool res = false; release_snapshot(); - rocksdb::Status s= m_rocksdb_tx->Commit(); - if (!s.ok()) - { + const rocksdb::Status s = m_rocksdb_tx->Commit(); + if (!s.ok()) { rdb_handle_io_error(s, RDB_IO_ERROR_TX_COMMIT); - res= true; + res = true; } /* Save the transaction object to be reused */ release_tx(); - m_write_count= 0; - m_lock_count= 0; + m_write_count = 0; + m_lock_count = 0; set_tx_read_only(false); - m_rollback_only= false; + m_rollback_only = false; return res; } - public: - void rollback() override - { - m_write_count= 0; - m_lock_count= 0; - m_ddl_transaction= false; - if (m_rocksdb_tx) - { +public: + void rollback() override { + m_write_count = 0; + m_lock_count = 0; + m_ddl_transaction = false; + if (m_rocksdb_tx) { release_snapshot(); /* This will also release all of the locks: */ m_rocksdb_tx->Rollback(); @@ -1957,41 +1933,33 @@ release_tx(); set_tx_read_only(false); - m_rollback_only= false; + m_rollback_only = false; } } - void acquire_snapshot(bool acquire_now) override - { + void acquire_snapshot(bool acquire_now) override { if (m_read_opts.snapshot == nullptr) { if (is_tx_read_only()) { snapshot_created(rdb->GetSnapshot()); - } - else if (acquire_now) { + } else if (acquire_now) { m_rocksdb_tx->SetSnapshot(); snapshot_created(m_rocksdb_tx->GetSnapshot()); - } - else if (!m_is_delayed_snapshot) { + } else if (!m_is_delayed_snapshot) { m_rocksdb_tx->SetSnapshotOnNextOperation(m_notifier); m_is_delayed_snapshot = true; } } } - void release_snapshot() override - { + void release_snapshot() override { bool need_clear = m_is_delayed_snapshot; - if (m_read_opts.snapshot != nullptr) - { + if (m_read_opts.snapshot != nullptr) { m_snapshot_timestamp = 0; - if (is_tx_read_only()) - { + if (is_tx_read_only()) { rdb->ReleaseSnapshot(m_read_opts.snapshot); need_clear = false; - } - else - { + } else { need_clear = true; } m_read_opts.snapshot = nullptr; @@ -2001,123 +1969,103 @@ m_rocksdb_tx->ClearSnapshot(); } - bool has_snapshot() - { - return m_read_opts.snapshot != nullptr; - } + bool has_snapshot() { return m_read_opts.snapshot != nullptr; } - const char *err_too_many_locks= - "Number of locks held by the transaction exceeded @@rocksdb_max_row_locks"; - - rocksdb::Status put(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - const rocksdb::Slice& value) override - { + rocksdb::Status put(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, + const rocksdb::Slice &value) override { ++m_write_count; ++m_lock_count; if (m_write_count > m_max_row_locks || m_lock_count > m_max_row_locks) - return rocksdb::Status::Aborted(rocksdb::Slice(err_too_many_locks)); + return rocksdb::Status::Aborted(rocksdb::Status::kLockLimit); return m_rocksdb_tx->Put(column_family, key, value); } - rocksdb::Status delete_key(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key) override - { + rocksdb::Status delete_key(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key) override { ++m_write_count; ++m_lock_count; if (m_write_count > m_max_row_locks || m_lock_count > m_max_row_locks) - return rocksdb::Status::Aborted(rocksdb::Slice(err_too_many_locks)); + return rocksdb::Status::Aborted(rocksdb::Status::kLockLimit); return m_rocksdb_tx->Delete(column_family, key); } - rocksdb::Status single_delete(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key) override - { + rocksdb::Status + single_delete(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key) override { ++m_write_count; ++m_lock_count; if (m_write_count > m_max_row_locks || m_lock_count > m_max_row_locks) - return rocksdb::Status::Aborted(rocksdb::Slice(err_too_many_locks)); + return rocksdb::Status::Aborted(rocksdb::Status::kLockLimit); return m_rocksdb_tx->SingleDelete(column_family, key); } - bool has_modifications() const override - { + bool has_modifications() const override { return m_rocksdb_tx->GetWriteBatch() && m_rocksdb_tx->GetWriteBatch()->GetWriteBatch() && m_rocksdb_tx->GetWriteBatch()->GetWriteBatch()->Count() > 0; } - rocksdb::WriteBatchBase* get_write_batch() override - { - if (is_two_phase()) - { - return m_rocksdb_tx->GetCommitTimeWriteBatch(); - } - return m_rocksdb_tx->GetWriteBatch()->GetWriteBatch(); - } - /* Return a WriteBatch that one can write to. The writes will skip any transaction locking. The writes WILL be visible to the transaction. */ - rocksdb::WriteBatchBase* get_indexed_write_batch() override - { + rocksdb::WriteBatchBase *get_indexed_write_batch() override { ++m_write_count; return m_rocksdb_tx->GetWriteBatch(); } - rocksdb::Status get(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - std::string* value) const override - { + rocksdb::Status get(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, + std::string *value) const override { return m_rocksdb_tx->Get(m_read_opts, column_family, key, value); } - rocksdb::Status get_for_update(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - std::string* value) override - { + rocksdb::Status + get_for_update(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, std::string *const value, + bool exclusive) override { if (++m_lock_count > m_max_row_locks) - return rocksdb::Status::Aborted(rocksdb::Slice(err_too_many_locks)); - return m_rocksdb_tx->GetForUpdate(m_read_opts, column_family, key, value); + return rocksdb::Status::Aborted(rocksdb::Status::kLockLimit); + + return m_rocksdb_tx->GetForUpdate(m_read_opts, column_family, key, value, + exclusive); } - rocksdb::Iterator *get_iterator(const rocksdb::ReadOptions &options, - rocksdb::ColumnFamilyHandle* column_family) - override - { + rocksdb::Iterator * + get_iterator(const rocksdb::ReadOptions &options, + rocksdb::ColumnFamilyHandle *const column_family) override { return m_rocksdb_tx->GetIterator(options, column_family); } - bool is_tx_started() const override - { - return (m_rocksdb_tx != nullptr); - } + const rocksdb::Transaction *get_rdb_trx() const { return m_rocksdb_tx; } - void start_tx() override - { + bool is_tx_started() const override { return (m_rocksdb_tx != nullptr); } + + void start_tx() override { rocksdb::TransactionOptions tx_opts; rocksdb::WriteOptions write_opts; - tx_opts.set_snapshot= false; - tx_opts.lock_timeout= m_timeout_sec * 1000; - - write_opts.sync= THDVAR(m_thd, write_sync); - write_opts.disableWAL= THDVAR(m_thd, write_disable_wal); - write_opts.ignore_missing_column_families= - THDVAR(m_thd, write_ignore_missing_column_families); - m_is_two_phase= !rocksdb_disable_2pc; + tx_opts.set_snapshot = false; + tx_opts.lock_timeout = rdb_convert_sec_to_ms(m_timeout_sec); + tx_opts.deadlock_detect = THDVAR(m_thd, deadlock_detect); + + write_opts.sync = THDVAR(m_thd, write_sync); + write_opts.disableWAL = THDVAR(m_thd, write_disable_wal); + write_opts.ignore_missing_column_families = + THDVAR(m_thd, write_ignore_missing_column_families); + m_is_two_phase = rocksdb_enable_2pc; /* If m_rocksdb_reuse_tx is null this will create a new transaction object. Otherwise it will reuse the existing one. */ - m_rocksdb_tx= rdb->BeginTransaction(write_opts, tx_opts, - m_rocksdb_reuse_tx); - m_rocksdb_reuse_tx= nullptr; + m_rocksdb_tx = + rdb->BeginTransaction(write_opts, tx_opts, m_rocksdb_reuse_tx); + m_rocksdb_reuse_tx = nullptr; - m_read_opts= rocksdb::ReadOptions(); + m_read_opts = rocksdb::ReadOptions(); - m_ddl_transaction= false; + m_ddl_transaction = false; } /* @@ -2129,8 +2077,7 @@ For hooking to start of statement that is its own transaction, see ha_rocksdb::external_lock(). */ - void start_stmt() override - { + void start_stmt() override { // Set the snapshot to delayed acquisition (SetSnapshotOnNextOperation) acquire_snapshot(false); m_rocksdb_tx->SetSavePoint(); @@ -2140,17 +2087,14 @@ This must be called when last statement is rolled back, but the transaction continues */ - void rollback_stmt() override - { + void rollback_stmt() override { /* TODO: here we must release the locks taken since the start_stmt() call */ - if (m_rocksdb_tx) - { - const rocksdb::Snapshot *org_snapshot = m_rocksdb_tx->GetSnapshot(); + if (m_rocksdb_tx) { + const rocksdb::Snapshot *const org_snapshot = m_rocksdb_tx->GetSnapshot(); m_rocksdb_tx->RollbackToSavePoint(); - const rocksdb::Snapshot *cur_snapshot = m_rocksdb_tx->GetSnapshot(); - if (org_snapshot != cur_snapshot) - { + const rocksdb::Snapshot *const cur_snapshot = m_rocksdb_tx->GetSnapshot(); + if (org_snapshot != cur_snapshot) { if (org_snapshot != nullptr) m_snapshot_timestamp = 0; @@ -2163,15 +2107,13 @@ } } - explicit Rdb_transaction_impl(THD *thd) : - Rdb_transaction(thd), m_rocksdb_tx(nullptr) - { + explicit Rdb_transaction_impl(THD *const thd) + : Rdb_transaction(thd), m_rocksdb_tx(nullptr) { // Create a notifier that can be called when a snapshot gets generated. m_notifier = std::make_shared(this); } - virtual ~Rdb_transaction_impl() - { + virtual ~Rdb_transaction_impl() { rollback(); // Theoretically the notifier could outlive the Rdb_transaction_impl @@ -2193,88 +2135,75 @@ to be non-conflicting. Any further usage of this class should completely be thought thoroughly. */ -class Rdb_writebatch_impl : public Rdb_transaction -{ - rocksdb::WriteBatchWithIndex* m_batch; +class Rdb_writebatch_impl : public Rdb_transaction { + rocksdb::WriteBatchWithIndex *m_batch; rocksdb::WriteOptions write_opts; // Called after commit/rollback. - void reset() - { + void reset() { m_batch->Clear(); m_read_opts = rocksdb::ReadOptions(); - m_ddl_transaction= false; - } - private: - bool prepare(const rocksdb::TransactionName& name) override - { - return true; + m_ddl_transaction = false; } - bool commit_no_binlog() override - { - bool res= false; +private: + bool prepare(const rocksdb::TransactionName &name) override { return true; } + + bool commit_no_binlog() override { + bool res = false; release_snapshot(); - rocksdb::Status s= rdb->GetBaseDB()->Write(write_opts, - m_batch->GetWriteBatch()); - if (!s.ok()) - { + const rocksdb::Status s = + rdb->GetBaseDB()->Write(write_opts, m_batch->GetWriteBatch()); + if (!s.ok()) { rdb_handle_io_error(s, RDB_IO_ERROR_TX_COMMIT); - res= true; + res = true; } reset(); - m_write_count= 0; + m_write_count = 0; set_tx_read_only(false); - m_rollback_only= false; + m_rollback_only = false; return res; } - public: - void set_lock_timeout(int timeout_sec_arg) override - { + +public: + bool is_writebatch_trx() const override { return true; } + + void set_lock_timeout(int timeout_sec_arg) override { // Nothing to do here. } - void set_sync(bool sync) override - { - write_opts.sync= sync; - } + void set_sync(bool sync) override { write_opts.sync = sync; } - void release_lock(rocksdb::ColumnFamilyHandle* column_family, - const std::string &rowkey) override - { + void release_lock(rocksdb::ColumnFamilyHandle *const column_family, + const std::string &rowkey) override { // Nothing to do here since we don't hold any row locks. } - void rollback() override - { - m_write_count= 0; - m_lock_count= 0; + void rollback() override { + m_write_count = 0; + m_lock_count = 0; release_snapshot(); reset(); set_tx_read_only(false); - m_rollback_only= false; + m_rollback_only = false; } - void acquire_snapshot(bool acquire_now) override - { + void acquire_snapshot(bool acquire_now) override { if (m_read_opts.snapshot == nullptr) snapshot_created(rdb->GetSnapshot()); } - void release_snapshot() override - { - if (m_read_opts.snapshot != nullptr) - { + void release_snapshot() override { + if (m_read_opts.snapshot != nullptr) { rdb->ReleaseSnapshot(m_read_opts.snapshot); m_read_opts.snapshot = nullptr; } } - rocksdb::Status put(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - const rocksdb::Slice& value) override - { + rocksdb::Status put(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, + const rocksdb::Slice &value) override { ++m_write_count; m_batch->Put(column_family, key, value); // Note Put/Delete in write batch doesn't return any error code. We simply @@ -2282,174 +2211,143 @@ return rocksdb::Status::OK(); } - rocksdb::Status delete_key(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key) override - { + rocksdb::Status delete_key(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key) override { ++m_write_count; m_batch->Delete(column_family, key); return rocksdb::Status::OK(); } - rocksdb::Status single_delete(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key) override - { + rocksdb::Status + single_delete(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key) override { ++m_write_count; m_batch->SingleDelete(column_family, key); return rocksdb::Status::OK(); } - bool has_modifications() const override - { + bool has_modifications() const override { return m_batch->GetWriteBatch()->Count() > 0; } - rocksdb::WriteBatchBase* get_write_batch() override - { - return m_batch; - } - - rocksdb::WriteBatchBase* get_indexed_write_batch() override - { + rocksdb::WriteBatchBase *get_indexed_write_batch() override { ++m_write_count; return m_batch; } - rocksdb::Status get(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - std::string* value) const override - { - return m_batch->GetFromBatchAndDB( - rdb, m_read_opts, column_family, key, value); + rocksdb::Status get(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, + std::string *const value) const override { + return m_batch->GetFromBatchAndDB(rdb, m_read_opts, column_family, key, + value); } - rocksdb::Status get_for_update(rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key, - std::string* value) override - { + rocksdb::Status + get_for_update(rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, std::string *const value, + bool exclusive) override { return get(column_family, key, value); } - rocksdb::Iterator *get_iterator(const rocksdb::ReadOptions &options, - rocksdb::ColumnFamilyHandle* column_family) - override - { - auto it = rdb->NewIterator(options); + rocksdb::Iterator * + get_iterator(const rocksdb::ReadOptions &options, + rocksdb::ColumnFamilyHandle *const column_family) override { + const auto it = rdb->NewIterator(options); return m_batch->NewIteratorWithBase(it); } - bool is_tx_started() const override - { - return (m_batch != nullptr); - } + bool is_tx_started() const override { return (m_batch != nullptr); } - void start_tx() override - { + void start_tx() override { reset(); - write_opts.sync= THDVAR(m_thd, write_sync); - write_opts.disableWAL= THDVAR(m_thd, write_disable_wal); - write_opts.ignore_missing_column_families= - THDVAR(m_thd, write_ignore_missing_column_families); + write_opts.sync = THDVAR(m_thd, write_sync); + write_opts.disableWAL = THDVAR(m_thd, write_disable_wal); + write_opts.ignore_missing_column_families = + THDVAR(m_thd, write_ignore_missing_column_families); } - void start_stmt() override - { - m_batch->SetSavePoint(); - } + void start_stmt() override { m_batch->SetSavePoint(); } - void rollback_stmt() override - { + void rollback_stmt() override { if (m_batch) m_batch->RollbackToSavePoint(); } - explicit Rdb_writebatch_impl(THD *thd) : - Rdb_transaction(thd), m_batch(nullptr) - { - m_batch = new rocksdb::WriteBatchWithIndex(rocksdb::BytewiseComparator(), - 0 , true); + explicit Rdb_writebatch_impl(THD *const thd) + : Rdb_transaction(thd), m_batch(nullptr) { + m_batch = new rocksdb::WriteBatchWithIndex(rocksdb::BytewiseComparator(), 0, + true); } - virtual ~Rdb_writebatch_impl() - { + virtual ~Rdb_writebatch_impl() { rollback(); delete m_batch; } }; -void Rdb_snapshot_notifier::SnapshotCreated(const rocksdb::Snapshot *snapshot) -{ - if (m_owning_tx != nullptr) - { +void Rdb_snapshot_notifier::SnapshotCreated( + const rocksdb::Snapshot *const snapshot) { + if (m_owning_tx != nullptr) { m_owning_tx->snapshot_created(snapshot); } } -std::multiset Rdb_transaction::s_tx_list; +std::multiset Rdb_transaction::s_tx_list; mysql_mutex_t Rdb_transaction::s_tx_list_mutex; -static Rdb_transaction* &get_tx_from_thd(THD *thd) -{ - return *reinterpret_cast( - my_core::thd_ha_data(thd, rocksdb_hton)); +static Rdb_transaction *&get_tx_from_thd(THD *const thd) { + return *reinterpret_cast( + my_core::thd_ha_data(thd, rocksdb_hton)); } namespace { -class Rdb_perf_context_guard -{ +class Rdb_perf_context_guard { Rdb_io_perf m_io_perf; THD *m_thd; - public: - explicit Rdb_perf_context_guard(THD *thd) : m_thd(thd) - { - Rdb_transaction*& tx= get_tx_from_thd(m_thd); +public: + Rdb_perf_context_guard(const Rdb_perf_context_guard &) = delete; + Rdb_perf_context_guard &operator=(const Rdb_perf_context_guard &) = delete; + + explicit Rdb_perf_context_guard(THD *const thd) : m_thd(thd) { + Rdb_transaction *&tx = get_tx_from_thd(m_thd); /* if perf_context information is already being recorded, this becomes a no-op */ - if (tx != nullptr) - { + if (tx != nullptr) { tx->io_perf_start(&m_io_perf); } } - ~Rdb_perf_context_guard() - { - Rdb_transaction*& tx= get_tx_from_thd(m_thd); - if (tx != nullptr) - { + ~Rdb_perf_context_guard() { + Rdb_transaction *&tx = get_tx_from_thd(m_thd); + if (tx != nullptr) { tx->io_perf_end_and_record(); } } }; -} // anonymous namespace +} // anonymous namespace /* TODO: maybe, call this in external_lock() and store in ha_rocksdb.. */ -static Rdb_transaction *get_or_create_tx(THD *thd) -{ - Rdb_transaction*& tx= get_tx_from_thd(thd); +static Rdb_transaction *get_or_create_tx(THD *const thd) { + Rdb_transaction *&tx = get_tx_from_thd(thd); // TODO: this is called too many times.. O(#rows) - if (tx == nullptr) - { + if (tx == nullptr) { if (rpl_skip_tx_api_var && thd->rli_slave) - tx= new Rdb_writebatch_impl(thd); + tx = new Rdb_writebatch_impl(thd); else - tx= new Rdb_transaction_impl(thd); - tx->set_params(THDVAR(thd, lock_wait_timeout), - THDVAR(thd, max_row_locks)); + tx = new Rdb_transaction_impl(thd); + tx->set_params(THDVAR(thd, lock_wait_timeout), THDVAR(thd, max_row_locks)); tx->start_tx(); - } - else - { - tx->set_params(THDVAR(thd, lock_wait_timeout), - THDVAR(thd, max_row_locks)); - if (!tx->is_tx_started()) - { + } else { + tx->set_params(THDVAR(thd, lock_wait_timeout), THDVAR(thd, max_row_locks)); + if (!tx->is_tx_started()) { tx->start_tx(); } } @@ -2457,33 +2355,29 @@ return tx; } - -static int rocksdb_close_connection(handlerton* hton, THD* thd) -{ - Rdb_transaction*& tx= get_tx_from_thd(thd); - if (tx != nullptr) - { - int rc= tx->finish_bulk_load(); - if (rc != 0) - { +static int rocksdb_close_connection(handlerton *const hton, THD *const thd) { + Rdb_transaction *&tx = get_tx_from_thd(thd); + if (tx != nullptr) { + int rc = tx->finish_bulk_load(); + if (rc != 0) { // NO_LINT_DEBUG sql_print_error("RocksDB: Error %d finalizing last SST file while " - "disconnecting", rc); + "disconnecting", + rc); abort_with_stack_traces(); } delete tx; - tx= nullptr; + tx = nullptr; } - return 0; + return HA_EXIT_SUCCESS; } /* * Serializes an xid to a string so that it can * be used as a rocksdb transaction name */ -static std::string rdb_xid_to_string(const XID& src) -{ +static std::string rdb_xid_to_string(const XID &src) { DBUG_ASSERT(src.gtrid_length >= 0 && src.gtrid_length <= MAXGTRIDSIZE); DBUG_ASSERT(src.bqual_length >= 0 && src.bqual_length <= MAXBQUALSIZE); @@ -2495,10 +2389,10 @@ * then reinterpret bit pattern as unsigned and store in network order */ uchar fidbuf[RDB_FORMATID_SZ]; - int64 signed_fid8= src.formatID; - uint64 raw_fid8= *reinterpret_cast(&signed_fid8); + int64 signed_fid8 = src.formatID; + const uint64 raw_fid8 = *reinterpret_cast(&signed_fid8); rdb_netbuf_store_uint64(fidbuf, raw_fid8); - buf.append(reinterpret_cast(fidbuf), RDB_FORMATID_SZ); + buf.append(reinterpret_cast(fidbuf), RDB_FORMATID_SZ); buf.push_back(src.gtrid_length); buf.push_back(src.bqual_length); @@ -2506,191 +2400,149 @@ return buf; } - /** Called by hton->flush_logs after MySQL group commit prepares a set of transactions. */ -static bool rocksdb_flush_wal(handlerton* hton __attribute__((__unused__)), - ulonglong target_lsn __attribute__((__unused__))) -{ +static bool rocksdb_flush_wal(handlerton *const hton + __attribute__((__unused__))) { DBUG_ASSERT(rdb != nullptr); - rocksdb::Status s= rdb->SyncWAL(); + rocksdb_wal_group_syncs++; + const rocksdb::Status s = rdb->SyncWAL(); if (!s.ok()) { - return 1; + return HA_EXIT_FAILURE; } - return 0; + return HA_EXIT_SUCCESS; } /** For a slave, prepare() updates the slave_gtid_info table which tracks the replication progress. */ -static int rocksdb_prepare(handlerton* hton, THD* thd, bool prepare_tx, - bool async) -{ - Rdb_transaction*& tx= get_tx_from_thd(thd); - if (!tx->can_prepare()) - { - return 1; +static int rocksdb_prepare(handlerton *const hton, THD *const thd, + bool prepare_tx) { + Rdb_transaction *&tx = get_tx_from_thd(thd); + if (!tx->can_prepare()) { + return HA_EXIT_FAILURE; } if (prepare_tx || (!my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { - /* We were instructed to prepare the whole transaction, or - this is an SQL statement end and autocommit is on */ - std::vector slave_gtid_info; - my_core::thd_slave_gtid_info(thd, &slave_gtid_info); - for (auto it : slave_gtid_info) { - rocksdb::WriteBatchBase* write_batch = tx->get_blind_write_batch(); - binlog_manager.update_slave_gtid_info(it.id, it.db, it.gtid, write_batch); - } if (tx->is_two_phase()) { - if (thd->durability_property == HA_IGNORE_DURABILITY || async) { + if (thd->durability_property == HA_IGNORE_DURABILITY) { tx->set_sync(false); } XID xid; - thd_get_xid(thd, reinterpret_cast(&xid)); + thd_get_xid(thd, reinterpret_cast(&xid)); if (!tx->prepare(rdb_xid_to_string(xid))) { - return 1; - } - if (thd->durability_property == HA_IGNORE_DURABILITY) { - /** - we set the log sequence as '1' just to trigger hton->flush_logs - */ - thd_store_lsn(thd, 1, DB_TYPE_ROCKSDB); + return HA_EXIT_FAILURE; } } DEBUG_SYNC(thd, "rocksdb.prepared"); } - return 0; + return HA_EXIT_SUCCESS; } /** do nothing for prepare/commit by xid this is needed to avoid crashes in XA scenarios */ -static int rocksdb_commit_by_xid(handlerton* hton, XID* xid) -{ - auto name= rdb_xid_to_string(*xid); - rocksdb::Transaction *trx= rdb->GetTransactionByName(name); +static int rocksdb_commit_by_xid(handlerton *const hton, XID *const xid) { + const auto name = rdb_xid_to_string(*xid); + rocksdb::Transaction *const trx = rdb->GetTransactionByName(name); if (trx == nullptr) { - return 1; + return HA_EXIT_FAILURE; } - rocksdb::Status s= trx->Commit(); + const rocksdb::Status s = trx->Commit(); if (!s.ok()) { - return 1; + return HA_EXIT_FAILURE; } delete trx; - return 0; + return HA_EXIT_SUCCESS; } -static int rocksdb_rollback_by_xid(handlerton* hton __attribute__((__unused__)), - XID* xid) -{ - auto name= rdb_xid_to_string(*xid); - rocksdb::Transaction *trx= rdb->GetTransactionByName(name); +static int rocksdb_rollback_by_xid(handlerton *const hton + __attribute__((__unused__)), + XID *const xid) { + const auto name = rdb_xid_to_string(*xid); + rocksdb::Transaction *const trx = rdb->GetTransactionByName(name); if (trx == nullptr) { - return 1; + return HA_EXIT_FAILURE; } - rocksdb::Status s= trx->Rollback(); + const rocksdb::Status s = trx->Rollback(); if (!s.ok()) { - return 1; + return HA_EXIT_FAILURE; } delete trx; - return 0; + return HA_EXIT_SUCCESS; } /** Rebuilds an XID from a serialized version stored in a string. */ -static void rdb_xid_from_string(const std::string& src, XID *dst) -{ +static void rdb_xid_from_string(const std::string &src, XID *const dst) { DBUG_ASSERT(dst != nullptr); - uint offset= 0; - uint64 raw_fid8= - rdb_netbuf_to_uint64(reinterpret_cast(src.data())); - int64 signed_fid8= *reinterpret_cast(&raw_fid8); - dst->formatID= signed_fid8; + uint offset = 0; + uint64 raw_fid8 = + rdb_netbuf_to_uint64(reinterpret_cast(src.data())); + const int64 signed_fid8 = *reinterpret_cast(&raw_fid8); + dst->formatID = signed_fid8; offset += RDB_FORMATID_SZ; - dst->gtrid_length= src.at(offset); + dst->gtrid_length = src.at(offset); offset += RDB_GTRID_SZ; - dst->bqual_length= src.at(offset); + dst->bqual_length = src.at(offset); offset += RDB_BQUAL_SZ; DBUG_ASSERT(dst->gtrid_length >= 0 && dst->gtrid_length <= MAXGTRIDSIZE); DBUG_ASSERT(dst->bqual_length >= 0 && dst->bqual_length <= MAXBQUALSIZE); - src.copy(dst->data, (dst->gtrid_length)+(dst->bqual_length), RDB_XIDHDR_LEN); + src.copy(dst->data, (dst->gtrid_length) + (dst->bqual_length), + RDB_XIDHDR_LEN); } /** Reading last committed binary log info from RocksDB system row. The info is needed for crash safe slave/master to work. */ -static int rocksdb_recover(handlerton* hton, XID* xid_list, uint len, - char* binlog_file, my_off_t* binlog_pos) -{ - if (binlog_file && binlog_pos) - { - char file_buf[FN_REFLEN+1]= {0}; - my_off_t pos; - char gtid_buf[FN_REFLEN+1]= {0}; - if (binlog_manager.read(file_buf, &pos, gtid_buf)) - { - if (is_binlog_advanced(binlog_file, *binlog_pos, file_buf, pos)) - { - memcpy(binlog_file, file_buf, FN_REFLEN + 1); - *binlog_pos= pos; - fprintf(stderr, "RocksDB: Last binlog file position %llu," - " file name %s\n", pos, file_buf); - if (*gtid_buf) - { - fprintf(stderr, "RocksDB: Last MySQL Gtid %s\n", gtid_buf); - } - } - } - } - - if (len == 0 || xid_list == nullptr) - { - return 0; +static int rocksdb_recover(handlerton *const hton, XID *const xid_list, + uint len) { + if (len == 0 || xid_list == nullptr) { + return HA_EXIT_SUCCESS; } - std::vector trans_list; + std::vector trans_list; rdb->GetAllPreparedTransactions(&trans_list); - uint count= 0; - for (auto& trans : trans_list) - { - if (count >= len) - { + uint count = 0; + for (auto &trans : trans_list) { + if (count >= len) { break; } - auto name= trans->GetName(); + auto name = trans->GetName(); rdb_xid_from_string(name, &xid_list[count]); count++; } return count; } -static int rocksdb_commit(handlerton* hton, THD* thd, bool commit_tx) -{ - DBUG_ENTER("rocksdb_commit"); +static int rocksdb_commit(handlerton *const hton, THD *const thd, + bool commit_tx) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(hton != nullptr); + DBUG_ASSERT(thd != nullptr); /* this will trigger saving of perf_context information */ Rdb_perf_context_guard guard(thd); /* note: h->external_lock(F_UNLCK) is called after this function is called) */ - Rdb_transaction*& tx= get_tx_from_thd(thd); + Rdb_transaction *&tx = get_tx_from_thd(thd); - if (tx != nullptr) - { - if (commit_tx || - (!my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) - { + if (tx != nullptr) { + if (commit_tx || (!my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | + OPTION_BEGIN))) { /* We get here - For a COMMIT statement that finishes a multi-statement transaction @@ -2698,9 +2550,7 @@ */ if (tx->commit()) DBUG_RETURN(HA_ERR_INTERNAL_ERROR); - } - else - { + } else { /* We get here when committing a statement within a transaction. @@ -2710,26 +2560,23 @@ tx->set_tx_failed(false); } - if (my_core::thd_tx_isolation(thd) <= ISO_READ_COMMITTED) - { + if (my_core::thd_tx_isolation(thd) <= ISO_READ_COMMITTED) { // For READ_COMMITTED, we release any existing snapshot so that we will // see any changes that occurred since the last statement. tx->release_snapshot(); } } - DBUG_RETURN(0); -} + DBUG_RETURN(HA_EXIT_SUCCESS); +} -static int rocksdb_rollback(handlerton* hton, THD* thd, bool rollback_tx) -{ +static int rocksdb_rollback(handlerton *const hton, THD *const thd, + bool rollback_tx) { Rdb_perf_context_guard guard(thd); - Rdb_transaction*& tx= get_tx_from_thd(thd); + Rdb_transaction *&tx = get_tx_from_thd(thd); - if (tx != nullptr) - { - if (rollback_tx) - { + if (tx != nullptr) { + if (rollback_tx) { /* We get here, when - ROLLBACK statement is issued. @@ -2737,9 +2584,7 @@ Discard the changes made by the transaction */ tx->rollback(); - } - else - { + } else { /* We get here when - a statement with AUTOCOMMIT=1 is being rolled back (because of some @@ -2751,48 +2596,64 @@ tx->set_tx_failed(true); } - if (my_core::thd_tx_isolation(thd) <= ISO_READ_COMMITTED) - { + if (my_core::thd_tx_isolation(thd) <= ISO_READ_COMMITTED) { // For READ_COMMITTED, we release any existing snapshot so that we will // see any changes that occurred since the last statement. tx->release_snapshot(); } } - return 0; + return HA_EXIT_SUCCESS; } -static bool print_stats(THD* thd, - std::string const& type, - std::string const& name, - std::string const& status, - stat_print_fn *stat_print) -{ +static bool print_stats(THD *const thd, std::string const &type, + std::string const &name, std::string const &status, + stat_print_fn *stat_print) { return stat_print(thd, type.c_str(), type.size(), name.c_str(), name.size(), status.c_str(), status.size()); } -static std::string format_string( - const char *format, - ...) -{ +static std::string format_string(const char *const format, ...) { std::string res; - va_list args; - va_list args_copy; + va_list args; + va_list args_copy; + char static_buff[256]; + + DBUG_ASSERT(format != nullptr); va_start(args, format); va_copy(args_copy, args); - size_t len = vsnprintf(nullptr, 0, format, args) + 1; + // Calculate how much space we will need + int len = vsnprintf(nullptr, 0, format, args); va_end(args); - if (len == 0) { + if (len < 0) { + res = std::string(""); + } else if (len == 0) { + // Shortcut for an empty string res = std::string(""); - } - else { - char buff[len]; - (void) vsnprintf(buff, len, format, args_copy); - - res = std::string(buff); + } else { + // For short enough output use a static buffer + char *buff = static_buff; + std::unique_ptr dynamic_buff = nullptr; + + len++; // Add one for null terminator + + // for longer output use an allocated buffer + if (static_cast(len) > sizeof(static_buff)) { + dynamic_buff.reset(new char[len]); + buff = dynamic_buff.get(); + } + + // Now re-do the vsnprintf with the buffer which is now large enough + (void)vsnprintf(buff, len, format, args_copy); + + // Convert to a std::string. Note we could have created a std::string + // large enough and then converted the buffer to a 'char*' and created + // the output in place. This would probably work but feels like a hack. + // Since this isn't code that needs to be super-performant we are going + // with this 'safer' method. + res = std::string(buff); } va_end(args_copy); @@ -2800,13 +2661,11 @@ return res; } -class Rdb_snapshot_status : public Rdb_tx_list_walker -{ - private: +class Rdb_snapshot_status : public Rdb_tx_list_walker { +private: std::string m_data; - static std::string current_timestamp(void) - { + static std::string current_timestamp(void) { static const char *const format = "%d-%02d-%02d %02d:%02d:%02d"; time_t currtime; struct tm currtm; @@ -2820,67 +2679,149 @@ currtm.tm_sec); } - static std::string get_header(void) - { - return - "\n============================================================\n" + - current_timestamp() + - " ROCKSDB TRANSACTION MONITOR OUTPUT\n" - "============================================================\n" - "---------\n" - "SNAPSHOTS\n" - "---------\n" - "LIST OF SNAPSHOTS FOR EACH SESSION:\n"; + static std::string get_header(void) { + return "\n============================================================\n" + + current_timestamp() + + " ROCKSDB TRANSACTION MONITOR OUTPUT\n" + "============================================================\n" + "---------\n" + "SNAPSHOTS\n" + "---------\n" + "LIST OF SNAPSHOTS FOR EACH SESSION:\n"; } - static std::string get_footer(void) - { - return - "-----------------------------------------\n" - "END OF ROCKSDB TRANSACTION MONITOR OUTPUT\n" - "=========================================\n"; + static std::string get_footer(void) { + return "-----------------------------------------\n" + "END OF ROCKSDB TRANSACTION MONITOR OUTPUT\n" + "=========================================\n"; } - public: +public: Rdb_snapshot_status() : m_data(get_header()) {} std::string getResult() { return m_data + get_footer(); } /* Implement Rdb_transaction interface */ /* Create one row in the snapshot status table */ - void process_tran(const Rdb_transaction *tx) override - { + void process_tran(const Rdb_transaction *const tx) override { + DBUG_ASSERT(tx != nullptr); + /* Calculate the duration the snapshot has existed */ int64_t snapshot_timestamp = tx->m_snapshot_timestamp; - if (snapshot_timestamp != 0) - { + if (snapshot_timestamp != 0) { int64_t curr_time; rdb->GetEnv()->GetCurrentTime(&curr_time); - THD* thd = tx->get_thd(); - + THD *thd = tx->get_thd(); + char buffer[1024]; + thd_security_context(thd, buffer, sizeof buffer, 0); m_data += format_string("---SNAPSHOT, ACTIVE %lld sec\n" - "MySQL thread id %lu, OS thread handle %p\n" + "%s\n" "lock count %llu, write count %llu\n", - curr_time - snapshot_timestamp, - my_core::thd_get_thread_id(thd), thd, + curr_time - snapshot_timestamp, buffer, tx->get_lock_count(), tx->get_write_count()); } } }; +/** + * @brief + * walks through all non-replication transactions and copies + * out relevant information for information_schema.rocksdb_trx + */ +class Rdb_trx_info_aggregator : public Rdb_tx_list_walker { +private: + std::vector *m_trx_info; + +public: + explicit Rdb_trx_info_aggregator(std::vector *const trx_info) + : m_trx_info(trx_info) {} + + void process_tran(const Rdb_transaction *const tx) override { + static const std::map state_map = { + {rocksdb::Transaction::STARTED, "STARTED"}, + {rocksdb::Transaction::AWAITING_PREPARE, "AWAITING_PREPARE"}, + {rocksdb::Transaction::PREPARED, "PREPARED"}, + {rocksdb::Transaction::AWAITING_COMMIT, "AWAITING_COMMIT"}, + {rocksdb::Transaction::COMMITED, "COMMITED"}, + {rocksdb::Transaction::AWAITING_ROLLBACK, "AWAITING_ROLLBACK"}, + {rocksdb::Transaction::ROLLEDBACK, "ROLLEDBACK"}, + }; + + DBUG_ASSERT(tx != nullptr); + + THD *const thd = tx->get_thd(); + ulong thread_id = thd->thread_id; + + if (tx->is_writebatch_trx()) { + const auto wb_impl = static_cast(tx); + DBUG_ASSERT(wb_impl); + m_trx_info->push_back( + {"", /* name */ + 0, /* trx_id */ + wb_impl->get_write_count(), 0, /* lock_count */ + 0, /* timeout_sec */ + "", /* state */ + "", /* waiting_key */ + 0, /* waiting_cf_id */ + 1, /*is_replication */ + 1, /* skip_trx_api */ + wb_impl->is_tx_read_only(), 0, /* deadlock detection */ + wb_impl->num_ongoing_bulk_load(), thread_id, "" /* query string */}); + } else { + const auto tx_impl = static_cast(tx); + DBUG_ASSERT(tx_impl); + const rocksdb::Transaction *rdb_trx = tx_impl->get_rdb_trx(); + + if (rdb_trx == nullptr) { + return; + } + + std::string query_str; + LEX_STRING *const lex_str = thd_query_string(thd); + if (lex_str != nullptr && lex_str->str != nullptr) { + query_str = std::string(lex_str->str); + } + + const auto state_it = state_map.find(rdb_trx->GetState()); + DBUG_ASSERT(state_it != state_map.end()); + const int is_replication = (thd->rli_slave != nullptr); + uint32_t waiting_cf_id; + std::string waiting_key; + rdb_trx->GetWaitingTxns(&waiting_cf_id, &waiting_key), + + m_trx_info->push_back( + {rdb_trx->GetName(), rdb_trx->GetID(), tx_impl->get_write_count(), + tx_impl->get_lock_count(), tx_impl->get_timeout_sec(), + state_it->second, waiting_key, waiting_cf_id, is_replication, + 0, /* skip_trx_api */ + tx_impl->is_tx_read_only(), rdb_trx->IsDeadlockDetect(), + tx_impl->num_ongoing_bulk_load(), thread_id, query_str}); + } + } +}; + +/* + returns a vector of info for all non-replication threads + for use by information_schema.rocksdb_trx +*/ +std::vector rdb_get_all_trx_info() { + std::vector trx_info; + Rdb_trx_info_aggregator trx_info_agg(&trx_info); + Rdb_transaction::walk_tx_list(&trx_info_agg); + return trx_info; +} + /* Generate the snapshot status table */ -static bool rocksdb_show_snapshot_status(handlerton* hton, - THD* thd, - stat_print_fn* stat_print) -{ +static bool rocksdb_show_snapshot_status(handlerton *const hton, THD *const thd, + stat_print_fn *const stat_print) { Rdb_snapshot_status showStatus; Rdb_transaction::walk_tx_list(&showStatus); - // Send the result data back to MySQL */ + /* Send the result data back to MySQL */ return print_stats(thd, "SNAPSHOTS", "rocksdb", showStatus.getResult(), - stat_print); + stat_print); } /* @@ -2890,14 +2831,11 @@ what column families are there) */ -static bool rocksdb_show_status(handlerton* hton, - THD* thd, - stat_print_fn* stat_print, - enum ha_stat_type stat_type) -{ - bool res= false; - if (stat_type == HA_ENGINE_STATUS) - { +static bool rocksdb_show_status(handlerton *const hton, THD *const thd, + stat_print_fn *const stat_print, + enum ha_stat_type stat_type) { + bool res = false; + if (stat_type == HA_ENGINE_STATUS) { std::string str; /* Per DB stats */ @@ -2906,16 +2844,15 @@ } /* Per column family stats */ - for (auto cf_name : cf_manager.get_cf_names()) - { - rocksdb::ColumnFamilyHandle* cfh; + for (const auto &cf_name : cf_manager.get_cf_names()) { + rocksdb::ColumnFamilyHandle *cfh; bool is_automatic; /* Only the cf name is important. Whether it was generated automatically does not matter, so is_automatic is ignored. */ - cfh= cf_manager.get_cf(cf_name.c_str(), "", nullptr, &is_automatic); + cfh = cf_manager.get_cf(cf_name.c_str(), "", nullptr, &is_automatic); if (cfh == nullptr) continue; @@ -2926,35 +2863,28 @@ } /* Memory Statistics */ - std::vector dbs; - std::unordered_set cache_set; + std::vector dbs; + std::unordered_set cache_set; size_t internal_cache_count = 0; size_t kDefaultInternalCacheSize = 8 * 1024 * 1024; char buf[100]; dbs.push_back(rdb); cache_set.insert(rocksdb_tbl_options.block_cache.get()); - for (const auto& cf_handle : cf_manager.get_all_cf()) - { + for (const auto &cf_handle : cf_manager.get_all_cf()) { rocksdb::ColumnFamilyDescriptor cf_desc; cf_handle->GetDescriptor(&cf_desc); - auto* table_factory = cf_desc.options.table_factory.get(); - if (table_factory != nullptr) - { + auto *const table_factory = cf_desc.options.table_factory.get(); + if (table_factory != nullptr) { std::string tf_name = table_factory->Name(); - if (tf_name.find("BlockBasedTable") != std::string::npos) - { - const rocksdb::BlockBasedTableOptions* bbt_opt = - reinterpret_cast( - table_factory->GetOptions()); - if (bbt_opt != nullptr) - { - if (bbt_opt->block_cache.get() != nullptr) - { + if (tf_name.find("BlockBasedTable") != std::string::npos) { + const rocksdb::BlockBasedTableOptions *const bbt_opt = + reinterpret_cast( + table_factory->GetOptions()); + if (bbt_opt != nullptr) { + if (bbt_opt->block_cache.get() != nullptr) { cache_set.insert(bbt_opt->block_cache.get()); - } - else - { + } else { internal_cache_count++; } cache_set.insert(bbt_opt->block_cache_compressed.get()); @@ -2965,8 +2895,8 @@ std::map temp_usage_by_type; str.clear(); - rocksdb::MemoryUtil::GetApproximateMemoryUsageByType( - dbs, cache_set, &temp_usage_by_type); + rocksdb::MemoryUtil::GetApproximateMemoryUsageByType(dbs, cache_set, + &temp_usage_by_type); snprintf(buf, sizeof(buf), "\nMemTable Total: %lu", temp_usage_by_type[rocksdb::MemoryUtil::kMemTableTotal]); str.append(buf); @@ -2984,89 +2914,54 @@ str.append(buf); res |= print_stats(thd, "Memory_Stats", "rocksdb", str, stat_print); } - else if (stat_type == HA_ENGINE_TRX) - { - /* Handle the SHOW ENGINE ROCKSDB TRANSACTION STATUS command */ - res |= rocksdb_show_snapshot_status(hton, thd, stat_print); - } return res; } -static inline void rocksdb_register_tx(handlerton *hton, THD *thd, - Rdb_transaction *tx) -{ +static inline void rocksdb_register_tx(handlerton *const hton, THD *const thd, + Rdb_transaction *const tx) { + DBUG_ASSERT(tx != nullptr); + trans_register_ha(thd, FALSE, rocksdb_hton); - if (my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) - { + if (my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) { tx->start_stmt(); trans_register_ha(thd, TRUE, rocksdb_hton); } } /* - Supporting START TRANSACTION WITH CONSISTENT [ROCKSDB] SNAPSHOT - - Features: - 1. Supporting START TRANSACTION WITH CONSISTENT SNAPSHOT - 2. Getting current binlog position in addition to #1. + Supporting START TRANSACTION WITH CONSISTENT SNAPSHOT - The second feature is done by START TRANSACTION WITH - CONSISTENT ROCKSDB SNAPSHOT. This is Facebook's extension, and - it works like existing START TRANSACTION WITH CONSISTENT INNODB SNAPSHOT. - - - When not setting engine, START TRANSACTION WITH CONSISTENT SNAPSHOT + - START TRANSACTION WITH CONSISTENT SNAPSHOT takes both InnoDB and RocksDB snapshots, and both InnoDB and RocksDB participate in transaction. When executing COMMIT, both InnoDB and RocksDB modifications are committed. Remember that XA is not supported yet, so mixing engines is not recommended anyway. - - - When setting engine, START TRANSACTION WITH CONSISTENT.. takes - snapshot for the specified engine only. But it starts both - InnoDB and RocksDB transactions. */ static int rocksdb_start_tx_and_assign_read_view( - handlerton* hton, /*!< in: RocksDB handlerton */ - THD* thd, /*!< in: MySQL thread handle of the - user for whom the transaction should - be committed */ - char* binlog_file, /* out: binlog file for last commit */ - ulonglong* binlog_pos, /* out: binlog pos for last commit */ - char** gtid_executed, /* out: Gtids logged until last commit */ - int* gtid_executed_length) /*out: Length of gtid_executed string */ + handlerton *const hton, /*!< in: RocksDB handlerton */ + THD *const thd) /*!< in: MySQL thread handle of the + user for whom the transaction should + be committed */ { Rdb_perf_context_guard guard(thd); ulong const tx_isolation = my_core::thd_tx_isolation(thd); - if (tx_isolation != ISO_REPEATABLE_READ) - { - my_printf_error(ER_UNKNOWN_ERROR, - "Only REPEATABLE READ isolation level is supported " - "for START TRANSACTION WITH CONSISTENT SNAPSHOT " - "in RocksDB Storage Engine.", MYF(0)); - return 1; - } - - if (binlog_file) - { - if (binlog_pos && mysql_bin_log_is_open()) - mysql_bin_log_lock_commits(); - else - return 1; - } - Rdb_transaction* tx= get_or_create_tx(thd); DBUG_ASSERT(!tx->has_snapshot()); tx->set_tx_read_only(true); rocksdb_register_tx(hton, thd, tx); - tx->acquire_snapshot(true); - - if (binlog_file) - mysql_bin_log_unlock_commits(binlog_file, binlog_pos, gtid_executed, - gtid_executed_length); - return 0; + if (tx_isolation == ISO_REPEATABLE_READ) { + tx->acquire_snapshot(true); + } else { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED, + "Only REPEATABLE READ isolation level is supported " + "for START TRANSACTION WITH CONSISTENT SNAPSHOT " + "in RocksDB Storage Engine. Snapshot has not been " + "taken."); + } return HA_EXIT_SUCCESS; } /* Dummy SAVEPOINT support. This is needed for long running transactions @@ -3074,128 +2969,34 @@ * Current SAVEPOINT does not correctly handle ROLLBACK and does not return * errors. This needs to be addressed in future versions (Issue#96). */ -static int rocksdb_savepoint(handlerton *hton, THD *thd, void *savepoint) -{ - return 0; +static int rocksdb_savepoint(handlerton *const hton, THD *const thd, + void *const savepoint) { + return HA_EXIT_SUCCESS; } -static int rocksdb_rollback_to_savepoint(handlerton *hton, THD *thd, - void *savepoint) -{ - Rdb_transaction*& tx= get_tx_from_thd(thd); +static int rocksdb_rollback_to_savepoint(handlerton *const hton, THD *const thd, + void *const savepoint) { + Rdb_transaction *&tx = get_tx_from_thd(thd); return tx->rollback_to_savepoint(savepoint); } -static bool rocksdb_rollback_to_savepoint_can_release_mdl(handlerton *hton, - THD *thd) -{ +static bool +rocksdb_rollback_to_savepoint_can_release_mdl(handlerton *const hton, + THD *const thd) { return true; } -/* - This is called for INFORMATION_SCHEMA -*/ -static void rocksdb_update_table_stats( - /* per-table stats callback */ - void (*cb)(const char* db, const char* tbl, bool is_partition, - my_io_perf_t* r, my_io_perf_t* w, my_io_perf_t* r_blob, - my_io_perf_t* r_primary, my_io_perf_t* r_secondary, - page_stats_t *page_stats, comp_stats_t *comp_stats, - int n_lock_wait, int n_lock_wait_timeout, - const char* engine)) -{ - my_io_perf_t io_perf_read; - my_io_perf_t io_perf; - page_stats_t page_stats; - comp_stats_t comp_stats; - std::vector tablenames; - - /* - Most of these are for innodb, so setting them to 0. - TODO: possibly separate out primary vs. secondary index reads - */ - memset(&io_perf, 0, sizeof(io_perf)); - memset(&page_stats, 0, sizeof(page_stats)); - memset(&comp_stats, 0, sizeof(comp_stats)); - - tablenames= rdb_open_tables.get_table_names(); - - for (const auto& it : tablenames) - { - Rdb_table_handler *table_handler; - std::string str, dbname, tablename, partname; - char dbname_sys[NAME_LEN + 1]; - char tablename_sys[NAME_LEN + 1]; - bool is_partition; - - if (rdb_normalize_tablename(it, &str)) { - /* Function needs to return void because of the interface and we've - * detected an error which shouldn't happen. There's no way to let - * caller know that something failed. - */ - SHIP_ASSERT(false); - return; - } - - if (rdb_split_normalized_tablename(str, &dbname, &tablename, &partname)) - { - continue; - } - - is_partition= (partname.size() != 0); - - table_handler= rdb_open_tables.get_table_handler(it.c_str()); - if (table_handler == nullptr) - { - continue; - } - - io_perf_read.bytes= table_handler->m_io_perf_read.bytes.load(); - io_perf_read.requests= table_handler->m_io_perf_read.requests.load(); - - /* - Convert from rocksdb timer to mysql timer. RocksDB values are - in nanoseconds, but table statistics expect the value to be - in my_timer format. - */ - io_perf_read.svc_time= my_core::microseconds_to_my_timer( - table_handler->m_io_perf_read.svc_time.load() / 1000); - io_perf_read.svc_time_max= my_core::microseconds_to_my_timer( - table_handler->m_io_perf_read.svc_time_max.load() / 1000); - io_perf_read.wait_time= my_core::microseconds_to_my_timer( - table_handler->m_io_perf_read.wait_time.load() / 1000); - io_perf_read.wait_time_max= my_core::microseconds_to_my_timer( - table_handler->m_io_perf_read.wait_time_max.load() / 1000); - io_perf_read.slow_ios= table_handler->m_io_perf_read.slow_ios.load(); - rdb_open_tables.release_table_handler(table_handler); - - /* - Table stats expects our database and table name to be in system encoding, - not filename format. Convert before calling callback. - */ - my_core::filename_to_tablename(dbname.c_str(), dbname_sys, - sizeof(dbname_sys)); - my_core::filename_to_tablename(tablename.c_str(), tablename_sys, - sizeof(tablename_sys)); - (*cb)(dbname_sys, tablename_sys, is_partition, &io_perf_read, &io_perf, - &io_perf, &io_perf, &io_perf, &page_stats, &comp_stats, 0, 0, - rocksdb_hton_name); - } -} - - static rocksdb::Status check_rocksdb_options_compatibility( - const char *dbpath, - const rocksdb::Options& main_opts, - const std::vector& cf_descr) + const char *const dbpath, const rocksdb::Options& main_opts, + const std::vector& cf_descr) { DBUG_ASSERT(rocksdb_datadir != nullptr); rocksdb::DBOptions loaded_db_opt; std::vector loaded_cf_descs; rocksdb::Status status = LoadLatestOptions(dbpath, - rocksdb::Env::Default(), &loaded_db_opt, - &loaded_cf_descs); + rocksdb::Env::Default(), + &loaded_db_opt, &loaded_cf_descs); // If we're starting from scratch and there are no options saved yet then this // is a valid case. Therefore we can't compare the current set of options to @@ -3209,32 +3010,32 @@ } if (loaded_cf_descs.size() != cf_descr.size()) { - return rocksdb::Status::NotSupported("Mismatched size of column family " \ - "descriptors."); + return rocksdb::Status::NotSupported("Mismatched size of column family " + "descriptors."); } // Please see RocksDB documentation for more context about why we need to set // user-defined functions and pointer-typed options manually. for (size_t i = 0; i < loaded_cf_descs.size(); i++) { loaded_cf_descs[i].options.compaction_filter = - cf_descr[i].options.compaction_filter; - loaded_cf_descs[i].options.compaction_filter_factory = - cf_descr[i].options.compaction_filter_factory; + cf_descr[i].options.compaction_filter; + loaded_cf_descs[i].options.compaction_filter_factory = + cf_descr[i].options.compaction_filter_factory; loaded_cf_descs[i].options.comparator = cf_descr[i].options.comparator; loaded_cf_descs[i].options.memtable_factory = - cf_descr[i].options.memtable_factory; + cf_descr[i].options.memtable_factory; loaded_cf_descs[i].options.merge_operator = - cf_descr[i].options.merge_operator; + cf_descr[i].options.merge_operator; loaded_cf_descs[i].options.prefix_extractor = - cf_descr[i].options.prefix_extractor; + cf_descr[i].options.prefix_extractor; loaded_cf_descs[i].options.table_factory = - cf_descr[i].options.table_factory; + cf_descr[i].options.table_factory; } // This is the essence of the function - determine if it's safe to open the // database or not. - status = CheckOptionsCompatibility(dbpath, rocksdb::Env::Default(), - main_opts, loaded_cf_descs); + status = CheckOptionsCompatibility(dbpath, rocksdb::Env::Default(), main_opts, + loaded_cf_descs); return status; } @@ -3243,9 +3044,8 @@ Storage Engine initialization function, invoked when plugin is loaded. */ -static int rocksdb_init_func(void *p) -{ - DBUG_ENTER("rocksdb_init_func"); +static int rocksdb_init_func(void *const p) { + DBUG_ENTER_FUNC(); // Validate the assumption about the size of ROCKSDB_SIZEOF_HIDDEN_PK_COLUMN. static_assert(sizeof(longlong) == 8, "Assuming that longlong is 8 bytes."); @@ -3254,12 +3054,11 @@ init_rocksdb_psi_keys(); #endif - rocksdb_hton= (handlerton *)p; + rocksdb_hton = (handlerton *)p; mysql_mutex_init(rdb_psi_open_tbls_mutex_key, &rdb_open_tables.m_mutex, MY_MUTEX_INIT_FAST); #ifdef HAVE_PSI_INTERFACE - rdb_bg_thread.init(rdb_signal_bg_psi_mutex_key, - rdb_signal_bg_psi_cond_key); + rdb_bg_thread.init(rdb_signal_bg_psi_mutex_key, rdb_signal_bg_psi_cond_key); rdb_drop_idx_thread.init(rdb_signal_drop_idx_psi_mutex_key, rdb_signal_drop_idx_psi_cond_key); #else @@ -3272,10 +3071,9 @@ MY_MUTEX_INIT_FAST); #if defined(HAVE_PSI_INTERFACE) - rdb_collation_exceptions = new Regex_list_handler( - key_rwlock_collation_exception_list); + rdb_collation_exceptions = new Regex(key_rwlock_collation_exception_list); #else - rdb_collation_exceptions = new Regex_list_handler(); + rdb_collation_exceptions = new Regex(); #endif mysql_mutex_init(rdb_sysvars_psi_mutex_key, &rdb_sysvars_mutex, @@ -3283,141 +3081,152 @@ rdb_open_tables.init_hash(); Rdb_transaction::init_mutex(); - rocksdb_hton->state= SHOW_OPTION_YES; - rocksdb_hton->create= rocksdb_create_handler; - rocksdb_hton->close_connection= rocksdb_close_connection; - rocksdb_hton->prepare= rocksdb_prepare; - rocksdb_hton->commit_by_xid= rocksdb_commit_by_xid; - rocksdb_hton->rollback_by_xid= rocksdb_rollback_by_xid; - rocksdb_hton->recover= rocksdb_recover; - rocksdb_hton->commit= rocksdb_commit; - rocksdb_hton->rollback= rocksdb_rollback; - rocksdb_hton->db_type= DB_TYPE_ROCKSDB; - rocksdb_hton->show_status= rocksdb_show_status; - rocksdb_hton->start_consistent_snapshot= - rocksdb_start_tx_and_assign_read_view; - rocksdb_hton->savepoint_set= rocksdb_savepoint; - rocksdb_hton->savepoint_rollback= rocksdb_rollback_to_savepoint; - rocksdb_hton->savepoint_rollback_can_release_mdl= - rocksdb_rollback_to_savepoint_can_release_mdl; - rocksdb_hton->update_table_stats = rocksdb_update_table_stats; - rocksdb_hton->flush_logs= rocksdb_flush_wal; - - rocksdb_hton->flags= HTON_TEMPORARY_NOT_SUPPORTED | - HTON_SUPPORTS_EXTENDED_KEYS | - HTON_CAN_RECREATE; + rocksdb_hton->state = SHOW_OPTION_YES; + rocksdb_hton->create = rocksdb_create_handler; + rocksdb_hton->close_connection = rocksdb_close_connection; + rocksdb_hton->prepare = rocksdb_prepare; + rocksdb_hton->commit_by_xid = rocksdb_commit_by_xid; + rocksdb_hton->rollback_by_xid = rocksdb_rollback_by_xid; + rocksdb_hton->recover = rocksdb_recover; + rocksdb_hton->commit = rocksdb_commit; + rocksdb_hton->rollback = rocksdb_rollback; + rocksdb_hton->db_type = DB_TYPE_ROCKSDB; + rocksdb_hton->show_status = rocksdb_show_status; + rocksdb_hton->start_consistent_snapshot = + rocksdb_start_tx_and_assign_read_view; + rocksdb_hton->savepoint_set = rocksdb_savepoint; + rocksdb_hton->savepoint_rollback = rocksdb_rollback_to_savepoint; + rocksdb_hton->savepoint_rollback_can_release_mdl = + rocksdb_rollback_to_savepoint_can_release_mdl; + rocksdb_hton->flush_logs = rocksdb_flush_wal; + + rocksdb_hton->flags = HTON_TEMPORARY_NOT_SUPPORTED | + HTON_SUPPORTS_EXTENDED_KEYS | HTON_CAN_RECREATE; DBUG_ASSERT(!mysqld_embedded); - rocksdb_stats= rocksdb::CreateDBStatistics(); - rocksdb_db_options.statistics= rocksdb_stats; + rocksdb_stats = rocksdb::CreateDBStatistics(); + rocksdb_db_options.statistics = rocksdb_stats; if (rocksdb_rate_limiter_bytes_per_sec != 0) { - rocksdb_rate_limiter.reset(rocksdb::NewGenericRateLimiter( - rocksdb_rate_limiter_bytes_per_sec)); - rocksdb_db_options.rate_limiter= rocksdb_rate_limiter; + rocksdb_rate_limiter.reset( + rocksdb::NewGenericRateLimiter(rocksdb_rate_limiter_bytes_per_sec)); + rocksdb_db_options.rate_limiter = rocksdb_rate_limiter; } - std::shared_ptr myrocks_logger= std::make_shared(); - rocksdb::Status s= rocksdb::CreateLoggerFromOptions( + std::shared_ptr myrocks_logger = std::make_shared(); + rocksdb::Status s = rocksdb::CreateLoggerFromOptions( rocksdb_datadir, rocksdb_db_options, &rocksdb_db_options.info_log); if (s.ok()) { myrocks_logger->SetRocksDBLogger(rocksdb_db_options.info_log); } - rocksdb_db_options.info_log= myrocks_logger; + rocksdb_db_options.info_log = myrocks_logger; myrocks_logger->SetInfoLogLevel( - static_cast(rocksdb_info_log_level)); - rocksdb_db_options.wal_dir= rocksdb_wal_dir; + static_cast(rocksdb_info_log_level)); + rocksdb_db_options.wal_dir = rocksdb_wal_dir; - rocksdb_db_options.wal_recovery_mode= - static_cast(rocksdb_wal_recovery_mode); + rocksdb_db_options.wal_recovery_mode = + static_cast(rocksdb_wal_recovery_mode); - rocksdb_db_options.access_hint_on_compaction_start= - static_cast - (rocksdb_access_hint_on_compaction_start); + rocksdb_db_options.access_hint_on_compaction_start = + static_cast( + rocksdb_access_hint_on_compaction_start); if (rocksdb_db_options.allow_mmap_reads && - !rocksdb_db_options.allow_os_buffer) - { - // allow_mmap_reads implies allow_os_buffer and RocksDB will not open if - // mmap_reads is on and os_buffer is off. (NO_LINT_DEBUG) - sql_print_error("RocksDB: Can't disable allow_os_buffer " - "if allow_mmap_reads is enabled\n"); + rocksdb_db_options.use_direct_reads) { + // allow_mmap_reads implies !use_direct_reads and RocksDB will not open if + // mmap_reads and direct_reads are both on. (NO_LINT_DEBUG) + sql_print_error("RocksDB: Can't enable both use_direct_reads " + "and allow_mmap_reads\n"); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); + } + + if (rocksdb_db_options.allow_mmap_writes && + rocksdb_db_options.use_direct_writes) { + // See above comment for allow_mmap_reads. (NO_LINT_DEBUG) + sql_print_error("RocksDB: Can't enable both use_direct_writes " + "and allow_mmap_writes\n"); + rdb_open_tables.free_hash(); + DBUG_RETURN(HA_EXIT_FAILURE); } std::vector cf_names; rocksdb::Status status; - status= rocksdb::DB::ListColumnFamilies(rocksdb_db_options, rocksdb_datadir, - &cf_names); - if (!status.ok()) - { + status = rocksdb::DB::ListColumnFamilies(rocksdb_db_options, rocksdb_datadir, + &cf_names); + if (!status.ok()) { /* When we start on an empty datadir, ListColumnFamilies returns IOError, and RocksDB doesn't provide any way to check what kind of error it was. Checking system errno happens to work right now. */ - if (status.IsIOError() && errno == ENOENT) - { + if (status.IsIOError() && errno == ENOENT) { sql_print_information("RocksDB: Got ENOENT when listing column families"); - sql_print_information("RocksDB: assuming that we're creating a new database"); - } - else - { - std::string err_text= status.ToString(); - sql_print_error("RocksDB: Error listing column families: %s", err_text.c_str()); + sql_print_information( + "RocksDB: assuming that we're creating a new database"); + } else { + std::string err_text = status.ToString(); + sql_print_error("RocksDB: Error listing column families: %s", + err_text.c_str()); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } - } - else - sql_print_information("RocksDB: %ld column families found", cf_names.size()); + } else + sql_print_information("RocksDB: %ld column families found", + cf_names.size()); std::vector cf_descr; - std::vector cf_handles; + std::vector cf_handles; - rocksdb_tbl_options.index_type= - (rocksdb::BlockBasedTableOptions::IndexType)rocksdb_index_type; + rocksdb_tbl_options.index_type = + (rocksdb::BlockBasedTableOptions::IndexType)rocksdb_index_type; if (!rocksdb_tbl_options.no_block_cache) { - rocksdb_tbl_options.block_cache= + rocksdb_tbl_options.block_cache = rocksdb::NewLRUCache(rocksdb_block_cache_size); } // Using newer BlockBasedTable format version for better compression // and better memory allocation. - // See: https://github.com/facebook/rocksdb/commit/9ab5adfc59a621d12357580c94451d9f7320c2dd - rocksdb_tbl_options.format_version= 2; + // See: + // https://github.com/facebook/rocksdb/commit/9ab5adfc59a621d12357580c94451d9f7320c2dd + rocksdb_tbl_options.format_version = 2; if (rocksdb_collect_sst_properties) { - properties_collector_factory = std::make_shared - ( - &ddl_manager - ); + properties_collector_factory = + std::make_shared(&ddl_manager); rocksdb_set_compaction_options(nullptr, nullptr, nullptr, nullptr); mysql_mutex_lock(&rdb_sysvars_mutex); - DBUG_ASSERT(rocksdb_table_stats_sampling_pct - <= RDB_TBL_STATS_SAMPLE_PCT_MAX); + DBUG_ASSERT(rocksdb_table_stats_sampling_pct <= + RDB_TBL_STATS_SAMPLE_PCT_MAX); properties_collector_factory->SetTableStatsSamplingPct( - rocksdb_table_stats_sampling_pct); + rocksdb_table_stats_sampling_pct); mysql_mutex_unlock(&rdb_sysvars_mutex); } - if (!rocksdb_cf_options_map.init(ROCKSDB_WRITE_BUFFER_SIZE_DEFAULT, - rocksdb_tbl_options, - properties_collector_factory, - rocksdb_default_cf_options, - rocksdb_override_cf_options)) - { + if (rocksdb_persistent_cache_size > 0) { + std::shared_ptr pcache; + rocksdb::NewPersistentCache( + rocksdb::Env::Default(), std::string(rocksdb_persistent_cache_path), + rocksdb_persistent_cache_size, myrocks_logger, true, &pcache); + rocksdb_tbl_options.persistent_cache = pcache; + } else if (strlen(rocksdb_persistent_cache_path)) { + sql_print_error("RocksDB: Must specify rocksdb_persistent_cache_size"); + DBUG_RETURN(1); + } + + if (!rocksdb_cf_options_map.init( + rocksdb_tbl_options, properties_collector_factory, + rocksdb_default_cf_options, rocksdb_override_cf_options)) { // NO_LINT_DEBUG sql_print_error("RocksDB: Failed to initialize CF options map."); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } /* @@ -3429,8 +3238,7 @@ std::vector compaction_enabled_cf_indices; sql_print_information("RocksDB: Column Families at start:"); - for (size_t i = 0; i < cf_names.size(); ++i) - { + for (size_t i = 0; i < cf_names.size(); ++i) { rocksdb::ColumnFamilyOptions opts; rocksdb_cf_options_map.get_cf_options(cf_names[i], &opts); @@ -3443,8 +3251,7 @@ Temporarily disable compactions to prevent a race condition where compaction starts before compaction filter is ready. */ - if (!opts.disable_auto_compactions) - { + if (!opts.disable_auto_compactions) { compaction_enabled_cf_indices.push_back(i); opts.disable_auto_compactions = true; } @@ -3459,105 +3266,105 @@ main_opts.env->SetBackgroundThreads(main_opts.max_background_compactions, rocksdb::Env::Priority::LOW); rocksdb::TransactionDBOptions tx_db_options; - tx_db_options.transaction_lock_timeout= 2; // 2 seconds - tx_db_options.custom_mutex_factory= std::make_shared(); + tx_db_options.transaction_lock_timeout = 2; // 2 seconds + tx_db_options.custom_mutex_factory = std::make_shared(); - status= check_rocksdb_options_compatibility(rocksdb_datadir, main_opts, - cf_descr); + status = + check_rocksdb_options_compatibility(rocksdb_datadir, main_opts, cf_descr); // We won't start if we'll determine that there's a chance of data corruption // because of incompatible options. if (!status.ok()) { // NO_LINT_DEBUG - sql_print_error("RocksDB: compatibility check against existing database " \ - "options failed. %s", status.ToString().c_str()); + sql_print_error("RocksDB: compatibility check against existing database " + "options failed. %s", + status.ToString().c_str()); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } - status= rocksdb::TransactionDB::Open(main_opts, tx_db_options, - rocksdb_datadir, cf_descr, - &cf_handles, &rdb); + status = rocksdb::TransactionDB::Open( + main_opts, tx_db_options, rocksdb_datadir, cf_descr, &cf_handles, &rdb); - if (!status.ok()) - { - std::string err_text= status.ToString(); + if (!status.ok()) { + std::string err_text = status.ToString(); sql_print_error("RocksDB: Error opening instance: %s", err_text.c_str()); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } cf_manager.init(&rocksdb_cf_options_map, &cf_handles); - if (dict_manager.init(rdb->GetBaseDB(), &cf_manager)) - { + if (dict_manager.init(rdb->GetBaseDB(), &cf_manager)) { // NO_LINT_DEBUG sql_print_error("RocksDB: Failed to initialize data dictionary."); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } - if (binlog_manager.init(&dict_manager)) - { + if (ddl_manager.init(&dict_manager, &cf_manager, rocksdb_validate_tables)) { // NO_LINT_DEBUG - sql_print_error("RocksDB: Failed to initialize binlog manager."); + sql_print_error("RocksDB: Failed to initialize DDL manager."); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } - if (ddl_manager.init(&dict_manager, &cf_manager, rocksdb_validate_tables)) - { - // NO_LINT_DEBUG - sql_print_error("RocksDB: Failed to initialize DDL manager."); - rdb_open_tables.free_hash(); - DBUG_RETURN(1); + for (const auto &cf_handle : cf_manager.get_all_cf()) { + uint flags; + if (!dict_manager.get_cf_flags(cf_handle->GetID(), &flags)) { + const std::unique_ptr wb = dict_manager.begin(); + rocksdb::WriteBatch *const batch = wb.get(); + dict_manager.add_cf_flags(batch, cf_handle->GetID(), 0); + dict_manager.commit(batch); + } } + Rdb_sst_info::init(rdb); /* Enable auto compaction, things needed for compaction filter are finished initializing */ - std::vector compaction_enabled_cf_handles; + std::vector compaction_enabled_cf_handles; compaction_enabled_cf_handles.reserve(compaction_enabled_cf_indices.size()); - for (auto index : compaction_enabled_cf_indices) - { + for (const auto &index : compaction_enabled_cf_indices) { compaction_enabled_cf_handles.push_back(cf_handles[index]); } - status= rdb->EnableAutoCompaction(compaction_enabled_cf_handles); + status = rdb->EnableAutoCompaction(compaction_enabled_cf_handles); - if (!status.ok()) - { - std::string err_text= status.ToString(); + if (!status.ok()) { + const std::string err_text = status.ToString(); // NO_LINT_DEBUG sql_print_error("RocksDB: Error enabling compaction: %s", err_text.c_str()); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } - auto err= rdb_bg_thread.create_thread( + auto err = rdb_bg_thread.create_thread(BG_THREAD_NAME #ifdef HAVE_PSI_INTERFACE - rdb_background_psi_thread_key + , + rdb_background_psi_thread_key #endif - ); + ); if (err != 0) { sql_print_error("RocksDB: Couldn't start the background thread: (errno=%d)", err); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } - err= rdb_drop_idx_thread.create_thread( + err = rdb_drop_idx_thread.create_thread(INDEX_THREAD_NAME #ifdef HAVE_PSI_INTERFACE - rdb_drop_idx_psi_thread_key + , + rdb_drop_idx_psi_thread_key #endif - ); + ); if (err != 0) { sql_print_error("RocksDB: Couldn't start the drop index thread: (errno=%d)", err); rdb_open_tables.free_hash(); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } rdb_set_collation_exception_list(rocksdb_strict_collation_exceptions); @@ -3567,17 +3374,17 @@ } sql_print_information("RocksDB instance opened"); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } /* Storage Engine deinitialization function, invoked when plugin is unloaded. */ -static int rocksdb_done_func(void *p) -{ - int error= 0; - DBUG_ENTER("rocksdb_done_func"); +static int rocksdb_done_func(void *const p) { + DBUG_ENTER_FUNC(); + + int error = 0; // signal the drop index thread to stop rdb_drop_idx_thread.signal(true); @@ -3596,7 +3403,7 @@ rdb_bg_thread.signal(true); // Wait for the background thread to finish. - auto err= rdb_bg_thread.join(); + auto err = rdb_bg_thread.join(); if (err != 0) { // We'll log the message and continue because we're shutting down and // continuation is the optimal strategy. @@ -3606,18 +3413,16 @@ } // Wait for the drop index thread to finish. - err= rdb_drop_idx_thread.join(); + err = rdb_drop_idx_thread.join(); if (err != 0) { // NO_LINT_DEBUG - sql_print_error("RocksDB: Couldn't stop the index thread: (errno=%d)", - err); + sql_print_error("RocksDB: Couldn't stop the index thread: (errno=%d)", err); } - if (rdb_open_tables.m_hash.records) - { + if (rdb_open_tables.m_hash.records) { // Looks like we are getting unloaded and yet we have some open tables // left behind. - error= 1; + error = 1; } rdb_open_tables.free_hash(); @@ -3630,26 +3435,23 @@ Rdb_transaction::term_mutex(); - for (auto& it : rdb_collation_data) - { + for (auto &it : rdb_collation_data) { delete it; - it= nullptr; + it = nullptr; } ddl_manager.cleanup(); - binlog_manager.cleanup(); dict_manager.cleanup(); cf_manager.cleanup(); delete rdb; - rdb= nullptr; + rdb = nullptr; - // Disown the cache data since we're shutting down. - // This results in memory leaks but it improved the shutdown time. - // Don't disown when running under valgrind +// Disown the cache data since we're shutting down. +// This results in memory leaks but it improved the shutdown time. +// Don't disown when running under valgrind #ifndef HAVE_purify - if (rocksdb_tbl_options.block_cache) - { + if (rocksdb_tbl_options.block_cache) { rocksdb_tbl_options.block_cache->DisownData(); } #endif /* HAVE_purify */ @@ -3657,7 +3459,6 @@ DBUG_RETURN(error); } - /** @brief Example of simple lock controls. The "table_handler" it creates is a @@ -3666,42 +3467,35 @@ they are needed to function. */ -Rdb_table_handler* Rdb_open_tables_map::get_table_handler( - const char *table_name) -{ +Rdb_table_handler * +Rdb_open_tables_map::get_table_handler(const char *const table_name) { Rdb_table_handler *table_handler; uint length; char *tmp_name; DBUG_ASSERT(table_name != nullptr); - length=(uint) strlen(table_name); + length = (uint)strlen(table_name); // First, look up the table in the hash map. mysql_mutex_lock(&m_mutex); - if (!(table_handler= reinterpret_cast( - my_hash_search(&m_hash, reinterpret_cast(table_name), - length)))) - { + if (!(table_handler = reinterpret_cast(my_hash_search( + &m_hash, reinterpret_cast(table_name), length)))) { // Since we did not find it in the hash map, attempt to create and add it // to the hash map. - if (!(table_handler= reinterpret_cast( - my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), - &table_handler, sizeof(*table_handler), - &tmp_name, length+1, - NullS)))) - { + if (!(table_handler = reinterpret_cast(my_multi_malloc( + MYF(MY_WME | MY_ZEROFILL), &table_handler, sizeof(*table_handler), + &tmp_name, length + 1, NullS)))) { // Allocating a new Rdb_table_handler and a new table name failed. mysql_mutex_unlock(&m_mutex); return nullptr; } - table_handler->m_ref_count= 0; - table_handler->m_table_name_length= length; - table_handler->m_table_name= tmp_name; + table_handler->m_ref_count = 0; + table_handler->m_table_name_length = length; + table_handler->m_table_name = tmp_name; strmov(table_handler->m_table_name, table_name); - if (my_hash_insert(&m_hash, reinterpret_cast(table_handler))) - { + if (my_hash_insert(&m_hash, reinterpret_cast(table_handler))) { // Inserting into the hash map failed. mysql_mutex_unlock(&m_mutex); my_free(table_handler); @@ -3709,7 +3503,7 @@ } thr_lock_init(&table_handler->m_thr_lock); - my_io_perf_atomic_init(&table_handler->m_io_perf_read); + table_handler->m_io_perf_read.init(); } DBUG_ASSERT(table_handler->m_ref_count >= 0); table_handler->m_ref_count++; @@ -3719,25 +3513,19 @@ return table_handler; } - -std::vector rdb_get_open_table_names(void) -{ +std::vector rdb_get_open_table_names(void) { return rdb_open_tables.get_table_names(); } - -std::vector Rdb_open_tables_map::get_table_names(void) const -{ +std::vector Rdb_open_tables_map::get_table_names(void) const { ulong i; const Rdb_table_handler *table_handler; std::vector names; mysql_mutex_lock(&m_mutex); - for (i = 0; - (table_handler= reinterpret_cast( - my_hash_const_element(&m_hash, i))); - i++) - { + for (i = 0; (table_handler = reinterpret_cast( + my_hash_const_element(&m_hash, i))); + i++) { DBUG_ASSERT(table_handler != nullptr); names.push_back(table_handler->m_table_name); } @@ -3747,12 +3535,10 @@ return names; } - -void ha_rocksdb::load_auto_incr_value() -{ - int save_active_index= active_index; - active_index= table->s->next_number_index; - uint8 save_table_status= table->status; +void ha_rocksdb::load_auto_incr_value() { + const int save_active_index = active_index; + active_index = table->s->next_number_index; + const uint8 save_table_status = table->status; /* load_auto_incr_value() may be called by statements that @@ -3760,26 +3546,25 @@ index_last() creates a snapshot. When a snapshot is created here, it has to be released as well. (GitHub issue#189) */ - Rdb_transaction *tx= get_or_create_tx(table->in_use); - bool is_new_snapshot= !tx->has_snapshot(); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); + const bool is_new_snapshot = !tx->has_snapshot(); // Do a lookup. We only need index column, so it should be index-only. // (another reason to make it index-only is that table->read_set is // not set appropriately and non-index-only lookup will not read the value) - bool save_keyread_only= m_keyread_only; - m_keyread_only= true; + const bool save_keyread_only = m_keyread_only; + m_keyread_only = true; if (!index_last(table->record[0])) update_auto_incr_val(); - m_keyread_only= save_keyread_only; - if (is_new_snapshot) - { + m_keyread_only = save_keyread_only; + if (is_new_snapshot) { tx->release_snapshot(); } - table->status= save_table_status; - active_index= save_active_index; + table->status = save_table_status; + active_index = save_active_index; /* Do what ha_rocksdb::index_end() does. @@ -3795,46 +3580,41 @@ end of ha_rocksdb::create. Also see opened issue here: https://github.com/facebook/mysql-5.6/issues/153 */ -void ha_rocksdb::update_auto_incr_val() -{ +void ha_rocksdb::update_auto_incr_val() { Field *field; longlong new_val; - field= table->key_info[table->s->next_number_index].key_part[0].field; + field = table->key_info[table->s->next_number_index].key_part[0].field; - my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set); - new_val= field->val_int() + 1; + my_bitmap_map *const old_map = + dbug_tmp_use_all_columns(table, table->read_set); + new_val = field->val_int() + 1; dbug_tmp_restore_column_map(table->read_set, old_map); - longlong auto_incr_val= m_tbl_def->m_auto_incr_val; + longlong auto_incr_val = m_tbl_def->m_auto_incr_val; while (auto_incr_val < new_val && - !m_tbl_def->m_auto_incr_val.compare_exchange_weak( - auto_incr_val, new_val)) - { + !m_tbl_def->m_auto_incr_val.compare_exchange_weak(auto_incr_val, + new_val)) { // Do nothing - just loop until auto_incr_val is >= new_val or // we successfully set it } } -int ha_rocksdb::load_hidden_pk_value() -{ - int save_active_index= active_index; - active_index= m_tbl_def->m_key_count - 1; - uint8 save_table_status= table->status; +int ha_rocksdb::load_hidden_pk_value() { + const int save_active_index = active_index; + active_index = m_tbl_def->m_key_count - 1; + const uint8 save_table_status = table->status; - Rdb_transaction *tx= get_or_create_tx(table->in_use); - bool is_new_snapshot= !tx->has_snapshot(); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); + const bool is_new_snapshot = !tx->has_snapshot(); // Do a lookup. - if (!index_last(table->record[0])) - { + if (!index_last(table->record[0])) { /* Decode PK field from the key */ - longlong hidden_pk_id= 0; - if (read_hidden_pk_id_from_rowkey(&hidden_pk_id)) - { - if (is_new_snapshot) - { + longlong hidden_pk_id = 0; + if (read_hidden_pk_id_from_rowkey(&hidden_pk_id)) { + if (is_new_snapshot) { tx->release_snapshot(); } return HA_ERR_INTERNAL_ERROR; @@ -3842,36 +3622,33 @@ hidden_pk_id++; longlong old = m_tbl_def->m_hidden_pk_val; - while (old < hidden_pk_id && - !m_tbl_def->m_hidden_pk_val.compare_exchange_weak(old, hidden_pk_id)) - {} + while ( + old < hidden_pk_id && + !m_tbl_def->m_hidden_pk_val.compare_exchange_weak(old, hidden_pk_id)) { + } } - if (is_new_snapshot) - { + if (is_new_snapshot) { tx->release_snapshot(); } - table->status= save_table_status; - active_index= save_active_index; + table->status = save_table_status; + active_index = save_active_index; release_scan_iterator(); - return 0; + return HA_EXIT_SUCCESS; } /* Get PK value from m_tbl_def->m_hidden_pk_info. */ -longlong ha_rocksdb::update_hidden_pk_val() -{ +longlong ha_rocksdb::update_hidden_pk_val() { DBUG_ASSERT(has_hidden_pk(table)); - longlong new_val; - new_val= m_tbl_def->m_hidden_pk_val++; + const longlong new_val = m_tbl_def->m_hidden_pk_val++; return new_val; } /* Get the id of the hidden pk id from m_last_rowkey */ -int ha_rocksdb::read_hidden_pk_id_from_rowkey(longlong* hidden_pk_id) -{ +int ha_rocksdb::read_hidden_pk_id_from_rowkey(longlong *const hidden_pk_id) { DBUG_ASSERT(hidden_pk_id != nullptr); DBUG_ASSERT(table != nullptr); DBUG_ASSERT(has_hidden_pk(table)); @@ -3881,20 +3658,18 @@ // Get hidden primary key from old key slice Rdb_string_reader reader(&rowkey_slice); if ((!reader.read(Rdb_key_def::INDEX_NUMBER_SIZE))) - return 1; + return HA_EXIT_FAILURE; - const int length= Field_longlong::PACK_LENGTH; - const uchar *from= reinterpret_cast(reader.read(length)); - if (from == nullptr) - { - return 1; /* Mem-comparable image doesn't have enough bytes */ + const int length = Field_longlong::PACK_LENGTH; + const uchar *from = reinterpret_cast(reader.read(length)); + if (from == nullptr) { + return HA_EXIT_FAILURE; /* Mem-comparable image doesn't have enough bytes */ } - *hidden_pk_id= rdb_netbuf_read_uint64(&from); - return 0; + *hidden_pk_id = rdb_netbuf_read_uint64(&from); + return HA_EXIT_SUCCESS; } - /** @brief Free lock controls. We call this whenever we close a table. If the table had @@ -3903,17 +3678,16 @@ */ void Rdb_open_tables_map::release_table_handler( - Rdb_table_handler *table_handler) -{ + Rdb_table_handler *const table_handler) { mysql_mutex_lock(&m_mutex); + DBUG_ASSERT(table_handler != nullptr); DBUG_ASSERT(table_handler->m_ref_count > 0); - if (!--table_handler->m_ref_count) - { + if (!--table_handler->m_ref_count) { // Last rereference was released. Tear down the hash entry. - auto ret __attribute__((__unused__)) = - my_hash_delete(&m_hash, reinterpret_cast(table_handler)); - DBUG_ASSERT(!ret); // the hash entry must actually be found and deleted + const auto ret __attribute__((__unused__)) = + my_hash_delete(&m_hash, reinterpret_cast(table_handler)); + DBUG_ASSERT(!ret); // the hash entry must actually be found and deleted my_core::thr_lock_delete(&table_handler->m_thr_lock); my_free(table_handler); } @@ -3921,64 +3695,57 @@ mysql_mutex_unlock(&m_mutex); } - -static handler* rocksdb_create_handler(my_core::handlerton *hton, - my_core::TABLE_SHARE *table_arg, - my_core::MEM_ROOT *mem_root) -{ +static handler *rocksdb_create_handler(my_core::handlerton *const hton, + my_core::TABLE_SHARE *const table_arg, + my_core::MEM_ROOT *const mem_root) { return new (mem_root) ha_rocksdb(hton, table_arg); } +ha_rocksdb::ha_rocksdb(my_core::handlerton *const hton, + my_core::TABLE_SHARE *const table_arg) + : handler(hton, table_arg), m_table_handler(nullptr), m_scan_it(nullptr), + m_scan_it_skips_bloom(false), m_scan_it_snapshot(nullptr), + m_tbl_def(nullptr), m_pk_descr(nullptr), m_key_descr_arr(nullptr), + m_pk_can_be_decoded(false), m_maybe_unpack_info(false), + m_pk_tuple(nullptr), m_pk_packed_tuple(nullptr), + m_sk_packed_tuple(nullptr), m_end_key_packed_tuple(nullptr), + m_sk_match_prefix(nullptr), m_sk_match_prefix_buf(nullptr), + m_sk_packed_tuple_old(nullptr), m_dup_sk_packed_tuple(nullptr), + m_dup_sk_packed_tuple_old(nullptr), m_pack_buffer(nullptr), + m_lock_rows(RDB_LOCK_NONE), m_keyread_only(FALSE), + m_bulk_load_tx(nullptr), m_encoder_arr(nullptr), + m_row_checksums_checked(0), m_in_rpl_delete_rows(false), + m_in_rpl_update_rows(false) { + // TODO(alexyang): create a valid PSI_mutex_key for this mutex + mysql_mutex_init(0, &m_bulk_load_mutex, MY_MUTEX_INIT_FAST); +} + +static const char *ha_rocksdb_exts[] = {NullS}; -ha_rocksdb::ha_rocksdb(my_core::handlerton *hton, - my_core::TABLE_SHARE *table_arg) - : handler(hton, table_arg), m_table_handler(nullptr), m_scan_it(nullptr), - m_scan_it_skips_bloom(false), m_tbl_def(nullptr), - m_pk_descr(nullptr), m_key_descr_arr(nullptr), - m_pk_can_be_decoded(false), - m_maybe_unpack_info(false), - m_pk_tuple(nullptr), m_pk_packed_tuple(nullptr), - m_sk_packed_tuple(nullptr), - m_sk_match_prefix(nullptr), m_sk_match_prefix_buf(nullptr), - m_sk_packed_tuple_old(nullptr), - m_pack_buffer(nullptr), m_lock_rows(RDB_LOCK_NONE), - m_keyread_only(FALSE), m_encoder_arr(nullptr), - m_row_checksums_checked(0), - m_in_rpl_delete_rows(false), m_in_rpl_update_rows(false), - m_force_skip_unique_check(false) -{} - - -static const char *ha_rocksdb_exts[] = { - NullS -}; - +const char **ha_rocksdb::bas_ext() const { + DBUG_ENTER_FUNC(); -const char **ha_rocksdb::bas_ext() const -{ - return ha_rocksdb_exts; + DBUG_RETURN(ha_rocksdb_exts); } -bool ha_rocksdb::same_table(const ha_rocksdb& other) const -{ +bool ha_rocksdb::same_table(const ha_rocksdb &other) const { return m_tbl_def->base_tablename() == other.m_tbl_def->base_tablename(); } -bool ha_rocksdb::init_with_fields() -{ - uint pk= table_share->primary_key; - if (pk != MAX_KEY) - { - uint key_parts= table_share->key_info[pk].user_defined_key_parts; - check_keyread_allowed(pk /*PK*/, key_parts-1, true); - } - else - m_pk_can_be_decoded= false; +bool ha_rocksdb::init_with_fields() { + DBUG_ENTER_FUNC(); - cached_table_flags= table_flags(); - return false; /* Ok */ -} + const uint pk = table_share->primary_key; + if (pk != MAX_KEY) { + const uint key_parts = table_share->key_info[pk].user_defined_key_parts; + check_keyread_allowed(pk /*PK*/, key_parts - 1, true); + } else + m_pk_can_be_decoded = false; + cached_table_flags = table_flags(); + + DBUG_RETURN(false); /* Ok */ +} /** Convert record from table->record[0] form into a form that can be written @@ -3990,11 +3757,8 @@ */ void ha_rocksdb::convert_record_to_storage_format( - const rocksdb::Slice& pk_packed_slice, - Rdb_string_writer *pk_unpack_info, - rocksdb::Slice *packed_rec) -{ - DBUG_ASSERT_IMP(m_maybe_unpack_info, pk_unpack_info); + const rocksdb::Slice &pk_packed_slice, + Rdb_string_writer *const pk_unpack_info, rocksdb::Slice *const packed_rec) { m_storage_record.length(0); /* All NULL bits are initially 0 */ @@ -4003,95 +3767,78 @@ // If a primary key may have non-empty unpack_info for certain values, // (m_maybe_unpack_info=TRUE), we write the unpack_info block. The block // itself was prepared in Rdb_key_def::pack_record. - if (m_maybe_unpack_info && - m_pk_descr->m_kv_format_version >= - Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1) - { - m_storage_record.append(reinterpret_cast(pk_unpack_info->ptr()), + if (m_maybe_unpack_info) { + m_storage_record.append(reinterpret_cast(pk_unpack_info->ptr()), pk_unpack_info->get_current_pos()); } - for (uint i=0; i < table->s->fields; i++) - { + for (uint i = 0; i < table->s->fields; i++) { /* Don't pack decodable PK key parts */ - if (m_encoder_arr[i].m_storage_type != Rdb_field_encoder::STORE_ALL) - { + if (m_encoder_arr[i].m_storage_type != Rdb_field_encoder::STORE_ALL) { continue; } - Field *field= table->field[i]; - if (m_encoder_arr[i].maybe_null()) - { - char *data= (char*)m_storage_record.ptr(); - if (field->is_null()) - { - data[m_encoder_arr[i].m_null_offset]|= m_encoder_arr[i].m_null_mask; + Field *const field = table->field[i]; + if (m_encoder_arr[i].maybe_null()) { + char *const data = (char *)m_storage_record.ptr(); + if (field->is_null()) { + data[m_encoder_arr[i].m_null_offset] |= m_encoder_arr[i].m_null_mask; /* Don't write anything for NULL values */ continue; } } - if (m_encoder_arr[i].m_field_type == MYSQL_TYPE_BLOB) - { - my_core::Field_blob *blob= (my_core::Field_blob*)field; + if (m_encoder_arr[i].m_field_type == MYSQL_TYPE_BLOB) { + my_core::Field_blob *blob = (my_core::Field_blob *)field; /* Get the number of bytes needed to store length*/ - uint length_bytes= blob->pack_length() - portable_sizeof_char_ptr; + const uint length_bytes = blob->pack_length() - portable_sizeof_char_ptr; /* Store the length of the value */ - m_storage_record.append(reinterpret_cast(blob->ptr), length_bytes); + m_storage_record.append(reinterpret_cast(blob->ptr), + length_bytes); /* Store the blob value itself */ char *data_ptr; - memcpy(&data_ptr, blob->ptr + length_bytes, sizeof(uchar**)); + memcpy(&data_ptr, blob->ptr + length_bytes, sizeof(uchar **)); m_storage_record.append(data_ptr, blob->get_length()); - } - else if (m_encoder_arr[i].m_field_type == MYSQL_TYPE_VARCHAR) - { - Field_varstring* field_var= (Field_varstring*)field; + } else if (m_encoder_arr[i].m_field_type == MYSQL_TYPE_VARCHAR) { + Field_varstring *const field_var = (Field_varstring *)field; uint data_len; /* field_var->length_bytes is 1 or 2 */ - if (field_var->length_bytes == 1) - { - data_len= field_var->ptr[0]; - } - else - { - DBUG_ASSERT(field_var->length_bytes==2); - data_len= uint2korr(field_var->ptr); + if (field_var->length_bytes == 1) { + data_len = field_var->ptr[0]; + } else { + DBUG_ASSERT(field_var->length_bytes == 2); + data_len = uint2korr(field_var->ptr); } - m_storage_record.append(reinterpret_cast(field_var->ptr), + m_storage_record.append(reinterpret_cast(field_var->ptr), field_var->length_bytes + data_len); - } - else - { + } else { /* Copy the field data */ - uint len= field->pack_length_in_rec(); - m_storage_record.append(reinterpret_cast(field->ptr), len); + const uint len = field->pack_length_in_rec(); + m_storage_record.append(reinterpret_cast(field->ptr), len); } } - if (should_store_checksums()) - { - uint32_t key_crc32= my_core::crc32(0, - rdb_slice_to_uchar_ptr(&pk_packed_slice), - pk_packed_slice.size()); - uint32_t val_crc32= my_core::crc32( - 0, rdb_mysql_str_to_uchar_str(&m_storage_record), - m_storage_record.length()); + if (should_store_row_debug_checksums()) { + const uint32_t key_crc32 = my_core::crc32( + 0, rdb_slice_to_uchar_ptr(&pk_packed_slice), pk_packed_slice.size()); + const uint32_t val_crc32 = + my_core::crc32(0, rdb_mysql_str_to_uchar_str(&m_storage_record), + m_storage_record.length()); uchar key_crc_buf[RDB_CHECKSUM_SIZE]; uchar val_crc_buf[RDB_CHECKSUM_SIZE]; rdb_netbuf_store_uint32(key_crc_buf, key_crc32); rdb_netbuf_store_uint32(val_crc_buf, val_crc32); - m_storage_record.append((const char*)&RDB_CHECKSUM_DATA_TAG, 1); - m_storage_record.append((const char*)key_crc_buf, RDB_CHECKSUM_SIZE); - m_storage_record.append((const char*)val_crc_buf, RDB_CHECKSUM_SIZE); + m_storage_record.append((const char *)&RDB_CHECKSUM_DATA_TAG, 1); + m_storage_record.append((const char *)key_crc_buf, RDB_CHECKSUM_SIZE); + m_storage_record.append((const char *)val_crc_buf, RDB_CHECKSUM_SIZE); } - *packed_rec= rocksdb::Slice(m_storage_record.ptr(), - m_storage_record.length()); + *packed_rec = + rocksdb::Slice(m_storage_record.ptr(), m_storage_record.length()); } - /* @brief Setup which fields will be unpacked when reading rows @@ -4099,7 +3846,8 @@ @detail Two special cases when we still unpack all fields: - When this table is being updated (m_lock_rows==RDB_LOCK_WRITE). - - When @@rocksdb_verify_checksums is ON (In this mode, we need to read all + - When @@rocksdb_verify_row_debug_checksums is ON (In this mode, we need to + read all fields to find whether there is a row checksum at the end. We could skip the fields instead of decoding them, but currently we do decoding.) @@ -4107,40 +3855,31 @@ ha_rocksdb::setup_field_converters() ha_rocksdb::convert_record_from_storage_format() */ -void ha_rocksdb::setup_read_decoders() -{ +void ha_rocksdb::setup_read_decoders() { m_decoders_vect.clear(); - int last_useful= 0; - int skip_size= 0; + int last_useful = 0; + int skip_size = 0; - for (uint i= 0; i < table->s->fields; i++) - { + for (uint i = 0; i < table->s->fields; i++) { // We only need the decoder if the whole record is stored. - if (m_encoder_arr[i].m_storage_type != Rdb_field_encoder::STORE_ALL) - { + if (m_encoder_arr[i].m_storage_type != Rdb_field_encoder::STORE_ALL) { continue; } - if (m_lock_rows == RDB_LOCK_WRITE || m_verify_checksums || - bitmap_is_set(table->read_set, table->field[i]->field_index)) - { + if (m_lock_rows == RDB_LOCK_WRITE || m_verify_row_debug_checksums || + bitmap_is_set(table->read_set, table->field[i]->field_index)) { // We will need to decode this field m_decoders_vect.push_back({&m_encoder_arr[i], true, skip_size}); - last_useful= m_decoders_vect.size(); - skip_size= 0; - } - else - { + last_useful = m_decoders_vect.size(); + skip_size = 0; + } else { if (m_encoder_arr[i].uses_variable_len_encoding() || - m_encoder_arr[i].maybe_null()) - { + m_encoder_arr[i].maybe_null()) { // For variable-length field, we need to read the data and skip it m_decoders_vect.push_back({&m_encoder_arr[i], false, skip_size}); - skip_size= 0; - } - else - { + skip_size = 0; + } else { // Fixed-width field can be skipped without looking at it. // Add appropriate skip_size to the next field. skip_size += m_encoder_arr[i].m_pack_length_in_rec; @@ -4154,20 +3893,14 @@ m_decoders_vect.end()); } - #ifndef NDEBUG -void dbug_append_garbage_at_end(std::string &on_disk_rec) -{ +void dbug_append_garbage_at_end(std::string &on_disk_rec) { on_disk_rec.append("abc"); } -void dbug_truncate_record(std::string &on_disk_rec) -{ - on_disk_rec.resize(0); -} +void dbug_truncate_record(std::string &on_disk_rec) { on_disk_rec.resize(0); } -void dbug_modify_rec_varchar12(std::string &on_disk_rec) -{ +void dbug_modify_rec_varchar12(std::string &on_disk_rec) { std::string res; // The record is NULL-byte followed by VARCHAR(10). // Put the NULL-byte @@ -4179,9 +3912,7 @@ on_disk_rec.assign(res); } - -void dbug_modify_key_varchar8(String &on_disk_rec) -{ +void dbug_modify_key_varchar8(String &on_disk_rec) { std::string res; // The key starts with index number res.append(on_disk_rec.ptr(), Rdb_key_def::INDEX_NUMBER_SIZE); @@ -4192,12 +3923,14 @@ on_disk_rec.append(res.data(), res.size()); } +void dbug_create_err_inplace_alter() { + my_printf_error(ER_UNKNOWN_ERROR, + "Intentional failure in inplace alter occurred.", MYF(0)); +} #endif - -int ha_rocksdb::convert_record_from_storage_format(const rocksdb::Slice *key, - uchar * buf) -{ +int ha_rocksdb::convert_record_from_storage_format( + const rocksdb::Slice *const key, uchar *const buf) { DBUG_EXECUTE_IF("myrocks_simulate_bad_row_read1", dbug_append_garbage_at_end(m_retrieved_record);); DBUG_EXECUTE_IF("myrocks_simulate_bad_row_read2", @@ -4205,12 +3938,11 @@ DBUG_EXECUTE_IF("myrocks_simulate_bad_row_read3", dbug_modify_rec_varchar12(m_retrieved_record);); - rocksdb::Slice retrieved_rec_slice(&m_retrieved_record.front(), - m_retrieved_record.size()); + const rocksdb::Slice retrieved_rec_slice(&m_retrieved_record.front(), + m_retrieved_record.size()); return convert_record_from_storage_format(key, &retrieved_rec_slice, buf); } - /* @brief Unpack the record in this->m_retrieved_record and this->m_last_rowkey from @@ -4235,15 +3967,14 @@ other Error inpacking the data */ -int ha_rocksdb::convert_record_from_storage_format(const rocksdb::Slice *key, - const rocksdb::Slice *value, - uchar * buf) -{ +int ha_rocksdb::convert_record_from_storage_format( + const rocksdb::Slice *const key, const rocksdb::Slice *const value, + uchar *const buf) { DBUG_ASSERT(key != nullptr); DBUG_ASSERT(buf != nullptr); Rdb_string_reader reader(value); - my_ptrdiff_t ptr_diff= buf - table->record[0]; + const my_ptrdiff_t ptr_diff = buf - table->record[0]; /* Decode PK fields from the key @@ -4253,152 +3984,127 @@ const rocksdb::Slice rowkey_slice(m_last_rowkey.ptr(), m_last_rowkey.length()); - const char *unpack_info= nullptr; - uint16 unpack_info_len= 0; + const char *unpack_info = nullptr; + uint16 unpack_info_len = 0; rocksdb::Slice unpack_slice; /* Other fields are decoded from the value */ - const char *null_bytes= nullptr; - if (m_null_bytes_in_rec && !(null_bytes= reader.read(m_null_bytes_in_rec))) - { + const char *null_bytes = nullptr; + if (m_null_bytes_in_rec && !(null_bytes = reader.read(m_null_bytes_in_rec))) { return HA_ERR_INTERNAL_ERROR; } - if (m_maybe_unpack_info && m_pk_descr->m_kv_format_version >= - Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1) - { - unpack_info= reader.read(RDB_UNPACK_HEADER_SIZE); + if (m_maybe_unpack_info) { + unpack_info = reader.read(RDB_UNPACK_HEADER_SIZE); - if (!unpack_info || unpack_info[0] != RDB_UNPACK_DATA_TAG) - { + if (!unpack_info || unpack_info[0] != RDB_UNPACK_DATA_TAG) { return HA_ERR_INTERNAL_ERROR; } - unpack_info_len= rdb_netbuf_to_uint16( - reinterpret_cast(unpack_info + 1)); - unpack_slice= rocksdb::Slice(unpack_info, unpack_info_len); + unpack_info_len = + rdb_netbuf_to_uint16(reinterpret_cast(unpack_info + 1)); + unpack_slice = rocksdb::Slice(unpack_info, unpack_info_len); reader.read(unpack_info_len - RDB_UNPACK_HEADER_SIZE); } if (m_pk_descr->unpack_record(table, buf, &rowkey_slice, unpack_info ? &unpack_slice : nullptr, - false /* verify_checksum */)) - { + false /* verify_checksum */)) { return HA_ERR_INTERNAL_ERROR; } - for (auto it= m_decoders_vect.begin(); it != m_decoders_vect.end(); it++) - { - const Rdb_field_encoder* const field_dec= it->m_field_enc; - const bool decode= it->m_decode; - bool isNull = field_dec->maybe_null() && - ((null_bytes[field_dec->m_null_offset] & field_dec->m_null_mask) != 0); + for (auto it = m_decoders_vect.begin(); it != m_decoders_vect.end(); it++) { + const Rdb_field_encoder *const field_dec = it->m_field_enc; + const bool decode = it->m_decode; + const bool isNull = + field_dec->maybe_null() && + ((null_bytes[field_dec->m_null_offset] & field_dec->m_null_mask) != 0); - Field *field= table->field[field_dec->m_field_index]; + Field *const field = table->field[field_dec->m_field_index]; /* Skip the bytes we need to skip */ if (it->m_skip && !reader.read(it->m_skip)) return HA_ERR_INTERNAL_ERROR; - if (isNull) - { - if (decode) - { + if (isNull) { + if (decode) { /* This sets the NULL-bit of this record */ field->set_null(ptr_diff); /* Besides that, set the field value to default value. CHECKSUM TABLE depends on this. */ - uint field_offset= field->ptr - table->record[0]; - memcpy(buf + field_offset, - table->s->default_values + field_offset, + uint field_offset = field->ptr - table->record[0]; + memcpy(buf + field_offset, table->s->default_values + field_offset, field->pack_length()); } continue; - } - else - { + } else { if (decode) field->set_notnull(ptr_diff); } - if (field_dec->m_field_type == MYSQL_TYPE_BLOB) - { - my_core::Field_blob *blob= (my_core::Field_blob*)field; + if (field_dec->m_field_type == MYSQL_TYPE_BLOB) { + my_core::Field_blob *const blob = (my_core::Field_blob *)field; /* Get the number of bytes needed to store length*/ - uint length_bytes= blob->pack_length() - portable_sizeof_char_ptr; + const uint length_bytes = blob->pack_length() - portable_sizeof_char_ptr; blob->move_field_offset(ptr_diff); const char *data_len_str; - if (!(data_len_str= reader.read(length_bytes))) - { + if (!(data_len_str = reader.read(length_bytes))) { blob->move_field_offset(-ptr_diff); return HA_ERR_INTERNAL_ERROR; } memcpy(blob->ptr, data_len_str, length_bytes); - uint32 data_len= blob->get_length((uchar*)data_len_str, length_bytes, - table->s->db_low_byte_first); + const uint32 data_len = blob->get_length( + (uchar *)data_len_str, length_bytes, table->s->db_low_byte_first); const char *blob_ptr; - if (!(blob_ptr= reader.read(data_len))) - { + if (!(blob_ptr = reader.read(data_len))) { blob->move_field_offset(-ptr_diff); return HA_ERR_INTERNAL_ERROR; } - if (decode) - { + if (decode) { // set 8-byte pointer to 0, like innodb does (relevant for 32-bit // platforms) memset(blob->ptr + length_bytes, 0, 8); - memcpy(blob->ptr + length_bytes, &blob_ptr, sizeof(uchar**)); + memcpy(blob->ptr + length_bytes, &blob_ptr, sizeof(uchar **)); blob->move_field_offset(-ptr_diff); } - } - else if (field_dec->m_field_type == MYSQL_TYPE_VARCHAR) - { - Field_varstring* field_var= (Field_varstring*)field; + } else if (field_dec->m_field_type == MYSQL_TYPE_VARCHAR) { + Field_varstring *const field_var = (Field_varstring *)field; const char *data_len_str; - if (!(data_len_str= reader.read(field_var->length_bytes))) + if (!(data_len_str = reader.read(field_var->length_bytes))) return HA_ERR_INTERNAL_ERROR; uint data_len; /* field_var->length_bytes is 1 or 2 */ - if (field_var->length_bytes == 1) - { - data_len= (uchar)data_len_str[0]; - } - else - { + if (field_var->length_bytes == 1) { + data_len = (uchar)data_len_str[0]; + } else { DBUG_ASSERT(field_var->length_bytes == 2); - data_len= uint2korr(data_len_str); + data_len = uint2korr(data_len_str); } - if (data_len > field->field_length) - { + if (data_len > field->field_length) { /* The data on disk is longer than table DDL allows? */ return HA_ERR_INTERNAL_ERROR; } if (!reader.read(data_len)) return HA_ERR_INTERNAL_ERROR; - if (decode) - { + if (decode) { memcpy(field_var->ptr + ptr_diff, data_len_str, field_var->length_bytes + data_len); } - } - else - { + } else { const char *data_bytes; - uint len= field_dec->m_pack_length_in_rec; - if (len > 0) - { - if ((data_bytes= reader.read(len)) == nullptr) - { + const uint len = field_dec->m_pack_length_in_rec; + if (len > 0) { + if ((data_bytes = reader.read(len)) == nullptr) { return HA_ERR_INTERNAL_ERROR; } if (decode) @@ -4407,35 +4113,31 @@ } } - if (m_verify_checksums) - { + if (m_verify_row_debug_checksums) { if (reader.remaining_bytes() == RDB_CHECKSUM_CHUNK_SIZE && - reader.read(1)[0] == RDB_CHECKSUM_DATA_TAG) - { - uint32_t stored_key_chksum= - rdb_netbuf_to_uint32((const uchar*)reader.read(RDB_CHECKSUM_SIZE)); - uint32_t stored_val_chksum= - rdb_netbuf_to_uint32((const uchar*)reader.read(RDB_CHECKSUM_SIZE)); + reader.read(1)[0] == RDB_CHECKSUM_DATA_TAG) { + uint32_t stored_key_chksum = + rdb_netbuf_to_uint32((const uchar *)reader.read(RDB_CHECKSUM_SIZE)); + uint32_t stored_val_chksum = + rdb_netbuf_to_uint32((const uchar *)reader.read(RDB_CHECKSUM_SIZE)); - uint32_t computed_key_chksum= + const uint32_t computed_key_chksum = my_core::crc32(0, rdb_slice_to_uchar_ptr(key), key->size()); - uint32_t computed_val_chksum= + const uint32_t computed_val_chksum = my_core::crc32(0, rdb_slice_to_uchar_ptr(value), value->size() - RDB_CHECKSUM_CHUNK_SIZE); DBUG_EXECUTE_IF("myrocks_simulate_bad_pk_checksum1", stored_key_chksum++;); - if (stored_key_chksum != computed_key_chksum) - { + if (stored_key_chksum != computed_key_chksum) { m_pk_descr->report_checksum_mismatch(true, key->data(), key->size()); return HA_ERR_INTERNAL_ERROR; } DBUG_EXECUTE_IF("myrocks_simulate_bad_pk_checksum2", stored_val_chksum++;); - if (stored_val_chksum != computed_val_chksum) - { + if (stored_val_chksum != computed_val_chksum) { m_pk_descr->report_checksum_mismatch(false, value->data(), value->size()); return HA_ERR_INTERNAL_ERROR; @@ -4447,88 +4149,45 @@ return HA_ERR_INTERNAL_ERROR; } - return 0; + return HA_EXIT_SUCCESS; } - -void ha_rocksdb::get_storage_type(Rdb_field_encoder *encoder, uint kp) -{ - Field *field= table->key_info[table->s->primary_key].key_part[kp].field; - - if (field->real_type() == MYSQL_TYPE_NEWDECIMAL) - { - // Index-only is supported for DECIMAL columns. - // A DECIMAL value can be restored from its mem-comparable form. - // This works for both the old data format and the new data format. - if (m_pk_descr->m_kv_format_version >= - Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1) - { - // New format, don't store Decimal value in the row. - encoder->m_storage_type= Rdb_field_encoder::STORE_NONE; - } - else - { - // Old format. Pretend there's no way to unpack the decimal from - // its mem-comparable form. - encoder->m_storage_type= Rdb_field_encoder::STORE_ALL; - } - return; - } - - if (m_pk_descr->m_kv_format_version >= - Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1) - { - // STORE_SOME uses unpack_info, so our key must be of version - // higher than PRIMARY_FORMAT_VERSION_UPDATE1 to use this - // feature. - if (m_pk_descr->has_unpack_info(kp)) - { - DBUG_ASSERT(m_pk_descr->can_unpack(kp)); - encoder->m_storage_type= Rdb_field_encoder::STORE_SOME; - m_maybe_unpack_info= true; - } - else if (m_pk_descr->can_unpack(kp)) - { - encoder->m_storage_type= Rdb_field_encoder::STORE_NONE; - } - } - else - { - // For old versions, we can only store none if there is no - // unpack_info (and it's unpackable). - if (m_pk_descr->can_unpack(kp) && !m_pk_descr->has_unpack_info(kp)) - { - encoder->m_storage_type= Rdb_field_encoder::STORE_NONE; - } +void ha_rocksdb::get_storage_type(Rdb_field_encoder *const encoder, + const uint &kp) { + // STORE_SOME uses unpack_info. + if (m_pk_descr->has_unpack_info(kp)) { + DBUG_ASSERT(m_pk_descr->can_unpack(kp)); + encoder->m_storage_type = Rdb_field_encoder::STORE_SOME; + m_maybe_unpack_info = true; + } else if (m_pk_descr->can_unpack(kp)) { + encoder->m_storage_type = Rdb_field_encoder::STORE_NONE; } } /* - Setup data needed to convert table->record[] to and from record storage format. + Setup data needed to convert table->record[] to and from record storage + format. @seealso ha_rocksdb::convert_record_to_storage_format, ha_rocksdb::convert_record_from_storage_format */ -void ha_rocksdb::setup_field_converters() -{ +void ha_rocksdb::setup_field_converters() { uint i; - uint null_bytes= 0; - uchar cur_null_mask= 0x1; + uint null_bytes = 0; + uchar cur_null_mask = 0x1; DBUG_ASSERT(m_encoder_arr == nullptr); - m_encoder_arr= static_cast( + m_encoder_arr = static_cast( my_malloc(table->s->fields * sizeof(Rdb_field_encoder), MYF(0))); - if (m_encoder_arr == nullptr) - { + if (m_encoder_arr == nullptr) { return; } - for (i= 0; i < table->s->fields; i++) - { - Field *field= table->field[i]; - m_encoder_arr[i].m_storage_type= Rdb_field_encoder::STORE_ALL; + for (i = 0; i < table->s->fields; i++) { + Field *const field = table->field[i]; + m_encoder_arr[i].m_storage_type = Rdb_field_encoder::STORE_ALL; /* Check if this field is @@ -4541,39 +4200,31 @@ part of the hidden pk. */ if (!has_hidden_pk(table) && - field->part_of_key.is_set(table->s->primary_key)) - { - KEY *pk_info= &table->key_info[table->s->primary_key]; - for (uint kp= 0; kp < pk_info->user_defined_key_parts; kp++) - { + field->part_of_key.is_set(table->s->primary_key)) { + KEY *const pk_info = &table->key_info[table->s->primary_key]; + for (uint kp = 0; kp < pk_info->user_defined_key_parts; kp++) { /* key_part->fieldnr is counted from 1 */ - if (field->field_index + 1 == pk_info->key_part[kp].fieldnr) - { + if (field->field_index + 1 == pk_info->key_part[kp].fieldnr) { get_storage_type(&m_encoder_arr[i], kp); break; } } } - m_encoder_arr[i].m_field_type= field->real_type(); - m_encoder_arr[i].m_field_index= i; - m_encoder_arr[i].m_pack_length_in_rec= field->pack_length_in_rec(); - - if (field->real_maybe_null()) - { - m_encoder_arr[i].m_null_mask= cur_null_mask; - m_encoder_arr[i].m_null_offset= null_bytes; - if (cur_null_mask == 0x80) - { - cur_null_mask= 0x1; + m_encoder_arr[i].m_field_type = field->real_type(); + m_encoder_arr[i].m_field_index = i; + m_encoder_arr[i].m_pack_length_in_rec = field->pack_length_in_rec(); + + if (field->real_maybe_null()) { + m_encoder_arr[i].m_null_mask = cur_null_mask; + m_encoder_arr[i].m_null_offset = null_bytes; + if (cur_null_mask == 0x80) { + cur_null_mask = 0x1; null_bytes++; - } - else - cur_null_mask= cur_null_mask << 1; - } - else - { - m_encoder_arr[i].m_null_mask= 0; + } else + cur_null_mask = cur_null_mask << 1; + } else { + m_encoder_arr[i].m_null_mask = 0; } } @@ -4581,151 +4232,159 @@ if (cur_null_mask != 0x1) null_bytes++; - m_null_bytes_in_rec= null_bytes; + m_null_bytes_in_rec = null_bytes; } -int ha_rocksdb::alloc_key_buffers(const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) -{ - DBUG_ENTER("ha_rocksdb::alloc_key_buffers"); +int ha_rocksdb::alloc_key_buffers(const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg, + bool alloc_alter_buffers) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(m_pk_tuple == nullptr); + DBUG_ASSERT(tbl_def_arg != nullptr); - std::shared_ptr* kd_arr= tbl_def_arg->m_key_descr_arr; + std::shared_ptr *const kd_arr = tbl_def_arg->m_key_descr_arr; - uint key_len= 0; - m_pk_descr= kd_arr[pk_index(table_arg, tbl_def_arg)]; - if (has_hidden_pk(table_arg)) - { - m_pk_key_parts= 1; - } - else - { - m_pk_key_parts= + uint key_len = 0; + uint max_packed_sk_len = 0; + uint pack_key_len = 0; + + m_pk_descr = kd_arr[pk_index(table_arg, tbl_def_arg)]; + if (has_hidden_pk(table_arg)) { + m_pk_key_parts = 1; + } else { + m_pk_key_parts = table->key_info[table->s->primary_key].user_defined_key_parts; - key_len= table->key_info[table->s->primary_key].key_length; + key_len = table->key_info[table->s->primary_key].key_length; } // move this into get_table_handler() ?? m_pk_descr->setup(table_arg, tbl_def_arg); - m_pk_tuple= reinterpret_cast(my_malloc(key_len, MYF(0))); - if (m_pk_tuple == nullptr) - { - DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + m_pk_tuple = reinterpret_cast(my_malloc(key_len, MYF(0))); + if (m_pk_tuple == nullptr) { + goto error; } - uint pack_key_len= m_pk_descr->max_storage_fmt_length(); - m_pk_packed_tuple= reinterpret_cast(my_malloc(pack_key_len, MYF(0))); - if (m_pk_packed_tuple == nullptr) - { - DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + pack_key_len = m_pk_descr->max_storage_fmt_length(); + m_pk_packed_tuple = + reinterpret_cast(my_malloc(pack_key_len, MYF(0))); + if (m_pk_packed_tuple == nullptr) { + goto error; } /* Sometimes, we may use m_sk_packed_tuple for storing packed PK */ - uint max_packed_sk_len= pack_key_len; - for (uint i= 0; i < table_arg->s->keys; i++) - { + max_packed_sk_len = pack_key_len; + for (uint i = 0; i < table_arg->s->keys; i++) { if (i == table_arg->s->primary_key) /* Primary key was processed above */ continue; // TODO: move this into get_table_handler() ?? kd_arr[i]->setup(table_arg, tbl_def_arg); - uint packed_len= kd_arr[i]->max_storage_fmt_length(); - if (packed_len > max_packed_sk_len) - { - max_packed_sk_len= packed_len; + const uint packed_len = kd_arr[i]->max_storage_fmt_length(); + if (packed_len > max_packed_sk_len) { + max_packed_sk_len = packed_len; } } - if (!(m_sk_packed_tuple= - reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || - !(m_sk_match_prefix_buf= - reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || - !(m_sk_packed_tuple_old= - reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || - !(m_end_key_packed_tuple= - reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || - !((m_pack_buffer= - reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))))) - { - DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + if (!(m_sk_packed_tuple = + reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || + !(m_sk_match_prefix_buf = + reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || + !(m_sk_packed_tuple_old = + reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || + !(m_end_key_packed_tuple = + reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || + !((m_pack_buffer = reinterpret_cast( + my_malloc(max_packed_sk_len, MYF(0)))))) { + goto error; + } + + /* + If inplace alter is happening, allocate special buffers for unique + secondary index duplicate checking. + */ + if (alloc_alter_buffers && + (!(m_dup_sk_packed_tuple = + reinterpret_cast(my_malloc(max_packed_sk_len, MYF(0)))) || + !(m_dup_sk_packed_tuple_old = reinterpret_cast( + my_malloc(max_packed_sk_len, MYF(0)))))) { + goto error; } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); + +error: + // If we're here then this means that at some point above an allocation may + // have failed. To avoid any resource leaks and maintain a clear contract + // we'll clean up before returning the error code. + free_key_buffers(); + + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } -void ha_rocksdb::free_key_buffers() -{ +void ha_rocksdb::free_key_buffers() { my_free(m_pk_tuple); - m_pk_tuple= nullptr; + m_pk_tuple = nullptr; my_free(m_pk_packed_tuple); - m_pk_packed_tuple= nullptr; + m_pk_packed_tuple = nullptr; my_free(m_sk_packed_tuple); - m_sk_packed_tuple= nullptr; + m_sk_packed_tuple = nullptr; my_free(m_sk_match_prefix_buf); - m_sk_match_prefix_buf= nullptr; + m_sk_match_prefix_buf = nullptr; my_free(m_sk_packed_tuple_old); - m_sk_packed_tuple_old= nullptr; + m_sk_packed_tuple_old = nullptr; my_free(m_end_key_packed_tuple); - m_end_key_packed_tuple= nullptr; + m_end_key_packed_tuple = nullptr; my_free(m_pack_buffer); - m_pack_buffer= nullptr; -} + m_pack_buffer = nullptr; -void ha_rocksdb::set_use_read_free_rpl(const char* whitelist) -{ - DBUG_ASSERT(whitelist != nullptr); - -#if defined(HAVE_PSI_INTERFACE) - Regex_list_handler regex_handler(key_rwlock_read_free_rpl_tables); -#else - Regex_list_handler regex_handler; -#endif - - if (!regex_handler.set_patterns(whitelist)) - { - warn_about_bad_patterns(®ex_handler, "read_free_rpl_tables"); - } + my_free(m_dup_sk_packed_tuple); + m_dup_sk_packed_tuple = nullptr; - m_use_read_free_rpl = regex_handler.matches(m_tbl_def->base_tablename()); + my_free(m_dup_sk_packed_tuple_old); + m_dup_sk_packed_tuple_old = nullptr; } -void ha_rocksdb::set_skip_unique_check_tables(const char* whitelist) -{ +void ha_rocksdb::set_use_read_free_rpl(const char *const whitelist) { DBUG_ASSERT(whitelist != nullptr); #if defined(HAVE_PSI_INTERFACE) - Regex_list_handler regex_handler(key_rwlock_skip_unique_check_tables); + Regex regex_handler(key_rwlock_read_free_rpl_tables); #else - Regex_list_handler regex_handler; + Regex regex_handler; #endif - if (!regex_handler.set_patterns(whitelist)) - { - warn_about_bad_patterns(®ex_handler, "skip_unique_check_tables"); + int flags = MY_REG_EXTENDED | MY_REG_NOSUB; + if (lower_case_table_names) + flags |= MY_REG_ICASE; + + if (!regex_handler.compile(whitelist, + flags, + table_alias_charset)) { + warn_about_bad_patterns(regex_handler, "read_free_rpl_tables"); } - m_skip_unique_check= regex_handler.matches(m_tbl_def->base_tablename()); + m_use_read_free_rpl = regex_handler.match(m_tbl_def->base_tablename()); } -int ha_rocksdb::open(const char *name, int mode, uint test_if_locked) -{ - DBUG_ENTER("ha_rocksdb::open"); +int ha_rocksdb::open(const char *const name, int mode, uint test_if_locked) { + DBUG_ENTER_FUNC(); - if (m_table_handler != nullptr) - { - rdb_open_tables.release_table_handler(m_table_handler); + if (close()) { + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - m_table_handler= rdb_open_tables.get_table_handler(name); - if (m_table_handler == nullptr) - { + + m_table_handler = rdb_open_tables.get_table_handler(name); + + if (m_table_handler == nullptr) { DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } @@ -4734,41 +4393,48 @@ m_io_perf.init(&m_table_handler->m_table_perf_context, &m_table_handler->m_io_perf_read, &stats); - /* - note: m_pk_descr may be non-NULL here, when using partitions. It seems, - it's ok to discard it - */ std::string fullname; - if (rdb_normalize_tablename(name, &fullname)) - { - return HA_ERR_INTERNAL_ERROR; + if (rdb_normalize_tablename(name, &fullname)) { + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - m_tbl_def= ddl_manager.find(fullname); - if (m_tbl_def == nullptr) - { + m_tbl_def = ddl_manager.find(fullname); + if (m_tbl_def == nullptr) { my_error(ER_INTERNAL_ERROR, MYF(0), - "Attempt to open a table that is not present in RocksDB-SE data " - "dictionary"); + "Attempt to open a table that is not present in RocksDB-SE data " + "dictionary"); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - m_lock_rows= RDB_LOCK_NONE; + m_lock_rows = RDB_LOCK_NONE; - m_key_descr_arr= m_tbl_def->m_key_descr_arr; + m_key_descr_arr = m_tbl_def->m_key_descr_arr; /* Full table scan actually uses primary key (UPDATE needs to know this, otherwise it will go into infinite loop on queries like "UPDATE tbl SET pk=pk+100") */ - key_used_on_scan= table->s->primary_key; + key_used_on_scan = table->s->primary_key; - int err; - if ((err = alloc_key_buffers(table, m_tbl_def))) - { + // close() above has already called free_key_buffers(). No need to do it here. + int err = alloc_key_buffers(table, m_tbl_def); + + if (err) { DBUG_RETURN(err); } + /* + init_with_fields() is used to initialize table flags based on the field + definitions in table->field[]. + It is called by open_binary_frm(), but that function calls the method for + a temporary ha_rocksdb object which is later destroyed. + + If we are here in ::open(), then init_with_fields() has not been called + for this object. Call it ourselves, we want all member variables to be + properly initialized. + */ + init_with_fields(); + setup_field_converters(); info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST); @@ -4781,14 +4447,16 @@ Initialize the necessary variables for them: */ - m_verify_checksums= false; + m_verify_row_debug_checksums = false; /* TODO: move the following to where TABLE_SHARE is opened: */ if (table->found_next_number_field) load_auto_incr_value(); - if (has_hidden_pk(table) && load_hidden_pk_value()) + if (has_hidden_pk(table) && load_hidden_pk_value()) { + free_key_buffers(); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } /* Index block size in MyRocks: used by MySQL in query optimization */ stats.block_size = rocksdb_tbl_options.block_size; @@ -4796,73 +4464,70 @@ /* Determine at open whether we can use Read Free Replication or not */ set_use_read_free_rpl(THDVAR(ha_thd(), read_free_rpl_tables)); - /* Determine at open whether we should skip unique checks for this table */ - set_skip_unique_check_tables(THDVAR(ha_thd(), skip_unique_check_tables)); - - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } +int ha_rocksdb::close(void) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::close(void) -{ - DBUG_ENTER("ha_rocksdb::close"); - - m_pk_descr= nullptr; - m_key_descr_arr= nullptr; + m_pk_descr = nullptr; + m_key_descr_arr = nullptr; free_key_buffers(); my_free(m_encoder_arr); - m_encoder_arr= nullptr; + m_encoder_arr = nullptr; - rdb_open_tables.release_table_handler(m_table_handler); - m_table_handler= nullptr; + if (m_table_handler != nullptr) { + rdb_open_tables.release_table_handler(m_table_handler); + m_table_handler = nullptr; + } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } -bool ha_rocksdb::get_error_message(const int error, String *buf) -{ +bool ha_rocksdb::get_error_message(const int error, String *const buf) { + DBUG_ENTER_FUNC(); + static_assert(HA_ERR_ROCKSDB_LAST > HA_ERR_FIRST, - "HA_ERR_ROCKSDB_LAST > HA_ERR_FIRST"); + "HA_ERR_ROCKSDB_LAST > HA_ERR_FIRST"); static_assert(HA_ERR_ROCKSDB_LAST > HA_ERR_LAST, - "HA_ERR_ROCKSDB_LAST > HA_ERR_LAST"); + "HA_ERR_ROCKSDB_LAST > HA_ERR_LAST"); DBUG_ASSERT(error > 0); DBUG_ASSERT(error <= HA_ERR_ROCKSDB_LAST); DBUG_ASSERT(buf != nullptr); switch (error) { - case HA_ERR_ROCKSDB_PK_REQUIRED: - buf->append("Table must have a PRIMARY KEY."); - break; - case HA_ERR_ROCKSDB_UNIQUE_NOT_SUPPORTED: - buf->append("Unique indexes are not supported."); - break; - case HA_ERR_ROCKSDB_TOO_MANY_LOCKS: - buf->append("Number of locks held reached @@rocksdb_max_row_locks."); - break; - default: - // We can be called with the values which are < HA_ERR_FIRST because most - // MySQL internal functions will just return 1 in case of an error. - break; + case HA_ERR_ROCKSDB_PK_REQUIRED: + buf->append("Table must have a PRIMARY KEY."); + break; + case HA_ERR_ROCKSDB_UNIQUE_NOT_SUPPORTED: + buf->append("Unique indexes are not supported."); + break; + case HA_ERR_ROCKSDB_TOO_MANY_LOCKS: + buf->append("Number of locks held reached @@rocksdb_max_row_locks."); + break; + default: + // We can be called with the values which are < HA_ERR_FIRST because most + // MySQL internal functions will just return HA_EXIT_FAILURE in case of + // an error. + break; } - return false; + DBUG_RETURN(false); } /* MyRocks supports only the following collations for indexed columns */ -static const std::set RDB_INDEX_COLLATIONS= - {&my_charset_bin, &my_charset_utf8_bin, &my_charset_latin1_bin}; +static const std::set RDB_INDEX_COLLATIONS = { + &my_charset_bin, &my_charset_utf8_bin, &my_charset_latin1_bin}; - -static bool rdb_is_index_collation_supported(const my_core::Field *field) -{ - my_core::enum_field_types type= field->real_type(); +static bool +rdb_is_index_collation_supported(const my_core::Field *const field) { + const my_core::enum_field_types type = field->real_type(); /* Handle [VAR](CHAR|BINARY) or TEXT|BLOB */ if (type == MYSQL_TYPE_VARCHAR || type == MYSQL_TYPE_STRING || - type == MYSQL_TYPE_BLOB) - { + type == MYSQL_TYPE_BLOB) { return RDB_INDEX_COLLATIONS.find(field->charset()) != RDB_INDEX_COLLATIONS.end(); } @@ -4885,17 +4550,16 @@ 0 - Ok other - error, either given table ddl is not supported by rocksdb or OOM. */ -int ha_rocksdb::create_key_defs(const TABLE *table_arg, - Rdb_tbl_def *tbl_def_arg, - const TABLE *old_table_arg /* = nullptr */, - const Rdb_tbl_def *old_tbl_def_arg - /* = nullptr */) -{ +int ha_rocksdb::create_key_defs( + const TABLE *const table_arg, Rdb_tbl_def *const tbl_def_arg, + const TABLE *const old_table_arg /* = nullptr */, + const Rdb_tbl_def *const old_tbl_def_arg + /* = nullptr */) const { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(table_arg != nullptr); DBUG_ASSERT(table_arg->s != nullptr); - DBUG_ENTER("ha_rocksdb::create_key_defs"); - uint i; /* @@ -4910,13 +4574,11 @@ allocated to each key definition. See below for more details. http://github.com/MySQLOnRocksDB/mysql-5.6/issues/86#issuecomment-138515501 */ - if (create_cfs(table_arg, tbl_def_arg, &cfs)) - { - DBUG_RETURN(1); + if (create_cfs(table_arg, tbl_def_arg, &cfs)) { + DBUG_RETURN(HA_EXIT_FAILURE); }; - if (!old_tbl_def_arg) - { + if (!old_tbl_def_arg) { /* old_tbl_def doesn't exist. this means we are in the process of creating a new table. @@ -4924,30 +4586,25 @@ Get the index numbers (this will update the next_index_number) and create Rdb_key_def structures. */ - for (i= 0; i < tbl_def_arg->m_key_count; i++) - { - if (create_key_def(table_arg, i, tbl_def_arg, - &m_key_descr_arr[i], cfs[i])) - { - DBUG_RETURN(1); + for (i = 0; i < tbl_def_arg->m_key_count; i++) { + if (create_key_def(table_arg, i, tbl_def_arg, &m_key_descr_arr[i], + cfs[i])) { + DBUG_RETURN(HA_EXIT_FAILURE); } } - } - else - { + } else { /* old_tbl_def exists. This means we are creating a new tbl_def as part of in-place alter table. Copy over existing keys from the old_tbl_def and generate the necessary new key definitions if any. */ if (create_inplace_key_defs(table_arg, tbl_def_arg, old_table_arg, - old_tbl_def_arg, cfs)) - { - DBUG_RETURN(1); + old_tbl_def_arg, cfs)) { + DBUG_RETURN(HA_EXIT_FAILURE); } } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } /* @@ -4966,14 +4623,14 @@ 0 - Ok other - error */ -int ha_rocksdb::create_cfs(const TABLE *table_arg, Rdb_tbl_def *tbl_def_arg, - std::array* cfs) -{ +int ha_rocksdb::create_cfs( + const TABLE *const table_arg, Rdb_tbl_def *const tbl_def_arg, + std::array *const cfs) const { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(table_arg != nullptr); DBUG_ASSERT(table_arg->s != nullptr); - DBUG_ENTER("ha_rocksdb::create_cfs"); - char tablename_sys[NAME_LEN + 1]; my_core::filename_to_tablename(tbl_def_arg->base_tablename().c_str(), @@ -4983,36 +4640,31 @@ The first loop checks the index parameters and creates column families if necessary. */ - for (uint i= 0; i < tbl_def_arg->m_key_count; i++) - { - rocksdb::ColumnFamilyHandle* cf_handle; + for (uint i = 0; i < tbl_def_arg->m_key_count; i++) { + rocksdb::ColumnFamilyHandle *cf_handle; if (rocksdb_strict_collation_check && !is_hidden_pk(i, table_arg, tbl_def_arg) && - tbl_def_arg->base_tablename().find(tmp_file_prefix) != 0) - { - for (uint part= 0; part < table_arg->key_info[i].actual_key_parts; part++) - { + tbl_def_arg->base_tablename().find(tmp_file_prefix) != 0) { + for (uint part = 0; part < table_arg->key_info[i].actual_key_parts; + part++) { if (!rdb_is_index_collation_supported( - table_arg->key_info[i].key_part[part].field) && - !rdb_collation_exceptions->matches(tablename_sys)) - { + table_arg->key_info[i].key_part[part].field) && + !rdb_collation_exceptions->match(tablename_sys)) { std::string collation_err; - for (auto coll : RDB_INDEX_COLLATIONS) - { - if (collation_err != "") - { + for (const auto &coll : RDB_INDEX_COLLATIONS) { + if (collation_err != "") { collation_err += ", "; } collation_err += coll->name; } - my_printf_error(ER_UNKNOWN_ERROR, - "Unsupported collation on string indexed " - "column %s.%s Use binary collation (%s).", MYF(0), - tbl_def_arg->full_tablename().c_str(), - table_arg->key_info[i].key_part[part].field->field_name, - collation_err.c_str()); - DBUG_RETURN(1); + my_printf_error( + ER_UNKNOWN_ERROR, "Unsupported collation on string indexed " + "column %s.%s Use binary collation (%s).", + MYF(0), tbl_def_arg->full_tablename().c_str(), + table_arg->key_info[i].key_part[part].field->field_name, + collation_err.c_str()); + DBUG_RETURN(HA_EXIT_FAILURE); } } } @@ -5021,36 +4673,34 @@ index comment has Column Family name. If there was no comment, we get NULL, and it means use the default column family. */ - const char *comment = get_key_comment(i, table_arg, tbl_def_arg); - const char *key_name = get_key_name(i, table_arg, tbl_def_arg); + const char *const comment = get_key_comment(i, table_arg, tbl_def_arg); + const char *const key_name = get_key_name(i, table_arg, tbl_def_arg); - if (looks_like_per_index_cf_typo(comment)) - { + if (looks_like_per_index_cf_typo(comment)) { my_error(ER_NOT_SUPPORTED_YET, MYF(0), "column family name looks like a typo of $per_index_cf"); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } /* Prevent create from using the system column family */ - if (comment && strcmp(DEFAULT_SYSTEM_CF_NAME, comment) == 0) - { + if (comment && strcmp(DEFAULT_SYSTEM_CF_NAME, comment) == 0) { my_error(ER_WRONG_ARGUMENTS, MYF(0), "column family not valid for storing index data"); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } bool is_auto_cf_flag; - cf_handle = cf_manager.get_or_create_cf(rdb, comment, - tbl_def_arg->full_tablename(), - key_name, &is_auto_cf_flag); + cf_handle = + cf_manager.get_or_create_cf(rdb, comment, tbl_def_arg->full_tablename(), + key_name, &is_auto_cf_flag); if (!cf_handle) - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); - auto& cf = (*cfs)[i]; + auto &cf = (*cfs)[i]; cf.cf_handle = cf_handle; cf.is_reverse_cf = Rdb_cf_manager::is_cf_name_reverse(comment); cf.is_auto_cf = is_auto_cf_flag; } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } /* @@ -5067,52 +4717,46 @@ 0 - Ok other - error, either given table ddl is not supported by rocksdb or OOM. */ -int ha_rocksdb::create_inplace_key_defs(const TABLE *table_arg, - Rdb_tbl_def *tbl_def_arg, - const TABLE *old_table_arg, - const Rdb_tbl_def *old_tbl_def_arg, - const std::array& cfs) -{ +int ha_rocksdb::create_inplace_key_defs( + const TABLE *const table_arg, Rdb_tbl_def *const tbl_def_arg, + const TABLE *const old_table_arg, const Rdb_tbl_def *const old_tbl_def_arg, + const std::array &cfs) const { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(table_arg != nullptr); DBUG_ASSERT(tbl_def_arg != nullptr); DBUG_ASSERT(old_tbl_def_arg != nullptr); - DBUG_ENTER("create_key_def"); - - std::shared_ptr* old_key_descr= + std::shared_ptr *const old_key_descr = old_tbl_def_arg->m_key_descr_arr; - std::shared_ptr* new_key_descr= + std::shared_ptr *const new_key_descr = tbl_def_arg->m_key_descr_arr; - std::unordered_map old_key_pos = - get_old_key_positions(table_arg, tbl_def_arg, old_table_arg, - old_tbl_def_arg); + const std::unordered_map old_key_pos = + get_old_key_positions(table_arg, tbl_def_arg, old_table_arg, + old_tbl_def_arg); uint i; - for (i= 0; i < tbl_def_arg->m_key_count; i++) - { - auto it = old_key_pos.find(get_key_name(i, table_arg, tbl_def_arg)); - if (it != old_key_pos.end()) - { + for (i = 0; i < tbl_def_arg->m_key_count; i++) { + const auto &it = old_key_pos.find(get_key_name(i, table_arg, tbl_def_arg)); + if (it != old_key_pos.end()) { /* Found matching index in old table definition, so copy it over to the new one created. */ - const std::shared_ptr& okd= - old_key_descr[it->second]; + const Rdb_key_def &okd = *old_key_descr[it->second]; - uint16 index_dict_version= 0; - uchar index_type= 0; - uint16 kv_version= 0; - GL_INDEX_ID gl_index_id= okd->get_gl_index_id(); + uint16 index_dict_version = 0; + uchar index_type = 0; + uint16 kv_version = 0; + const GL_INDEX_ID gl_index_id = okd.get_gl_index_id(); if (!dict_manager.get_index_info(gl_index_id, &index_dict_version, - &index_type, &kv_version)) - { + &index_type, &kv_version)) { // NO_LINT_DEBUG sql_print_error("RocksDB: Could not get index information " "for Index Number (%u,%u), table %s", gl_index_id.cf_id, gl_index_id.index_id, old_tbl_def_arg->full_tablename().c_str()); - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } /* @@ -5120,59 +4764,45 @@ keynr within the pack_info for each field and the keyno of the keydef itself. */ - new_key_descr[i]= std::make_shared( - okd->get_index_number(), - i, - okd->get_cf(), - index_dict_version, - index_type, - kv_version, - okd->m_is_reverse_cf, - okd->m_is_auto_cf, - okd->m_name.c_str(), - dict_manager.get_stats(gl_index_id)); - } - else if (create_key_def(table_arg, i, tbl_def_arg, - &new_key_descr[i], cfs[i])) - { - DBUG_RETURN(1); + new_key_descr[i] = std::make_shared( + okd.get_index_number(), i, okd.get_cf(), index_dict_version, + index_type, kv_version, okd.m_is_reverse_cf, okd.m_is_auto_cf, + okd.m_name.c_str(), dict_manager.get_stats(gl_index_id)); + } else if (create_key_def(table_arg, i, tbl_def_arg, &new_key_descr[i], + cfs[i])) { + DBUG_RETURN(HA_EXIT_FAILURE); } DBUG_ASSERT(new_key_descr[i] != nullptr); new_key_descr[i]->setup(table_arg, tbl_def_arg); } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } std::unordered_map ha_rocksdb::get_old_key_positions( - const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg, - const TABLE* old_table_arg, - const Rdb_tbl_def* old_tbl_def_arg) -{ + const TABLE *const table_arg, const Rdb_tbl_def *const tbl_def_arg, + const TABLE *const old_table_arg, + const Rdb_tbl_def *const old_tbl_def_arg) const { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(table_arg != nullptr); DBUG_ASSERT(old_table_arg != nullptr); DBUG_ASSERT(tbl_def_arg != nullptr); DBUG_ASSERT(old_tbl_def_arg != nullptr); - DBUG_ENTER("get_old_key_positions"); - - std::shared_ptr* old_key_descr= + std::shared_ptr *const old_key_descr = old_tbl_def_arg->m_key_descr_arr; std::unordered_map old_key_pos; std::unordered_map new_key_pos; uint i; - for (i= 0; i < tbl_def_arg->m_key_count; i++) - { + for (i = 0; i < tbl_def_arg->m_key_count; i++) { new_key_pos[get_key_name(i, table_arg, tbl_def_arg)] = i; } - for (i= 0; i < old_tbl_def_arg->m_key_count; i++) - { - if (is_hidden_pk(i, old_table_arg, old_tbl_def_arg)) - { + for (i = 0; i < old_tbl_def_arg->m_key_count; i++) { + if (is_hidden_pk(i, old_table_arg, old_tbl_def_arg)) { old_key_pos[old_key_descr[i]->m_name] = i; continue; } @@ -5186,17 +4816,15 @@ CREATE TABLE t1 (a INT, b INT, KEY ka(a)) ENGINE=RocksDB; ALTER TABLE t1 DROP INDEX ka, ADD INDEX ka(b), ALGORITHM=INPLACE; */ - const KEY* old_key = &old_table_arg->key_info[i]; - auto it = new_key_pos.find(old_key->name); - if (it == new_key_pos.end()) - { + const KEY *const old_key = &old_table_arg->key_info[i]; + const auto &it = new_key_pos.find(old_key->name); + if (it == new_key_pos.end()) { continue; } - KEY* new_key = &table_arg->key_info[it->second]; + KEY *const new_key = &table_arg->key_info[it->second]; - if (!compare_key_parts(old_key, new_key)) - { + if (!compare_key_parts(old_key, new_key)) { old_key_pos[old_key->name] = i; } } @@ -5205,30 +4833,27 @@ } /* Check two keys to ensure that key parts within keys match */ -int ha_rocksdb::compare_key_parts(const KEY* old_key, const KEY* new_key) -{ +int ha_rocksdb::compare_key_parts(const KEY *const old_key, + const KEY *const new_key) const { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(old_key != nullptr); DBUG_ASSERT(new_key != nullptr); - DBUG_ENTER("compare_key_parts"); - /* Skip if key parts do not match, as it is a different key */ - if (new_key->user_defined_key_parts != old_key->user_defined_key_parts) - { - DBUG_RETURN(1); + if (new_key->user_defined_key_parts != old_key->user_defined_key_parts) { + DBUG_RETURN(HA_EXIT_FAILURE); } /* Check to see that key parts themselves match */ - for (uint i= 0; i < old_key->user_defined_key_parts; i++) - { + for (uint i = 0; i < old_key->user_defined_key_parts; i++) { if (strcmp(old_key->key_part[i].field->field_name, - new_key->key_part[i].field->field_name) != 0) - { - DBUG_RETURN(1); + new_key->key_part[i].field->field_name) != 0) { + DBUG_RETURN(HA_EXIT_FAILURE); } } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } /* @@ -5248,94 +4873,75 @@ 0 - Ok other - error, either given table ddl is not supported by rocksdb or OOM. */ -int ha_rocksdb::create_key_def(const TABLE *table_arg, uint i, - const Rdb_tbl_def* tbl_def_arg, - std::shared_ptr* new_key_def, - const struct key_def_cf_info& cf_info) -{ - DBUG_ENTER("create_key_def"); +int ha_rocksdb::create_key_def(const TABLE *const table_arg, const uint &i, + const Rdb_tbl_def *const tbl_def_arg, + std::shared_ptr *const new_key_def, + const struct key_def_cf_info &cf_info) const { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(new_key_def != nullptr); DBUG_ASSERT(*new_key_def == nullptr); - uint index_id= ddl_manager.get_and_update_next_number(&dict_manager); - uint16_t index_dict_version= Rdb_key_def::INDEX_INFO_VERSION_LATEST; + const uint index_id = ddl_manager.get_and_update_next_number(&dict_manager); + const uint16_t index_dict_version = Rdb_key_def::INDEX_INFO_VERSION_LATEST; uchar index_type; uint16_t kv_version; - if (is_hidden_pk(i, table_arg, tbl_def_arg)) - { - index_type= Rdb_key_def::INDEX_TYPE_HIDDEN_PRIMARY; - kv_version= Rdb_key_def::PRIMARY_FORMAT_VERSION_LATEST; - } - else if (i == table_arg->s->primary_key) - { - index_type= Rdb_key_def::INDEX_TYPE_PRIMARY; - uint16 pk_latest_version= Rdb_key_def::PRIMARY_FORMAT_VERSION_LATEST; - DBUG_EXECUTE_IF("MYROCKS_FORMAT_VERSION_INITIAL", - {pk_latest_version= - Rdb_key_def::PRIMARY_FORMAT_VERSION_INITIAL; - }); - kv_version= pk_latest_version; - } - else - { - index_type= Rdb_key_def::INDEX_TYPE_SECONDARY; - uint16 sk_latest_version= Rdb_key_def::SECONDARY_FORMAT_VERSION_LATEST; - DBUG_EXECUTE_IF("MYROCKS_FORMAT_VERSION_INITIAL", - {sk_latest_version= - Rdb_key_def::SECONDARY_FORMAT_VERSION_INITIAL; - }); - kv_version= sk_latest_version; + if (is_hidden_pk(i, table_arg, tbl_def_arg)) { + index_type = Rdb_key_def::INDEX_TYPE_HIDDEN_PRIMARY; + kv_version = Rdb_key_def::PRIMARY_FORMAT_VERSION_LATEST; + } else if (i == table_arg->s->primary_key) { + index_type = Rdb_key_def::INDEX_TYPE_PRIMARY; + uint16 pk_latest_version = Rdb_key_def::PRIMARY_FORMAT_VERSION_LATEST; + kv_version = pk_latest_version; + } else { + index_type = Rdb_key_def::INDEX_TYPE_SECONDARY; + uint16 sk_latest_version = Rdb_key_def::SECONDARY_FORMAT_VERSION_LATEST; + kv_version = sk_latest_version; } - const char *key_name = get_key_name(i, table_arg, m_tbl_def); - *new_key_def= std::make_shared( + const char *const key_name = get_key_name(i, table_arg, m_tbl_def); + *new_key_def = std::make_shared( index_id, i, cf_info.cf_handle, index_dict_version, index_type, kv_version, cf_info.is_reverse_cf, cf_info.is_auto_cf, key_name); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } -int rdb_normalize_tablename(const std::string& tablename, - std::string* strbuf) -{ +int rdb_normalize_tablename(const std::string &tablename, + std::string *const strbuf) { DBUG_ASSERT(strbuf != nullptr); - if (tablename.size() < 2 || tablename[0] != '.' || tablename[1] != '/') - { - DBUG_ASSERT(0); // We were not passed table name? + if (tablename.size() < 2 || tablename[0] != '.' || tablename[1] != '/') { + DBUG_ASSERT(0); // We were not passed table name? return HA_ERR_INTERNAL_ERROR; } size_t pos = tablename.find_first_of('/', 2); - if (pos == std::string::npos) - { - DBUG_ASSERT(0); // We were not passed table name? + if (pos == std::string::npos) { + DBUG_ASSERT(0); // We were not passed table name? return HA_ERR_INTERNAL_ERROR; } *strbuf = tablename.substr(2, pos - 2) + "." + tablename.substr(pos + 1); - return 0; + return HA_EXIT_SUCCESS; } /* Check to see if the user's original statement includes foreign key references */ -bool ha_rocksdb::contains_foreign_key(THD* thd) -{ +bool ha_rocksdb::contains_foreign_key(THD *const thd) { bool success; - const char* str = thd_query_string(thd)->str; + const char *str = thd_query_string(thd)->str; DBUG_ASSERT(str != nullptr); - while (*str != '\0') - { + while (*str != '\0') { // Scan from our current pos looking for 'FOREIGN' str = rdb_find_in_string(str, "FOREIGN", &success); - if (!success) - { + if (!success) { return false; } @@ -5343,22 +4949,19 @@ str = rdb_check_next_token(&my_charset_bin, str, "FOREIGN", &success); DBUG_ASSERT(success); - if (!my_isspace(&my_charset_bin, *str)) - { + if (!my_isspace(&my_charset_bin, *str)) { return false; } // See if the next token is 'KEY' str = rdb_check_next_token(&my_charset_bin, str, "KEY", &success); - if (!success) - { + if (!success) { continue; } // See if the next token is '(' str = rdb_check_next_token(&my_charset_bin, str, "(", &success); - if (!success) - { + if (!success) { // There is an optional index id after 'FOREIGN KEY', skip it str = rdb_skip_id(&my_charset_bin, str); @@ -5383,13 +4986,12 @@ @param dbbuf returns database name/table_schema @param tablebuf returns tablename @param partitionbuf returns partition suffix if there is one - @return 0 on success, non-zero on failure to split + @return HA_EXIT_SUCCESS on success, non-zero on failure to split */ -int rdb_split_normalized_tablename(const std::string& fullname, - std::string* db, - std::string* table, - std::string* partition) -{ +int rdb_split_normalized_tablename(const std::string &fullname, + std::string *const db, + std::string *const table, + std::string *const partition) { DBUG_ASSERT(!fullname.empty()); #define RDB_PARTITION_STR "#P#" @@ -5398,47 +5000,39 @@ size_t dotpos = fullname.find('.'); /* Invalid table name? */ - if (dotpos == std::string::npos) - { + if (dotpos == std::string::npos) { return HA_ERR_INTERNAL_ERROR; } // Table must have a database name associated with it. DBUG_ASSERT(dotpos > 0); - if (db != nullptr) - { + if (db != nullptr) { *db = fullname.substr(0, dotpos); } dotpos++; - size_t partpos = fullname.find(RDB_PARTITION_STR, dotpos, - strlen(RDB_PARTITION_STR)); + const size_t partpos = + fullname.find(RDB_PARTITION_STR, dotpos, strlen(RDB_PARTITION_STR)); - if (partpos != std::string::npos) - { + if (partpos != std::string::npos) { DBUG_ASSERT(partpos >= dotpos); - if (table != nullptr) - { + if (table != nullptr) { *table = fullname.substr(dotpos, partpos - dotpos); } - if (partition != nullptr) - { + if (partition != nullptr) { *partition = fullname.substr(partpos + strlen(RDB_PARTITION_STR)); } - } - else if (table != nullptr) - { + } else if (table != nullptr) { *table = fullname.substr(dotpos); } - return 0; + return HA_EXIT_SUCCESS; } - /** @brief create() is called to create a database. The variable name will have the name @@ -5458,14 +5052,14 @@ ha_create_table() in handle.cc */ -int ha_rocksdb::create(const char *name, TABLE *table_arg, - HA_CREATE_INFO *create_info) -{ +int ha_rocksdb::create(const char *const name, TABLE *const table_arg, + HA_CREATE_INFO *const create_info) { + DBUG_ENTER_FUNC(); + int res; std::string str; - DBUG_ENTER("ha_rocksdb::create"); - THD *thd = my_core::thd_get_current_thd(); + THD *const thd = my_core::thd_get_current_thd(); if (get_table_if_exists(name)) { if (thd->lex->sql_command == SQLCOM_TRUNCATE) { @@ -5476,11 +5070,12 @@ if (rdb_normalize_tablename(name, &str)) { DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - my_printf_error(ER_UNKNOWN_ERROR, - "Table '%s' does not exist, but metadata information exists inside " - "MyRocks. This is a sign of data inconsistency. Please check if " - "'%s.frm' exists, and try to restore it if it does not exist.", - MYF(0), str.c_str(), name); + my_printf_error( + ER_UNKNOWN_ERROR, + "Table '%s' does not exist, but metadata information exists inside " + "MyRocks. This is a sign of data inconsistency. Please check if " + "'%s.frm' exists, and try to restore it if it does not exist.", + MYF(0), str.c_str(), name); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } } @@ -5490,15 +5085,14 @@ passes strings like "./test/t14#P#p0" for individual partitions, while table_arg->s->table_name has none of that. */ - if (rdb_normalize_tablename(name, &str)) - { + if (rdb_normalize_tablename(name, &str)) { DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - if (contains_foreign_key(thd)) - { + if (contains_foreign_key(thd)) { my_printf_error(ER_NOT_SUPPORTED_YET, "MyRocks does not currently support " - "foreign key constraints", MYF(0)); + "foreign key constraints", + MYF(0)); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } @@ -5506,65 +5100,60 @@ TODO(alexyang): Temporarily disable unique indexes support when there is no Primary Key */ - for (uint keyno= 0; keyno < table_arg->s->keys; keyno++) - { + for (uint keyno = 0; keyno < table_arg->s->keys; keyno++) { if ((table_arg->key_info[keyno].flags & HA_NOSAME) && - has_hidden_pk(table_arg)) - { - my_printf_error(ER_UNKNOWN_ERROR, - "Unique index support is disabled when the table has no primary key. ", - MYF(0)); + has_hidden_pk(table_arg)) { + my_printf_error(ER_UNKNOWN_ERROR, "Unique index support is disabled when " + "the table has no primary key. ", + MYF(0)); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } } - bool write_err= false; - std::unique_ptr wb= dict_manager.begin(); - rocksdb::WriteBatch *batch= wb.get(); + bool write_err = false; + const std::unique_ptr wb = dict_manager.begin(); + rocksdb::WriteBatch *const batch = wb.get(); /* Create table/key descriptions and put them into the data dictionary */ - m_tbl_def= new Rdb_tbl_def(str); + m_tbl_def = new Rdb_tbl_def(str); - uint n_keys= table_arg->s->keys; + uint n_keys = table_arg->s->keys; /* If no primary key found, create a hidden PK and place it inside table definition */ - if (has_hidden_pk(table_arg)) - { + if (has_hidden_pk(table_arg)) { n_keys += 1; } - m_key_descr_arr= new std::shared_ptr[n_keys]; - m_tbl_def->m_key_count= n_keys; - m_tbl_def->m_key_descr_arr= m_key_descr_arr; + m_key_descr_arr = new std::shared_ptr[n_keys]; + m_tbl_def->m_key_count = n_keys; + m_tbl_def->m_key_descr_arr = m_key_descr_arr; - if ((res= create_key_defs(table_arg, m_tbl_def))) - { + if ((res = create_key_defs(table_arg, m_tbl_def))) { goto error; } - m_pk_descr= m_key_descr_arr[pk_index(table_arg, m_tbl_def)]; + m_pk_descr = m_key_descr_arr[pk_index(table_arg, m_tbl_def)]; dict_manager.lock(); - write_err= ddl_manager.put_and_write(m_tbl_def, batch) - || dict_manager.commit(batch); + write_err = + ddl_manager.put_and_write(m_tbl_def, batch) || dict_manager.commit(batch); dict_manager.unlock(); - if (write_err) - { + if (write_err) { goto error; } if (create_info->auto_increment_value) - m_tbl_def->m_auto_incr_val= create_info->auto_increment_value; + m_tbl_def->m_auto_incr_val = create_info->auto_increment_value; /* We only support auto_increment at start of the PRIMARY KEY. */ - //Field *field; - //if ((field= table_arg->next_number_field)) + // Field *field; + // if ((field= table_arg->next_number_field)) /* TODO mdcallag: disable this for now to let UNIQUE indexes kind of work if ((field= table_arg->found_next_number_field)) { @@ -5574,18 +5163,17 @@ DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } */ - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); error: /* Delete what we have allocated so far */ delete m_tbl_def; - m_tbl_def= nullptr; - m_key_descr_arr= nullptr; + m_tbl_def = nullptr; + m_key_descr_arr = nullptr; DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - /** @note This function is used only when the table has not yet been opened, and @@ -5594,49 +5182,43 @@ See comment in ha_rocksdb::index_flags() for details. */ -bool ha_rocksdb::check_keyread_allowed(uint inx, uint part, bool all_parts) const -{ - bool res= true; - KEY *key_info= &table_share->key_info[inx]; +bool ha_rocksdb::check_keyread_allowed(uint inx, uint part, + bool all_parts) const { + bool res = true; + KEY *const key_info = &table_share->key_info[inx]; Rdb_field_packing dummy1; - res= dummy1.setup(nullptr, key_info->key_part[part].field, inx, part, - key_info->key_part[part].length); + res = dummy1.setup(nullptr, key_info->key_part[part].field, inx, part, + key_info->key_part[part].length); - if (res && all_parts) - { - for (uint i= 0; i < part; i++) - { + if (res && all_parts) { + for (uint i = 0; i < part; i++) { Field *field; - if ((field= key_info->key_part[i].field)) - { + if ((field = key_info->key_part[i].field)) { Rdb_field_packing dummy; - if (!dummy.setup(nullptr, field, inx, i, key_info->key_part[i].length)) - { + if (!dummy.setup(nullptr, field, inx, i, + key_info->key_part[i].length)) { /* Cannot do index-only reads for this column */ - res= false; + res = false; break; } } } } - uint pk= table_share->primary_key; + const uint pk = table_share->primary_key; if (inx == pk && all_parts && - part + 1 == table_share->key_info[pk].user_defined_key_parts) - { - m_pk_can_be_decoded= res; + part + 1 == table_share->key_info[pk].user_defined_key_parts) { + m_pk_can_be_decoded = res; } return res; } -int ha_rocksdb::read_key_exact(const std::shared_ptr& kd, - rocksdb::Iterator *iter, - bool full_key_match, - const rocksdb::Slice& key_slice) const -{ - DBUG_ASSERT(kd != nullptr); +int ha_rocksdb::read_key_exact(const Rdb_key_def &kd, + rocksdb::Iterator *const iter, + const bool &full_key_match, + const rocksdb::Slice &key_slice) const { DBUG_ASSERT(iter != nullptr); /* @@ -5644,10 +5226,8 @@ index_tuple= lookup_tuple. lookup_tuple may be a prefix of the index. */ - if (kd->m_is_reverse_cf) - { - if (!full_key_match) - { + if (kd.m_is_reverse_cf) { + if (!full_key_match) { if (!iter->Valid()) iter->SeekToLast(); else @@ -5655,53 +5235,42 @@ } } - if (!iter->Valid() || !kd->value_matches_prefix(iter->key(), key_slice)) - { + if (!iter->Valid() || !kd.value_matches_prefix(iter->key(), key_slice)) { /* Got a record that is not equal to the lookup value, or even a record from another table.index. */ return HA_ERR_KEY_NOT_FOUND; } - return 0; + return HA_EXIT_SUCCESS; } -int ha_rocksdb::read_before_key(const std::shared_ptr& kd, - bool full_key_match, - const rocksdb::Slice& key_slice) -{ - DBUG_ASSERT(kd != nullptr); - +int ha_rocksdb::read_before_key(const Rdb_key_def &kd, + const bool &full_key_match, + const rocksdb::Slice &key_slice) { /* We are looking for record with the biggest t.key such that t.key < lookup_tuple. */ - if (kd->m_is_reverse_cf) - { + if (kd.m_is_reverse_cf) { if (m_scan_it->Valid() && full_key_match && - kd->value_matches_prefix(m_scan_it->key(), key_slice)) - { + kd.value_matches_prefix(m_scan_it->key(), key_slice)) { /* We are using full key and we've hit an exact match */ m_scan_it->Next(); } - } - else - { + } else { if (m_scan_it->Valid()) m_scan_it->Prev(); else m_scan_it->SeekToLast(); } - return m_scan_it->Valid() ? 0 : HA_ERR_KEY_NOT_FOUND; + return m_scan_it->Valid() ? HA_EXIT_SUCCESS : HA_ERR_KEY_NOT_FOUND; } -int ha_rocksdb::read_after_key(const std::shared_ptr& kd, - bool full_key_match, - const rocksdb::Slice& key_slice) -{ - DBUG_ASSERT(kd != nullptr); - +int ha_rocksdb::read_after_key(const Rdb_key_def &kd, + const bool &full_key_match, + const rocksdb::Slice &key_slice) { /* We are looking for the first record such that @@ -5710,73 +5279,64 @@ with HA_READ_AFTER_KEY, $GT = '>', with HA_READ_KEY_OR_NEXT, $GT = '>=' */ - if (kd->m_is_reverse_cf) - { - if (!m_scan_it->Valid()) - { + if (kd.m_is_reverse_cf) { + if (!m_scan_it->Valid()) { m_scan_it->SeekToLast(); - } - else - { + } else { /* We should step back - when not using full extended key - when using full extended key and when we've got an exact match */ if (!full_key_match || - !kd->value_matches_prefix(m_scan_it->key(), key_slice)) - { + !kd.value_matches_prefix(m_scan_it->key(), key_slice)) { m_scan_it->Prev(); } } } - return m_scan_it->Valid() ? 0 : HA_ERR_KEY_NOT_FOUND; + return m_scan_it->Valid() ? HA_EXIT_SUCCESS : HA_ERR_KEY_NOT_FOUND; } -int ha_rocksdb::position_to_correct_key( - const std::shared_ptr& kd, - enum ha_rkey_function find_flag, - bool full_key_match, - const uchar* key, - key_part_map keypart_map, - const rocksdb::Slice& key_slice, - bool* move_forward) -{ - int rc= 0; +int ha_rocksdb::position_to_correct_key(const Rdb_key_def &kd, + const enum ha_rkey_function &find_flag, + const bool &full_key_match, + const uchar *const key, + const key_part_map &keypart_map, + const rocksdb::Slice &key_slice, + bool *const move_forward) { + int rc = 0; - *move_forward= true; + *move_forward = true; switch (find_flag) { case HA_READ_KEY_EXACT: - rc= read_key_exact(kd, m_scan_it, full_key_match, key_slice); + rc = read_key_exact(kd, m_scan_it, full_key_match, key_slice); break; case HA_READ_BEFORE_KEY: - *move_forward= false; - rc= read_before_key(kd, full_key_match, key_slice); - if (rc == 0 && !kd->covers_key(m_scan_it->key())) - { + *move_forward = false; + rc = read_before_key(kd, full_key_match, key_slice); + if (rc == 0 && !kd.covers_key(m_scan_it->key())) { /* The record we've got is not from this index */ - rc= HA_ERR_KEY_NOT_FOUND; + rc = HA_ERR_KEY_NOT_FOUND; } break; case HA_READ_AFTER_KEY: case HA_READ_KEY_OR_NEXT: - rc= read_after_key(kd, full_key_match, key_slice); - if (rc == 0 && !kd->covers_key(m_scan_it->key())) - { + rc = read_after_key(kd, full_key_match, key_slice); + if (rc == 0 && !kd.covers_key(m_scan_it->key())) { /* The record we've got is not from this index */ - rc= HA_ERR_KEY_NOT_FOUND; + rc = HA_ERR_KEY_NOT_FOUND; } break; case HA_READ_KEY_OR_PREV: case HA_READ_PREFIX: /* This flag is not used by the SQL layer, so we don't support it yet. */ - rc= HA_ERR_UNSUPPORTED; + rc = HA_ERR_UNSUPPORTED; break; case HA_READ_PREFIX_LAST: case HA_READ_PREFIX_LAST_OR_PREV: - *move_forward= false; + *move_forward = false; /* Find the last record with the specified index prefix lookup. - HA_READ_PREFIX_LAST requires that the record has the @@ -5786,27 +5346,21 @@ records with prefix=lookup, we should return the last record before that. */ - rc= read_before_key(kd, full_key_match, key_slice); - if (rc == 0) - { - const rocksdb::Slice& rkey= m_scan_it->key(); - if (!kd->covers_key(rkey)) - { + rc = read_before_key(kd, full_key_match, key_slice); + if (rc == 0) { + const rocksdb::Slice &rkey = m_scan_it->key(); + if (!kd.covers_key(rkey)) { /* The record we've got is not from this index */ - rc= HA_ERR_KEY_NOT_FOUND; - } - else if (find_flag == HA_READ_PREFIX_LAST) - { - uint size = kd->pack_index_tuple(table, m_pack_buffer, - m_sk_packed_tuple, key, - keypart_map); - rocksdb::Slice lookup_tuple( - reinterpret_cast(m_sk_packed_tuple), size); + rc = HA_ERR_KEY_NOT_FOUND; + } else if (find_flag == HA_READ_PREFIX_LAST) { + uint size = kd.pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple, + key, keypart_map); + rocksdb::Slice lookup_tuple(reinterpret_cast(m_sk_packed_tuple), + size); // We need to compare the key we've got with the original search prefix. - if (!kd->value_matches_prefix(rkey, lookup_tuple)) - { - rc= HA_ERR_KEY_NOT_FOUND; + if (!kd.value_matches_prefix(rkey, lookup_tuple)) { + rc = HA_ERR_KEY_NOT_FOUND; } } } @@ -5819,32 +5373,28 @@ return rc; } -int ha_rocksdb::calc_eq_cond_len(const std::shared_ptr& kd, - enum ha_rkey_function find_flag, - const rocksdb::Slice& slice, - int bytes_changed_by_succ, - const key_range *end_key, - uint* end_key_packed_size) -{ +int ha_rocksdb::calc_eq_cond_len(const Rdb_key_def &kd, + const enum ha_rkey_function &find_flag, + const rocksdb::Slice &slice, + const int &bytes_changed_by_succ, + const key_range *const end_key, + uint *const end_key_packed_size) { if (find_flag == HA_READ_KEY_EXACT) return slice.size(); - if (find_flag == HA_READ_PREFIX_LAST) - { + if (find_flag == HA_READ_PREFIX_LAST) { /* - We have made the kd->successor(m_sk_packed_tuple) call above. + We have made the kd.successor(m_sk_packed_tuple) call above. The slice is at least Rdb_key_def::INDEX_NUMBER_SIZE bytes long. */ return slice.size() - bytes_changed_by_succ; } - if (end_key) - { - *end_key_packed_size= kd->pack_index_tuple(table, m_pack_buffer, - m_end_key_packed_tuple, - end_key->key, - end_key->keypart_map); + if (end_key) { + *end_key_packed_size = + kd.pack_index_tuple(table, m_pack_buffer, m_end_key_packed_tuple, + end_key->key, end_key->keypart_map); /* Calculating length of the equal conditions here. 4 byte index id is @@ -5855,7 +5405,7 @@ Example2: id1 VARCHAR(30), id2 INT, PRIMARY KEY (id1, id2) WHERE id1 = 'AAA' and id2 < 3; => eq_cond_len=13 (varchar used 9 bytes) */ - rocksdb::Slice end_slice(reinterpret_cast(m_end_key_packed_tuple), + rocksdb::Slice end_slice(reinterpret_cast(m_end_key_packed_tuple), *end_key_packed_size); return slice.difference_offset(end_slice); } @@ -5869,83 +5419,67 @@ return Rdb_key_def::INDEX_NUMBER_SIZE; } -int ha_rocksdb::read_row_from_primary_key(uchar *buf) -{ +int ha_rocksdb::read_row_from_primary_key(uchar *const buf) { DBUG_ASSERT(buf != nullptr); int rc; - const rocksdb::Slice& rkey= m_scan_it->key(); - uint pk_size= rkey.size(); - const char *pk_data= rkey.data(); + const rocksdb::Slice &rkey = m_scan_it->key(); + const uint pk_size = rkey.size(); + const char *pk_data = rkey.data(); memcpy(m_pk_packed_tuple, pk_data, pk_size); m_last_rowkey.copy(pk_data, pk_size, &my_charset_bin); - if (m_lock_rows != RDB_LOCK_NONE) - { + if (m_lock_rows != RDB_LOCK_NONE) { /* We need to put a lock and re-read */ - rc= get_row_by_rowid(buf, m_pk_packed_tuple, pk_size); - } - else - { + rc = get_row_by_rowid(buf, m_pk_packed_tuple, pk_size); + } else { /* Unpack from the row we've read */ - const rocksdb::Slice& value = m_scan_it->value(); - rc= convert_record_from_storage_format(&rkey, &value, buf); + const rocksdb::Slice &value = m_scan_it->value(); + rc = convert_record_from_storage_format(&rkey, &value, buf); } return rc; } -int ha_rocksdb::read_row_from_secondary_key(uchar *buf, - const std::shared_ptr& kd, bool move_forward) -{ +int ha_rocksdb::read_row_from_secondary_key(uchar *const buf, + const Rdb_key_def &kd, + bool move_forward) { DBUG_ASSERT(buf != nullptr); - DBUG_ASSERT(kd != nullptr); - int rc= 0; + int rc = 0; uint pk_size; - if (m_keyread_only && m_lock_rows == RDB_LOCK_NONE && !has_hidden_pk(table)) - { + if (m_keyread_only && m_lock_rows == RDB_LOCK_NONE && !has_hidden_pk(table)) { /* Get the key columns and primary key value */ - const rocksdb::Slice& rkey= m_scan_it->key(); - pk_size= kd->get_primary_key_tuple(table, m_pk_descr, &rkey, - m_pk_packed_tuple); - const rocksdb::Slice& value= m_scan_it->value(); - if (pk_size == RDB_INVALID_KEY_LEN) - { - rc= HA_ERR_INTERNAL_ERROR; - } - else - { - rc= try_keyonly_read_from_sk(buf, kd, rkey, value, pk_size); + const rocksdb::Slice &rkey = m_scan_it->key(); + pk_size = + kd.get_primary_key_tuple(table, *m_pk_descr, &rkey, m_pk_packed_tuple); + const rocksdb::Slice &value = m_scan_it->value(); + if (pk_size == RDB_INVALID_KEY_LEN || + kd.unpack_record(table, buf, &rkey, &value, + m_verify_row_debug_checksums)) { + rc = HA_ERR_INTERNAL_ERROR; } - } - else - { - if (kd->m_is_reverse_cf) - move_forward= !move_forward; + } else { + if (kd.m_is_reverse_cf) + move_forward = !move_forward; - rc= find_icp_matching_index_rec(move_forward, buf); - if (!rc) - { - const rocksdb::Slice& rkey= m_scan_it->key(); - pk_size= kd->get_primary_key_tuple(table, m_pk_descr, &rkey, + rc = find_icp_matching_index_rec(move_forward, buf); + if (!rc) { + const rocksdb::Slice &rkey = m_scan_it->key(); + pk_size = kd.get_primary_key_tuple(table, *m_pk_descr, &rkey, m_pk_packed_tuple); - if (pk_size == RDB_INVALID_KEY_LEN) - { - rc= HA_ERR_INTERNAL_ERROR; - } - else - { - rc= get_row_by_rowid(buf, m_pk_packed_tuple, pk_size); + if (pk_size == RDB_INVALID_KEY_LEN) { + rc = HA_ERR_INTERNAL_ERROR; + } else { + rc = get_row_by_rowid(buf, m_pk_packed_tuple, pk_size); } } } - if (!rc) - { - m_last_rowkey.copy((const char*)m_pk_packed_tuple, pk_size, + if (!rc) { + m_last_rowkey.copy((const char *)m_pk_packed_tuple, pk_size, &my_charset_bin); } @@ -5954,41 +5488,6 @@ /** @note - Some data types require unpack_info in order to do index-only reads. - - However, support for this may have been added after the database was built. - This means that we need to support the case where unpack_info is not - available. In this case, we should just do a primary key lookup. -*/ -int ha_rocksdb::try_keyonly_read_from_sk(uchar* buf, - const std::shared_ptr& kd, - const rocksdb::Slice& key, - const rocksdb::Slice& value, - const uint rowid_size) -{ - int res= kd->unpack_record(table, buf, &key, &value, m_verify_checksums); - uint size= rowid_size; - if (res == UNPACK_INFO_MISSING) - { - // If we can't unpack, then do a PK lookup. - if (rowid_size == RDB_INVALID_KEY_LEN) - { - size= kd->get_primary_key_tuple( - table, m_pk_descr, &key, m_pk_packed_tuple); - } - return get_row_by_rowid(buf, m_pk_packed_tuple, size); - } - else if (res == UNPACK_FAILURE) - { - return HA_ERR_INTERNAL_ERROR; - } - DBUG_ASSERT(res == UNPACK_SUCCESS); - return res; -} - - -/** - @note The problem with this function is that SQL layer calls it, when - the table has not been yet opened (no ::open() call done) - this->table_share already exists, but it is in the process of being @@ -6008,27 +5507,23 @@ yet). */ -ulong ha_rocksdb::index_flags(uint inx, uint part, bool all_parts) const -{ - ulong base_flags= HA_READ_NEXT | // doesn't seem to be used - HA_READ_ORDER | - HA_READ_RANGE | - HA_READ_PREV; +ulong ha_rocksdb::index_flags(uint inx, uint part, bool all_parts) const { + DBUG_ENTER_FUNC(); + + ulong base_flags = HA_READ_NEXT | // doesn't seem to be used + HA_READ_ORDER | HA_READ_RANGE | HA_READ_PREV; if (check_keyread_allowed(inx, part, all_parts)) base_flags |= HA_KEYREAD_ONLY; - if (inx == table_share->primary_key) - { + if (inx == table_share->primary_key) { /* Index-only reads on primary key are the same as table scan for us. Still, we need to explicitly "allow" them, otherwise SQL layer will miss some plans. */ base_flags |= HA_KEYREAD_ONLY; - } - else - { + } else { /* We can Index Condition Pushdown any key except the primary. With primary key, we get (pk, record) pair immediately, there is no place to put the @@ -6037,10 +5532,9 @@ base_flags |= HA_DO_INDEX_COND_PUSHDOWN; } - return base_flags; + DBUG_RETURN(base_flags); } - /** @brief Read next index tuple through the secondary index. @@ -6049,51 +5543,43 @@ m_scan_it points at the index key-value pair that we should read the (pk,row) pair for. */ -int ha_rocksdb::secondary_index_read(const int keyno, uchar *buf) -{ +int ha_rocksdb::secondary_index_read(const int keyno, uchar *const buf) { DBUG_ASSERT(buf != nullptr); DBUG_ASSERT(table != nullptr); - stats.rows_requested++; - /* Use STATUS_NOT_FOUND when record not found or some error occurred */ - table->status= STATUS_NOT_FOUND; + table->status = STATUS_NOT_FOUND; - if (m_scan_it->Valid()) - { - rocksdb::Slice key= m_scan_it->key(); + if (m_scan_it->Valid()) { + rocksdb::Slice key = m_scan_it->key(); /* Check if we've ran out of records of this index */ - if (m_key_descr_arr[keyno]->covers_key(key)) - { - int rc; - - //TODO: We could here check if we have ran out of range we're scanning - uint size= m_key_descr_arr[keyno]->get_primary_key_tuple( - table, m_pk_descr, &key, m_pk_packed_tuple); - if (size == RDB_INVALID_KEY_LEN) - { + if (m_key_descr_arr[keyno]->covers_key(key)) { + int rc = 0; + + // TODO: We could here check if we have ran out of range we're scanning + const uint size = m_key_descr_arr[keyno]->get_primary_key_tuple( + table, *m_pk_descr, &key, m_pk_packed_tuple); + if (size == RDB_INVALID_KEY_LEN) { return HA_ERR_INTERNAL_ERROR; } - m_last_rowkey.copy((const char*)m_pk_packed_tuple, size, &my_charset_bin); + m_last_rowkey.copy((const char *)m_pk_packed_tuple, size, + &my_charset_bin); if (m_keyread_only && m_lock_rows == RDB_LOCK_NONE && - !has_hidden_pk(table)) - { - rc= try_keyonly_read_from_sk(buf, m_key_descr_arr[keyno], - key, m_scan_it->value(), size); - } - else - { - rc= get_row_by_rowid(buf, m_pk_packed_tuple, size); + !has_hidden_pk(table)) { + rocksdb::Slice value = m_scan_it->value(); + if (m_key_descr_arr[keyno]->unpack_record( + table, buf, &key, &value, m_verify_row_debug_checksums)) { + return HA_ERR_INTERNAL_ERROR; + } + } else { + rc = get_row_by_rowid(buf, m_pk_packed_tuple, size); } - if (!rc) - { - table->status= 0; - stats.rows_read++; - stats.rows_index_next++; + if (!rc) { + table->status = 0; update_row_stats(ROWS_READ); } return rc; @@ -6102,56 +5588,46 @@ return HA_ERR_END_OF_FILE; } - /* ha_rocksdb::read_range_first overrides handler::read_range_first. The only difference from handler::read_range_first is that ha_rocksdb::read_range_first passes end_key to ha_rocksdb::index_read_map_impl function. */ -int ha_rocksdb::read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range_arg, bool sorted) -{ +int ha_rocksdb::read_range_first(const key_range *const start_key, + const key_range *const end_key, + bool eq_range_arg, bool sorted) { + DBUG_ENTER_FUNC(); + int result; - DBUG_ENTER("ha_rocksdb::read_range_first"); - eq_range= eq_range_arg; + eq_range = eq_range_arg; set_end_range(end_key, RANGE_SCAN_ASC); - range_key_part= table->key_info[active_index].key_part; + range_key_part = table->key_info[active_index].key_part; - if (!start_key) // Read first record - result= ha_index_first(table->record[0]); - else - { - if (is_using_prohibited_gap_locks(table, - is_using_full_unique_key( - active_index, - start_key->keypart_map, - start_key->flag))) - { + if (!start_key) // Read first record + result = ha_index_first(table->record[0]); + else { + if (is_using_prohibited_gap_locks( + table, + is_using_full_unique_key(active_index, start_key->keypart_map, + start_key->flag))) { DBUG_RETURN(HA_ERR_LOCK_DEADLOCK); } - MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, - { result= index_read_map_impl(table->record[0], - start_key->key, - start_key->keypart_map, - start_key->flag, - end_key); }) + MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, { + result = + index_read_map_impl(table->record[0], start_key->key, + start_key->keypart_map, start_key->flag, end_key); + }) } if (result) - DBUG_RETURN((result == HA_ERR_KEY_NOT_FOUND) - ? HA_ERR_END_OF_FILE - : result); + DBUG_RETURN((result == HA_ERR_KEY_NOT_FOUND) ? HA_ERR_END_OF_FILE : result); - if (compare_key(end_range) <= 0) - { - DBUG_RETURN(0); - } - else - { + if (compare_key(end_range) <= 0) { + DBUG_RETURN(HA_EXIT_SUCCESS); + } else { /* The last read row does not fall in the range. So request storage engine to release row lock if possible. @@ -6161,12 +5637,12 @@ } } - -int ha_rocksdb::index_read_map(uchar *buf, const uchar *key, +int ha_rocksdb::index_read_map(uchar *const buf, const uchar *const key, key_part_map keypart_map, - enum ha_rkey_function find_flag) -{ - return index_read_map_impl(buf, key, keypart_map, find_flag, nullptr); + enum ha_rkey_function find_flag) { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(index_read_map_impl(buf, key, keypart_map, find_flag, nullptr)); } /* @@ -6175,46 +5651,42 @@ This function takes end_key as an argument, and it is set on range scan. MyRocks needs to decide whether prefix bloom filter can be used or not. - To decide to use prefix bloom filter or not, calculating equal condition length + To decide to use prefix bloom filter or not, calculating equal condition + length is needed. On equal lookups (find_flag == HA_READ_KEY_EXACT), equal condition length is the same as rocksdb::Slice.size() of the start key. On range scan, equal condition length is MIN(start_key, end_key) of the rocksdb::Slice expression. */ -int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key, +int ha_rocksdb::index_read_map_impl(uchar *const buf, const uchar *const key, key_part_map keypart_map, enum ha_rkey_function find_flag, - const key_range *end_key) -{ - int rc= 0; - DBUG_ENTER("ha_rocksdb::index_read_map"); + const key_range *end_key) { + DBUG_ENTER_FUNC(); + + int rc = 0; ha_statistic_increment(&SSV::ha_read_key_count); - const std::shared_ptr& kd= m_key_descr_arr[active_index]; - uint actual_key_parts= kd->get_key_parts(); - bool using_full_key= is_using_full_key(keypart_map, actual_key_parts); + const Rdb_key_def &kd = *m_key_descr_arr[active_index]; + const uint actual_key_parts = kd.get_key_parts(); + bool using_full_key = is_using_full_key(keypart_map, actual_key_parts); if (!end_key) - end_key= end_range; + end_key = end_range; /* By default, we don't need the retrieved records to match the prefix */ - m_sk_match_prefix= nullptr; - stats.rows_requested++; + m_sk_match_prefix = nullptr; - if (active_index == table->s->primary_key && - find_flag == HA_READ_KEY_EXACT && using_full_key) - { + if (active_index == table->s->primary_key && find_flag == HA_READ_KEY_EXACT && + using_full_key) { /* Equality lookup over primary key, using full tuple. This is a special case, use DB::Get. */ - uint size= kd->pack_index_tuple(table, m_pack_buffer, m_pk_packed_tuple, - key, keypart_map); - rc= get_row_by_rowid(buf, m_pk_packed_tuple, size); - if (!rc) - { - stats.rows_read++; - stats.rows_index_first++; + const uint size = kd.pack_index_tuple(table, m_pack_buffer, + m_pk_packed_tuple, key, keypart_map); + rc = get_row_by_rowid(buf, m_pk_packed_tuple, size); + if (!rc) { update_row_stats(ROWS_READ); } DBUG_RETURN(rc); @@ -6226,25 +5698,22 @@ uint packed_size; if (active_index != table->s->primary_key && table->key_info[active_index].flags & HA_NOSAME && - find_flag == HA_READ_KEY_EXACT && using_full_key) - { - key_part_map tmp_map= (key_part_map(1) << - table->key_info[active_index].user_defined_key_parts) - 1; - packed_size= kd->pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple, + find_flag == HA_READ_KEY_EXACT && using_full_key) { + key_part_map tmp_map = (key_part_map(1) << table->key_info[active_index] + .user_defined_key_parts) - + 1; + packed_size = kd.pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple, key, tmp_map); if (table->key_info[active_index].user_defined_key_parts != - kd->get_key_parts()) - using_full_key= false; - } - else - { - packed_size= kd->pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple, + kd.get_key_parts()) + using_full_key = false; + } else { + packed_size = kd.pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple, key, keypart_map); } if ((pushed_idx_cond && pushed_idx_cond_keyno == active_index) && - (find_flag == HA_READ_KEY_EXACT || find_flag == HA_READ_PREFIX_LAST)) - { + (find_flag == HA_READ_KEY_EXACT || find_flag == HA_READ_PREFIX_LAST)) { /* We are doing a point index lookup, and ICP is enabled. It is possible that this call will be followed by ha_rocksdb->index_next_same() call. @@ -6257,39 +5726,36 @@ that don't match the lookup prefix are not returned. row matches the lookup prefix. */ - m_sk_match_prefix= m_sk_match_prefix_buf; - m_sk_match_length= packed_size; + m_sk_match_prefix = m_sk_match_prefix_buf; + m_sk_match_length = packed_size; memcpy(m_sk_match_prefix, m_sk_packed_tuple, packed_size); } - int bytes_changed_by_succ= 0; + int bytes_changed_by_succ = 0; if (find_flag == HA_READ_PREFIX_LAST_OR_PREV || - find_flag == HA_READ_PREFIX_LAST || - find_flag == HA_READ_AFTER_KEY) - { + find_flag == HA_READ_PREFIX_LAST || find_flag == HA_READ_AFTER_KEY) { /* See below */ - bytes_changed_by_succ= kd->successor(m_sk_packed_tuple, packed_size); + bytes_changed_by_succ = kd.successor(m_sk_packed_tuple, packed_size); } - rocksdb::Slice slice( - reinterpret_cast(m_sk_packed_tuple), packed_size); + rocksdb::Slice slice(reinterpret_cast(m_sk_packed_tuple), + packed_size); - uint end_key_packed_size= 0; - uint eq_cond_len= calc_eq_cond_len(kd, find_flag, slice, - bytes_changed_by_succ, end_key, - &end_key_packed_size); + uint end_key_packed_size = 0; + const uint eq_cond_len = + calc_eq_cond_len(kd, find_flag, slice, bytes_changed_by_succ, end_key, + &end_key_packed_size); - bool use_all_keys= false; + bool use_all_keys = false; if (find_flag == HA_READ_KEY_EXACT && - my_count_bits(keypart_map) == kd->get_key_parts()) - use_all_keys= true; + my_count_bits(keypart_map) == kd.get_key_parts()) + use_all_keys = true; - Rdb_transaction *tx= get_or_create_tx(table->in_use); - bool is_new_snapshot= !tx->has_snapshot(); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); + const bool is_new_snapshot = !tx->has_snapshot(); // Loop as long as we get a deadlock error AND we end up creating the // snapshot here (i.e. it did not exist prior to this) - for (;;) - { + for (;;) { /* This will open the iterator and position it at a record that's equal or greater than the lookup tuple. @@ -6305,14 +5771,13 @@ rc = position_to_correct_key(kd, find_flag, using_full_key, key, keypart_map, slice, &move_forward); - if (rc) - { + if (rc) { /* This status is returned on any error */ - table->status= STATUS_NOT_FOUND; + table->status = STATUS_NOT_FOUND; DBUG_RETURN(rc); } - m_skip_scan_it_next_call= false; + m_skip_scan_it_next_call = false; /* Now get the data for the row into 'buf'. If we were using a primary key @@ -6320,9 +5785,9 @@ lookup the primary key. */ if (active_index == table->s->primary_key) - rc= read_row_from_primary_key(buf); + rc = read_row_from_primary_key(buf); else - rc= read_row_from_secondary_key(buf, kd, move_forward); + rc = read_row_from_secondary_key(buf, kd, move_forward); if (rc != HA_ERR_LOCK_DEADLOCK || !is_new_snapshot) break; /* Exit the loop */ @@ -6332,22 +5797,17 @@ release_scan_iterator(); } - if (rc) - { + if (rc) { /* the only possible error condition is record-not-found */ - table->status= STATUS_NOT_FOUND; - } - else - { - table->status= 0; - stats.rows_read++; - stats.rows_index_first++; + table->status = STATUS_NOT_FOUND; + } else { + table->status = 0; update_row_stats(ROWS_READ); } + DBUG_RETURN(rc); } - /* @brief Scan the secondary index until we find an index record that satisfies ICP @@ -6368,65 +5828,55 @@ other - error code */ -int ha_rocksdb::find_icp_matching_index_rec(bool move_forward, uchar *buf) -{ +int ha_rocksdb::find_icp_matching_index_rec(const bool &move_forward, + uchar *const buf) { DBUG_ASSERT(buf != nullptr); - if (pushed_idx_cond && pushed_idx_cond_keyno == active_index) - { - const std::shared_ptr& kd= m_key_descr_arr[active_index]; - DBUG_ASSERT(kd != nullptr); + if (pushed_idx_cond && pushed_idx_cond_keyno == active_index) { + const Rdb_key_def &kd = *m_key_descr_arr[active_index]; - while (1) - { - if (!m_scan_it->Valid()) - { - table->status= STATUS_NOT_FOUND; + while (1) { + if (!m_scan_it->Valid()) { + table->status = STATUS_NOT_FOUND; return HA_ERR_END_OF_FILE; } - rocksdb::Slice rkey= m_scan_it->key(); + const rocksdb::Slice rkey = m_scan_it->key(); - if (!kd->covers_key(rkey)) - { - table->status= STATUS_NOT_FOUND; + if (!kd.covers_key(rkey)) { + table->status = STATUS_NOT_FOUND; return HA_ERR_END_OF_FILE; } - if (m_sk_match_prefix) - { - rocksdb::Slice prefix((const char*)m_sk_match_prefix, - m_sk_match_length); - if (!kd->value_matches_prefix(rkey, prefix)) - { - table->status= STATUS_NOT_FOUND; + if (m_sk_match_prefix) { + const rocksdb::Slice prefix((const char *)m_sk_match_prefix, + m_sk_match_length); + if (!kd.value_matches_prefix(rkey, prefix)) { + table->status = STATUS_NOT_FOUND; return HA_ERR_END_OF_FILE; } } - rocksdb::Slice value= m_scan_it->value(); - if (try_keyonly_read_from_sk(buf, kd, rkey, value, RDB_INVALID_KEY_LEN)) - { + const rocksdb::Slice value = m_scan_it->value(); + if (kd.unpack_record(table, buf, &rkey, &value, + m_verify_row_debug_checksums)) { return HA_ERR_INTERNAL_ERROR; } - enum icp_result icp_status= check_index_cond(); - if (icp_status == ICP_NO_MATCH) - { + const enum icp_result icp_status = check_index_cond(); + if (icp_status == ICP_NO_MATCH) { if (move_forward) m_scan_it->Next(); else m_scan_it->Prev(); continue; /* Get the next (or prev) index tuple */ - } - else if (icp_status == ICP_OUT_OF_RANGE) - { + } else if (icp_status == ICP_OUT_OF_RANGE) { /* We have walked out of range we are scanning */ - table->status= STATUS_NOT_FOUND; + table->status = STATUS_NOT_FOUND; return HA_ERR_END_OF_FILE; - } - else /* icp_status == ICP_MATCH */ + } else /* icp_status == ICP_MATCH */ { - /* Index Condition is satisfied. We have rc==0, proceed to fetch the row. */ + /* Index Condition is satisfied. We have rc==0, proceed to fetch the + * row. */ break; } /* @@ -6439,84 +5889,81 @@ */ } } - return 0; + return HA_EXIT_SUCCESS; } +int ha_rocksdb::index_read_last_map(uchar *const buf, const uchar *const key, + key_part_map keypart_map) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::index_read_last_map(uchar * buf, const uchar * key, - key_part_map keypart_map) -{ - return index_read_map(buf, key, keypart_map, HA_READ_PREFIX_LAST); + DBUG_RETURN(index_read_map(buf, key, keypart_map, HA_READ_PREFIX_LAST)); } +int ha_rocksdb::check(THD *const thd, HA_CHECK_OPT *const check_opt) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::check(THD* thd, HA_CHECK_OPT* check_opt) -{ - uint pk= pk_index(table, m_tbl_def); + DBUG_ASSERT(thd != nullptr); + DBUG_ASSERT(check_opt != nullptr); + + const uint pk = pk_index(table, m_tbl_def); String rowkey_copy; String sec_key_copy; - const char* table_name = table->s->table_name.str; + const char *const table_name = table->s->table_name.str; // Only when debugging: don't use snapshot when reading // Rdb_transaction *tx= get_or_create_tx(table->in_use); // tx->snapshot= nullptr; - bool save_verify_checksums= m_verify_checksums; - m_verify_checksums= true; + const bool save_verify_row_debug_checksums = m_verify_row_debug_checksums; + m_verify_row_debug_checksums = true; /* For each secondary index, check that we can get a PK value from it */ // NO_LINT_DEBUG sql_print_information("CHECKTABLE %s: Checking table %s", table_name, table_name); ha_rows UNINIT_VAR(row_checksums_at_start); // set/used iff first_index==true - ha_rows row_checksums= ha_rows(-1); - bool first_index= true; + ha_rows row_checksums = ha_rows(-1); + bool first_index = true; - for (uint keyno= 0; keyno < table->s->keys; keyno++) - { - if (keyno != pk) - { + for (uint keyno = 0; keyno < table->s->keys; keyno++) { + if (keyno != pk) { extra(HA_EXTRA_KEYREAD); ha_index_init(keyno, true); - ha_rows rows= 0; - ha_rows checksums= 0; + ha_rows rows = 0; + ha_rows checksums = 0; if (first_index) - row_checksums_at_start= m_row_checksums_checked; + row_checksums_at_start = m_row_checksums_checked; int res; // NO_LINT_DEBUG sql_print_information("CHECKTABLE %s: Checking index %s", table_name, table->key_info[keyno].name); - while (1) - { + while (1) { if (!rows) - res= index_first(table->record[0]); + res = index_first(table->record[0]); else - res= index_next(table->record[0]); + res = index_next(table->record[0]); if (res == HA_ERR_END_OF_FILE) break; - if (res) - { + if (res) { // error // NO_LINT_DEBUG sql_print_error("CHECKTABLE %s: .. row %lld: index scan error %d", table_name, rows, res); goto error; } - rocksdb::Slice key= m_scan_it->key(); + rocksdb::Slice key = m_scan_it->key(); sec_key_copy.copy(key.data(), key.size(), &my_charset_bin); rowkey_copy.copy(m_last_rowkey.ptr(), m_last_rowkey.length(), &my_charset_bin); - if (m_key_descr_arr[keyno]-> - unpack_info_has_checksum(m_scan_it->value())) - { + if (m_key_descr_arr[keyno]->unpack_info_has_checksum( + m_scan_it->value())) { checksums++; } - if ((res= get_row_by_rowid(table->record[0], rowkey_copy.ptr(), - rowkey_copy.length()))) - { + if ((res = get_row_by_rowid(table->record[0], rowkey_copy.ptr(), + rowkey_copy.length()))) { // NO_LINT_DEBUG sql_print_error("CHECKTABLE %s: .. row %lld: " "failed to fetch row by rowid", @@ -6524,18 +5971,17 @@ goto error; } - longlong hidden_pk_id= 0; + longlong hidden_pk_id = 0; if (has_hidden_pk(table) && read_hidden_pk_id_from_rowkey(&hidden_pk_id)) goto error; /* Check if we get the same PK value */ - uint packed_size= m_pk_descr->pack_record( + uint packed_size = m_pk_descr->pack_record( table, m_pack_buffer, table->record[0], m_pk_packed_tuple, nullptr, false, hidden_pk_id); if (packed_size != rowkey_copy.length() || - memcmp(m_pk_packed_tuple, rowkey_copy.ptr(), packed_size)) - { + memcmp(m_pk_packed_tuple, rowkey_copy.ptr(), packed_size)) { // NO_LINT_DEBUG sql_print_error("CHECKTABLE %s: .. row %lld: PK value mismatch", table_name, rows); @@ -6543,12 +5989,11 @@ } /* Check if we get the same secondary key value */ - packed_size= m_key_descr_arr[keyno]->pack_record( + packed_size = m_key_descr_arr[keyno]->pack_record( table, m_pack_buffer, table->record[0], m_sk_packed_tuple, &m_sk_tails, false, hidden_pk_id); if (packed_size != sec_key_copy.length() || - memcmp(m_sk_packed_tuple, sec_key_copy.ptr(), packed_size)) - { + memcmp(m_sk_packed_tuple, sec_key_copy.ptr(), packed_size)) { // NO_LINT_DEBUG sql_print_error("CHECKTABLE %s: .. row %lld: " "secondary index value mismatch", @@ -6558,70 +6003,64 @@ rows++; continue; -print_and_error: - { - std::string buf; - buf = rdb_hexdump(rowkey_copy.ptr(), rowkey_copy.length(), 1000); - // NO_LINT_DEBUG - sql_print_error("CHECKTABLE %s: rowkey: %s", table_name, - buf.c_str()); + print_and_error : { + std::string buf; + buf = rdb_hexdump(rowkey_copy.ptr(), rowkey_copy.length(), + RDB_MAX_HEXDUMP_LEN); + // NO_LINT_DEBUG + sql_print_error("CHECKTABLE %s: rowkey: %s", table_name, buf.c_str()); - buf= rdb_hexdump(m_retrieved_record.data(), m_retrieved_record.size(), - 1000); - // NO_LINT_DEBUG - sql_print_error("CHECKTABLE %s: record: %s", table_name, - buf.c_str()); + buf = rdb_hexdump(m_retrieved_record.data(), m_retrieved_record.size(), + RDB_MAX_HEXDUMP_LEN); + // NO_LINT_DEBUG + sql_print_error("CHECKTABLE %s: record: %s", table_name, buf.c_str()); - buf = rdb_hexdump(sec_key_copy.ptr(), sec_key_copy.length(), 1000); - // NO_LINT_DEBUG - sql_print_error("CHECKTABLE %s: index: %s", table_name, - buf.c_str()); + buf = rdb_hexdump(sec_key_copy.ptr(), sec_key_copy.length(), + RDB_MAX_HEXDUMP_LEN); + // NO_LINT_DEBUG + sql_print_error("CHECKTABLE %s: index: %s", table_name, buf.c_str()); - goto error; - } + goto error; + } } // NO_LINT_DEBUG sql_print_information("CHECKTABLE %s: ... %lld index entries checked " - "(%lld had checksums)", table_name, rows, - checksums); + "(%lld had checksums)", + table_name, rows, checksums); - if (first_index) - { - row_checksums= m_row_checksums_checked - row_checksums_at_start; - first_index= false; + if (first_index) { + row_checksums = m_row_checksums_checked - row_checksums_at_start; + first_index = false; } ha_index_end(); } } - if (row_checksums != ha_rows(-1)) - { + if (row_checksums != ha_rows(-1)) { // NO_LINT_DEBUG sql_print_information("CHECKTABLE %s: %lld table records had checksums", table_name, row_checksums); } extra(HA_EXTRA_NO_KEYREAD); - m_verify_checksums= save_verify_checksums; + m_verify_row_debug_checksums = save_verify_row_debug_checksums; /* TODO: we should check also for PK records that are missing in the secondary indexes. For that, need to walk through the PK and check that every PK record has a proper counterpart in each secondary index. */ - return HA_ADMIN_OK; + DBUG_RETURN(HA_ADMIN_OK); error: - m_verify_checksums= save_verify_checksums; + m_verify_row_debug_checksums = save_verify_row_debug_checksums; ha_index_or_rnd_end(); extra(HA_EXTRA_NO_KEYREAD); - return HA_ADMIN_CORRUPT; -} + DBUG_RETURN(HA_ADMIN_CORRUPT); +} -static void dbug_dump_str(FILE *out, const char *str, int len) -{ +static void dbug_dump_str(FILE *const out, const char *const str, int len) { fprintf(out, "\""); - for (int i= 0; i < len; i++) - { + for (int i = 0; i < len; i++) { if (str[i] > 32) fprintf(out, "%c", str[i]); else @@ -6630,23 +6069,21 @@ fprintf(out, "\""); } - /* Debugging help: dump the whole database into a human-readable file. Usage: dbug_dump_database(rdb); */ -void dbug_dump_database(rocksdb::DB *db) -{ - FILE *out= fopen("/tmp/rocksdb.dump", "wt"); +void dbug_dump_database(rocksdb::DB *const db) { + FILE *const out = fopen("/tmp/rocksdb.dump", "wt"); if (!out) return; - rocksdb::Iterator* it = db->NewIterator(rocksdb::ReadOptions()); + rocksdb::Iterator *it = db->NewIterator(rocksdb::ReadOptions()); for (it->SeekToFirst(); it->Valid(); it->Next()) { - rocksdb::Slice key= it->key(); - rocksdb::Slice val= it->value(); + rocksdb::Slice key = it->key(); + rocksdb::Slice val = it->value(); dbug_dump_str(out, key.data(), key.size()); fprintf(out, " -> "); dbug_dump_str(out, val.data(), val.size()); @@ -6657,6 +6094,26 @@ fclose(out); } +rocksdb::Status ha_rocksdb::get_for_update( + Rdb_transaction *const tx, rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, std::string *const value) const { + DBUG_ASSERT(m_lock_rows != RDB_LOCK_NONE); + const bool exclusive = m_lock_rows != RDB_LOCK_READ; + + rocksdb::Status s = tx->get_for_update(column_family, key, value, exclusive); + + // If we have a lock conflict and we are running in READ COMMITTTED mode + // release and reacquire the snapshot and then retry the get_for_update(). + if (s.IsBusy() && !s.IsDeadlock() && + my_core::thd_tx_isolation(ha_thd()) == ISO_READ_COMMITTED) { + tx->release_snapshot(); + tx->acquire_snapshot(false); + + s = tx->get_for_update(column_family, key, value, exclusive); + } + + return s; +} /* Given a rowid (i.e. packed PK) as a parameter, get the record. @@ -6666,158 +6123,146 @@ other - HA_ERR error code. */ -int ha_rocksdb::get_row_by_rowid(uchar *buf, const char *rowid, - const uint rowid_size) -{ +int ha_rocksdb::get_row_by_rowid(uchar *const buf, const char *const rowid, + const uint rowid_size) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(buf != nullptr); DBUG_ASSERT(rowid != nullptr); DBUG_ASSERT(table != nullptr); int rc; - DBUG_ENTER("ha_rocksdb::get_row_by_rowid"); rocksdb::Slice key_slice(rowid, rowid_size); - Rdb_transaction *tx= get_or_create_tx(table->in_use); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); DBUG_ASSERT(tx != nullptr); DEBUG_SYNC(ha_thd(), "rocksdb.get_row_by_rowid"); - DBUG_EXECUTE_IF("dbug.rocksdb.get_row_by_rowid", - { - THD *thd= ha_thd(); - const char act[]= - "now signal Reached " - "wait_for signal.rocksdb.get_row_by_rowid_let_running"; - DBUG_ASSERT(opt_debug_sync_timeout > 0); - DBUG_ASSERT(!debug_sync_set_action(thd, - STRING_WITH_LEN(act))); - };); + DBUG_EXECUTE_IF("dbug.rocksdb.get_row_by_rowid", { + THD *thd = ha_thd(); + const char act[] = "now signal Reached " + "wait_for signal.rocksdb.get_row_by_rowid_let_running"; + DBUG_ASSERT(opt_debug_sync_timeout > 0); + DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); + };); bool found; rocksdb::Status s; - if (m_lock_rows == RDB_LOCK_NONE) - { + if (m_lock_rows == RDB_LOCK_NONE) { tx->acquire_snapshot(true); - s= tx->get(m_pk_descr->get_cf(), key_slice, &m_retrieved_record); + s = tx->get(m_pk_descr->get_cf(), key_slice, &m_retrieved_record); + } else { + s = get_for_update(tx, m_pk_descr->get_cf(), key_slice, + &m_retrieved_record); } - else - s= tx->get_for_update(m_pk_descr->get_cf(), key_slice, &m_retrieved_record); - if (!s.IsNotFound() && !s.ok()) - { - DBUG_RETURN(tx->set_status_error(table->in_use, s, m_pk_descr, m_tbl_def)); + if (!s.IsNotFound() && !s.ok()) { + DBUG_RETURN(tx->set_status_error(table->in_use, s, *m_pk_descr, m_tbl_def)); } - found= !s.IsNotFound(); + found = !s.IsNotFound(); - table->status= STATUS_NOT_FOUND; - if (found) - { - m_last_rowkey.copy((const char*)rowid, rowid_size, &my_charset_bin); - rc= convert_record_from_storage_format(&key_slice, buf); + table->status = STATUS_NOT_FOUND; + if (found) { + m_last_rowkey.copy((const char *)rowid, rowid_size, &my_charset_bin); + rc = convert_record_from_storage_format(&key_slice, buf); if (!rc) - table->status= 0; - } - else - { + table->status = 0; + } else { /* Note: we don't need to unlock the row. It is intentional that we keep locks on rows that don't exist. */ - rc= HA_ERR_KEY_NOT_FOUND; + rc = HA_ERR_KEY_NOT_FOUND; } DBUG_RETURN(rc); } +int ha_rocksdb::index_next(uchar *const buf) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::index_next(uchar *buf) -{ - bool moves_forward= true; + bool moves_forward = true; ha_statistic_increment(&SSV::ha_read_next_count); - if (m_key_descr_arr[active_index]->m_is_reverse_cf) - { - moves_forward= false; + if (m_key_descr_arr[active_index]->m_is_reverse_cf) { + moves_forward = false; } - int rc= index_next_with_direction(buf, moves_forward); + int rc = index_next_with_direction(buf, moves_forward); if (rc == HA_ERR_KEY_NOT_FOUND) rc = HA_ERR_END_OF_FILE; - return rc; + + DBUG_RETURN(rc); } +int ha_rocksdb::index_prev(uchar *const buf) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::index_prev(uchar *buf) -{ - bool moves_forward= false; + bool moves_forward = false; ha_statistic_increment(&SSV::ha_read_prev_count); - if (m_key_descr_arr[active_index]->m_is_reverse_cf) - { - moves_forward= true; + if (m_key_descr_arr[active_index]->m_is_reverse_cf) { + moves_forward = true; } - int rc= index_next_with_direction(buf, moves_forward); + int rc = index_next_with_direction(buf, moves_forward); if (rc == HA_ERR_KEY_NOT_FOUND) rc = HA_ERR_END_OF_FILE; - return rc; + DBUG_RETURN(rc); } +int ha_rocksdb::index_next_with_direction(uchar *const buf, bool move_forward) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::index_next_with_direction(uchar *buf, bool move_forward) -{ int rc; - DBUG_ENTER("ha_rocksdb::index_next"); - if (active_index == pk_index(table, m_tbl_def)) - { - rc= rnd_next_with_direction(buf, move_forward); - } - else - { - if (m_skip_scan_it_next_call) - { - m_skip_scan_it_next_call= false; - } - else - { + if (active_index == pk_index(table, m_tbl_def)) { + rc = rnd_next_with_direction(buf, move_forward); + } else { + if (m_skip_scan_it_next_call) { + m_skip_scan_it_next_call = false; + } else { if (move_forward) - m_scan_it->Next(); /* this call cannot fail */ + m_scan_it->Next(); /* this call cannot fail */ else m_scan_it->Prev(); } - rc= find_icp_matching_index_rec(move_forward, buf); + rc = find_icp_matching_index_rec(move_forward, buf); if (!rc) - rc= secondary_index_read(active_index, buf); + rc = secondary_index_read(active_index, buf); } DBUG_RETURN(rc); } +int ha_rocksdb::index_first(uchar *const buf) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::index_first(uchar *buf) -{ - m_sk_match_prefix= nullptr; + m_sk_match_prefix = nullptr; ha_statistic_increment(&SSV::ha_read_first_count); - int rc= m_key_descr_arr[active_index]->m_is_reverse_cf ? - index_last_intern(buf) : index_first_intern(buf); + int rc = m_key_descr_arr[active_index]->m_is_reverse_cf + ? index_last_intern(buf) + : index_first_intern(buf); if (rc == HA_ERR_KEY_NOT_FOUND) rc = HA_ERR_END_OF_FILE; - return rc; + + DBUG_RETURN(rc); } +int ha_rocksdb::index_last(uchar *const buf) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::index_last(uchar *buf) -{ - m_sk_match_prefix= nullptr; + m_sk_match_prefix = nullptr; ha_statistic_increment(&SSV::ha_read_last_count); - int rc= m_key_descr_arr[active_index]->m_is_reverse_cf ? - index_first_intern(buf) : index_last_intern(buf); + int rc = m_key_descr_arr[active_index]->m_is_reverse_cf + ? index_first_intern(buf) + : index_last_intern(buf); if (rc == HA_ERR_KEY_NOT_FOUND) rc = HA_ERR_END_OF_FILE; - return rc; -} + DBUG_RETURN(rc); +} /* Start scanning from the "first" value. @@ -6850,72 +6295,55 @@ */ -int ha_rocksdb::index_first_intern(uchar *buf) -{ +int ha_rocksdb::index_first_intern(uchar *const buf) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(buf != nullptr); uchar *key; uint key_size; int rc; - DBUG_ENTER("ha_rocksdb::index_first"); - if (is_pk(active_index, table, m_tbl_def)) - { - key= m_pk_packed_tuple; - } - else - { - key= m_sk_packed_tuple; + if (is_pk(active_index, table, m_tbl_def)) { + key = m_pk_packed_tuple; + } else { + key = m_sk_packed_tuple; } DBUG_ASSERT(key != nullptr); - const std::shared_ptr& kd= m_key_descr_arr[active_index]; - if (kd->m_is_reverse_cf) - { - kd->get_supremum_key(key, &key_size); - } - else - { - kd->get_infimum_key(key, &key_size); + const Rdb_key_def &kd = *m_key_descr_arr[active_index]; + if (kd.m_is_reverse_cf) { + kd.get_supremum_key(key, &key_size); + } else { + kd.get_infimum_key(key, &key_size); } - rocksdb::Slice index_key((const char*)key, key_size); + rocksdb::Slice index_key((const char *)key, key_size); - Rdb_transaction *tx= get_or_create_tx(table->in_use); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); DBUG_ASSERT(tx != nullptr); - bool is_new_snapshot= !tx->has_snapshot(); + const bool is_new_snapshot = !tx->has_snapshot(); // Loop as long as we get a deadlock error AND we end up creating the // snapshot here (i.e. it did not exist prior to this) - for (;;) - { - setup_scan_iterator(kd, &index_key, false, !kd->m_is_reverse_cf, + for (;;) { + setup_scan_iterator(kd, &index_key, false, !kd.m_is_reverse_cf, Rdb_key_def::INDEX_NUMBER_SIZE); - m_skip_scan_it_next_call= true; + m_skip_scan_it_next_call = true; - rc= index_next_with_direction(buf, true); + rc = index_next_with_direction(buf, true); if (rc != HA_ERR_LOCK_DEADLOCK || !is_new_snapshot) - break; // exit the loop + break; // exit the loop // release the snapshot and iterator so they will be regenerated tx->release_snapshot(); release_scan_iterator(); } - if (!rc) - { - /* - index_next is always incremented on success, so decrement if it is - index_first instead - */ - stats.rows_index_first++; - stats.rows_index_next--; - } DBUG_RETURN(rc); } - /** @details Start scanning from the "last" value @@ -6953,109 +6381,88 @@ So, need to: it->Seek(n) || it->SeekToLast(); it->Prev(); */ -int ha_rocksdb::index_last_intern(uchar *buf) -{ +int ha_rocksdb::index_last_intern(uchar *const buf) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(buf != nullptr); uchar *key; uint key_size; int rc; - DBUG_ENTER("ha_rocksdb::index_last"); - if (is_pk(active_index, table, m_tbl_def)) - { - key= m_pk_packed_tuple; - } - else - { - key= m_sk_packed_tuple; + if (is_pk(active_index, table, m_tbl_def)) { + key = m_pk_packed_tuple; + } else { + key = m_sk_packed_tuple; } DBUG_ASSERT(key != nullptr); - const std::shared_ptr& kd= m_key_descr_arr[active_index]; - if (kd->m_is_reverse_cf) - { - kd->get_infimum_key(key, &key_size); - } - else - { - kd->get_supremum_key(key, &key_size); + const Rdb_key_def &kd = *m_key_descr_arr[active_index]; + if (kd.m_is_reverse_cf) { + kd.get_infimum_key(key, &key_size); + } else { + kd.get_supremum_key(key, &key_size); } - rocksdb::Slice index_key((const char*)key, key_size); + rocksdb::Slice index_key((const char *)key, key_size); - Rdb_transaction *tx= get_or_create_tx(table->in_use); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); DBUG_ASSERT(tx != nullptr); - bool is_new_snapshot= !tx->has_snapshot(); + const bool is_new_snapshot = !tx->has_snapshot(); // Loop as long as we get a deadlock error AND we end up creating the // snapshot here (i.e. it did not exist prior to this) - for (;;) - { - setup_scan_iterator(kd, &index_key, false, kd->m_is_reverse_cf, + for (;;) { + setup_scan_iterator(kd, &index_key, false, kd.m_is_reverse_cf, Rdb_key_def::INDEX_NUMBER_SIZE); - if (!m_scan_it->Valid()) - { + if (!m_scan_it->Valid()) { /* RocksDB keyspace has no records that follow our index. It could be, our index is the last in the keyspace. Navigate to last record in the keyspace. */ m_scan_it->SeekToLast(); - } - else - { + } else { /* Iterator is pointing at some record right after the end of the index. Move one record back. */ m_scan_it->Prev(); } - m_skip_scan_it_next_call= false; + m_skip_scan_it_next_call = false; - if (is_pk(active_index, table, m_tbl_def)) - { - m_skip_scan_it_next_call= true; - rc= rnd_next_with_direction(buf, false); - } - else - { - rc= find_icp_matching_index_rec(false /*move_forward*/, buf); + if (is_pk(active_index, table, m_tbl_def)) { + m_skip_scan_it_next_call = true; + rc = rnd_next_with_direction(buf, false); + } else { + rc = find_icp_matching_index_rec(false /*move_forward*/, buf); if (!rc) - rc= secondary_index_read(active_index, buf); + rc = secondary_index_read(active_index, buf); } if (rc != HA_ERR_LOCK_DEADLOCK || !is_new_snapshot) - break; /* exit the loop */ + break; /* exit the loop */ // release the snapshot and iterator so they will be regenerated tx->release_snapshot(); release_scan_iterator(); } - if (!rc) - { - /* - index_next is always incremented on success, so decrement if it is - index_first instead - */ - stats.rows_index_first++; - stats.rows_index_next--; - } DBUG_RETURN(rc); } +void ha_rocksdb::unlock_row() { + DBUG_ENTER_FUNC(); -void ha_rocksdb::unlock_row() -{ - if (m_lock_rows != RDB_LOCK_NONE) - { - Rdb_transaction *tx= get_or_create_tx(table->in_use); - tx->release_lock(m_pk_descr->get_cf(), std::string(m_last_rowkey.ptr(), - m_last_rowkey.length())); + if (m_lock_rows != RDB_LOCK_NONE) { + Rdb_transaction *const tx = get_or_create_tx(table->in_use); + tx->release_lock(m_pk_descr->get_cf(), + std::string(m_last_rowkey.ptr(), m_last_rowkey.length())); } + + DBUG_VOID_RETURN; } /* @@ -7064,35 +6471,23 @@ - If the index is PRIMARY KEY, and if all of the columns of the table are covered by the PRIMARY KEY, SingleDelete can be used. */ -bool ha_rocksdb::can_use_single_delete(uint index) -{ +bool ha_rocksdb::can_use_single_delete(const uint &index) const { return (index != pk_index(table, m_tbl_def) || (!has_hidden_pk(table) && - table->key_info[index].actual_key_parts == table->s->fields)); + table->key_info[index].actual_key_parts == table->s->fields)); } -bool ha_rocksdb::skip_unique_check() -{ +bool ha_rocksdb::skip_unique_check() const { /* We want to skip unique checks if: 1) bulk_load is on - 2) this table is in the whitelist of tables to skip and the replication - lag has reached a large enough value (see unique_check_lag_threshold - and unique_check_lage_reset_threshold) - 3) the user set rocksdb_skip_unique_check + 2) the user set unique_checks option to 0 */ return THDVAR(table->in_use, bulk_load) || - (m_force_skip_unique_check && m_skip_unique_check) || - THDVAR(table->in_use, skip_unique_check); + my_core::thd_test_options(table->in_use, OPTION_RELAXED_UNIQUE_CHECKS); } -void ha_rocksdb::set_force_skip_unique_check(bool skip) -{ - m_force_skip_unique_check= skip; -} - -bool ha_rocksdb::commit_in_the_middle() -{ +bool ha_rocksdb::commit_in_the_middle() { return THDVAR(table->in_use, bulk_load) || THDVAR(table->in_use, commit_in_the_middle); } @@ -7102,8 +6497,7 @@ @retval true if bulk commit failed @retval false if bulk commit was skipped or succeeded */ -bool ha_rocksdb::do_bulk_commit(Rdb_transaction *tx) -{ +bool ha_rocksdb::do_bulk_commit(Rdb_transaction *const tx) { DBUG_ASSERT(tx != nullptr); return commit_in_the_middle() && tx->get_write_count() >= THDVAR(table->in_use, bulk_load_size) && @@ -7116,8 +6510,7 @@ does not contain a primary key. (In which case we generate a hidden 'auto-incremented' pk.) */ -bool ha_rocksdb::has_hidden_pk(const TABLE* table) -{ +bool ha_rocksdb::has_hidden_pk(const TABLE *const table) const { DBUG_ASSERT(table != nullptr); return Rdb_key_def::table_has_hidden_pk(table); } @@ -7126,9 +6519,8 @@ Returns true if given index number is a hidden_pk. - This is used when a table is created with no primary key. */ -bool ha_rocksdb::is_hidden_pk(const uint index, const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) -{ +bool ha_rocksdb::is_hidden_pk(const uint index, const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) { DBUG_ASSERT(table_arg != nullptr); DBUG_ASSERT(table_arg->s != nullptr); DBUG_ASSERT(tbl_def_arg != nullptr); @@ -7138,22 +6530,19 @@ } /* Returns index of primary key */ -uint ha_rocksdb::pk_index(const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) -{ +uint ha_rocksdb::pk_index(const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) { DBUG_ASSERT(table_arg != nullptr); DBUG_ASSERT(table_arg->s != nullptr); DBUG_ASSERT(tbl_def_arg != nullptr); - return table_arg->s->primary_key == MAX_INDEXES ? - tbl_def_arg->m_key_count - 1 : - table_arg->s->primary_key; + return table_arg->s->primary_key == MAX_INDEXES ? tbl_def_arg->m_key_count - 1 + : table_arg->s->primary_key; } /* Returns true if given index number is a primary key */ -bool ha_rocksdb::is_pk(const uint index, const TABLE* table_arg, - const Rdb_tbl_def *tbl_def_arg) -{ +bool ha_rocksdb::is_pk(const uint index, const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) { DBUG_ASSERT(table_arg != nullptr); DBUG_ASSERT(table_arg->s != nullptr); DBUG_ASSERT(tbl_def_arg != nullptr); @@ -7162,63 +6551,58 @@ is_hidden_pk(index, table_arg, tbl_def_arg); } -const char* ha_rocksdb::get_key_name(const uint index, const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) -{ +const char *ha_rocksdb::get_key_name(const uint index, + const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) { DBUG_ASSERT(table_arg != nullptr); - if (is_hidden_pk(index, table_arg, tbl_def_arg)) - { + if (is_hidden_pk(index, table_arg, tbl_def_arg)) { return HIDDEN_PK_NAME; } return table_arg->key_info[index].name; } -const char* ha_rocksdb::get_key_comment(const uint index, - const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) -{ +const char *ha_rocksdb::get_key_comment(const uint index, + const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) { DBUG_ASSERT(table_arg != nullptr); - if (is_hidden_pk(index, table_arg, tbl_def_arg)) - { + if (is_hidden_pk(index, table_arg, tbl_def_arg)) { return nullptr; } return table_arg->key_info[index].comment.str; } -int ha_rocksdb::write_row(uchar *buf) -{ - DBUG_ENTER("ha_rocksdb::write_row"); +int ha_rocksdb::write_row(uchar *const buf) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(buf != nullptr); DBUG_ASSERT(buf == table->record[0]); DBUG_ASSERT(m_lock_rows == RDB_LOCK_WRITE); + ha_statistic_increment(&SSV::ha_write_count); /* Note: "buf == table->record[0]" is copied from innodb. I am not aware of any use cases where this condition is not true. */ - if (table->next_number_field && buf == table->record[0]) - { + if (table->next_number_field && buf == table->record[0]) { int err; - if ((err= update_auto_increment())) - { + if ((err = update_auto_increment())) { DBUG_RETURN(err); } } - int rv= update_write_row(nullptr, buf, skip_unique_check()); + const int rv = update_write_row(nullptr, buf, skip_unique_check()); - if (rv == 0) - { - stats.rows_inserted++; + if (rv == 0) { update_row_stats(ROWS_INSERTED); } + DBUG_RETURN(rv); } - /** Constructing m_last_rowkey (MyRocks key expression) from before_update|delete image (MySQL row expression). @@ -7228,86 +6612,76 @@ called without setting m_last_rowkey. This function sets m_last_rowkey for Read Free Replication. */ -void ha_rocksdb::set_last_rowkey(const uchar *old_data) -{ - if (old_data && use_read_free_rpl()) - { - int old_pk_size= m_pk_descr->pack_record( +void ha_rocksdb::set_last_rowkey(const uchar *const old_data) { + if (old_data && use_read_free_rpl()) { + const int old_pk_size = m_pk_descr->pack_record( table, m_pack_buffer, old_data, m_pk_packed_tuple, nullptr, false); - m_last_rowkey.copy((const char*)m_pk_packed_tuple, old_pk_size, + m_last_rowkey.copy((const char *)m_pk_packed_tuple, old_pk_size, &my_charset_bin); } } -int ha_rocksdb::get_pk_for_update(struct update_row_info* row_info) -{ +int ha_rocksdb::get_pk_for_update(struct update_row_info *const row_info) { int size; /* Get new row key for any insert, and any update where the pk is not hidden. Row key for updates with hidden pk is handled below. */ - if (!has_hidden_pk(table)) - { - row_info->hidden_pk_id= 0; + if (!has_hidden_pk(table)) { + row_info->hidden_pk_id = 0; - row_info->new_pk_unpack_info= &m_pk_unpack_info; + row_info->new_pk_unpack_info = &m_pk_unpack_info; - size= m_pk_descr->pack_record(table, m_pack_buffer, row_info->new_data, - m_pk_packed_tuple, - row_info->new_pk_unpack_info, - false); - } - else if (row_info->old_data == nullptr) - { - row_info->hidden_pk_id= update_hidden_pk_val(); - size= m_pk_descr->pack_hidden_pk(row_info->hidden_pk_id, m_pk_packed_tuple); - } - else - { + size = m_pk_descr->pack_record(table, m_pack_buffer, row_info->new_data, + m_pk_packed_tuple, + row_info->new_pk_unpack_info, false); + } else if (row_info->old_data == nullptr) { + row_info->hidden_pk_id = update_hidden_pk_val(); + size = + m_pk_descr->pack_hidden_pk(row_info->hidden_pk_id, m_pk_packed_tuple); + } else { /* If hidden primary key, rowkey for new record will always be the same as before */ - size= row_info->old_pk_slice.size(); + size = row_info->old_pk_slice.size(); memcpy(m_pk_packed_tuple, row_info->old_pk_slice.data(), size); - if (read_hidden_pk_id_from_rowkey(&row_info->hidden_pk_id)) - { + if (read_hidden_pk_id_from_rowkey(&row_info->hidden_pk_id)) { return HA_ERR_INTERNAL_ERROR; } } - row_info->new_pk_slice= rocksdb::Slice((const char*)m_pk_packed_tuple, size); + row_info->new_pk_slice = + rocksdb::Slice((const char *)m_pk_packed_tuple, size); - return 0; + return HA_EXIT_SUCCESS; } -int ha_rocksdb::check_and_lock_unique_pk(uint key_id, - const struct update_row_info& row_info, - bool* found, bool* pk_changed) -{ +int ha_rocksdb::check_and_lock_unique_pk(const uint &key_id, + const struct update_row_info &row_info, + bool *const found, + bool *const pk_changed) { DBUG_ASSERT(found != nullptr); DBUG_ASSERT(pk_changed != nullptr); - *pk_changed= false; + *pk_changed = false; /* For UPDATEs, if the key has changed, we need to obtain a lock. INSERTs always require locking. */ - if (row_info.old_pk_slice.size() > 0) - { + if (row_info.old_pk_slice.size() > 0) { /* If the keys are the same, then no lock is needed */ if (!Rdb_pk_comparator::bytewise_compare(row_info.new_pk_slice, - row_info.old_pk_slice)) - { - *found= false; - return 0; + row_info.old_pk_slice)) { + *found = false; + return HA_EXIT_SUCCESS; } - *pk_changed= true; + *pk_changed = true; } /* @@ -7329,50 +6703,46 @@ 2) T1 Get(empty) -> T1 Put(insert, not committed yet) -> T2 Get(empty) -> T2 Put(insert, blocked) -> T1 commit -> T2 commit(overwrite) */ - rocksdb::Status s= row_info.tx->get_for_update(m_pk_descr->get_cf(), - row_info.new_pk_slice, - &m_retrieved_record); - if (!s.ok() && !s.IsNotFound()) - { + const rocksdb::Status s = + get_for_update(row_info.tx, m_pk_descr->get_cf(), row_info.new_pk_slice, + &m_retrieved_record); + if (!s.ok() && !s.IsNotFound()) { return row_info.tx->set_status_error(table->in_use, s, - m_key_descr_arr[key_id], m_tbl_def); + *m_key_descr_arr[key_id], m_tbl_def); } - *found= !s.IsNotFound(); - return 0; + *found = !s.IsNotFound(); + return HA_EXIT_SUCCESS; } -int ha_rocksdb::check_and_lock_sk(uint key_id, - const struct update_row_info& row_info, - bool* found) const -{ +int ha_rocksdb::check_and_lock_sk(const uint &key_id, + const struct update_row_info &row_info, + bool *const found) const { DBUG_ASSERT(found != nullptr); - *found= false; + *found = false; /* Can skip checking this key if none of the key fields have changed. */ - if (row_info.old_data != nullptr && !m_update_scope.is_set(key_id)) - { - return 0; + if (row_info.old_data != nullptr && !m_update_scope.is_set(key_id)) { + return HA_EXIT_SUCCESS; } - KEY* key_info= nullptr; - uint n_null_fields= 0; - uint user_defined_key_parts= 1; + KEY *key_info = nullptr; + uint n_null_fields = 0; + uint user_defined_key_parts = 1; - key_info= &table->key_info[key_id]; - user_defined_key_parts= key_info->user_defined_key_parts; + key_info = &table->key_info[key_id]; + user_defined_key_parts = key_info->user_defined_key_parts; /* If there are no uniqueness requirements, there's no need to obtain a lock for this key. */ - if (!(key_info->flags & HA_NOSAME)) - { - return 0; + if (!(key_info->flags & HA_NOSAME)) { + return HA_EXIT_SUCCESS; } - const std::shared_ptr& kd= m_key_descr_arr[key_id]; + const Rdb_key_def &kd = *m_key_descr_arr[key_id]; /* Calculate the new key for obtaining the lock @@ -7380,33 +6750,30 @@ For unique secondary indexes, the key used for locking does not include the extended fields. */ - int size= kd->pack_record(table, m_pack_buffer, row_info.new_data, - m_sk_packed_tuple, nullptr, false, 0, - user_defined_key_parts, &n_null_fields); - if (n_null_fields > 0) - { + int size = + kd.pack_record(table, m_pack_buffer, row_info.new_data, m_sk_packed_tuple, + nullptr, false, 0, user_defined_key_parts, &n_null_fields); + if (n_null_fields > 0) { /* If any fields are marked as NULL this will never match another row as to NULL never matches anything else including another NULL. */ - return 0; + return HA_EXIT_SUCCESS; } - rocksdb::Slice new_slice= rocksdb::Slice((const char*)m_sk_packed_tuple, - size); + const rocksdb::Slice new_slice = + rocksdb::Slice((const char *)m_sk_packed_tuple, size); /* For UPDATEs, if the key has changed, we need to obtain a lock. INSERTs always require locking. */ - if (row_info.old_data != nullptr) - { - size= kd->pack_record(table, m_pack_buffer, row_info.old_data, + if (row_info.old_data != nullptr) { + size = kd.pack_record(table, m_pack_buffer, row_info.old_data, m_sk_packed_tuple_old, nullptr, false, - row_info.hidden_pk_id, - user_defined_key_parts); - rocksdb::Slice old_slice= rocksdb::Slice( - (const char*)m_sk_packed_tuple_old, size); + row_info.hidden_pk_id, user_defined_key_parts); + const rocksdb::Slice old_slice = + rocksdb::Slice((const char *)m_sk_packed_tuple_old, size); /* For updates, if the keys are the same, then no lock is needed @@ -7415,9 +6782,8 @@ this key is unique since NULL is not equal to each other, so no lock is needed. */ - if (!Rdb_pk_comparator::bytewise_compare(new_slice, old_slice)) - { - return 0; + if (!Rdb_pk_comparator::bytewise_compare(new_slice, old_slice)) { + return HA_EXIT_SUCCESS; } } @@ -7429,7 +6795,7 @@ the latest committed data. */ - bool all_parts_used= (user_defined_key_parts == kd->get_key_parts()); + const bool all_parts_used = (user_defined_key_parts == kd.get_key_parts()); /* This iterator seems expensive since we need to allocate and free @@ -7442,27 +6808,23 @@ The bloom filter may need to be disabled for this lookup. */ - bool total_order_seek= - !can_use_bloom_filter(ha_thd(), kd, new_slice, all_parts_used, - is_ascending(m_key_descr_arr[key_id], - HA_READ_KEY_EXACT)); - bool fill_cache= !THDVAR(ha_thd(), skip_fill_cache); + const bool total_order_seek = !can_use_bloom_filter( + ha_thd(), kd, new_slice, all_parts_used, + is_ascending(*m_key_descr_arr[key_id], HA_READ_KEY_EXACT)); + const bool fill_cache = !THDVAR(ha_thd(), skip_fill_cache); /* psergey-todo: we just need to take lock, lookups not needed: */ std::string dummy_value; - rocksdb::Status s= row_info.tx->get_for_update(kd->get_cf(), new_slice, - &dummy_value); - if (!s.ok() && !s.IsNotFound()) - { + const rocksdb::Status s = + get_for_update(row_info.tx, kd.get_cf(), new_slice, &dummy_value); + if (!s.ok() && !s.IsNotFound()) { return row_info.tx->set_status_error(table->in_use, s, kd, m_tbl_def); } - rocksdb::Iterator *iter= row_info.tx->get_iterator(kd->get_cf(), - total_order_seek, - fill_cache, - true /* read current data */, + rocksdb::Iterator *const iter = row_info.tx->get_iterator( + kd.get_cf(), total_order_seek, fill_cache, true /* read current data */, false /* acquire snapshot */); /* Need to scan the transaction to see if there is a duplicate key. @@ -7470,183 +6832,188 @@ in the transaction. */ iter->Seek(new_slice); - *found= !read_key_exact(kd, iter, all_parts_used, new_slice); + *found = !read_key_exact(kd, iter, all_parts_used, new_slice); delete iter; - return 0; + return HA_EXIT_SUCCESS; } int ha_rocksdb::check_uniqueness_and_lock( - const struct update_row_info& row_info, - bool* pk_changed) -{ + const struct update_row_info &row_info, bool *const pk_changed) { /* Go through each index and determine if the index has uniqueness requirements. If it does, then try to obtain a row lock on the new values. Once all locks have been obtained, then perform the changes needed to update/insert the row. */ - for (uint key_id= 0; key_id < m_tbl_def->m_key_count; key_id++) - { + for (uint key_id = 0; key_id < m_tbl_def->m_key_count; key_id++) { bool found; - int rc; + int rc; - if (is_pk(key_id, table, m_tbl_def)) - { - rc= check_and_lock_unique_pk(key_id, row_info, &found, pk_changed); - } - else - { - rc= check_and_lock_sk(key_id, row_info, &found); + if (is_pk(key_id, table, m_tbl_def)) { + rc = check_and_lock_unique_pk(key_id, row_info, &found, pk_changed); + } else { + rc = check_and_lock_sk(key_id, row_info, &found); } - if (rc != 0) - { + if (rc != 0) { return rc; } - if (found) - { + if (found) { /* There is a row with this key already, so error out. */ - errkey= key_id; - m_dupp_errkey= errkey; + errkey = key_id; + m_dupp_errkey = errkey; return HA_ERR_FOUND_DUPP_KEY; } } + return HA_EXIT_SUCCESS; +} + +int ha_rocksdb::check_duplicate_sk(const TABLE *table_arg, + const Rdb_key_def &index, + const rocksdb::Slice *key, + struct unique_sk_buf_info *sk_info) { + uint n_null_fields = 0; + const rocksdb::Comparator *index_comp = index.get_cf()->GetComparator(); + + /* Get proper SK buffer. */ + uchar *sk_buf = sk_info->swap_and_get_sk_buf(); + + /* Get memcmp form of sk without extended pk tail */ + uint sk_memcmp_size = + index.get_memcmp_sk_parts(table_arg, *key, sk_buf, &n_null_fields); + + sk_info->sk_memcmp_key = + rocksdb::Slice(reinterpret_cast(sk_buf), sk_memcmp_size); + + if (sk_info->sk_memcmp_key_old.size() > 0 && n_null_fields == 0 && + index_comp->Compare(sk_info->sk_memcmp_key, sk_info->sk_memcmp_key_old) == + 0) { + return 1; + } + + sk_info->sk_memcmp_key_old = sk_info->sk_memcmp_key; return 0; } -int ha_rocksdb::bulk_load_key(Rdb_transaction* tx, - const std::shared_ptr& kd, - const rocksdb::Slice& key, - const rocksdb::Slice& value) -{ - rocksdb::ColumnFamilyHandle* cf= kd->get_cf(); +int ha_rocksdb::bulk_load_key(Rdb_transaction *const tx, const Rdb_key_def &kd, + const rocksdb::Slice &key, + const rocksdb::Slice &value) { + rocksdb::ColumnFamilyHandle *const cf = kd.get_cf(); DBUG_ASSERT(cf != nullptr); - if (m_sst_info == nullptr) - { - m_sst_info= - std::make_shared(rdb, m_table_handler->m_table_name, - kd->get_name(), cf, rocksdb_db_options); + if (m_sst_info == nullptr) { + m_sst_info = std::make_shared( + rdb, m_table_handler->m_table_name, kd.get_name(), cf, + rocksdb_db_options, THDVAR(ha_thd(), trace_sst_api)); tx->start_bulk_load(this); + m_bulk_load_tx = tx; } DBUG_ASSERT(m_sst_info != nullptr); - int rc= m_sst_info->put(key, value); - if (rc != 0) - { + int rc = m_sst_info->put(key, value); + if (rc != 0) { my_printf_error(ER_UNKNOWN_ERROR, "Failed to add a key to sst file writer(%s)", MYF(0), m_sst_info->error_message().c_str()); - rc= HA_ERR_INTERNAL_ERROR; + rc = HA_ERR_INTERNAL_ERROR; } return rc; } -int ha_rocksdb::finalize_bulk_load() -{ - int rc= 0; +int ha_rocksdb::finalize_bulk_load() { + int rc = 0; - if (m_sst_info != nullptr) - { - rc= m_sst_info->commit(); - if (rc != 0) - { + /* Skip if there are no possible ongoing bulk loads */ + if (m_sst_info == nullptr && m_bulk_load_tx == nullptr) { + return rc; + } + + mysql_mutex_lock(&m_bulk_load_mutex); + + /* + We need this check because it's possible that m_sst_info has been + flushed and cleared by another thread by the time the mutex has been + acquired. + */ + if (m_sst_info != nullptr) { + rc = m_sst_info->commit(); + if (rc != 0) { my_printf_error(ER_UNKNOWN_ERROR, "Failed to commit bulk loaded sst file to the " "data store (%s)", MYF(0), m_sst_info->error_message().c_str()); - rc= HA_ERR_INTERNAL_ERROR; + rc = HA_ERR_INTERNAL_ERROR; } - m_sst_info= nullptr; - - Rdb_transaction *tx= get_or_create_tx(ha_thd()); - if (tx != nullptr) - { - tx->end_bulk_load(this); - } + m_sst_info = nullptr; + m_bulk_load_tx->end_bulk_load(this); + m_bulk_load_tx = nullptr; } + mysql_mutex_unlock(&m_bulk_load_mutex); return rc; } -int ha_rocksdb::update_pk(const std::shared_ptr& kd, - const struct update_row_info& row_info, - bool pk_changed) -{ - uint key_id= kd->get_keyno(); - bool hidden_pk= is_hidden_pk(key_id, table, m_tbl_def); - if (!hidden_pk && pk_changed) - { +int ha_rocksdb::update_pk(const Rdb_key_def &kd, + const struct update_row_info &row_info, + const bool &pk_changed) { + const uint key_id = kd.get_keyno(); + const bool hidden_pk = is_hidden_pk(key_id, table, m_tbl_def); + if (!hidden_pk && pk_changed) { /* The old key needs to be deleted. */ - rocksdb::Status s= delete_or_singledelete(key_id, row_info.tx, kd->get_cf(), - row_info.old_pk_slice); - if (!s.ok()) - { + const rocksdb::Status s = delete_or_singledelete( + key_id, row_info.tx, kd.get_cf(), row_info.old_pk_slice); + if (!s.ok()) { return row_info.tx->set_status_error(table->in_use, s, kd, m_tbl_def); } } - if (table->next_number_field) - { + if (table->next_number_field) { update_auto_incr_val(); } rocksdb::Slice value_slice; convert_record_to_storage_format(row_info.new_pk_slice, - row_info.new_pk_unpack_info, - &value_slice); + row_info.new_pk_unpack_info, &value_slice); - int rc= 0; - auto cf= m_pk_descr->get_cf(); + int rc = 0; + const auto cf = m_pk_descr->get_cf(); if (rocksdb_enable_bulk_load_api && THDVAR(table->in_use, bulk_load) && - !hidden_pk) - { + !hidden_pk) { /* Write the primary key directly to an SST file using an SstFileWriter */ - rc= bulk_load_key(row_info.tx, kd, row_info.new_pk_slice, - value_slice); - } - else if (row_info.skip_unique_check) - { + rc = bulk_load_key(row_info.tx, kd, row_info.new_pk_slice, value_slice); + } else if (row_info.skip_unique_check) { /* It is responsibility of the user to make sure that the data being inserted doesn't violate any unique keys. */ row_info.tx->get_blind_write_batch()->Put(cf, row_info.new_pk_slice, value_slice); - } - else if (row_info.tx->m_ddl_transaction) - { + } else if (row_info.tx->m_ddl_transaction) { /* DDL statement must check for unique key conflicts. For example: ALTER TABLE tbl DROP PRIMARY KEY, ADD PRIMARY KEY(non_unique_column) */ row_info.tx->get_indexed_write_batch()->Put(cf, row_info.new_pk_slice, value_slice); - } - else - { - auto s= row_info.tx->put(cf, row_info.new_pk_slice, value_slice); - if (!s.ok()) - { - if (s.IsBusy()) - { - errkey= table->s->primary_key; - m_dupp_errkey= errkey; + } else { + const auto s = row_info.tx->put(cf, row_info.new_pk_slice, value_slice); + if (!s.ok()) { + if (s.IsBusy()) { + errkey = table->s->primary_key; + m_dupp_errkey = errkey; rc = HA_ERR_FOUND_DUPP_KEY; - } - else - { - rc = row_info.tx->set_status_error(table->in_use, s, m_pk_descr, + } else { + rc = row_info.tx->set_status_error(table->in_use, s, *m_pk_descr, m_tbl_def); } } @@ -7655,10 +7022,8 @@ return rc; } -int ha_rocksdb::update_sk(const TABLE* table_arg, - const std::shared_ptr& kd, - const struct update_row_info& row_info) -{ +int ha_rocksdb::update_sk(const TABLE *const table_arg, const Rdb_key_def &kd, + const struct update_row_info &row_info) { int new_packed_size; int old_packed_size; @@ -7666,30 +7031,25 @@ rocksdb::Slice new_value_slice; rocksdb::Slice old_key_slice; - uint key_id = kd->get_keyno(); + const uint key_id = kd.get_keyno(); /* Can skip updating this key if none of the key fields have changed. */ - if (row_info.old_data != nullptr && !m_update_scope.is_set(key_id)) - { - return 0; + if (row_info.old_data != nullptr && !m_update_scope.is_set(key_id)) { + return HA_EXIT_SUCCESS; } - bool store_checksums= should_store_checksums(); + const bool store_row_debug_checksums = should_store_row_debug_checksums(); - new_packed_size= kd->pack_record(table_arg, m_pack_buffer, row_info.new_data, - m_sk_packed_tuple, &m_sk_tails, - store_checksums, - row_info.hidden_pk_id); + new_packed_size = kd.pack_record( + table_arg, m_pack_buffer, row_info.new_data, m_sk_packed_tuple, + &m_sk_tails, store_row_debug_checksums, row_info.hidden_pk_id); - if (row_info.old_data != nullptr) - { + if (row_info.old_data != nullptr) { // The old value - old_packed_size= kd->pack_record(table_arg, m_pack_buffer, - row_info.old_data, - m_sk_packed_tuple_old, &m_sk_tails_old, - store_checksums, - row_info.hidden_pk_id); + old_packed_size = kd.pack_record( + table_arg, m_pack_buffer, row_info.old_data, m_sk_packed_tuple_old, + &m_sk_tails_old, store_row_debug_checksums, row_info.hidden_pk_id); /* Check if we are going to write the same value. This can happen when @@ -7707,12 +7067,11 @@ */ if (old_packed_size == new_packed_size && m_sk_tails_old.get_current_pos() == m_sk_tails.get_current_pos() && - memcmp(m_sk_packed_tuple_old, m_sk_packed_tuple, - old_packed_size) == 0 && + memcmp(m_sk_packed_tuple_old, m_sk_packed_tuple, old_packed_size) == + 0 && memcmp(m_sk_tails_old.ptr(), m_sk_tails.ptr(), - m_sk_tails.get_current_pos()) == 0) - { - return 0; + m_sk_tails.get_current_pos()) == 0) { + return HA_EXIT_SUCCESS; } /* @@ -7721,11 +7080,10 @@ (also note that DDL statements do not delete rows, so this is not a DDL statement) */ - old_key_slice= rocksdb::Slice( - reinterpret_cast(m_sk_packed_tuple_old), - old_packed_size); + old_key_slice = rocksdb::Slice( + reinterpret_cast(m_sk_packed_tuple_old), old_packed_size); - row_info.tx->get_indexed_write_batch()->SingleDelete(kd->get_cf(), + row_info.tx->get_indexed_write_batch()->SingleDelete(kd.get_cf(), old_key_slice); } @@ -7740,74 +7098,63 @@ rocksdb::WriteBatchBase *write_batch; if ((row_info.tx->m_ddl_transaction && !(table_arg->key_info[key_id].flags & HA_NOSAME)) || - row_info.skip_unique_check) - { - write_batch= row_info.tx->get_blind_write_batch(); - } - else - { - write_batch= row_info.tx->get_indexed_write_batch(); + row_info.skip_unique_check) { + write_batch = row_info.tx->get_blind_write_batch(); + } else { + write_batch = row_info.tx->get_indexed_write_batch(); } - new_key_slice= rocksdb::Slice( - reinterpret_cast(m_sk_packed_tuple), new_packed_size); - new_value_slice= rocksdb::Slice( - reinterpret_cast(m_sk_tails.ptr()), - m_sk_tails.get_current_pos()); + new_key_slice = rocksdb::Slice( + reinterpret_cast(m_sk_packed_tuple), new_packed_size); + new_value_slice = + rocksdb::Slice(reinterpret_cast(m_sk_tails.ptr()), + m_sk_tails.get_current_pos()); - write_batch->Put(kd->get_cf(), new_key_slice, new_value_slice); + write_batch->Put(kd.get_cf(), new_key_slice, new_value_slice); - return 0; + return HA_EXIT_SUCCESS; } -int ha_rocksdb::update_indexes(const struct update_row_info& row_info, - bool pk_changed) -{ +int ha_rocksdb::update_indexes(const struct update_row_info &row_info, + const bool &pk_changed) { int rc; - for (uint key_id= 0; key_id < m_tbl_def->m_key_count; key_id++) - { - const std::shared_ptr& kd= m_key_descr_arr[key_id]; - if (is_pk(key_id, table, m_tbl_def)) - { - rc= update_pk(kd, row_info, pk_changed); - } - else - { - rc= update_sk(table, kd, row_info); + for (uint key_id = 0; key_id < m_tbl_def->m_key_count; key_id++) { + const Rdb_key_def &kd = *m_key_descr_arr[key_id]; + if (is_pk(key_id, table, m_tbl_def)) { + rc = update_pk(kd, row_info, pk_changed); + } else { + rc = update_sk(table, kd, row_info); } - if (rc != 0) - { + if (rc != 0) { return rc; } } - return 0; + return HA_EXIT_SUCCESS; } -int ha_rocksdb::update_write_row(const uchar *old_data, - const uchar *new_data, - const bool skip_unique_check) -{ - bool pk_changed= false; - struct update_row_info row_info; +int ha_rocksdb::update_write_row(const uchar *const old_data, + const uchar *const new_data, + const bool skip_unique_check) { + DBUG_ENTER_FUNC(); - row_info.old_data= old_data; - row_info.new_data= new_data; - row_info.skip_unique_check= skip_unique_check; - row_info.new_pk_unpack_info= nullptr; + bool pk_changed = false; + struct update_row_info row_info; - DBUG_ENTER("ha_rocksdb::write_row_common"); + row_info.old_data = old_data; + row_info.new_data = new_data; + row_info.skip_unique_check = skip_unique_check; + row_info.new_pk_unpack_info = nullptr; set_last_rowkey(old_data); - row_info.tx= get_or_create_tx(table->in_use); + row_info.tx = get_or_create_tx(table->in_use); - if (old_data != nullptr) - { - row_info.old_pk_slice= rocksdb::Slice(m_last_rowkey.ptr(), - m_last_rowkey.length()); + if (old_data != nullptr) { + row_info.old_pk_slice = + rocksdb::Slice(m_last_rowkey.ptr(), m_last_rowkey.length()); /* Determine which indexes need updating. */ calc_updated_indexes(); @@ -7816,21 +7163,18 @@ /* Get the new row key into row_info.new_pk_slice */ - int rc= get_pk_for_update(&row_info); - if (rc != 0) - { + int rc = get_pk_for_update(&row_info); + if (rc != 0) { DBUG_RETURN(rc); } - if (!skip_unique_check) - { + if (!skip_unique_check) { /* Check to see if we are going to have failures because of unique keys. Also lock the appropriate key values. */ - rc= check_uniqueness_and_lock(row_info, &pk_changed); - if (rc != 0) - { + rc = check_uniqueness_and_lock(row_info, &pk_changed); + if (rc != 0) { DBUG_RETURN(rc); } } @@ -7843,60 +7187,57 @@ here because updates to the transaction will be made and those updates cannot be easily removed without rolling back the entire transaction. */ - rc= update_indexes(row_info, pk_changed); - if (rc != 0) - { + rc = update_indexes(row_info, pk_changed); + if (rc != 0) { DBUG_RETURN(rc); } - if (do_bulk_commit(row_info.tx)) - { + if (do_bulk_commit(row_info.tx)) { DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } - /* Open a cursor and position it at the passed record */ -void ha_rocksdb::setup_scan_iterator( - const std::shared_ptr& kd, - rocksdb::Slice *slice, - const bool use_all_keys, - const bool is_ascending, - const uint eq_cond_len) -{ - DBUG_ASSERT(kd != nullptr); +void ha_rocksdb::setup_scan_iterator(const Rdb_key_def &kd, + rocksdb::Slice *const slice, + const bool use_all_keys, + const bool is_ascending, + const uint eq_cond_len) { DBUG_ASSERT(slice != nullptr); DBUG_ASSERT(slice->size() >= eq_cond_len); - Rdb_transaction *tx= get_or_create_tx(table->in_use); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); - bool skip_bloom= true; + bool skip_bloom = true; - rocksdb::Slice eq_cond(slice->data(), eq_cond_len); - if (can_use_bloom_filter(ha_thd(), kd, eq_cond, use_all_keys, is_ascending)) - { - skip_bloom= false; + const rocksdb::Slice eq_cond(slice->data(), eq_cond_len); + if (can_use_bloom_filter(ha_thd(), kd, eq_cond, use_all_keys, is_ascending)) { + skip_bloom = false; } /* In some cases, setup_scan_iterator() is called multiple times from the same query but bloom filter can not always be used. - Suppose the following query example. id2 is VARCHAR(30) and PRIMARY KEY (id1, id2). - select count(*) from t2 WHERE id1=100 and id2 IN ('00000000000000000000', '100'); + Suppose the following query example. id2 is VARCHAR(30) and PRIMARY KEY + (id1, id2). + select count(*) from t2 WHERE id1=100 and id2 IN ('00000000000000000000', + '100'); In this case, setup_scan_iterator() is called twice, the first time is for - (id1, id2)=(100, '00000000000000000000') and the second time is for (100, '100'). - If prefix bloom filter length is 24 bytes, prefix bloom filter can be used for the + (id1, id2)=(100, '00000000000000000000') and the second time is for (100, + '100'). + If prefix bloom filter length is 24 bytes, prefix bloom filter can be used + for the first condition but not for the second condition. - If bloom filter condition is changed, currently it is necessary to destroy and + If bloom filter condition is changed, currently it is necessary to destroy + and re-create Iterator. */ - if (m_scan_it_skips_bloom != skip_bloom) - { + if (m_scan_it_skips_bloom != skip_bloom) { release_scan_iterator(); } @@ -7904,22 +7245,40 @@ SQL layer can call rnd_init() multiple times in a row. In that case, re-use the iterator, but re-position it at the table start. */ - if (!m_scan_it) - { - bool fill_cache= !THDVAR(ha_thd(), skip_fill_cache); - m_scan_it= tx->get_iterator(kd->get_cf(), skip_bloom, fill_cache); - m_scan_it_skips_bloom= skip_bloom; + if (!m_scan_it) { + const bool fill_cache = !THDVAR(ha_thd(), skip_fill_cache); + if (commit_in_the_middle()) { + DBUG_ASSERT(m_scan_it_snapshot == nullptr); + m_scan_it_snapshot = rdb->GetSnapshot(); + + auto read_opts = rocksdb::ReadOptions(); + read_opts.total_order_seek = true; // TODO: set based on WHERE conditions + read_opts.snapshot = m_scan_it_snapshot; + m_scan_it = rdb->NewIterator(read_opts, kd.get_cf()); + } else { + m_scan_it = tx->get_iterator(kd.get_cf(), skip_bloom, fill_cache); + } + m_scan_it_skips_bloom = skip_bloom; } /* - Seek() will "Position at the first key in the source that at or past target". + Seek() will "Position at the first key in the source that at or past + target". The operation cannot fail. */ m_scan_it->Seek(*slice); } +void ha_rocksdb::release_scan_iterator() { + delete m_scan_it; + m_scan_it = nullptr; -void ha_rocksdb::setup_iterator_for_rnd_scan() -{ + if (m_scan_it_snapshot) { + rdb->ReleaseSnapshot(m_scan_it_snapshot); + m_scan_it_snapshot = nullptr; + } +} + +void ha_rocksdb::setup_iterator_for_rnd_scan() { uint key_size; if (m_pk_descr->m_is_reverse_cf) @@ -7927,27 +7286,22 @@ else m_pk_descr->get_infimum_key(m_pk_packed_tuple, &key_size); - rocksdb::Slice table_key((const char*)m_pk_packed_tuple, key_size); + rocksdb::Slice table_key((const char *)m_pk_packed_tuple, key_size); - setup_scan_iterator(m_pk_descr, &table_key); - m_skip_scan_it_next_call= true; + setup_scan_iterator(*m_pk_descr, &table_key); + m_skip_scan_it_next_call = true; } +int ha_rocksdb::rnd_init(bool scan) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::rnd_init(bool scan) -{ - DBUG_ENTER("ha_rocksdb::rnd_init"); - - Rdb_transaction *tx= get_or_create_tx(table->in_use); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); setup_read_decoders(); - if (scan) - { - m_rnd_scan_is_new_snapshot= !tx->has_snapshot(); + if (scan) { + m_rnd_scan_is_new_snapshot = !tx->has_snapshot(); setup_iterator_for_rnd_scan(); - } - else - { + } else { /* We don't need any preparations for rnd_pos() calls. */ } @@ -7956,48 +7310,45 @@ // the snapshot immediately. tx->acquire_snapshot(m_lock_rows == RDB_LOCK_NONE); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } +int ha_rocksdb::rnd_next(uchar *const buf) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::rnd_next(uchar *buf) -{ int rc; ha_statistic_increment(&SSV::ha_read_rnd_next_count); - for (;;) - { - rc= rnd_next_with_direction(buf, true); + for (;;) { + rc = rnd_next_with_direction(buf, true); if (rc != HA_ERR_LOCK_DEADLOCK || !m_rnd_scan_is_new_snapshot) - break; /* exit the loop */ + break; /* exit the loop */ // release the snapshot and iterator and then regenerate them - Rdb_transaction *tx= get_or_create_tx(table->in_use); + Rdb_transaction *tx = get_or_create_tx(table->in_use); tx->release_snapshot(); release_scan_iterator(); setup_iterator_for_rnd_scan(); } - m_rnd_scan_is_new_snapshot= false; + m_rnd_scan_is_new_snapshot = false; if (rc == HA_ERR_KEY_NOT_FOUND) rc = HA_ERR_END_OF_FILE; - return rc; -} + DBUG_RETURN(rc); +} /* See also secondary_index_read(). */ -int ha_rocksdb::rnd_next_with_direction(uchar *buf, bool move_forward) -{ +int ha_rocksdb::rnd_next_with_direction(uchar *const buf, bool move_forward) { + DBUG_ENTER_FUNC(); + int rc; - DBUG_ENTER("ha_rocksdb::rnd_next"); - table->status= STATUS_NOT_FOUND; - stats.rows_requested++; + table->status = STATUS_NOT_FOUND; - if (!m_scan_it || !m_scan_it->Valid()) - { + if (!m_scan_it || !m_scan_it->Valid()) { /* We can get here when SQL layer has called @@ -8009,88 +7360,88 @@ DBUG_RETURN(HA_ERR_END_OF_FILE); } - if (m_skip_scan_it_next_call) - { - m_skip_scan_it_next_call= false; - } - else - { - if (move_forward) - m_scan_it->Next(); /* this call cannot fail */ - else - m_scan_it->Prev(); /* this call cannot fail */ - } + for (;;) { + if (m_skip_scan_it_next_call) { + m_skip_scan_it_next_call = false; + } else { + if (move_forward) + m_scan_it->Next(); /* this call cannot fail */ + else + m_scan_it->Prev(); /* this call cannot fail */ + } + + if (!m_scan_it->Valid()) { + rc = HA_ERR_END_OF_FILE; + break; + } - if (m_scan_it->Valid()) - { /* check if we're out of this table */ - rocksdb::Slice key= m_scan_it->key(); - if (!m_pk_descr->covers_key(key)) - { - rc= HA_ERR_END_OF_FILE; + const rocksdb::Slice key = m_scan_it->key(); + if (!m_pk_descr->covers_key(key)) { + rc = HA_ERR_END_OF_FILE; + break; } - else - { - if (m_lock_rows != RDB_LOCK_NONE) - { - /* - Lock the row we've just read. - Now we call get_for_update which will 1) Take a lock and 2) Will fail - if the row was deleted since the snapshot was taken. - */ - Rdb_transaction *tx= get_or_create_tx(table->in_use); - DEBUG_SYNC(ha_thd(), "rocksdb_concurrent_delete"); - rocksdb::Status s= tx->get_for_update(m_pk_descr->get_cf(), key, - &m_retrieved_record); - if (!s.ok()) - { - DBUG_RETURN(tx->set_status_error(table->in_use, s, m_pk_descr, - m_tbl_def)); - } + if (m_lock_rows != RDB_LOCK_NONE) { + /* + Lock the row we've just read. - // If we called get_for_update() use the value from that call not from - // the iterator as it may be stale since we don't have a snapshot - // when m_lock_rows is not RDB_LOCK_NONE. - m_last_rowkey.copy(key.data(), key.size(), &my_charset_bin); - rc= convert_record_from_storage_format(&key, buf); + Now we call get_for_update which will 1) Take a lock and 2) Will fail + if the row was deleted since the snapshot was taken. + */ + Rdb_transaction *const tx = get_or_create_tx(table->in_use); + DEBUG_SYNC(ha_thd(), "rocksdb_concurrent_delete"); + const rocksdb::Status s = + get_for_update(tx, m_pk_descr->get_cf(), key, &m_retrieved_record); + if (s.IsNotFound() && + my_core::thd_tx_isolation(ha_thd()) == ISO_READ_COMMITTED) { + // This occurs if we accessed a row, tried to lock it, failed, + // released and reacquired the snapshot (because of READ COMMITTED + // mode) and the row was deleted by someone else in the meantime. + // If so, we just want to move on to the next row. + continue; } - else - { - // Use the value from the iterator - rocksdb::Slice value= m_scan_it->value(); - m_last_rowkey.copy(key.data(), key.size(), &my_charset_bin); - rc= convert_record_from_storage_format(&key, &value, buf); + + if (!s.ok()) { + DBUG_RETURN( + tx->set_status_error(table->in_use, s, *m_pk_descr, m_tbl_def)); } - table->status= 0; + // If we called get_for_update() use the value from that call not from + // the iterator as it may be stale since we don't have a snapshot + // when m_lock_rows is not RDB_LOCK_NONE. + m_last_rowkey.copy(key.data(), key.size(), &my_charset_bin); + rc = convert_record_from_storage_format(&key, buf); + } else { + // Use the value from the iterator + rocksdb::Slice value = m_scan_it->value(); + m_last_rowkey.copy(key.data(), key.size(), &my_charset_bin); + rc = convert_record_from_storage_format(&key, &value, buf); } + + table->status = 0; + break; } - else - rc= HA_ERR_END_OF_FILE; if (!rc) { - stats.rows_read++; - stats.rows_index_next++; update_row_stats(ROWS_READ); } DBUG_RETURN(rc); } - -int ha_rocksdb::rnd_end() -{ - DBUG_ENTER("ha_rocksdb::rnd_end"); +int ha_rocksdb::rnd_end() { + DBUG_ENTER_FUNC(); release_scan_iterator(); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } -int ha_rocksdb::index_init(uint idx, bool sorted) -{ - Rdb_transaction *tx= get_or_create_tx(table->in_use); +int ha_rocksdb::index_init(uint idx, bool sorted) { + DBUG_ENTER_FUNC(); + + Rdb_transaction *const tx = get_or_create_tx(table->in_use); DBUG_ASSERT(tx != nullptr); setup_read_decoders(); @@ -8100,28 +7451,34 @@ // Otherwise acquire the snapshot immediately. tx->acquire_snapshot(m_lock_rows == RDB_LOCK_NONE); - active_index= idx; + active_index = idx; - return 0; + DBUG_RETURN(HA_EXIT_SUCCESS); } -int ha_rocksdb::index_end() -{ +int ha_rocksdb::index_end() { + DBUG_ENTER_FUNC(); + release_scan_iterator(); - active_index= MAX_KEY; - in_range_check_pushed_down= FALSE; - return 0; + active_index = MAX_KEY; + in_range_check_pushed_down = FALSE; + + DBUG_RETURN(HA_EXIT_SUCCESS); } -int ha_rocksdb::truncate() -{ - m_tbl_def->m_auto_incr_val= 1; - m_tbl_def->m_hidden_pk_val= 1; +int ha_rocksdb::truncate() { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(m_tbl_def != nullptr); + + m_tbl_def->m_auto_incr_val = 1; + m_tbl_def->m_hidden_pk_val = 1; + remove_rows(m_tbl_def); - return 0; -} + DBUG_RETURN(HA_EXIT_SUCCESS); +} /* Delete the row we've last read. The row is also passed as parameter. @@ -8131,108 +7488,94 @@ The row is either table->record[0] or table->record[1]. (Check out InnoDB: row_update_for_mysql() has "UT_NOT_USED(mysql_rec)" */ -int ha_rocksdb::delete_row(const uchar *buf) -{ - DBUG_ENTER("ha_rocksdb::delete_row"); +int ha_rocksdb::delete_row(const uchar *const buf) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(buf != nullptr); ha_statistic_increment(&SSV::ha_delete_count); set_last_rowkey(buf); rocksdb::Slice key_slice(m_last_rowkey.ptr(), m_last_rowkey.length()); - Rdb_transaction *tx= get_or_create_tx(table->in_use); + Rdb_transaction *const tx = get_or_create_tx(table->in_use); - uint index= pk_index(table, m_tbl_def); - rocksdb::Status s= delete_or_singledelete(index, tx, - m_pk_descr->get_cf(), - key_slice); - if (!s.ok()) - { - DBUG_RETURN(tx->set_status_error(table->in_use, s, m_pk_descr, m_tbl_def)); + const uint index = pk_index(table, m_tbl_def); + rocksdb::Status s = + delete_or_singledelete(index, tx, m_pk_descr->get_cf(), key_slice); + if (!s.ok()) { + DBUG_RETURN(tx->set_status_error(table->in_use, s, *m_pk_descr, m_tbl_def)); } - longlong hidden_pk_id= 0; - if (m_tbl_def->m_key_count > 1 && - has_hidden_pk(table) && read_hidden_pk_id_from_rowkey(&hidden_pk_id)) + longlong hidden_pk_id = 0; + if (m_tbl_def->m_key_count > 1 && has_hidden_pk(table) && + read_hidden_pk_id_from_rowkey(&hidden_pk_id)) DBUG_RETURN(HA_ERR_INTERNAL_ERROR); // Delete the record for every secondary index - for (uint i= 0; i < m_tbl_def->m_key_count; i++) - { - if (!is_pk(i, table, m_tbl_def)) - { + for (uint i = 0; i < m_tbl_def->m_key_count; i++) { + if (!is_pk(i, table, m_tbl_def)) { int packed_size; - const std::shared_ptr& kd= m_key_descr_arr[i]; - packed_size= kd->pack_record(table, m_pack_buffer, buf, m_sk_packed_tuple, + const Rdb_key_def &kd = *m_key_descr_arr[i]; + packed_size = kd.pack_record(table, m_pack_buffer, buf, m_sk_packed_tuple, nullptr, false, hidden_pk_id); rocksdb::Slice secondary_key_slice( - reinterpret_cast(m_sk_packed_tuple), packed_size); + reinterpret_cast(m_sk_packed_tuple), packed_size); /* Deleting on secondary key doesn't need any locks: */ - tx->get_indexed_write_batch()->SingleDelete(kd->get_cf(), + tx->get_indexed_write_batch()->SingleDelete(kd.get_cf(), secondary_key_slice); } } - if (do_bulk_commit(tx)) - { + if (do_bulk_commit(tx)) { DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - stats.rows_deleted++; update_row_stats(ROWS_DELETED); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } - -rocksdb::Status -ha_rocksdb::delete_or_singledelete(uint index, - Rdb_transaction *tx, - rocksdb::ColumnFamilyHandle* column_family, - const rocksdb::Slice& key) -{ +rocksdb::Status ha_rocksdb::delete_or_singledelete( + uint index, Rdb_transaction *const tx, + rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key) { if (can_use_single_delete(index)) return tx->single_delete(column_family, key); return tx->delete_key(column_family, key); } +void ha_rocksdb::update_stats(void) { + DBUG_ENTER_FUNC(); -void ha_rocksdb::update_stats(void) -{ - DBUG_ENTER("ha_rocksdb::update_stats"); - - stats.records= 0; - stats.index_file_length= 0ul; - stats.data_file_length= 0ul; - stats.mean_rec_length= 0; - for (uint i= 0; i < m_tbl_def->m_key_count; i++) - { - if (is_pk(i, table, m_tbl_def)) - { - stats.data_file_length= m_pk_descr->m_stats.m_actual_disk_size; + stats.records = 0; + stats.index_file_length = 0ul; + stats.data_file_length = 0ul; + stats.mean_rec_length = 0; + + for (uint i = 0; i < m_tbl_def->m_key_count; i++) { + if (is_pk(i, table, m_tbl_def)) { + stats.data_file_length = m_pk_descr->m_stats.m_actual_disk_size; stats.records = m_pk_descr->m_stats.m_rows; - } - else - { - stats.index_file_length+= m_key_descr_arr[i]->m_stats.m_actual_disk_size; + } else { + stats.index_file_length += m_key_descr_arr[i]->m_stats.m_actual_disk_size; } } + DBUG_VOID_RETURN; } -int ha_rocksdb::info(uint flag) -{ - DBUG_ENTER("ha_rocksdb::info"); +int ha_rocksdb::info(uint flag) { + DBUG_ENTER_FUNC(); if (!table) - return 1; + return HA_EXIT_FAILURE; - if (flag & HA_STATUS_VARIABLE) - { + if (flag & HA_STATUS_VARIABLE) { /* Test only to simulate corrupted stats */ DBUG_EXECUTE_IF("myrocks_simulate_negative_stats", - m_pk_descr->m_stats.m_actual_disk_size = - -m_pk_descr->m_stats.m_actual_disk_size;); + m_pk_descr->m_stats.m_actual_disk_size = + -m_pk_descr->m_stats.m_actual_disk_size;); update_stats(); @@ -8242,27 +7585,27 @@ */ if (static_cast(stats.data_file_length) < 0 || static_cast(stats.index_file_length) < 0 || - static_cast(stats.records) < 0) - { + static_cast(stats.records) < 0) { if (analyze(nullptr, nullptr)) { - DBUG_RETURN(1); + DBUG_RETURN(HA_EXIT_FAILURE); } update_stats(); } - if (stats.records == 0) - { + if (stats.records == 0) { // most likely, the table is in memtable // try to deduce from GetApproximateSizes - uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE*2]; - auto r= get_range(pk_index(table, m_tbl_def), buf); - uint64_t sz= 0; - rdb->GetApproximateSizes( - m_pk_descr->get_cf(), - &r, 1, - &sz, true); - stats.records = sz/ROCKSDB_ASSUMED_KEY_VALUE_DISK_SIZE; + uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2]; + auto r = get_range(pk_index(table, m_tbl_def), buf); + uint64_t sz = 0; + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + rdb->GetApproximateSizes(m_pk_descr->get_cf(), &r, 1, &sz, true); +#pragma GCC diagnostic pop + + stats.records = sz / ROCKSDB_ASSUMED_KEY_VALUE_DISK_SIZE; stats.data_file_length = sz; if (rocksdb_debug_optimizer_n_rows > 0) @@ -8272,66 +7615,59 @@ if (stats.records != 0) stats.mean_rec_length = stats.data_file_length / stats.records; } - if (flag & HA_STATUS_CONST) - { - ref_length= m_pk_descr->max_storage_fmt_length(); + if (flag & HA_STATUS_CONST) { + ref_length = m_pk_descr->max_storage_fmt_length(); // TODO: Needs to reimplement after having real index statistics - for (uint i= 0; i < m_tbl_def->m_key_count; i++) - { - if (is_hidden_pk(i, table, m_tbl_def)) - { + for (uint i = 0; i < m_tbl_def->m_key_count; i++) { + if (is_hidden_pk(i, table, m_tbl_def)) { continue; } - KEY* k= &table->key_info[i]; - for (uint j = 0; j < k->actual_key_parts; j++) - { - const Rdb_index_stats& k_stats= m_key_descr_arr[i]->m_stats; + KEY *const k = &table->key_info[i]; + for (uint j = 0; j < k->actual_key_parts; j++) { + const Rdb_index_stats &k_stats = m_key_descr_arr[i]->m_stats; uint x = k_stats.m_distinct_keys_per_prefix.size() > j && - k_stats.m_distinct_keys_per_prefix[j] > 0 ? - k_stats.m_rows / k_stats.m_distinct_keys_per_prefix[j] : - 0; + k_stats.m_distinct_keys_per_prefix[j] > 0 + ? k_stats.m_rows / k_stats.m_distinct_keys_per_prefix[j] + : 0; if (x > stats.records) x = stats.records; if ((x == 0 && rocksdb_debug_optimizer_no_zero_cardinality) || - rocksdb_debug_optimizer_n_rows > 0) - { - // Fake cardinality implementation. For example, (idx1, idx2, idx3) index + rocksdb_debug_optimizer_n_rows > 0) { + // Fake cardinality implementation. For example, (idx1, idx2, idx3) + // index // will have rec_per_key for (idx1)=4, (idx1,2)=2, and (idx1,2,3)=1. // rec_per_key for the whole index is 1, and multiplied by 2^n if // n suffix columns of the index are not used. - x = 1 << (k->actual_key_parts-j-1); + x = 1 << (k->actual_key_parts - j - 1); } - k->rec_per_key[j]= x; + k->rec_per_key[j] = x; } } } - if (flag & HA_STATUS_ERRKEY) - { + if (flag & HA_STATUS_ERRKEY) { /* Currently we support only primary keys so we know which key had a uniqueness violation. */ - errkey= m_dupp_errkey; - dup_ref= m_pk_tuple; // TODO(?): this should store packed PK. + errkey = m_dupp_errkey; + dup_ref = m_pk_tuple; // TODO(?): this should store packed PK. } - if (flag & HA_STATUS_AUTO) - { - stats.auto_increment_value= m_tbl_def->m_auto_incr_val; + if (flag & HA_STATUS_AUTO) { + stats.auto_increment_value = m_tbl_def->m_auto_incr_val; } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } -void ha_rocksdb::position(const uchar *record) -{ - DBUG_ENTER("ha_rocksdb::position"); +void ha_rocksdb::position(const uchar *const record) { + DBUG_ENTER_FUNC(); - longlong hidden_pk_id= 0; + longlong hidden_pk_id = 0; if (has_hidden_pk(table) && read_hidden_pk_id_from_rowkey(&hidden_pk_id)) - DBUG_ASSERT(false); // should never reach here + DBUG_ASSERT(false); // should never reach here /* Get packed primary key value from the record. @@ -8346,8 +7682,8 @@ read set (this may potentially disable index-only access when PK column cannot be restored from its mem-comparable form in the secondary indexes). */ - uint packed_size= m_pk_descr->pack_record(table, m_pack_buffer, record, - ref, nullptr, false, hidden_pk_id); + const uint packed_size = m_pk_descr->pack_record( + table, m_pack_buffer, record, ref, nullptr, false, hidden_pk_id); /* It could be that mem-comparable form of PK occupies less than ref_length @@ -8359,64 +7695,54 @@ DBUG_VOID_RETURN; } +int ha_rocksdb::rnd_pos(uchar *const buf, uchar *const pos) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::rnd_pos(uchar *buf, uchar *pos) -{ int rc; size_t len; - DBUG_ENTER("ha_rocksdb::rnd_pos"); ha_statistic_increment(&SSV::ha_read_rnd_count); - stats.rows_requested++; - len= m_pk_descr->key_length(table, rocksdb::Slice((const char*)pos, - ref_length)); - if (len == size_t(-1)) - { + len = m_pk_descr->key_length(table, + rocksdb::Slice((const char *)pos, ref_length)); + if (len == size_t(-1)) { DBUG_RETURN(HA_ERR_INTERNAL_ERROR); /* Data corruption? */ } - rc= get_row_by_rowid(buf, pos, len); + rc = get_row_by_rowid(buf, pos, len); - if (!rc) - { - stats.rows_read++; + if (!rc) { update_row_stats(ROWS_READ); } DBUG_RETURN(rc); } - /* @brief Calculate (if needed) the bitmap of indexes that are modified by the current query @detail - The calculation done by checking index definitions against the table->write_set + The calculation done by checking index definitions against the + table->write_set column bitmap. */ -void ha_rocksdb::calc_updated_indexes() -{ - if (!m_update_scope_is_valid) - { - m_update_scope_is_valid= true; +void ha_rocksdb::calc_updated_indexes() { + if (!m_update_scope_is_valid) { + m_update_scope_is_valid = true; m_update_scope.clear_all(); - for (uint keynr= 0; keynr < table->s->keys; keynr++) - { - const std::shared_ptr& kd= m_key_descr_arr[keynr]; + for (uint keynr = 0; keynr < table->s->keys; keynr++) { + const Rdb_key_def &kd = *m_key_descr_arr[keynr]; /* Walk over all key parts, including the "extended key" suffix */ - uint key_parts= kd->get_key_parts(); - for (uint kp= 0; kp < key_parts; kp++) - { + const uint key_parts = kd.get_key_parts(); + for (uint kp = 0; kp < key_parts; kp++) { if (has_hidden_pk(table) && kp + 1 == key_parts) break; - Field *field= kd->get_table_field_for_part_no(table, kp); - if (bitmap_is_set(table->write_set, field->field_index)) - { + Field *const field = kd.get_table_field_for_part_no(table, kp); + if (bitmap_is_set(table->write_set, field->field_index)) { m_update_scope.set_bit(keynr); break; } @@ -8425,10 +7751,11 @@ } } +int ha_rocksdb::update_row(const uchar *const old_data, uchar *const new_data) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::update_row(const uchar *old_data, uchar *new_data) -{ - DBUG_ENTER("ha_rocksdb::update_row"); + DBUG_ASSERT(old_data != nullptr); + DBUG_ASSERT(new_data != nullptr); DBUG_ASSERT(m_lock_rows == RDB_LOCK_WRITE); /* old_data points to record we're updating. It is the same as the record @@ -8438,52 +7765,46 @@ DBUG_ASSERT(new_data == table->record[0]); ha_statistic_increment(&SSV::ha_update_count); - int rv; - rv= update_write_row(old_data, new_data, false); + const int rv = update_write_row(old_data, new_data, false); - if (rv == 0) - { - stats.rows_updated++; + if (rv == 0) { update_row_stats(ROWS_UPDATED); } + DBUG_RETURN(rv); } - /* The following function was copied from ha_blackhole::store_lock: */ -THR_LOCK_DATA **ha_rocksdb::store_lock(THD *thd, - THR_LOCK_DATA **to, - enum thr_lock_type lock_type) -{ - DBUG_ENTER("ha_rocksdb::store_lock"); +THR_LOCK_DATA **ha_rocksdb::store_lock(THD *const thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(thd != nullptr); + DBUG_ASSERT(to != nullptr); bool in_lock_tables = my_core::thd_in_lock_tables(thd); /* First, make a decision about MyRocks's internal locking */ - if (lock_type >= TL_WRITE_ALLOW_WRITE) - { + if (lock_type >= TL_WRITE_ALLOW_WRITE) { m_lock_rows = RDB_LOCK_WRITE; - } - else if (lock_type == TL_READ_WITH_SHARED_LOCKS) - { + } else if (lock_type == TL_READ_WITH_SHARED_LOCKS) { m_lock_rows = RDB_LOCK_READ; - } - else - { + } else { m_lock_rows = RDB_LOCK_NONE; - if (THDVAR(thd, lock_scanned_rows)) - { + if (THDVAR(thd, lock_scanned_rows)) { /* The following logic was copied directly from ha_innobase::store_lock_with_x_type() in storage/innobase/handler/ha_innodb.cc and causes MyRocks to leave - locks in place on rows that are in a table that is not beint updated. + locks in place on rows that are in a table that is not being updated. */ - uint sql_command = my_core::thd_sql_command(thd); + const uint sql_command = my_core::thd_sql_command(thd); if ((lock_type == TL_READ && in_lock_tables) || (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables) || - can_hold_read_locks_on_select(thd, lock_type)) - { + lock_type == TL_READ_WITH_SHARED_LOCKS || + lock_type == TL_READ_NO_INSERT || + (lock_type != TL_IGNORE && sql_command != SQLCOM_SELECT)) { + ulong tx_isolation = my_core::thd_tx_isolation(thd); if (sql_command != SQLCOM_CHECKSUM && ((my_core::thd_test_options(thd, OPTION_BIN_LOG) && @@ -8492,10 +7813,8 @@ (lock_type != TL_READ && lock_type != TL_READ_NO_INSERT) || (sql_command != SQLCOM_INSERT_SELECT && sql_command != SQLCOM_REPLACE_SELECT && - sql_command != SQLCOM_UPDATE && - sql_command != SQLCOM_DELETE && - sql_command != SQLCOM_CREATE_TABLE))) - { + sql_command != SQLCOM_UPDATE && sql_command != SQLCOM_DELETE && + sql_command != SQLCOM_CREATE_TABLE))) { m_lock_rows = RDB_LOCK_READ; } } @@ -8503,8 +7822,7 @@ } /* Then, tell the SQL layer what kind of locking it should use: */ - if (lock_type != TL_IGNORE && m_db_lock.type == TL_UNLOCK) - { + if (lock_type != TL_IGNORE && m_db_lock.type == TL_UNLOCK) { /* Here is where we get into the guts of a row level lock. If TL_UNLOCK is set @@ -8513,8 +7831,7 @@ */ if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) && - !in_lock_tables && !my_core::thd_tablespace_op(thd)) - { + !in_lock_tables && !my_core::thd_tablespace_op(thd)) { lock_type = TL_WRITE_ALLOW_WRITE; } @@ -8526,50 +7843,61 @@ concurrent inserts to t2. */ - if (lock_type == TL_READ_NO_INSERT && !in_lock_tables) - { + if (lock_type == TL_READ_NO_INSERT && !in_lock_tables) { lock_type = TL_READ; } - m_db_lock.type= lock_type; + m_db_lock.type = lock_type; } - *to++= &m_db_lock; + + *to++ = &m_db_lock; + DBUG_RETURN(to); } -void ha_rocksdb::read_thd_vars(THD *thd) -{ - m_store_checksums= THDVAR(thd, store_checksums); - m_verify_checksums= THDVAR(thd, verify_checksums); - m_checksums_pct= THDVAR(thd, checksums_pct); +void ha_rocksdb::read_thd_vars(THD *const thd) { + m_store_row_debug_checksums = THDVAR(thd, store_row_debug_checksums); + m_verify_row_debug_checksums = THDVAR(thd, verify_row_debug_checksums); + m_checksums_pct = THDVAR(thd, checksums_pct); } -int ha_rocksdb::external_lock(THD *thd, int lock_type) -{ - int res= 0; - DBUG_ENTER("ha_rocksdb::external_lock"); +const char *ha_rocksdb::thd_rocksdb_tmpdir() { + const char *tmp_dir = THDVAR(ha_thd(), tmpdir); + + /* + We want to treat an empty string as nullptr, in these cases DDL operations + will use the default --tmpdir passed to mysql instead. + */ + if (tmp_dir != nullptr && *tmp_dir == '\0') { + tmp_dir = nullptr; + } + + return (tmp_dir); +} + +int ha_rocksdb::external_lock(THD *const thd, int lock_type) { + DBUG_ENTER_FUNC(); - int binlog_format= my_core::thd_binlog_format(thd); - bool unsafe_for_binlog= THDVAR(ha_thd(), unsafe_for_binlog); - if (lock_type == F_WRLCK && !thd->rli_slave && - !unsafe_for_binlog && + DBUG_ASSERT(thd != nullptr); + + int res = 0; + int binlog_format = my_core::thd_binlog_format(thd); + bool unsafe_for_binlog = THDVAR(ha_thd(), unsafe_for_binlog); + if (lock_type == F_WRLCK && !thd->rli_slave && !unsafe_for_binlog && binlog_format != BINLOG_FORMAT_ROW && binlog_format != BINLOG_FORMAT_UNSPEC && - my_core::thd_binlog_filter_ok(thd)) - { - my_printf_error(ER_UNKNOWN_ERROR, - "Can't execute updates on master with binlog_format != ROW.", - MYF(0)); + my_core::thd_binlog_filter_ok(thd)) { + my_printf_error( + ER_UNKNOWN_ERROR, + "Can't execute updates on master with binlog_format != ROW.", MYF(0)); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - if (lock_type == F_UNLCK) - { - Rdb_transaction* tx= get_or_create_tx(thd); + if (lock_type == F_UNLCK) { + Rdb_transaction *const tx = get_or_create_tx(thd); tx->io_perf_end_and_record(&m_io_perf); - if (!my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) - { + if (!my_core::thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) { /* Do like InnoDB: when we get here, it's time to commit a single-statement transaction. @@ -8578,21 +7906,17 @@ for each of them, but that's ok because non-first tx->commit() calls will be no-ops. */ - res= tx->commit_or_rollback(); + res = tx->commit_or_rollback(); } - } - else - { + } else { if (my_core::thd_tx_isolation(thd) < ISO_READ_COMMITTED || - my_core::thd_tx_isolation(thd) > ISO_REPEATABLE_READ) - { - my_printf_error(ER_UNKNOWN_ERROR, - "MyRocks supports only READ COMMITTED and " - "REPEATABLE READ isolation levels. " - "Please change from current isolation " - "level %s", - MYF(0), - tx_isolation_names[my_core::thd_tx_isolation(thd)]); + my_core::thd_tx_isolation(thd) > ISO_REPEATABLE_READ) { + my_printf_error( + ER_UNKNOWN_ERROR, "MyRocks supports only READ COMMITTED and " + "REPEATABLE READ isolation levels. " + "Please change from current isolation " + "level %s", + MYF(0), tx_isolation_names[my_core::thd_tx_isolation(thd)]); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } /* @@ -8600,19 +7924,17 @@ is, handler->start_stmt() is not called for INSERTs. So, we put this code here. */ - Rdb_transaction* tx= get_or_create_tx(thd); + Rdb_transaction *const tx = get_or_create_tx(thd); read_thd_vars(thd); - m_update_scope_is_valid= false; + m_update_scope_is_valid = false; - if (skip_unique_check()) - { + if (skip_unique_check()) { if ((thd->lex->sql_command == SQLCOM_INSERT || - thd->lex->sql_command == SQLCOM_LOAD || - thd->lex->sql_command == SQLCOM_REPLACE) && + thd->lex->sql_command == SQLCOM_LOAD || + thd->lex->sql_command == SQLCOM_REPLACE) && (thd->lex->duplicates == DUP_REPLACE || - thd->lex->duplicates == DUP_UPDATE)) - { + thd->lex->duplicates == DUP_UPDATE)) { my_printf_error(ER_UNKNOWN_ERROR, "When unique checking is disabled in MyRocks, INSERT," "UPDATE,LOAD statements with clauses that update or " @@ -8624,14 +7946,11 @@ } } - if (lock_type == F_WRLCK) - { - if (tx->is_tx_read_only()) - { + if (lock_type == F_WRLCK) { + if (tx->is_tx_read_only()) { my_printf_error(ER_UNKNOWN_ERROR, "Can't execute updates when you started a transaction " - "with START TRANSACTION WITH CONSISTENT [ROCKSDB] " - "SNAPSHOT.", + "with START TRANSACTION WITH CONSISTENT SNAPSHOT.", MYF(0)); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } @@ -8643,13 +7962,12 @@ Note: sometimes, external_lock() can be called without a prior ::store_lock call. That's why we need to set lock_* members here, too. */ - m_lock_rows= RDB_LOCK_WRITE; + m_lock_rows = RDB_LOCK_WRITE; if (thd->lex->sql_command == SQLCOM_CREATE_INDEX || - thd->lex->sql_command == SQLCOM_DROP_INDEX || - thd->lex->sql_command == SQLCOM_ALTER_TABLE) - { - tx->m_ddl_transaction= true; + thd->lex->sql_command == SQLCOM_DROP_INDEX || + thd->lex->sql_command == SQLCOM_ALTER_TABLE) { + tx->m_ddl_transaction = true; } } rocksdb_register_tx(rocksdb_hton, thd, tx); @@ -8659,7 +7977,6 @@ DBUG_RETURN(res); } - /** @note A quote from ha_innobase::start_stmt(): @@ -8670,63 +7987,58 @@ */ -int ha_rocksdb::start_stmt(THD *thd, thr_lock_type lock_type) -{ - Rdb_transaction* tx= get_or_create_tx(thd); +int ha_rocksdb::start_stmt(THD *const thd, thr_lock_type lock_type) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(thd != nullptr); + + Rdb_transaction *const tx = get_or_create_tx(thd); read_thd_vars(thd); rocksdb_register_tx(ht, thd, tx); tx->io_perf_start(&m_io_perf); - return 0; + + DBUG_RETURN(HA_EXIT_SUCCESS); } -rocksdb::Range get_range( - uint32_t i, uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE*2], int offset1, - int offset2) -{ - uchar* buf_begin= buf; - uchar* buf_end= buf + Rdb_key_def::INDEX_NUMBER_SIZE; +rocksdb::Range get_range(uint32_t i, + uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2], + int offset1, int offset2) { + uchar *buf_begin = buf; + uchar *buf_end = buf + Rdb_key_def::INDEX_NUMBER_SIZE; rdb_netbuf_store_index(buf_begin, i + offset1); rdb_netbuf_store_index(buf_end, i + offset2); return rocksdb::Range( - rocksdb::Slice((const char*) buf_begin, Rdb_key_def::INDEX_NUMBER_SIZE), - rocksdb::Slice((const char*) buf_end, Rdb_key_def::INDEX_NUMBER_SIZE)); + rocksdb::Slice((const char *)buf_begin, Rdb_key_def::INDEX_NUMBER_SIZE), + rocksdb::Slice((const char *)buf_end, Rdb_key_def::INDEX_NUMBER_SIZE)); } -static rocksdb::Range get_range( - const std::shared_ptr& kd, - uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE*2], - int offset1, int offset2) -{ - return get_range(kd->get_index_number(), buf, offset1, offset2); +static rocksdb::Range get_range(const Rdb_key_def &kd, + uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2], + int offset1, int offset2) { + return get_range(kd.get_index_number(), buf, offset1, offset2); } -rocksdb::Range get_range(const std::shared_ptr& kd, - uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE*2]) -{ - if (kd->m_is_reverse_cf) - { +rocksdb::Range get_range(const Rdb_key_def &kd, + uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2]) { + if (kd.m_is_reverse_cf) { return myrocks::get_range(kd, buf, 1, 0); - } - else - { + } else { return myrocks::get_range(kd, buf, 0, 1); } } -rocksdb::Range ha_rocksdb::get_range( - int i, uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE*2]) const -{ - return myrocks::get_range(m_key_descr_arr[i], buf); +rocksdb::Range +ha_rocksdb::get_range(const int &i, + uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2]) const { + return myrocks::get_range(*m_key_descr_arr[i], buf); } - /* Drop index thread's main logic */ -void Rdb_drop_index_thread::run() -{ +void Rdb_drop_index_thread::run() { mysql_mutex_lock(&m_signal_mutex); for (;;) { @@ -8742,11 +8054,11 @@ timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += dict_manager.is_drop_index_empty() - ? 24*60*60 // no filtering - : 60; // filtering + ? 24 * 60 * 60 // no filtering + : 60; // filtering - auto ret __attribute__((__unused__)) = mysql_cond_timedwait( - &m_signal_cond, &m_signal_mutex, &ts); + const auto ret __attribute__((__unused__)) = + mysql_cond_timedwait(&m_signal_cond, &m_signal_mutex, &ts); if (m_stop) { break; } @@ -8754,85 +8066,73 @@ DBUG_ASSERT(ret == 0 || ret == ETIMEDOUT); mysql_mutex_unlock(&m_signal_mutex); - std::vector indices; + std::unordered_set indices; dict_manager.get_ongoing_drop_indexes(&indices); if (!indices.empty()) { std::unordered_set finished; rocksdb::ReadOptions read_opts; read_opts.total_order_seek = true; // disable bloom filter - for (auto d : indices) { - uint32 cf_flags= 0; - if (!dict_manager.get_cf_flags(d.cf_id, &cf_flags)) - { + for (const auto d : indices) { + uint32 cf_flags = 0; + if (!dict_manager.get_cf_flags(d.cf_id, &cf_flags)) { sql_print_error("RocksDB: Failed to get column family flags " "from cf id %u. MyRocks data dictionary may " - "get corrupted.", d.cf_id); + "get corrupted.", + d.cf_id); abort_with_stack_traces(); } - rocksdb::ColumnFamilyHandle* cfh= cf_manager.get_cf(d.cf_id); + rocksdb::ColumnFamilyHandle *cfh = cf_manager.get_cf(d.cf_id); DBUG_ASSERT(cfh); - bool is_reverse_cf= cf_flags & Rdb_key_def::REVERSE_CF_FLAG; + const bool is_reverse_cf = cf_flags & Rdb_key_def::REVERSE_CF_FLAG; - bool index_removed= false; - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE]= {0}; + bool index_removed = false; + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE] = {0}; rdb_netbuf_store_uint32(key_buf, d.index_id); - rocksdb::Slice key = rocksdb::Slice((char*)key_buf, sizeof(key_buf)); - uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE*2]; - rocksdb::Range range = get_range(d.index_id, buf, is_reverse_cf?1:0, - is_reverse_cf?0:1); + const rocksdb::Slice key = + rocksdb::Slice((char *)key_buf, sizeof(key_buf)); + uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2]; + rocksdb::Range range = get_range(d.index_id, buf, is_reverse_cf ? 1 : 0, + is_reverse_cf ? 0 : 1); rocksdb::CompactRangeOptions compact_range_options; compact_range_options.bottommost_level_compaction = - rocksdb::BottommostLevelCompaction::kForce; + rocksdb::BottommostLevelCompaction::kForce; compact_range_options.exclusive_manual_compaction = false; rocksdb::Status status = DeleteFilesInRange(rdb->GetBaseDB(), cfh, - &range.start, &range.limit); - if (!status.ok()) - { - if (status.IsShutdownInProgress()) - { + &range.start, &range.limit); + if (!status.ok()) { + if (status.IsShutdownInProgress()) { break; } rdb_handle_io_error(status, RDB_IO_ERROR_BG_THREAD); } - status = rdb->CompactRange( - compact_range_options, cfh, &range.start, &range.limit); - if (!status.ok()) - { - if (status.IsShutdownInProgress()) - { + status = rdb->CompactRange(compact_range_options, cfh, &range.start, + &range.limit); + if (!status.ok()) { + if (status.IsShutdownInProgress()) { break; } rdb_handle_io_error(status, RDB_IO_ERROR_BG_THREAD); } - std::unique_ptr it( - rdb->NewIterator(read_opts, cfh)); + std::unique_ptr it(rdb->NewIterator(read_opts, cfh)); it->Seek(key); - if (is_reverse_cf) - { - if (!it->Valid()) - { + if (is_reverse_cf) { + if (!it->Valid()) { it->SeekToLast(); - } - else - { + } else { it->Prev(); } } - if (!it->Valid()) - { - index_removed= true; - } - else - { - if (memcmp(it->key().data(), key_buf, Rdb_key_def::INDEX_NUMBER_SIZE)) - { + if (!it->Valid()) { + index_removed = true; + } else { + if (memcmp(it->key().data(), key_buf, + Rdb_key_def::INDEX_NUMBER_SIZE)) { // Key does not have same prefix - index_removed= true; + index_removed = true; } } - if (index_removed) - { + if (index_removed) { finished.insert(d); } } @@ -8847,14 +8147,11 @@ mysql_mutex_unlock(&m_signal_mutex); } - -Rdb_tbl_def* ha_rocksdb::get_table_if_exists(const char* tablename) -{ +Rdb_tbl_def *ha_rocksdb::get_table_if_exists(const char *const tablename) { DBUG_ASSERT(tablename != nullptr); std::string str; - if (rdb_normalize_tablename(tablename, &str)) - { + if (rdb_normalize_tablename(tablename, &str)) { // We were not passed table name? DBUG_ASSERT(0); return nullptr; @@ -8870,14 +8167,16 @@ tablename points to line in form "./dbname/tablename". */ -int ha_rocksdb::delete_table(const char *tablename) -{ - DBUG_ENTER("ha_rocksdb::delete_table"); - std::unique_ptr wb= dict_manager.begin(); - rocksdb::WriteBatch *batch= wb.get(); +int ha_rocksdb::delete_table(const char *const tablename) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(tablename != nullptr); + + const std::unique_ptr wb = dict_manager.begin(); + rocksdb::WriteBatch *const batch = wb.get(); /* Find the table in the hash */ - Rdb_tbl_def *tbl = get_table_if_exists(tablename); + Rdb_tbl_def *const tbl = get_table_if_exists(tablename); if (!tbl) DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); dict_manager.add_drop_table(tbl->m_key_descr_arr, tbl->m_key_count, batch); @@ -8892,17 +8191,16 @@ rdb_drop_idx_thread.signal(); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } - -void ha_rocksdb::remove_rows(Rdb_tbl_def *tbl) -{ - rocksdb::WriteOptions wo= rdb_get_rocksdb_write_options(handler::ha_thd()); +void ha_rocksdb::remove_rows(Rdb_tbl_def *const tbl) { + const rocksdb::WriteOptions wo = + rdb_get_rocksdb_write_options(handler::ha_thd()); rocksdb::ReadOptions opts; - opts.total_order_seek= true; - rocksdb::Iterator* it= rdb->NewIterator(opts); + opts.total_order_seek = true; + rocksdb::Iterator *const it = rdb->NewIterator(opts); char key_buf[MAX_KEY_LENGTH]; uint key_len; @@ -8911,18 +8209,15 @@ (This is is not crash-safe, but it doesn't matter, because bulk row deletion will be handled on rocksdb side) */ - for (uint i= 0; i < tbl->m_key_count ; i++) - { - const std::shared_ptr& kd= tbl->m_key_descr_arr[i]; - kd->get_infimum_key(reinterpret_cast(key_buf), &key_len); + for (uint i = 0; i < tbl->m_key_count; i++) { + const Rdb_key_def &kd = *tbl->m_key_descr_arr[i]; + kd.get_infimum_key(reinterpret_cast(key_buf), &key_len); - rocksdb::Slice table_key(key_buf, key_len); + const rocksdb::Slice table_key(key_buf, key_len); it->Seek(table_key); - while (it->Valid()) - { - rocksdb::Slice key= it->key(); - if (!kd->covers_key(key)) - { + while (it->Valid()) { + const rocksdb::Slice key = it->key(); + if (!kd.covers_key(key)) { break; } @@ -8936,35 +8231,32 @@ delete it; } +int ha_rocksdb::rename_table(const char *const from, const char *const to) { + DBUG_ENTER_FUNC(); -int ha_rocksdb::rename_table(const char *from, const char *to) -{ DBUG_ASSERT(from != nullptr); DBUG_ASSERT(to != nullptr); - bool write_err= false; + bool write_err = false; std::string from_str; std::string to_str; std::string from_db; std::string to_db; if (rdb_normalize_tablename(from, &from_str) || - rdb_split_normalized_tablename(from_str, &from_db)) - { - return HA_ERR_INTERNAL_ERROR; + rdb_split_normalized_tablename(from_str, &from_db)) { + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } if (rdb_normalize_tablename(to, &to_str) || - rdb_split_normalized_tablename(to_str, &to_db)) - { - return HA_ERR_INTERNAL_ERROR; + rdb_split_normalized_tablename(to_str, &to_db)) { + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } // If the user changed the database part of the name then validate that the // 'to' database exists. - if (from_db != to_db && !rdb_database_exists(to_db)) - { - return HA_ERR_INTERNAL_ERROR; + if (from_db != to_db && !rdb_database_exists(to_db)) { + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } /* Check if any index has a per-index column family */ @@ -8979,30 +8271,28 @@ it has been opened by this statement), and check is_auto_cf there. */ Rdb_tbl_def *tdef; - if (!(tdef= ddl_manager.find(from_str))) - return HA_ERR_INTERNAL_ERROR; + if (!(tdef = ddl_manager.find(from_str))) + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); - for (uint i= 0; i < tdef->m_key_count; i++) - { + for (uint i = 0; i < tdef->m_key_count; i++) { DBUG_ASSERT(tdef->m_key_descr_arr != nullptr); - if (tdef->m_key_descr_arr[i]->m_is_auto_cf) - { + if (tdef->m_key_descr_arr[i]->m_is_auto_cf) { my_error(ER_NOT_SUPPORTED_YET, MYF(0), "ALTER TABLE on table with per-index CF"); - return HA_ERR_INTERNAL_ERROR; + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } } } - std::unique_ptr wb= dict_manager.begin(); - rocksdb::WriteBatch *batch= wb.get(); + const std::unique_ptr wb = dict_manager.begin(); + rocksdb::WriteBatch *const batch = wb.get(); dict_manager.lock(); - write_err= ddl_manager.rename(from_str, to_str, batch) - || dict_manager.commit(batch); + write_err = + ddl_manager.rename(from_str, to_str, batch) || dict_manager.commit(batch); dict_manager.unlock(); - return write_err ? HA_ERR_INTERNAL_ERROR : 0; + DBUG_RETURN(write_err ? HA_ERR_INTERNAL_ERROR : 0); } /** @@ -9016,25 +8306,25 @@ */ -bool ha_rocksdb::check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes) -{ - DBUG_ENTER("ha_rocksdb::check_if_incompatible_data"); +bool ha_rocksdb::check_if_incompatible_data(HA_CREATE_INFO *const info, + uint table_changes) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(info != nullptr); + // this function is needed only for online alter-table DBUG_RETURN(COMPATIBLE_DATA_NO); } - -int ha_rocksdb::extra(enum ha_extra_function operation) -{ - DBUG_ENTER("ha_rocksdb::extra"); +int ha_rocksdb::extra(enum ha_extra_function operation) { + DBUG_ENTER_FUNC(); switch (operation) { case HA_EXTRA_KEYREAD: - m_keyread_only= true; + m_keyread_only = true; break; case HA_EXTRA_NO_KEYREAD: - m_keyread_only= false; + m_keyread_only = false; break; case HA_EXTRA_FLUSH: /* @@ -9047,94 +8337,89 @@ break; } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } /* Given a starting key and an ending key, estimate the number of rows that will exist between the two keys. */ -ha_rows ha_rocksdb::records_in_range(uint inx, key_range *min_key, - key_range *max_key) -{ - DBUG_ENTER("ha_rocksdb::records_in_range"); +ha_rows ha_rocksdb::records_in_range(uint inx, key_range *const min_key, + key_range *const max_key) { + DBUG_ENTER_FUNC(); + ha_rows ret = THDVAR(ha_thd(), records_in_range); if (ret) { DBUG_RETURN(ret); } if (table->force_index) { - ha_rows force_rows = THDVAR(ha_thd(), force_index_records_in_range); + const ha_rows force_rows = THDVAR(ha_thd(), force_index_records_in_range); if (force_rows) { DBUG_RETURN(force_rows); } } - const std::shared_ptr& kd= m_key_descr_arr[inx]; - DBUG_ASSERT(kd); + const Rdb_key_def &kd = *m_key_descr_arr[inx]; - uint size1=0; + uint size1 = 0; if (min_key) { - size1 = kd->pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple, - min_key->key, min_key->keypart_map); + size1 = kd.pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple, + min_key->key, min_key->keypart_map); if (min_key->flag == HA_READ_PREFIX_LAST_OR_PREV || min_key->flag == HA_READ_PREFIX_LAST || - min_key->flag == HA_READ_AFTER_KEY) - { - kd->successor(m_sk_packed_tuple, size1); + min_key->flag == HA_READ_AFTER_KEY) { + kd.successor(m_sk_packed_tuple, size1); } } else { - kd->get_infimum_key(m_sk_packed_tuple, &size1); + kd.get_infimum_key(m_sk_packed_tuple, &size1); } - uint size2=0; + uint size2 = 0; if (max_key) { - size2 = kd->pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple_old, - max_key->key, max_key->keypart_map); + size2 = kd.pack_index_tuple(table, m_pack_buffer, m_sk_packed_tuple_old, + max_key->key, max_key->keypart_map); if (max_key->flag == HA_READ_PREFIX_LAST_OR_PREV || max_key->flag == HA_READ_PREFIX_LAST || - max_key->flag == HA_READ_AFTER_KEY) - { - kd->successor(m_sk_packed_tuple_old, size2); + max_key->flag == HA_READ_AFTER_KEY) { + kd.successor(m_sk_packed_tuple_old, size2); } // pad the upper key with FFFFs to make sure it is more than the lower if (size1 > size2) { - memset(m_sk_packed_tuple_old+size2, 0xff, size1-size2); + memset(m_sk_packed_tuple_old + size2, 0xff, size1 - size2); size2 = size1; } } else { - kd->get_supremum_key(m_sk_packed_tuple_old, &size2); + kd.get_supremum_key(m_sk_packed_tuple_old, &size2); } - rocksdb::Slice slice1((const char*) m_sk_packed_tuple, size1); - rocksdb::Slice slice2((const char*) m_sk_packed_tuple_old, size2); + const rocksdb::Slice slice1((const char *)m_sk_packed_tuple, size1); + const rocksdb::Slice slice2((const char *)m_sk_packed_tuple_old, size2); // slice1 >= slice2 means no row will match - if (slice1.compare(slice2) >= 0) - { - DBUG_RETURN(0); + if (slice1.compare(slice2) >= 0) { + DBUG_RETURN(HA_EXIT_SUCCESS); } - rocksdb::Range r( - kd->m_is_reverse_cf ? slice2 : slice1, - kd->m_is_reverse_cf ? slice1 : slice2 - ); + rocksdb::Range r(kd.m_is_reverse_cf ? slice2 : slice1, + kd.m_is_reverse_cf ? slice1 : slice2); - uint64_t sz=0; - auto disk_size = kd->m_stats.m_actual_disk_size; + uint64_t sz = 0; + auto disk_size = kd.m_stats.m_actual_disk_size; if (disk_size == 0) - disk_size = kd->m_stats.m_data_size; - auto rows = kd->m_stats.m_rows; - if (rows == 0 || disk_size == 0) - { - rows= 1; - disk_size= ROCKSDB_ASSUMED_KEY_VALUE_DISK_SIZE; + disk_size = kd.m_stats.m_data_size; + auto rows = kd.m_stats.m_rows; + if (rows == 0 || disk_size == 0) { + rows = 1; + disk_size = ROCKSDB_ASSUMED_KEY_VALUE_DISK_SIZE; } + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // Getting statistics, including from Memtables - rdb->GetApproximateSizes( - kd->get_cf(), - &r, 1, - &sz, true); - ret = rows*sz/disk_size; + rdb->GetApproximateSizes(kd.get_cf(), &r, 1, &sz, true); +#pragma GCC diagnostic pop + + ret = rows * sz / disk_size; /* GetApproximateSizes() gives estimates so ret might exceed stats.records. @@ -9143,30 +8428,29 @@ To prevent this, changing estimated records slightly smaller than stats.records. */ - if (ret >= stats.records) - { + if (ret >= stats.records) { ret = stats.records * 0.99; } - if (rocksdb_debug_optimizer_n_rows > 0) - { - ret= rocksdb_debug_optimizer_n_rows; - } - else if (ret == 0) - { + if (rocksdb_debug_optimizer_n_rows > 0) { + ret = rocksdb_debug_optimizer_n_rows; + } else if (ret == 0) { ret = 1; } DBUG_RETURN(ret); } +void ha_rocksdb::update_create_info(HA_CREATE_INFO *const create_info) { + DBUG_ENTER_FUNC(); -void ha_rocksdb::update_create_info(HA_CREATE_INFO *create_info) -{ - if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) - { - create_info->auto_increment_value= m_tbl_def->m_auto_incr_val; + DBUG_ASSERT(create_info != nullptr); + + if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) { + create_info->auto_increment_value = m_tbl_def->m_auto_incr_val; } + + DBUG_VOID_RETURN; } /** @@ -9183,86 +8467,81 @@ column family, the first row of the next index id should be the last row of the previous index id. */ -int ha_rocksdb::optimize(THD *thd, HA_CHECK_OPT* check_opt) -{ - int rc= 0; - for (uint i= 0; i < table->s->keys; i++) - { - uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE*2]; +int ha_rocksdb::optimize(THD *const thd, HA_CHECK_OPT *const check_opt) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(thd != nullptr); + DBUG_ASSERT(check_opt != nullptr); + + int rc = 0; + for (uint i = 0; i < table->s->keys; i++) { + uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2]; auto range = get_range(i, buf); if (!rdb->CompactRange(rocksdb::CompactRangeOptions(), - m_key_descr_arr[i]->get_cf(), - &range.start, &range.limit).ok()) - { - rc= 1; + m_key_descr_arr[i]->get_cf(), &range.start, + &range.limit) + .ok()) { + rc = 1; break; } } - return rc; -} -int ha_rocksdb::analyze(THD* thd, HA_CHECK_OPT* check_opt) -{ - DBUG_ENTER("ha_rocksdb::analyze"); + DBUG_RETURN(rc); +} - if (!table) - DBUG_RETURN(1); +int ha_rocksdb::calculate_stats(const TABLE *const table_arg, THD *const thd, + HA_CHECK_OPT *const check_opt) { + DBUG_ENTER_FUNC(); // find per column family key ranges which need to be queried - std::unordered_map> - ranges; + std::unordered_map> + ranges; std::unordered_set ids_to_check; - std::vector buf(table->s->keys * 2 * Rdb_key_def::INDEX_NUMBER_SIZE); - for (uint i = 0; i < table->s->keys; i++) - { - auto bufp = &buf[i * 2 * Rdb_key_def::INDEX_NUMBER_SIZE]; - const std::shared_ptr& kd= m_key_descr_arr[i]; - ranges[kd->get_cf()].push_back(get_range(i, bufp)); - ids_to_check.insert(kd->get_gl_index_id()); + std::vector buf(table_arg->s->keys * 2 * + Rdb_key_def::INDEX_NUMBER_SIZE); + for (uint i = 0; i < table_arg->s->keys; i++) { + const auto bufp = &buf[i * 2 * Rdb_key_def::INDEX_NUMBER_SIZE]; + const Rdb_key_def &kd = *m_key_descr_arr[i]; + ranges[kd.get_cf()].push_back(get_range(i, bufp)); + ids_to_check.insert(kd.get_gl_index_id()); } // for analyze statements, force flush on memtable to get accurate cardinality - Rdb_cf_manager& cf_manager= rdb_get_cf_manager(); + Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); if (thd != nullptr && THDVAR(thd, flush_memtable_on_analyze) && - !rocksdb_pause_background_work) - { - for (auto it : ids_to_check) - { + !rocksdb_pause_background_work) { + for (auto it : ids_to_check) { rdb->Flush(rocksdb::FlushOptions(), cf_manager.get_cf(it.cf_id)); } } // get RocksDB table properties for these ranges rocksdb::TablePropertiesCollection props; - for (auto it : ranges) - { - auto old_size __attribute__((__unused__)) = props.size(); - auto status = rdb->GetPropertiesOfTablesInRange( - it.first, &it.second[0], it.second.size(), &props); + for (auto it : ranges) { + const auto old_size __attribute__((__unused__)) = props.size(); + const auto status = rdb->GetPropertiesOfTablesInRange( + it.first, &it.second[0], it.second.size(), &props); DBUG_ASSERT(props.size() >= old_size); if (!status.ok()) DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } - int num_sst= 0; + int num_sst = 0; // group stats per index id std::unordered_map stats; - for (auto it : ids_to_check) - { + for (const auto &it : ids_to_check) { // Initialize the stats to 0. If there are no files that contain // this gl_index_id, then 0 should be stored for the cached stats. stats[it] = Rdb_index_stats(it); } - for (auto it : props) - { + for (const auto &it : props) { std::vector sst_stats; Rdb_tbl_prop_coll::read_stats_from_tbl_props(it.second, &sst_stats); /* sst_stats is a list of index statistics for indexes that have entries in the current SST file. */ - for (auto it1 : sst_stats) - { + for (const auto &it1 : sst_stats) { /* Only update statistics for indexes that belong to this SQL table. @@ -9274,8 +8553,8 @@ if (ids_to_check.find(it1.m_gl_index_id) == ids_to_check.end()) continue; - const std::shared_ptr& kd= - ddl_manager.find(it1.m_gl_index_id); + auto kd = ddl_manager.safe_find(it1.m_gl_index_id); + DBUG_ASSERT(kd != nullptr); stats[it1.m_gl_index_id].merge(it1, true, kd->max_storage_fmt_length()); } num_sst++; @@ -9285,14 +8564,23 @@ ddl_manager.set_stats(stats); ddl_manager.persist_stats(true); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); +} + +int ha_rocksdb::analyze(THD *const thd, HA_CHECK_OPT *const check_opt) { + DBUG_ENTER_FUNC(); + + if (!table) { + DBUG_RETURN(HA_EXIT_FAILURE); + } + + DBUG_RETURN(calculate_stats(table, thd, check_opt)); } -void ha_rocksdb::get_auto_increment(ulonglong offset, ulonglong increment, +void ha_rocksdb::get_auto_increment(ulonglong off, ulonglong inc, ulonglong nb_desired_values, - ulonglong *first_value, - ulonglong *nb_reserved_values) -{ + ulonglong *const first_value, + ulonglong *const nb_reserved_values) { /* MySQL has a somewhat complicated way of handling the auto-increment value. The first time get_auto_increment is called for a statement, @@ -9308,24 +8596,59 @@ m_auto_incr_val this should be safe - if we had to grab a mutex, doing an actual reserve of some values might be a better solution. */ - *first_value= m_tbl_def->m_auto_incr_val++; - *nb_reserved_values= 1; -} + DEBUG_SYNC(ha_thd(), "rocksdb.autoinc_vars"); + + if (off > inc) { + off = 1; + } + + // Local variable reference to simplify code below + std::atomic &auto_incr = m_tbl_def->m_auto_incr_val; + + if (inc == 1 && off == 1) { + // Optimization for the standard case where we are always simply + // incrementing from the last position + *first_value = auto_incr++; + } else { + // The next value can be more complicated if either `inc` or 'off' is not 1 + longlong new_val; + longlong last_val = auto_incr; + + // Loop until we can correctly update the atomic value + do { + // Calculate the next value in the auto increment series: + // offset + N * increment + // where N is 0, 1, 2, ... + // + // For further information please visit: + // http://dev.mysql.com/doc/refman/5.7/en/replication-options-master.html + new_val = ((last_val + (inc - off) - 1) / inc) * inc + off; + + // Attempt to store the new value (plus 1 since m_auto_incr_val contains + // the next available value) into the atomic value. If the current + // value no longer matches what we have in 'last_val' this will fail and + // we will repeat the loop (`last_val` will automatically get updated + // with the current value). + } while (!auto_incr.compare_exchange_weak(last_val, new_val + 1)); + + *first_value = new_val; + } + *nb_reserved_values = 1; +} #ifndef DBUG_OFF /* Debugger help function */ static char dbug_item_print_buf[512]; -const char *dbug_print_item(Item *item) -{ - char *buf= dbug_item_print_buf; +const char *dbug_print_item(Item *const item) { + char *const buf = dbug_item_print_buf; String str(buf, sizeof(dbug_item_print_buf), &my_charset_bin); str.length(0); if (!item) return "(Item*)nullptr"; - item->print(&str ,QT_ORDINARY); + item->print(&str, QT_ORDINARY); if (str.c_ptr() == buf) return buf; else @@ -9334,7 +8657,6 @@ #endif /*DBUG_OFF*/ - /** SQL layer calls this function to push an index condition. @@ -9356,8 +8678,9 @@ Part of condition we couldn't check (always nullptr). */ -class Item* ha_rocksdb::idx_cond_push(uint keyno, class Item* idx_cond) -{ +class Item *ha_rocksdb::idx_cond_push(uint keyno, class Item *const idx_cond) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(keyno != MAX_KEY); DBUG_ASSERT(idx_cond != nullptr); @@ -9366,10 +8689,9 @@ in_range_check_pushed_down = TRUE; /* We will check the whole condition */ - return nullptr; + DBUG_RETURN(nullptr); } - /* @brief Check the index condition. @@ -9388,13 +8710,11 @@ and return it) */ -enum icp_result ha_rocksdb::check_index_cond() -{ +enum icp_result ha_rocksdb::check_index_cond() const { DBUG_ASSERT(pushed_idx_cond); DBUG_ASSERT(pushed_idx_cond_keyno != MAX_KEY); - if (end_range && compare_key_icp(end_range) > 0) - { + if (end_range && compare_key_icp(end_range) > 0) { /* caller should return HA_ERR_END_OF_FILE already */ return ICP_OUT_OF_RANGE; } @@ -9402,7 +8722,6 @@ return pushed_idx_cond->val_int() ? ICP_MATCH : ICP_NO_MATCH; } - /** Checking if an index is used for ascending scan or not @@ -9414,39 +8733,32 @@ @param kd @param find_flag */ -bool ha_rocksdb::is_ascending(const std::shared_ptr& kd, - enum ha_rkey_function find_flag) const -{ - DBUG_ASSERT(kd != nullptr); - +bool ha_rocksdb::is_ascending(const Rdb_key_def &kd, + enum ha_rkey_function find_flag) const { bool is_ascending; switch (find_flag) { - case HA_READ_KEY_EXACT: - { - is_ascending = !kd->m_is_reverse_cf; + case HA_READ_KEY_EXACT: { + is_ascending = !kd.m_is_reverse_cf; break; } - case HA_READ_PREFIX: - { - is_ascending= true; + case HA_READ_PREFIX: { + is_ascending = true; break; } case HA_READ_KEY_OR_NEXT: - case HA_READ_AFTER_KEY: - { - is_ascending = !kd->m_is_reverse_cf; + case HA_READ_AFTER_KEY: { + is_ascending = !kd.m_is_reverse_cf; break; } case HA_READ_KEY_OR_PREV: case HA_READ_BEFORE_KEY: case HA_READ_PREFIX_LAST: - case HA_READ_PREFIX_LAST_OR_PREV: - { - is_ascending = kd->m_is_reverse_cf; + case HA_READ_PREFIX_LAST_OR_PREV: { + is_ascending = kd.m_is_reverse_cf; break; } default: - is_ascending= false; + is_ascending = false; } return is_ascending; } @@ -9456,16 +8768,23 @@ */ my_core::enum_alter_inplace_result ha_rocksdb::check_if_supported_inplace_alter( - TABLE* /* altered_table */, - my_core::Alter_inplace_info *ha_alter_info) -{ - DBUG_ENTER("check_if_supported_alter"); + TABLE *altered_table, my_core::Alter_inplace_info *const ha_alter_info) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(ha_alter_info != nullptr); if (ha_alter_info->handler_flags & ~(my_core::Alter_inplace_info::DROP_INDEX | my_core::Alter_inplace_info::DROP_UNIQUE_INDEX | - my_core::Alter_inplace_info::ADD_INDEX)) - { + my_core::Alter_inplace_info::ADD_INDEX | + my_core::Alter_inplace_info::ADD_UNIQUE_INDEX)) { + DBUG_RETURN(my_core::HA_ALTER_INPLACE_NOT_SUPPORTED); + } + + /* We don't support unique keys on table w/ no primary keys */ + if ((ha_alter_info->handler_flags & + my_core::Alter_inplace_info::ADD_UNIQUE_INDEX) && + has_hidden_pk(altered_table)) { DBUG_RETURN(my_core::HA_ALTER_INPLACE_NOT_SUPPORTED); } @@ -9501,37 +8820,41 @@ @retval false Success */ bool ha_rocksdb::prepare_inplace_alter_table( - TABLE *altered_table, - my_core::Alter_inplace_info *ha_alter_info) -{ - DBUG_ENTER("prepare_inplace_alter_table"); - uint n_dropped_keys= ha_alter_info->index_drop_count; - uint n_added_keys= ha_alter_info->index_add_count; - uint old_n_keys= m_tbl_def->m_key_count; - uint new_n_keys= altered_table->s->keys; - if (has_hidden_pk(altered_table)) - { + TABLE *const altered_table, + my_core::Alter_inplace_info *const ha_alter_info) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(altered_table != nullptr); + DBUG_ASSERT(ha_alter_info != nullptr); + + const uint n_dropped_keys = ha_alter_info->index_drop_count; + const uint n_added_keys = ha_alter_info->index_add_count; + const uint old_n_keys = m_tbl_def->m_key_count; + uint new_n_keys = altered_table->s->keys; + + if (has_hidden_pk(altered_table)) { new_n_keys += 1; } - std::shared_ptr* old_key_descr= m_tbl_def->m_key_descr_arr; - std::shared_ptr* new_key_descr= + std::shared_ptr *const old_key_descr = + m_tbl_def->m_key_descr_arr; + std::shared_ptr *const new_key_descr = new std::shared_ptr[new_n_keys]; - Rdb_tbl_def* new_tdef= new Rdb_tbl_def(m_tbl_def->full_tablename()); - new_tdef->m_key_descr_arr= new_key_descr; - new_tdef->m_key_count= new_n_keys; - new_tdef->m_auto_incr_val= - m_tbl_def->m_auto_incr_val.load(std::memory_order_relaxed); - new_tdef->m_hidden_pk_val= - m_tbl_def->m_hidden_pk_val.load(std::memory_order_relaxed); + Rdb_tbl_def *const new_tdef = new Rdb_tbl_def(m_tbl_def->full_tablename()); + new_tdef->m_key_descr_arr = new_key_descr; + new_tdef->m_key_count = new_n_keys; + new_tdef->m_auto_incr_val = + m_tbl_def->m_auto_incr_val.load(std::memory_order_relaxed); + new_tdef->m_hidden_pk_val = + m_tbl_def->m_hidden_pk_val.load(std::memory_order_relaxed); if (ha_alter_info->handler_flags & - (my_core::Alter_inplace_info::DROP_INDEX | - my_core::Alter_inplace_info::DROP_UNIQUE_INDEX | - my_core::Alter_inplace_info::ADD_INDEX) - && create_key_defs(altered_table, new_tdef, table, m_tbl_def)) - { + (my_core::Alter_inplace_info::DROP_INDEX | + my_core::Alter_inplace_info::DROP_UNIQUE_INDEX | + my_core::Alter_inplace_info::ADD_INDEX | + my_core::Alter_inplace_info::ADD_UNIQUE_INDEX) && + create_key_defs(altered_table, new_tdef, table, m_tbl_def)) { /* Delete the new key descriptors */ delete[] new_key_descr; @@ -9539,9 +8862,13 @@ Explicitly mark as nullptr so we don't accidentally remove entries from data dictionary on cleanup (or cause double delete[]). */ - new_tdef->m_key_descr_arr= nullptr; + new_tdef->m_key_descr_arr = nullptr; delete new_tdef; - DBUG_RETURN(1); + + my_printf_error(ER_UNKNOWN_ERROR, + "MyRocks failed creating new key definitions during alter.", + MYF(0)); + DBUG_RETURN(HA_EXIT_FAILURE); } std::unordered_set> added_indexes; @@ -9549,16 +8876,13 @@ uint i; uint j; - const KEY* key; + const KEY *key; /* Determine which(if any) key definition(s) need to be dropped */ - for (i = 0; i < ha_alter_info->index_drop_count; i++) - { - const KEY* key = ha_alter_info->index_drop_buffer[i]; - for (j = 0; j < old_n_keys; j++) - { - if (!old_key_descr[j]->m_name.compare(key->name)) - { + for (i = 0; i < ha_alter_info->index_drop_count; i++) { + const KEY *const key = ha_alter_info->index_drop_buffer[i]; + for (j = 0; j < old_n_keys; j++) { + if (!old_key_descr[j]->m_name.compare(key->name)) { dropped_index_ids.insert(old_key_descr[j]->get_gl_index_id()); break; } @@ -9568,14 +8892,10 @@ DBUG_ASSERT(dropped_index_ids.size() == ha_alter_info->index_drop_count); /* Determine which(if any) key definitions(s) need to be added */ - for (i = 0; i < ha_alter_info->index_add_count; i++) - { - key = &ha_alter_info->key_info_buffer[ - ha_alter_info->index_add_buffer[i]]; - for (j = 0; j < new_n_keys; j++) - { - if (!new_key_descr[j]->m_name.compare(key->name)) - { + for (i = 0; i < ha_alter_info->index_add_count; i++) { + key = &ha_alter_info->key_info_buffer[ha_alter_info->index_add_buffer[i]]; + for (j = 0; j < new_n_keys; j++) { + if (!new_key_descr[j]->m_name.compare(key->name)) { added_indexes.insert(new_key_descr[j]); break; } @@ -9584,11 +8904,11 @@ DBUG_ASSERT(added_indexes.size() == ha_alter_info->index_add_count); - ha_alter_info->handler_ctx= new Rdb_inplace_alter_ctx( - new_tdef, old_key_descr, new_key_descr, old_n_keys, new_n_keys, - added_indexes, dropped_index_ids, n_added_keys, n_dropped_keys); + ha_alter_info->handler_ctx = new Rdb_inplace_alter_ctx( + new_tdef, old_key_descr, new_key_descr, old_n_keys, new_n_keys, + added_indexes, dropped_index_ids, n_added_keys, n_dropped_keys); - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } /** @@ -9611,53 +8931,74 @@ @retval true Error @retval false Success */ -bool ha_rocksdb::inplace_alter_table(TABLE* altered_table, - my_core::Alter_inplace_info *ha_alter_info) -{ - /* Do nothing for now */ - DBUG_ENTER("inplace_alter_table"); - DBUG_ASSERT(ha_alter_info->handler_ctx); +bool ha_rocksdb::inplace_alter_table( + TABLE *const altered_table, + my_core::Alter_inplace_info *const ha_alter_info) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(altered_table != nullptr); + DBUG_ASSERT(ha_alter_info != nullptr); + DBUG_ASSERT(ha_alter_info->handler_ctx != nullptr); - Rdb_inplace_alter_ctx* ctx= - static_cast (ha_alter_info->handler_ctx); + Rdb_inplace_alter_ctx *const ctx = + static_cast(ha_alter_info->handler_ctx); - if (ha_alter_info->handler_flags & my_core::Alter_inplace_info::ADD_INDEX) - { + if (ha_alter_info->handler_flags & + (my_core::Alter_inplace_info::ADD_INDEX | + my_core::Alter_inplace_info::ADD_UNIQUE_INDEX)) { /* Buffers need to be set up again to account for new, possibly longer secondary keys. */ free_key_buffers(); - if (alloc_key_buffers(altered_table, ctx->m_new_tdef)) - { - DBUG_RETURN(1); + + DBUG_ASSERT(ctx != nullptr); + + /* + If adding unique index, allocate special buffers for duplicate checking. + */ + int err; + if ((err = alloc_key_buffers( + altered_table, ctx->m_new_tdef, + ha_alter_info->handler_flags & + my_core::Alter_inplace_info::ADD_UNIQUE_INDEX))) { + my_printf_error(ER_UNKNOWN_ERROR, + "MyRocks failed allocating key buffers during alter.", + MYF(0)); + DBUG_RETURN(err); } - /* Populate all new secondary keys by scanning primary key */ - if (inplace_populate_sk(altered_table, ctx->m_added_indexes)) - { - DBUG_RETURN(1); + /* Populate all new secondary keys by scanning the primary key. */ + if ((err = inplace_populate_sk(altered_table, ctx->m_added_indexes))) { + my_printf_error(ER_UNKNOWN_ERROR, + "MyRocks failed populating secondary key during alter.", + MYF(0)); + DBUG_RETURN(HA_EXIT_FAILURE); } } - DBUG_EXECUTE_IF("myrocks_simulate_index_create_rollback", DBUG_RETURN(1);); - DBUG_RETURN(0); + DBUG_EXECUTE_IF("myrocks_simulate_index_create_rollback", { + dbug_create_err_inplace_alter(); + DBUG_RETURN(HA_EXIT_FAILURE); + };); + + DBUG_RETURN(HA_EXIT_SUCCESS); } /** Scan the Primary Key index entries and populate the new secondary keys. */ -int ha_rocksdb::inplace_populate_sk(const TABLE* new_table_arg, - const std::unordered_set>& indexes) -{ - DBUG_ENTER("ha_rocksdb::inplace_populate_sk"); - std::unique_ptr wb= dict_manager.begin(); - rocksdb::WriteBatch *batch= wb.get(); +int ha_rocksdb::inplace_populate_sk( + TABLE *const new_table_arg, + const std::unordered_set> &indexes) { + DBUG_ENTER_FUNC(); + + const std::unique_ptr wb = dict_manager.begin(); + rocksdb::WriteBatch *const batch = wb.get(); /* Update the data dictionary */ std::unordered_set create_index_ids; - for (auto& index : indexes) - { + for (const auto &index : indexes) { create_index_ids.insert(index->get_gl_index_id()); } dict_manager.add_create_index(create_index_ids, batch); @@ -9665,20 +9006,57 @@ const bool hidden_pk_exists = has_hidden_pk(table); - int res= 0; - Rdb_transaction *tx; - ulonglong rdb_merge_buf_size= THDVAR(ha_thd(), merge_buf_size); - ulonglong rdb_merge_combine_read_size= THDVAR(ha_thd(), - merge_combine_read_size); + int res = 0; + Rdb_transaction *tx = get_or_create_tx(table->in_use); - for (auto& index : indexes) - { - const rocksdb::Comparator* index_comp= index->get_cf()->GetComparator(); - Rdb_index_merge rdb_merge(rdb_merge_buf_size, rdb_merge_combine_read_size, - index_comp); + /* + There is one specific scenario where m_sst_info may not be nullptr. This + happens if the handler we're using happens to be the handler where the PK + bulk load was done on. The sequence of events that lead to this is as + follows (T1 is PK bulk load, T2 is SK alter table): + + T1: Execute last INSERT statement + T1: Return TABLE and handler object back to Table_cache_manager + T1: Close connection + T2: Execute ALTER statement + T2: Take same TABLE/handler from Table_cache_manager + T2: Call closefrm which will call finalize_bulk_load on every other open + table/handler *except* the one it's on. + T2: Acquire stale snapshot of PK + T1: Call finalize_bulk_load + + This is rare because usually, closefrm will call the destructor (and thus + finalize_bulk_load) on the handler where PK bulk load is done. However, if + the thread ids of the bulk load thread and the alter thread differ by a + multiple of table_cache_instances (8 by default), then they hash to the + same bucket in Table_cache_manager and the alter thread will not not call + the destructor on the handler it is holding. Thus, its m_sst_info will not + be nullptr. + + At this point, it is safe to refresh the snapshot because we know all other + open handlers have been closed at this point, and the one we're on is the + only one left. + */ + if (m_sst_info != nullptr) { + if ((res = finalize_bulk_load())) { + DBUG_RETURN(res); + } + tx->commit(); + } - if ((res= rdb_merge.init())) - { + const ulonglong rdb_merge_buf_size = THDVAR(ha_thd(), merge_buf_size); + const ulonglong rdb_merge_combine_read_size = + THDVAR(ha_thd(), merge_combine_read_size); + + for (const auto &index : indexes) { + const rocksdb::Comparator *index_comp = index->get_cf()->GetComparator(); + bool is_unique_index = + new_table_arg->key_info[index->get_keyno()].flags & HA_NOSAME; + + Rdb_index_merge rdb_merge(thd_rocksdb_tmpdir(), rdb_merge_buf_size, + rdb_merge_combine_read_size, index_comp); + + if ((res = rdb_merge.init())) { DBUG_RETURN(res); } @@ -9687,17 +9065,14 @@ as the pk index position may have changed in the case of hidden primary keys. */ - uint pk= pk_index(table, m_tbl_def); + const uint pk = pk_index(table, m_tbl_def); ha_index_init(pk, true); /* Scan each record in the primary key in order */ for (res = index_first(table->record[0]); res == 0; - res = index_next(table->record[0])) - { - longlong hidden_pk_id= 0; - if (hidden_pk_exists && - read_hidden_pk_id_from_rowkey(&hidden_pk_id)) - { + res = index_next(table->record[0])) { + longlong hidden_pk_id = 0; + if (hidden_pk_exists && read_hidden_pk_id_from_rowkey(&hidden_pk_id)) { // NO_LINT_DEBUG sql_print_error("Error retrieving hidden pk id."); ha_index_end(); @@ -9705,38 +9080,33 @@ } /* Create new secondary index entry */ - int new_packed_size= index->pack_record(new_table_arg, m_pack_buffer, - table->record[0], - m_sk_packed_tuple, &m_sk_tails, - should_store_checksums(), - hidden_pk_id); - - rocksdb::Slice key= rocksdb::Slice( - reinterpret_cast(m_sk_packed_tuple), new_packed_size); - rocksdb::Slice val= rocksdb::Slice( - reinterpret_cast(m_sk_tails.ptr()), - m_sk_tails.get_current_pos()); + const int new_packed_size = index->pack_record( + new_table_arg, m_pack_buffer, table->record[0], m_sk_packed_tuple, + &m_sk_tails, should_store_row_debug_checksums(), hidden_pk_id); + + const rocksdb::Slice key = rocksdb::Slice( + reinterpret_cast(m_sk_packed_tuple), new_packed_size); + const rocksdb::Slice val = + rocksdb::Slice(reinterpret_cast(m_sk_tails.ptr()), + m_sk_tails.get_current_pos()); /* Add record to offset tree in preparation for writing out to disk in sorted chunks. */ - if ((res= rdb_merge.add(key, val))) - { + if ((res = rdb_merge.add(key, val))) { ha_index_end(); DBUG_RETURN(res); } } - if (res != HA_ERR_END_OF_FILE) - { + if (res != HA_ERR_END_OF_FILE) { // NO_LINT_DEBUG sql_print_error("Error retrieving index entry from primary key."); ha_index_end(); DBUG_RETURN(res); } - tx= get_or_create_tx(table->in_use); ha_index_end(); /* @@ -9745,13 +9115,39 @@ */ rocksdb::Slice merge_key; rocksdb::Slice merge_val; - while ((res= rdb_merge.next(&merge_key, &merge_val)) == 0) - { + + struct unique_sk_buf_info sk_info; + sk_info.dup_sk_buf = m_dup_sk_packed_tuple; + sk_info.dup_sk_buf_old = m_dup_sk_packed_tuple_old; + + while ((res = rdb_merge.next(&merge_key, &merge_val)) == 0) { + /* Perform uniqueness check if needed */ + if (is_unique_index) { + if (check_duplicate_sk(new_table_arg, *index, &merge_key, &sk_info)) { + /* + Duplicate entry found when trying to create unique secondary key. + We need to unpack the record into new_table_arg->record[0] as it + is used inside print_keydup_error so that the error message shows + the duplicate record. + */ + if (index->unpack_record(new_table_arg, new_table_arg->record[0], + &merge_key, nullptr, + m_verify_row_debug_checksums)) { + /* Should never reach here */ + DBUG_ASSERT(0); + } + + print_keydup_error(new_table_arg, + &new_table_arg->key_info[index->get_keyno()], + MYF(0)); + DBUG_RETURN(ER_DUP_ENTRY); + } + } + /* Insert key and slice to SST via SSTFileWriter API. */ - if ((res= bulk_load_key(tx, index, merge_key, merge_val))) - { + if ((res = bulk_load_key(tx, *index, merge_key, merge_val))) { break; } } @@ -9760,15 +9156,13 @@ Here, res == -1 means that we are finished, while > 0 means an error occurred. */ - if (res > 0) - { + if (res > 0) { // NO_LINT_DEBUG sql_print_error("Error while bulk loading keys in external merge sort."); DBUG_RETURN(res); } - if ((res= tx->finish_bulk_load())) - { + if ((res = tx->finish_bulk_load())) { // NO_LINT_DEBUG sql_print_error("Error finishing bulk load."); DBUG_RETURN(res); @@ -9818,14 +9212,15 @@ @retval false Success */ bool ha_rocksdb::commit_inplace_alter_table( - my_core::TABLE *altered_table, - my_core::Alter_inplace_info *ha_alter_info, - bool commit) -{ - Rdb_inplace_alter_ctx* ctx0= - static_cast (ha_alter_info->handler_ctx); + my_core::TABLE *const altered_table, + my_core::Alter_inplace_info *const ha_alter_info, bool commit) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(altered_table != nullptr); + DBUG_ASSERT(ha_alter_info != nullptr); - DBUG_ENTER("commit_inplace_alter_table"); + Rdb_inplace_alter_ctx *const ctx0 = + static_cast(ha_alter_info->handler_ctx); /* IMPORTANT: When rollback is requested, mysql will abort with @@ -9837,12 +9232,10 @@ is done for each partition. A successful commit call only executes once for all partitions. */ - if (!commit) - { + if (!commit) { /* If ctx has not been created yet, nothing to do here */ - if (!ctx0) - { - DBUG_RETURN(0); + if (!ctx0) { + DBUG_RETURN(HA_EXIT_SUCCESS); } /* @@ -9850,12 +9243,10 @@ erase the mappings inside the ddl_manager, as the old_key_descr is still using them. */ - if (ctx0->m_new_key_descr) - { + if (ctx0->m_new_key_descr) { /* Delete the new key descriptors */ - for (uint i = 0; i < ctx0->m_new_tdef->m_key_count; i++) - { - ctx0->m_new_key_descr[i]= nullptr; + for (uint i = 0; i < ctx0->m_new_tdef->m_key_count; i++) { + ctx0->m_new_key_descr[i] = nullptr; } delete[] ctx0->m_new_key_descr; @@ -9865,7 +9256,10 @@ delete ctx0->m_new_tdef; } - DBUG_RETURN(0); + /* Rollback any partially created indexes */ + dict_manager.rollback_ongoing_index_creation(); + + DBUG_RETURN(HA_EXIT_SUCCESS); } DBUG_ASSERT(ctx0); @@ -9874,17 +9268,13 @@ For partitioned tables, we need to commit all changes to all tables at once, unlike in the other inplace alter API methods. */ - inplace_alter_handler_ctx** ctx_array; - inplace_alter_handler_ctx* ctx_single[2]; + inplace_alter_handler_ctx **ctx_array; + inplace_alter_handler_ctx *ctx_single[2]; - if (ha_alter_info->group_commit_ctx) - { - DBUG_EXECUTE_IF("crash_during_index_creation_partition", - DBUG_SUICIDE();); + if (ha_alter_info->group_commit_ctx) { + DBUG_EXECUTE_IF("crash_during_index_creation_partition", DBUG_SUICIDE();); ctx_array = ha_alter_info->group_commit_ctx; - } - else - { + } else { ctx_single[0] = ctx0; ctx_single[1] = nullptr; ctx_array = ctx_single; @@ -9896,31 +9286,29 @@ if (ha_alter_info->handler_flags & (my_core::Alter_inplace_info::DROP_INDEX | my_core::Alter_inplace_info::DROP_UNIQUE_INDEX | - my_core::Alter_inplace_info::ADD_INDEX)) - { - std::unique_ptr wb= dict_manager.begin(); - rocksdb::WriteBatch *batch= wb.get(); + my_core::Alter_inplace_info::ADD_INDEX | + my_core::Alter_inplace_info::ADD_UNIQUE_INDEX)) { + const std::unique_ptr wb = dict_manager.begin(); + rocksdb::WriteBatch *const batch = wb.get(); std::unordered_set create_index_ids; - m_tbl_def= ctx0->m_new_tdef; - m_key_descr_arr= m_tbl_def->m_key_descr_arr; - m_pk_descr= m_key_descr_arr[pk_index(altered_table, m_tbl_def)]; + m_tbl_def = ctx0->m_new_tdef; + m_key_descr_arr = m_tbl_def->m_key_descr_arr; + m_pk_descr = m_key_descr_arr[pk_index(altered_table, m_tbl_def)]; dict_manager.lock(); - for (inplace_alter_handler_ctx** pctx = ctx_array; *pctx; pctx++) - { - Rdb_inplace_alter_ctx* ctx= static_cast (*pctx); + for (inplace_alter_handler_ctx **pctx = ctx_array; *pctx; pctx++) { + Rdb_inplace_alter_ctx *const ctx = + static_cast(*pctx); /* Mark indexes to be dropped */ dict_manager.add_drop_index(ctx->m_dropped_index_ids, batch); - for (auto& index : ctx->m_added_indexes) - { + for (const auto &index : ctx->m_added_indexes) { create_index_ids.insert(index->get_gl_index_id()); } - if (ddl_manager.put_and_write(ctx->m_new_tdef, batch)) - { + if (ddl_manager.put_and_write(ctx->m_new_tdef, batch)) { /* Failed to write new entry into data dictionary, this should never happen. @@ -9929,8 +9317,7 @@ } } - if (dict_manager.commit(batch)) - { + if (dict_manager.commit(batch)) { /* Should never reach here. We assume MyRocks will abort if commit fails. */ @@ -9940,34 +9327,46 @@ dict_manager.unlock(); /* Mark ongoing create indexes as finished/remove from data dictionary */ - dict_manager.finish_indexes_operation(create_index_ids, - Rdb_key_def::DDL_CREATE_INDEX_ONGOING); + dict_manager.finish_indexes_operation( + create_index_ids, Rdb_key_def::DDL_CREATE_INDEX_ONGOING); + + /* + We need to recalculate the index stats here manually. The reason is that + the secondary index does not exist inside + m_index_num_to_keydef until it is committed to the data dictionary, which + prevents us from updating the stats normally as the ddl_manager cannot + find the proper gl_index_ids yet during adjust_stats calls. + */ + if (calculate_stats(altered_table, nullptr, nullptr)) { + /* Failed to update index statistics, should never happen */ + DBUG_ASSERT(0); + } + rdb_drop_idx_thread.signal(); } - DBUG_RETURN(0); + DBUG_RETURN(HA_EXIT_SUCCESS); } #define SHOW_FNAME(name) rocksdb_show_##name -#define DEF_SHOW_FUNC(name, key) \ - static int SHOW_FNAME(name)(MYSQL_THD thd, SHOW_VAR *var, char *buff) \ - { \ - rocksdb_status_counters.name = \ - rocksdb_stats->getTickerCount(rocksdb::key); \ - var->type = SHOW_LONGLONG; \ - var->value = (char *)&rocksdb_status_counters.name; \ - return 0; \ +#define DEF_SHOW_FUNC(name, key) \ + static int SHOW_FNAME(name)(MYSQL_THD thd, SHOW_VAR * var, char *buff) { \ + rocksdb_status_counters.name = \ + rocksdb_stats->getTickerCount(rocksdb::key); \ + var->type = SHOW_LONGLONG; \ + var->value = (char *)&rocksdb_status_counters.name; \ + return HA_EXIT_SUCCESS; \ } -#define DEF_STATUS_VAR(name) \ - {"rocksdb_" #name, (char*) &SHOW_FNAME(name), SHOW_FUNC} +#define DEF_STATUS_VAR(name) \ + { "rocksdb_" #name, (char *)&SHOW_FNAME(name), SHOW_FUNC } -#define DEF_STATUS_VAR_PTR(name, ptr, option) \ - {"rocksdb_" name, (char*) ptr, option} +#define DEF_STATUS_VAR_PTR(name, ptr, option) \ + { "rocksdb_" name, (char *)ptr, option } -#define DEF_STATUS_VAR_FUNC(name, ptr, option) \ - {name, reinterpret_cast(ptr), option} +#define DEF_STATUS_VAR_FUNC(name, ptr, option) \ + { name, reinterpret_cast(ptr), option } struct rocksdb_status_counters_t { uint64_t block_cache_miss; @@ -10003,7 +9402,6 @@ uint64_t number_multiget_bytes_read; uint64_t number_deletes_filtered; uint64_t number_merge_failures; - uint64_t sequence_number; uint64_t bloom_filter_prefix_checked; uint64_t bloom_filter_prefix_useful; uint64_t number_reseeks_iteration; @@ -10060,7 +9458,6 @@ DEF_SHOW_FUNC(number_multiget_bytes_read, NUMBER_MULTIGET_BYTES_READ) DEF_SHOW_FUNC(number_deletes_filtered, NUMBER_FILTERED_DELETES) DEF_SHOW_FUNC(number_merge_failures, NUMBER_MERGE_FAILURES) -DEF_SHOW_FUNC(sequence_number, SEQUENCE_NUMBER) DEF_SHOW_FUNC(bloom_filter_prefix_checked, BLOOM_FILTER_PREFIX_CHECKED) DEF_SHOW_FUNC(bloom_filter_prefix_useful, BLOOM_FILTER_PREFIX_USEFUL) DEF_SHOW_FUNC(number_reseeks_iteration, NUMBER_OF_RESEEKS_IN_ITERATION) @@ -10093,160 +9490,165 @@ export_stats.system_rows_updated = global_stats.system_rows[ROWS_UPDATED]; } -static SHOW_VAR myrocks_status_variables[]= { - DEF_STATUS_VAR_FUNC("rows_deleted", &export_stats.rows_deleted, - SHOW_LONGLONG), - DEF_STATUS_VAR_FUNC("rows_inserted", &export_stats.rows_inserted, - SHOW_LONGLONG), - DEF_STATUS_VAR_FUNC("rows_read", &export_stats.rows_read, SHOW_LONGLONG), - DEF_STATUS_VAR_FUNC("rows_updated", &export_stats.rows_updated, - SHOW_LONGLONG), - DEF_STATUS_VAR_FUNC("system_rows_deleted", &export_stats.system_rows_deleted, - SHOW_LONGLONG), - DEF_STATUS_VAR_FUNC("system_rows_inserted", - &export_stats.system_rows_inserted, SHOW_LONGLONG), - DEF_STATUS_VAR_FUNC("system_rows_read", &export_stats.system_rows_read, - SHOW_LONGLONG), - DEF_STATUS_VAR_FUNC("system_rows_updated", &export_stats.system_rows_updated, - SHOW_LONGLONG), +static SHOW_VAR myrocks_status_variables[] = { + DEF_STATUS_VAR_FUNC("rows_deleted", &export_stats.rows_deleted, + SHOW_LONGLONG), + DEF_STATUS_VAR_FUNC("rows_inserted", &export_stats.rows_inserted, + SHOW_LONGLONG), + DEF_STATUS_VAR_FUNC("rows_read", &export_stats.rows_read, SHOW_LONGLONG), + DEF_STATUS_VAR_FUNC("rows_updated", &export_stats.rows_updated, + SHOW_LONGLONG), + DEF_STATUS_VAR_FUNC("system_rows_deleted", + &export_stats.system_rows_deleted, SHOW_LONGLONG), + DEF_STATUS_VAR_FUNC("system_rows_inserted", + &export_stats.system_rows_inserted, SHOW_LONGLONG), + DEF_STATUS_VAR_FUNC("system_rows_read", &export_stats.system_rows_read, + SHOW_LONGLONG), + DEF_STATUS_VAR_FUNC("system_rows_updated", + &export_stats.system_rows_updated, SHOW_LONGLONG), - {NullS, NullS, SHOW_LONG} -}; + {NullS, NullS, SHOW_LONG}}; -static void show_myrocks_vars(THD* thd, SHOW_VAR* var, char* buff) { +static void show_myrocks_vars(THD *thd, SHOW_VAR *var, char *buff) { myrocks_update_status(); var->type = SHOW_ARRAY; - var->value = reinterpret_cast(&myrocks_status_variables); + var->value = reinterpret_cast(&myrocks_status_variables); } -static SHOW_VAR rocksdb_status_vars[]= { - DEF_STATUS_VAR(block_cache_miss), - DEF_STATUS_VAR(block_cache_hit), - DEF_STATUS_VAR(block_cache_add), - DEF_STATUS_VAR(block_cache_index_miss), - DEF_STATUS_VAR(block_cache_index_hit), - DEF_STATUS_VAR(block_cache_filter_miss), - DEF_STATUS_VAR(block_cache_filter_hit), - DEF_STATUS_VAR(block_cache_data_miss), - DEF_STATUS_VAR(block_cache_data_hit), - DEF_STATUS_VAR(bloom_filter_useful), - DEF_STATUS_VAR(memtable_hit), - DEF_STATUS_VAR(memtable_miss), - DEF_STATUS_VAR(compaction_key_drop_new), - DEF_STATUS_VAR(compaction_key_drop_obsolete), - DEF_STATUS_VAR(compaction_key_drop_user), - DEF_STATUS_VAR(number_keys_written), - DEF_STATUS_VAR(number_keys_read), - DEF_STATUS_VAR(number_keys_updated), - DEF_STATUS_VAR(bytes_written), - DEF_STATUS_VAR(bytes_read), - DEF_STATUS_VAR(no_file_closes), - DEF_STATUS_VAR(no_file_opens), - DEF_STATUS_VAR(no_file_errors), - DEF_STATUS_VAR(l0_slowdown_micros), - DEF_STATUS_VAR(memtable_compaction_micros), - DEF_STATUS_VAR(l0_num_files_stall_micros), - DEF_STATUS_VAR(rate_limit_delay_millis), - DEF_STATUS_VAR(num_iterators), - DEF_STATUS_VAR(number_multiget_get), - DEF_STATUS_VAR(number_multiget_keys_read), - DEF_STATUS_VAR(number_multiget_bytes_read), - DEF_STATUS_VAR(number_deletes_filtered), - DEF_STATUS_VAR(number_merge_failures), - DEF_STATUS_VAR(sequence_number), - DEF_STATUS_VAR(bloom_filter_prefix_checked), - DEF_STATUS_VAR(bloom_filter_prefix_useful), - DEF_STATUS_VAR(number_reseeks_iteration), - DEF_STATUS_VAR(getupdatessince_calls), - DEF_STATUS_VAR(block_cachecompressed_miss), - DEF_STATUS_VAR(block_cachecompressed_hit), - DEF_STATUS_VAR(wal_synced), - DEF_STATUS_VAR(wal_bytes), - DEF_STATUS_VAR(write_self), - DEF_STATUS_VAR(write_other), - DEF_STATUS_VAR(write_timedout), - DEF_STATUS_VAR(write_wal), - DEF_STATUS_VAR(flush_write_bytes), - DEF_STATUS_VAR(compact_read_bytes), - DEF_STATUS_VAR(compact_write_bytes), - DEF_STATUS_VAR(number_superversion_acquires), - DEF_STATUS_VAR(number_superversion_releases), - DEF_STATUS_VAR(number_superversion_cleanups), - DEF_STATUS_VAR(number_block_not_compressed), - DEF_STATUS_VAR_PTR("snapshot_conflict_errors", - &rocksdb_snapshot_conflict_errors, - SHOW_LONGLONG), - DEF_STATUS_VAR_PTR("number_stat_computes", &rocksdb_number_stat_computes, SHOW_LONGLONG), - DEF_STATUS_VAR_PTR("number_sst_entry_put", &rocksdb_num_sst_entry_put, - SHOW_LONGLONG), - DEF_STATUS_VAR_PTR("number_sst_entry_delete", &rocksdb_num_sst_entry_delete, - SHOW_LONGLONG), - DEF_STATUS_VAR_PTR("number_sst_entry_singledelete", - &rocksdb_num_sst_entry_singledelete, SHOW_LONGLONG), - DEF_STATUS_VAR_PTR("number_sst_entry_merge", &rocksdb_num_sst_entry_merge, - SHOW_LONGLONG), - DEF_STATUS_VAR_PTR("number_sst_entry_other", &rocksdb_num_sst_entry_other, - SHOW_LONGLONG), - {"rocksdb", reinterpret_cast(&show_myrocks_vars), SHOW_FUNC}, - {NullS, NullS, SHOW_LONG} -}; - +static SHOW_VAR rocksdb_status_vars[] = { + DEF_STATUS_VAR(block_cache_miss), + DEF_STATUS_VAR(block_cache_hit), + DEF_STATUS_VAR(block_cache_add), + DEF_STATUS_VAR(block_cache_index_miss), + DEF_STATUS_VAR(block_cache_index_hit), + DEF_STATUS_VAR(block_cache_filter_miss), + DEF_STATUS_VAR(block_cache_filter_hit), + DEF_STATUS_VAR(block_cache_data_miss), + DEF_STATUS_VAR(block_cache_data_hit), + DEF_STATUS_VAR(bloom_filter_useful), + DEF_STATUS_VAR(memtable_hit), + DEF_STATUS_VAR(memtable_miss), + DEF_STATUS_VAR(compaction_key_drop_new), + DEF_STATUS_VAR(compaction_key_drop_obsolete), + DEF_STATUS_VAR(compaction_key_drop_user), + DEF_STATUS_VAR(number_keys_written), + DEF_STATUS_VAR(number_keys_read), + DEF_STATUS_VAR(number_keys_updated), + DEF_STATUS_VAR(bytes_written), + DEF_STATUS_VAR(bytes_read), + DEF_STATUS_VAR(no_file_closes), + DEF_STATUS_VAR(no_file_opens), + DEF_STATUS_VAR(no_file_errors), + DEF_STATUS_VAR(l0_slowdown_micros), + DEF_STATUS_VAR(memtable_compaction_micros), + DEF_STATUS_VAR(l0_num_files_stall_micros), + DEF_STATUS_VAR(rate_limit_delay_millis), + DEF_STATUS_VAR(num_iterators), + DEF_STATUS_VAR(number_multiget_get), + DEF_STATUS_VAR(number_multiget_keys_read), + DEF_STATUS_VAR(number_multiget_bytes_read), + DEF_STATUS_VAR(number_deletes_filtered), + DEF_STATUS_VAR(number_merge_failures), + DEF_STATUS_VAR(bloom_filter_prefix_checked), + DEF_STATUS_VAR(bloom_filter_prefix_useful), + DEF_STATUS_VAR(number_reseeks_iteration), + DEF_STATUS_VAR(getupdatessince_calls), + DEF_STATUS_VAR(block_cachecompressed_miss), + DEF_STATUS_VAR(block_cachecompressed_hit), + DEF_STATUS_VAR(wal_synced), + DEF_STATUS_VAR(wal_bytes), + DEF_STATUS_VAR(write_self), + DEF_STATUS_VAR(write_other), + DEF_STATUS_VAR(write_timedout), + DEF_STATUS_VAR(write_wal), + DEF_STATUS_VAR(flush_write_bytes), + DEF_STATUS_VAR(compact_read_bytes), + DEF_STATUS_VAR(compact_write_bytes), + DEF_STATUS_VAR(number_superversion_acquires), + DEF_STATUS_VAR(number_superversion_releases), + DEF_STATUS_VAR(number_superversion_cleanups), + DEF_STATUS_VAR(number_block_not_compressed), + DEF_STATUS_VAR_PTR("snapshot_conflict_errors", + &rocksdb_snapshot_conflict_errors, SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("wal_group_syncs", &rocksdb_wal_group_syncs, + SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("number_stat_computes", &rocksdb_number_stat_computes, + SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("number_sst_entry_put", &rocksdb_num_sst_entry_put, + SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("number_sst_entry_delete", &rocksdb_num_sst_entry_delete, + SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("number_sst_entry_singledelete", + &rocksdb_num_sst_entry_singledelete, SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("number_sst_entry_merge", &rocksdb_num_sst_entry_merge, + SHOW_LONGLONG), + DEF_STATUS_VAR_PTR("number_sst_entry_other", &rocksdb_num_sst_entry_other, + SHOW_LONGLONG), + {"rocksdb", reinterpret_cast(&show_myrocks_vars), SHOW_FUNC}, + {NullS, NullS, SHOW_LONG}}; /* Background thread's main logic */ -void Rdb_background_thread::run() -{ +void Rdb_background_thread::run() { + // How many seconds to wait till flushing the WAL next time. + const int WAKE_UP_INTERVAL = 1; + timespec ts_next_sync; clock_gettime(CLOCK_REALTIME, &ts_next_sync); - ts_next_sync.tv_sec++; + ts_next_sync.tv_sec += WAKE_UP_INTERVAL; - for (;;) - { - // wait for 1 second or until we received a condition to stop the thread + for (;;) { + // Wait until the next timeout or until we receive a signal to stop the + // thread. Request to stop the thread should only be triggered when the + // storage engine is being unloaded. mysql_mutex_lock(&m_signal_mutex); - auto ret __attribute__((__unused__)) = mysql_cond_timedwait( - &m_signal_cond, &m_signal_mutex, &ts_next_sync); - // make sure that no program error is returned + const auto ret __attribute__((__unused__)) = + mysql_cond_timedwait(&m_signal_cond, &m_signal_mutex, &ts_next_sync); + + // Check that we receive only the expected error codes. DBUG_ASSERT(ret == 0 || ret == ETIMEDOUT); - bool local_stop= m_stop; - bool local_save_stats= m_save_stats; + const bool local_stop = m_stop; + const bool local_save_stats = m_save_stats; reset(); mysql_mutex_unlock(&m_signal_mutex); - if (local_stop) - { + if (local_stop) { + // If we're here then that's because condition variable was signaled by + // another thread and we're shutting down. Break out the loop to make + // sure that shutdown thread can proceed. break; } - if (local_save_stats) - { + // This path should be taken only when the timer expired. + DBUG_ASSERT(ret == ETIMEDOUT); + + if (local_save_stats) { ddl_manager.persist_stats(); } - // Flush the WAL if need be but don't do it more frequent - // than once per second timespec ts; clock_gettime(CLOCK_REALTIME, &ts); - if (ts.tv_sec - ts_next_sync.tv_sec >= 1) - { - if (rdb && rocksdb_background_sync) - { - DBUG_ASSERT(!rocksdb_db_options.allow_mmap_writes); - rocksdb::Status s= rdb->SyncWAL(); - if (!s.ok()) - rdb_handle_io_error(s, RDB_IO_ERROR_BG_THREAD); + + // Flush the WAL. + if (rdb && rocksdb_background_sync) { + DBUG_ASSERT(!rocksdb_db_options.allow_mmap_writes); + const rocksdb::Status s = rdb->SyncWAL(); + if (!s.ok()) { + rdb_handle_io_error(s, RDB_IO_ERROR_BG_THREAD); } - ts_next_sync.tv_sec= ts.tv_sec + 1; } + + // Set the next timestamp for mysql_cond_timedwait() (which ends up calling + // pthread_cond_timedwait()) to wait on. + ts_next_sync.tv_sec = ts.tv_sec + WAKE_UP_INTERVAL; } // save remaining stats which might've left unsaved ddl_manager.persist_stats(); } - /** Deciding if it is possible to use bloom filter or not. @@ -10265,22 +9667,17 @@ @param use_all_keys True if all key parts are set with equal conditions. This is aware of extended keys. */ -bool can_use_bloom_filter(THD *thd, - const std::shared_ptr& kd, +bool can_use_bloom_filter(THD *thd, const Rdb_key_def &kd, const rocksdb::Slice &eq_cond, - const bool use_all_keys, - bool is_ascending) -{ - bool can_use= false; + const bool use_all_keys, bool is_ascending) { + bool can_use = false; - if (THDVAR(thd, skip_bloom_filter_on_read)) - { + if (THDVAR(thd, skip_bloom_filter_on_read)) { return can_use; } - rocksdb::Options opt = rdb->GetOptions(kd->get_cf()); - if (opt.prefix_extractor) - { + const rocksdb::SliceTransform *prefix_extractor = kd.get_extractor(); + if (prefix_extractor) { /* This is an optimized use case for CappedPrefixTransform. If eq_cond length >= prefix extractor length and if @@ -10299,106 +9696,92 @@ shorter require all parts of the key to be available for the short key match. */ - if (use_all_keys && opt.prefix_extractor->InRange(eq_cond)) - can_use= true; + if (use_all_keys && prefix_extractor->InRange(eq_cond)) + can_use = true; else if (!is_ascending) - can_use= false; - else if (opt.prefix_extractor->SameResultWhenAppended(eq_cond)) - can_use= true; + can_use = false; + else if (prefix_extractor->SameResultWhenAppended(eq_cond)) + can_use = true; else - can_use= false; - } else - { + can_use = false; + } else { /* if prefix extractor is not defined, all key parts have to be used by eq_cond. */ if (use_all_keys) - can_use= true; + can_use = true; else - can_use= false; + can_use = false; } return can_use; } /* For modules that need access to the global data structures */ -rocksdb::DB *rdb_get_rocksdb_db() -{ - return rdb; -} +rocksdb::TransactionDB *rdb_get_rocksdb_db() { return rdb; } -Rdb_cf_manager& rdb_get_cf_manager() -{ - return cf_manager; -} +Rdb_cf_manager &rdb_get_cf_manager() { return cf_manager; } -rocksdb::BlockBasedTableOptions& rdb_get_table_options() -{ +rocksdb::BlockBasedTableOptions &rdb_get_table_options() { return rocksdb_tbl_options; } - -int rdb_get_table_perf_counters(const char *tablename, - Rdb_perf_counters *counters) -{ +int rdb_get_table_perf_counters(const char *const tablename, + Rdb_perf_counters *const counters) { DBUG_ASSERT(counters != nullptr); DBUG_ASSERT(tablename != nullptr); Rdb_table_handler *table_handler; - table_handler= rdb_open_tables.get_table_handler(tablename); - if (table_handler == nullptr) - { + table_handler = rdb_open_tables.get_table_handler(tablename); + if (table_handler == nullptr) { return HA_ERR_INTERNAL_ERROR; } counters->load(table_handler->m_table_perf_context); rdb_open_tables.release_table_handler(table_handler); - return 0; + return HA_EXIT_SUCCESS; } - -void rdb_handle_io_error(rocksdb::Status status, RDB_IO_ERROR_TYPE err_type) -{ - if (status.IsIOError()) - { +void rdb_handle_io_error(rocksdb::Status status, RDB_IO_ERROR_TYPE err_type) { + if (status.IsIOError()) { switch (err_type) { case RDB_IO_ERROR_TX_COMMIT: - case RDB_IO_ERROR_DICT_COMMIT: - { + case RDB_IO_ERROR_DICT_COMMIT: { sql_print_error("RocksDB: Failed to write to WAL - status %d, %s", status.code(), status.ToString().c_str()); sql_print_error("RocksDB: Aborting on WAL write error."); abort_with_stack_traces(); break; } - case RDB_IO_ERROR_BG_THREAD: - { + case RDB_IO_ERROR_BG_THREAD: { sql_print_warning("RocksDB: BG Thread failed to write to RocksDB " - "- status %d, %s", status.code(), - status.ToString().c_str()); + "- status %d, %s", + status.code(), status.ToString().c_str()); + break; + } + case RDB_IO_ERROR_GENERAL: { + sql_print_error("RocksDB: Failed on I/O - status %d, %s", status.code(), + status.ToString().c_str()); + sql_print_error("RocksDB: Aborting on I/O error."); + abort_with_stack_traces(); break; } default: DBUG_ASSERT(0); break; } - } - else if (status.IsCorruption()) - { + } else if (status.IsCorruption()) { /* NO_LINT_DEBUG */ - sql_print_error("RocksDB: Data Corruption detected! %d, %s", - status.code(), status.ToString().c_str()); + sql_print_error("RocksDB: Data Corruption detected! %d, %s", status.code(), + status.ToString().c_str()); /* NO_LINT_DEBUG */ sql_print_error("RocksDB: Aborting because of data corruption."); abort_with_stack_traces(); - } - else if (!status.ok()) - { + } else if (!status.ok()) { switch (err_type) { - case RDB_IO_ERROR_DICT_COMMIT: - { + case RDB_IO_ERROR_DICT_COMMIT: { sql_print_error("RocksDB: Failed to write to WAL (dictionary) - " "status %d, %s", status.code(), status.ToString().c_str()); @@ -10407,66 +9790,50 @@ break; } default: - sql_print_warning("RocksDB: Failed to write to RocksDB " - "- status %d, %s", status.code(), - status.ToString().c_str()); + sql_print_warning("RocksDB: Failed to read/write in RocksDB " + "- status %d, %s", + status.code(), status.ToString().c_str()); break; } } } -Rdb_dict_manager *rdb_get_dict_manager(void) -{ - return &dict_manager; -} - -Rdb_ddl_manager *rdb_get_ddl_manager(void) -{ - return &ddl_manager; -} - -Rdb_binlog_manager *rdb_get_binlog_manager(void) -{ - return &binlog_manager; -} +Rdb_dict_manager *rdb_get_dict_manager(void) { return &dict_manager; } +Rdb_ddl_manager *rdb_get_ddl_manager(void) { return &ddl_manager; } -void -rocksdb_set_compaction_options( - my_core::THD* thd __attribute__((__unused__)), - my_core::st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr, - const void* save) -{ +void rocksdb_set_compaction_options(my_core::THD *const thd + __attribute__((__unused__)), + my_core::st_mysql_sys_var *const var + __attribute__((__unused__)), + void *const var_ptr, + const void *const save) { if (var_ptr && save) { - *(uint64_t*)var_ptr = *(const uint64_t*) save; + *(uint64_t *)var_ptr = *(const uint64_t *)save; } - Rdb_compact_params params = { - (uint64_t)rocksdb_compaction_sequential_deletes, - (uint64_t)rocksdb_compaction_sequential_deletes_window, - (uint64_t)rocksdb_compaction_sequential_deletes_file_size - }; + const Rdb_compact_params params = { + (uint64_t)rocksdb_compaction_sequential_deletes, + (uint64_t)rocksdb_compaction_sequential_deletes_window, + (uint64_t)rocksdb_compaction_sequential_deletes_file_size}; if (properties_collector_factory) { properties_collector_factory->SetCompactionParams(params); } } void rocksdb_set_table_stats_sampling_pct( - my_core::THD* thd __attribute__((__unused__)), - my_core::st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr __attribute__((__unused__)), - const void* save) -{ + my_core::THD *const thd __attribute__((__unused__)), + my_core::st_mysql_sys_var *const var __attribute__((__unused__)), + void *const var_ptr __attribute__((__unused__)), const void *const save) { mysql_mutex_lock(&rdb_sysvars_mutex); - uint32_t new_val= *static_cast(save); + const uint32_t new_val = *static_cast(save); if (new_val != rocksdb_table_stats_sampling_pct) { rocksdb_table_stats_sampling_pct = new_val; if (properties_collector_factory) { properties_collector_factory->SetTableStatsSamplingPct( - rocksdb_table_stats_sampling_pct); + rocksdb_table_stats_sampling_pct); } } @@ -10482,105 +9849,119 @@ This is similar to the code in innodb_doublewrite_update (found in storage/innobase/handler/ha_innodb.cc). */ -void -rocksdb_set_rate_limiter_bytes_per_sec( - my_core::THD* thd, - my_core::st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr __attribute__((__unused__)), - const void* save) -{ - uint64_t new_val= *static_cast(save); - if (new_val == 0 || rocksdb_rate_limiter_bytes_per_sec == 0) - { +void rocksdb_set_rate_limiter_bytes_per_sec(my_core::THD *const thd, + my_core::st_mysql_sys_var *const var + __attribute__((__unused__)), + void *const var_ptr + __attribute__((__unused__)), + const void *const save) { + const uint64_t new_val = *static_cast(save); + if (new_val == 0 || rocksdb_rate_limiter_bytes_per_sec == 0) { /* If a rate_limiter was not enabled at startup we can't change it nor can we disable it if one was created at startup */ - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_WRONG_ARGUMENTS, + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_WRONG_ARGUMENTS, "RocksDB: rocksdb_rate_limiter_bytes_per_sec cannot " "be dynamically changed to or from 0. Do a clean " "shutdown if you want to change it from or to 0."); - } - else if (new_val != rocksdb_rate_limiter_bytes_per_sec) - { + } else if (new_val != rocksdb_rate_limiter_bytes_per_sec) { /* Apply the new value to the rate limiter and store it locally */ DBUG_ASSERT(rocksdb_rate_limiter != nullptr); - rocksdb_rate_limiter_bytes_per_sec= new_val; + rocksdb_rate_limiter_bytes_per_sec = new_val; rocksdb_rate_limiter->SetBytesPerSecond(new_val); } } -void rdb_set_collation_exception_list(const char *exception_list) -{ +void rdb_set_collation_exception_list(const char *const exception_list) { DBUG_ASSERT(rdb_collation_exceptions != nullptr); - if (!rdb_collation_exceptions->set_patterns(exception_list)) - { - warn_about_bad_patterns(rdb_collation_exceptions, + int flags = MY_REG_EXTENDED | MY_REG_NOSUB; + if (lower_case_table_names) + flags |= MY_REG_ICASE; + if (!rdb_collation_exceptions->compile( + exception_list, flags, table_alias_charset)) { + warn_about_bad_patterns(*rdb_collation_exceptions, "strict_collation_exceptions"); } } -void -rocksdb_set_collation_exception_list(THD* thd, - struct st_mysql_sys_var* var, - void* var_ptr, - const void* save) -{ - const char* val = *static_cast(save); +void rocksdb_set_collation_exception_list(THD *const thd, + struct st_mysql_sys_var *const var, + void *const var_ptr, + const void *const save) { + const char *const val = *static_cast(save); rdb_set_collation_exception_list(val); - *static_cast(var_ptr) = val; + *static_cast(var_ptr) = val; } -void -rocksdb_set_bulk_load(THD* thd, - struct st_mysql_sys_var* var __attribute__((__unused__)), - void* var_ptr, - const void* save) -{ - Rdb_transaction*& tx= get_tx_from_thd(thd); +void rocksdb_set_bulk_load(THD *const thd, struct st_mysql_sys_var *const var + __attribute__((__unused__)), + void *const var_ptr, const void *const save) { + Rdb_transaction *&tx = get_tx_from_thd(thd); - if (tx != nullptr) - { - int rc= tx->finish_bulk_load(); - if (rc != 0) - { + if (tx != nullptr) { + const int rc = tx->finish_bulk_load(); + if (rc != 0) { // NO_LINT_DEBUG sql_print_error("RocksDB: Error %d finalizing last SST file while " - "setting bulk loading variable", rc); + "setting bulk loading variable", + rc); abort_with_stack_traces(); } } - *static_cast(var_ptr) = *static_cast(save); + *static_cast(var_ptr) = *static_cast(save); } -void rdb_queue_save_stats_request() -{ - rdb_bg_thread.request_save_stats(); +static void rocksdb_set_max_background_compactions( + THD *thd, struct st_mysql_sys_var *const var, void *const var_ptr, + const void *const save) { + DBUG_ASSERT(save != nullptr); + + mysql_mutex_lock(&rdb_sysvars_mutex); + rocksdb_db_options.max_background_compactions = + *static_cast(save); + rocksdb_db_options.env->SetBackgroundThreads( + rocksdb_db_options.max_background_compactions, + rocksdb::Env::Priority::LOW); + mysql_mutex_unlock(&rdb_sysvars_mutex); } -void ha_rocksdb::rpl_before_delete_rows() -{ - m_in_rpl_delete_rows= true; +void rdb_queue_save_stats_request() { rdb_bg_thread.request_save_stats(); } + +void ha_rocksdb::rpl_before_delete_rows() { + DBUG_ENTER_FUNC(); + + m_in_rpl_delete_rows = true; + + DBUG_VOID_RETURN; } -void ha_rocksdb::rpl_after_delete_rows() -{ - m_in_rpl_delete_rows= false; +void ha_rocksdb::rpl_after_delete_rows() { + DBUG_ENTER_FUNC(); + + m_in_rpl_delete_rows = false; + + DBUG_VOID_RETURN; } -void ha_rocksdb::rpl_before_update_rows() -{ - m_in_rpl_update_rows= true; +void ha_rocksdb::rpl_before_update_rows() { + DBUG_ENTER_FUNC(); + + m_in_rpl_update_rows = true; + + DBUG_VOID_RETURN; } -void ha_rocksdb::rpl_after_update_rows() -{ - m_in_rpl_update_rows= false; +void ha_rocksdb::rpl_after_update_rows() { + DBUG_ENTER_FUNC(); + + m_in_rpl_update_rows = false; + + DBUG_VOID_RETURN; } /** @@ -10590,22 +9971,25 @@ on UPDATE or DELETE row events, and table must have user defined primary key. */ -bool ha_rocksdb::use_read_free_rpl() -{ - return ((m_in_rpl_delete_rows || m_in_rpl_update_rows) && - !has_hidden_pk(table) && m_use_read_free_rpl); +bool ha_rocksdb::use_read_free_rpl() { + DBUG_ENTER_FUNC(); + + DBUG_RETURN((m_in_rpl_delete_rows || m_in_rpl_update_rows) && + !has_hidden_pk(table) && m_use_read_free_rpl); } -double ha_rocksdb::read_time(uint index, uint ranges, ha_rows rows) -{ +double ha_rocksdb::read_time(uint index, uint ranges, ha_rows rows) { + DBUG_ENTER_FUNC(); + if (index != table->s->primary_key) { /* Non covering index range scan */ - return(handler::read_time(index, ranges, rows)); + DBUG_RETURN(handler::read_time(index, ranges, rows)); } - return (rows/20.0) + 1; + + DBUG_RETURN((rows / 20.0) + 1); } -} // namespace myrocks +} // namespace myrocks /* Register the storage engine plugin outside of myrocks namespace @@ -10613,31 +9997,27 @@ its name generation. */ -struct st_mysql_storage_engine rocksdb_storage_engine= -{ MYSQL_HANDLERTON_INTERFACE_VERSION }; +struct st_mysql_storage_engine rocksdb_storage_engine = { + MYSQL_HANDLERTON_INTERFACE_VERSION}; -mysql_declare_plugin(rocksdb_se) -{ - MYSQL_STORAGE_ENGINE_PLUGIN, /* Plugin Type */ - &rocksdb_storage_engine, /* Plugin Descriptor */ - "ROCKSDB", /* Plugin Name */ - "Monty Program Ab", /* Plugin Author */ - "RocksDB storage engine", /* Plugin Description */ - PLUGIN_LICENSE_GPL, /* Plugin Licence */ - myrocks::rocksdb_init_func, /* Plugin Entry Point */ - myrocks::rocksdb_done_func, /* Plugin Deinitializer */ - 0x0001, /* version number (0.1) */ - myrocks::rocksdb_status_vars, /* status variables */ - myrocks::rocksdb_system_variables, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +mysql_declare_plugin(rocksdb_se){ + MYSQL_STORAGE_ENGINE_PLUGIN, /* Plugin Type */ + &rocksdb_storage_engine, /* Plugin Descriptor */ + "ROCKSDB", /* Plugin Name */ + "Monty Program Ab", /* Plugin Author */ + "RocksDB storage engine", /* Plugin Description */ + PLUGIN_LICENSE_GPL, /* Plugin Licence */ + myrocks::rocksdb_init_func, /* Plugin Entry Point */ + myrocks::rocksdb_done_func, /* Plugin Deinitializer */ + 0x0001, /* version number (0.1) */ + myrocks::rocksdb_status_vars, /* status variables */ + myrocks::rocksdb_system_variables, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }, -myrocks::rdb_i_s_cfstats, -myrocks::rdb_i_s_dbstats, -myrocks::rdb_i_s_perf_context, -myrocks::rdb_i_s_perf_context_global, -myrocks::rdb_i_s_cfoptions, -myrocks::rdb_i_s_global_info, -myrocks::rdb_i_s_ddl, -myrocks::rdb_i_s_index_file_map -mysql_declare_plugin_end; + myrocks::rdb_i_s_cfstats, myrocks::rdb_i_s_dbstats, + myrocks::rdb_i_s_perf_context, myrocks::rdb_i_s_perf_context_global, + myrocks::rdb_i_s_cfoptions, myrocks::rdb_i_s_compact_stats, + myrocks::rdb_i_s_global_info, myrocks::rdb_i_s_ddl, + myrocks::rdb_i_s_index_file_map, myrocks::rdb_i_s_lock_info, + myrocks::rdb_i_s_trx_info mysql_declare_plugin_end; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ha_rocksdb.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ha_rocksdb.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ha_rocksdb.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ha_rocksdb.h 2017-10-19 04:25:29.000000000 +0000 @@ -16,20 +16,21 @@ #pragma once #ifdef USE_PRAGMA_INTERFACE -#pragma interface /* gcc class implementation */ +#pragma interface /* gcc class implementation */ #endif /* C++ standard header files */ +#include #include #include #include #include /* MySQL header files */ -#include "./handler.h" /* handler */ -#include "./my_global.h" /* ulonglong */ +#include "./handler.h" /* handler */ +#include "./my_global.h" /* ulonglong */ #include "./sql_string.h" -#include "./ut0counter.h" +#include "./ib_ut0counter.h" /* RocksDB header files */ #include "rocksdb/cache.h" @@ -63,47 +64,81 @@ namespace myrocks { /* + * class for exporting transaction information for + * information_schema.rocksdb_trx + */ +struct Rdb_trx_info { + std::string name; + ulonglong trx_id; + ulonglong write_count; + ulonglong lock_count; + int timeout_sec; + std::string state; + std::string waiting_key; + ulonglong waiting_cf_id; + int is_replication; + int skip_trx_api; + int read_only; + int deadlock_detect; + int num_ongoing_bulk_load; + ulong thread_id; + std::string query_str; +}; + +std::vector rdb_get_all_trx_info(); + +/* This is - the name of the default Column Family (the CF which stores indexes which didn't explicitly specify which CF they are in) - the name used to set the default column family parameter for per-cf arguments. */ -const char * const DEFAULT_CF_NAME= "default"; +const char *const DEFAULT_CF_NAME = "default"; /* This is the name of the Column Family used for storing the data dictionary. */ -const char * const DEFAULT_SYSTEM_CF_NAME= "__system__"; +const char *const DEFAULT_SYSTEM_CF_NAME = "__system__"; /* This is the name of the hidden primary key for tables with no pk. */ -const char * const HIDDEN_PK_NAME= "HIDDEN_PK_ID"; +const char *const HIDDEN_PK_NAME = "HIDDEN_PK_ID"; /* Column family name which means "put this index into its own column family". See Rdb_cf_manager::get_per_index_cf_name(). */ -const char * const PER_INDEX_CF_NAME = "$per_index_cf"; +const char *const PER_INDEX_CF_NAME = "$per_index_cf"; + +/* + Name for the background thread. +*/ +const char *const BG_THREAD_NAME = "myrocks-bg"; + +/* + Name for the drop index thread. +*/ +const char *const INDEX_THREAD_NAME = "myrocks-index"; /* Default, minimal valid, and maximum valid sampling rate values when collecting statistics about table. */ -#define RDB_DEFAULT_TBL_STATS_SAMPLE_PCT 10 -#define RDB_TBL_STATS_SAMPLE_PCT_MIN 1 -#define RDB_TBL_STATS_SAMPLE_PCT_MAX 100 +#define RDB_DEFAULT_TBL_STATS_SAMPLE_PCT 10 +#define RDB_TBL_STATS_SAMPLE_PCT_MIN 1 +#define RDB_TBL_STATS_SAMPLE_PCT_MAX 100 /* Default and maximum values for rocksdb-compaction-sequential-deletes and rocksdb-compaction-sequential-deletes-window to add basic boundary checking. */ -#define DEFAULT_COMPACTION_SEQUENTIAL_DELETES 0 -#define MAX_COMPACTION_SEQUENTIAL_DELETES 2000000 +#define DEFAULT_COMPACTION_SEQUENTIAL_DELETES 0 +#define MAX_COMPACTION_SEQUENTIAL_DELETES 2000000 -#define DEFAULT_COMPACTION_SEQUENTIAL_DELETES_WINDOW 0 -#define MAX_COMPACTION_SEQUENTIAL_DELETES_WINDOW 2000000 +#define DEFAULT_COMPACTION_SEQUENTIAL_DELETES_WINDOW 0 +#define MAX_COMPACTION_SEQUENTIAL_DELETES_WINDOW 2000000 /* Default and maximum values for various compaction and flushing related @@ -115,11 +150,11 @@ CPU-s and derive the values from there. This however has its own set of problems and we'll choose simplicity for now. */ -#define MAX_BACKGROUND_COMPACTIONS 64 -#define MAX_BACKGROUND_FLUSHES 64 +#define MAX_BACKGROUND_COMPACTIONS 64 +#define MAX_BACKGROUND_FLUSHES 64 -#define DEFAULT_SUBCOMPACTIONS 1 -#define MAX_SUBCOMPACTIONS 64 +#define DEFAULT_SUBCOMPACTIONS 1 +#define MAX_SUBCOMPACTIONS 64 /* Defines the field sizes for serializing XID object to a string representation. @@ -143,7 +178,7 @@ The reason behind the cast issue is the lack of unsigned int support in Java. */ -#define MAX_RATE_LIMITER_BYTES_PER_SEC static_cast(LONGLONG_MAX) +#define MAX_RATE_LIMITER_BYTES_PER_SEC static_cast(LONGLONG_MAX) /* Hidden PK column (for tables with no primary key) is a longlong (aka 8 bytes). @@ -155,14 +190,13 @@ MyRocks specific error codes. NB! Please make sure that you will update HA_ERR_ROCKSDB_LAST when adding new ones. */ -#define HA_ERR_ROCKSDB_UNIQUE_NOT_SUPPORTED (HA_ERR_LAST + 1) -#define HA_ERR_ROCKSDB_PK_REQUIRED (HA_ERR_LAST + 2) -#define HA_ERR_ROCKSDB_TOO_MANY_LOCKS (HA_ERR_LAST + 3) -#define HA_ERR_ROCKSDB_LAST HA_ERR_ROCKSDB_TOO_MANY_LOCKS - -inline bool looks_like_per_index_cf_typo(const char *name) -{ - return (name && name[0]=='$' && strcmp(name, PER_INDEX_CF_NAME)); +#define HA_ERR_ROCKSDB_UNIQUE_NOT_SUPPORTED (HA_ERR_LAST + 1) +#define HA_ERR_ROCKSDB_PK_REQUIRED (HA_ERR_LAST + 2) +#define HA_ERR_ROCKSDB_TOO_MANY_LOCKS (HA_ERR_LAST + 3) +#define HA_ERR_ROCKSDB_LAST HA_ERR_ROCKSDB_TOO_MANY_LOCKS + +inline bool looks_like_per_index_cf_typo(const char *const name) { + return (name && name[0] == '$' && strcmp(name, PER_INDEX_CF_NAME)); } /** @@ -172,21 +206,18 @@ //TODO: join this with Rdb_tbl_def ? */ -struct Rdb_table_handler -{ - char *m_table_name; - uint m_table_name_length; - int m_ref_count; +struct Rdb_table_handler { + char *m_table_name; + uint m_table_name_length; + int m_ref_count; - my_core::THR_LOCK m_thr_lock; ///< MySQL latch needed by m_db_lock + my_core::THR_LOCK m_thr_lock; ///< MySQL latch needed by m_db_lock /* Stores cumulative table statistics */ - my_io_perf_atomic_t m_io_perf_read; - Rdb_atomic_perf_counters m_table_perf_context; + my_io_perf_atomic_t m_io_perf_read; + Rdb_atomic_perf_counters m_table_perf_context; }; - - class Rdb_key_def; class Rdb_tbl_def; class Rdb_transaction; @@ -194,38 +225,32 @@ class Rdb_writebatch_impl; class Rdb_field_encoder; -const char *const rocksdb_hton_name= "ROCKSDB"; +const char *const rocksdb_hton_name = "ROCKSDB"; typedef struct _gl_index_id_s { uint32_t cf_id; uint32_t index_id; - bool operator==(const struct _gl_index_id_s& other) const - { + bool operator==(const struct _gl_index_id_s &other) const { return cf_id == other.cf_id && index_id == other.index_id; } - bool operator!=(const struct _gl_index_id_s& other) const - { + bool operator!=(const struct _gl_index_id_s &other) const { return cf_id != other.cf_id || index_id != other.index_id; } - bool operator<(const struct _gl_index_id_s& other) const - { + bool operator<(const struct _gl_index_id_s &other) const { return cf_id < other.cf_id || - (cf_id == other.cf_id && index_id < other.index_id); + (cf_id == other.cf_id && index_id < other.index_id); } - bool operator<=(const struct _gl_index_id_s& other) const - { + bool operator<=(const struct _gl_index_id_s &other) const { return cf_id < other.cf_id || - (cf_id == other.cf_id && index_id <= other.index_id); + (cf_id == other.cf_id && index_id <= other.index_id); } - bool operator>(const struct _gl_index_id_s& other) const - { + bool operator>(const struct _gl_index_id_s &other) const { return cf_id > other.cf_id || - (cf_id == other.cf_id && index_id > other.index_id); + (cf_id == other.cf_id && index_id > other.index_id); } - bool operator>=(const struct _gl_index_id_s& other) const - { + bool operator>=(const struct _gl_index_id_s &other) const { return cf_id > other.cf_id || - (cf_id == other.cf_id && index_id >= other.index_id); + (cf_id == other.cf_id && index_id >= other.index_id); } } GL_INDEX_ID; @@ -237,13 +262,19 @@ ROWS_MAX }; +#if defined(HAVE_SCHED_GETCPU) +#define RDB_INDEXER get_sched_indexer_t +#else +#define RDB_INDEXER thread_id_indexer_t +#endif + /* Global statistics struct used inside MyRocks */ struct st_global_stats { - ib_counter_t rows[ROWS_MAX]; + ib_counter_t rows[ROWS_MAX]; // system_rows_ stats are only for system // tables. They are not counted in rows_* stats. - ib_counter_t system_rows[ROWS_MAX]; + ib_counter_t system_rows[ROWS_MAX]; }; /* Struct used for exporting status to MySQL */ @@ -259,23 +290,20 @@ ulonglong system_rows_updated; }; -} // namespace myrocks +} // namespace myrocks #include "./rdb_buff.h" /* Provide hash function for GL_INDEX_ID so we can include it in sets */ namespace std { - template <> - struct hash - { - std::size_t operator()(const myrocks::GL_INDEX_ID& gl_index_id) const - { - uint64_t val = ((uint64_t) gl_index_id.cf_id << 32 | - (uint64_t) gl_index_id.index_id); - return std::hash()(val); - } - }; -} // namespace std +template <> struct hash { + std::size_t operator()(const myrocks::GL_INDEX_ID &gl_index_id) const { + const uint64_t val = + ((uint64_t)gl_index_id.cf_id << 32 | (uint64_t)gl_index_id.index_id); + return std::hash()(val); + } +}; +} // namespace std namespace myrocks { @@ -284,11 +312,10 @@ Class definition for ROCKSDB storage engine plugin handler */ -class ha_rocksdb: public my_core::handler -{ - my_core::THR_LOCK_DATA m_db_lock; ///< MySQL database lock +class ha_rocksdb : public my_core::handler { + my_core::THR_LOCK_DATA m_db_lock; ///< MySQL database lock - Rdb_table_handler *m_table_handler; ///< Open table handler + Rdb_table_handler *m_table_handler; ///< Open table handler /* Iterator used for range scans and for full table/index scans */ rocksdb::Iterator *m_scan_it; @@ -296,6 +323,8 @@ /* Whether m_scan_it was created with skip_bloom=true */ bool m_scan_it_skips_bloom; + const rocksdb::Snapshot *m_scan_it_snapshot; + Rdb_tbl_def *m_tbl_def; /* Primary Key encoder from KeyTupleFormat to StorageFormat */ @@ -322,7 +351,7 @@ */ bool m_maybe_unpack_info; - uchar *m_pk_tuple; /* Buffer for storing PK in KeyTupleFormat */ + uchar *m_pk_tuple; /* Buffer for storing PK in KeyTupleFormat */ uchar *m_pk_packed_tuple; /* Buffer for storing PK in StorageFormat */ // ^^ todo: change it to 'char*'? TODO: ^ can we join this with last_rowkey? @@ -355,6 +384,10 @@ uchar *m_sk_packed_tuple_old; Rdb_string_writer m_sk_tails_old; + /* Buffers used for duplicate checking during unique_index_creation */ + uchar *m_dup_sk_packed_tuple; + uchar *m_dup_sk_packed_tuple_old; + /* Temporary space for packing VARCHARs (we provide it to pack_record()/pack_index_tuple() calls). @@ -389,12 +422,6 @@ /* TRUE means the replication slave will use Read Free Replication */ bool m_use_read_free_rpl; - /* - TRUE means we should skip unique key checks for this table if the - replication lag gets too large - */ - bool m_skip_unique_check; - /** @brief This is a bitmap of indexes (i.e. a set) whose keys (in future, values) may @@ -407,45 +434,46 @@ /* SST information used for bulk loading the primary key */ std::shared_ptr m_sst_info; + Rdb_transaction *m_bulk_load_tx; + /* Mutex to protect finalizing bulk load */ + mysql_mutex_t m_bulk_load_mutex; /* MySQL index number for duplicate key error */ int m_dupp_errkey; - int create_key_defs(const TABLE *table_arg, Rdb_tbl_def *tbl_def_arg, - const TABLE *old_table_arg= nullptr, - const Rdb_tbl_def *old_tbl_def_arg= nullptr) + int create_key_defs(const TABLE *const table_arg, + Rdb_tbl_def *const tbl_def_arg, + const TABLE *const old_table_arg = nullptr, + const Rdb_tbl_def *const old_tbl_def_arg = nullptr) const __attribute__((__nonnull__(2, 3), __warn_unused_result__)); - int secondary_index_read(const int keyno, uchar *buf) + int secondary_index_read(const int keyno, uchar *const buf) __attribute__((__nonnull__, __warn_unused_result__)); void setup_iterator_for_rnd_scan(); - void setup_scan_iterator(const std::shared_ptr& kd, - rocksdb::Slice *slice) - __attribute__((__nonnull__)) - { + void setup_scan_iterator(const Rdb_key_def &kd, rocksdb::Slice *const slice) + __attribute__((__nonnull__)) { setup_scan_iterator(kd, slice, false, false, 0); } - bool is_ascending(const std::shared_ptr& keydef, + bool is_ascending(const Rdb_key_def &keydef, enum ha_rkey_function find_flag) const - __attribute__((__nonnull__, __warn_unused_result__)); - void setup_scan_iterator(const std::shared_ptr& kd, - rocksdb::Slice *slice, const bool use_all_keys, - const bool is_ascending, const uint eq_cond_len) - __attribute__((__nonnull__)); - void release_scan_iterator(void) - { - delete m_scan_it; - m_scan_it= nullptr; - } + __attribute__((__nonnull__, __warn_unused_result__)); + void setup_scan_iterator(const Rdb_key_def &kd, rocksdb::Slice *slice, + const bool use_all_keys, const bool is_ascending, + const uint eq_cond_len) __attribute__((__nonnull__)); + void release_scan_iterator(void); + + rocksdb::Status + get_for_update(Rdb_transaction *const tx, + rocksdb::ColumnFamilyHandle *const column_family, + const rocksdb::Slice &key, std::string *const value) const; - int get_row_by_rowid(uchar *buf, const char *rowid, + int get_row_by_rowid(uchar *const buf, const char *const rowid, const uint rowid_size) - __attribute__((__nonnull__, __warn_unused_result__)); - int get_row_by_rowid(uchar *buf, const uchar *rowid, + __attribute__((__nonnull__, __warn_unused_result__)); + int get_row_by_rowid(uchar *const buf, const uchar *const rowid, const uint rowid_size) - __attribute__((__nonnull__, __warn_unused_result__)) - { + __attribute__((__nonnull__, __warn_unused_result__)) { return get_row_by_rowid(buf, reinterpret_cast(rowid), rowid_size); } @@ -454,21 +482,20 @@ void load_auto_incr_value(); longlong update_hidden_pk_val(); int load_hidden_pk_value() __attribute__((__warn_unused_result__)); - int read_hidden_pk_id_from_rowkey(longlong *hidden_pk_id) - __attribute__((__nonnull__, __warn_unused_result__)); - bool can_use_single_delete(uint index) - __attribute__((__warn_unused_result__)); - bool skip_unique_check() __attribute__((__warn_unused_result__)); - void set_force_skip_unique_check(bool skip) override; + int read_hidden_pk_id_from_rowkey(longlong *const hidden_pk_id) + __attribute__((__nonnull__, __warn_unused_result__)); + bool can_use_single_delete(const uint &index) const + __attribute__((__warn_unused_result__)); + bool skip_unique_check() const __attribute__((__warn_unused_result__)); bool commit_in_the_middle() __attribute__((__warn_unused_result__)); - bool do_bulk_commit(Rdb_transaction *tx) - __attribute__((__nonnull__, __warn_unused_result__)); - bool has_hidden_pk(const TABLE* table) - __attribute__((__nonnull__, __warn_unused_result__)); + bool do_bulk_commit(Rdb_transaction *const tx) + __attribute__((__nonnull__, __warn_unused_result__)); + bool has_hidden_pk(const TABLE *const table) const + __attribute__((__nonnull__, __warn_unused_result__)); - void update_row_stats(operation_type type); + void update_row_stats(const operation_type &type); - void set_last_rowkey(const uchar *old_data); + void set_last_rowkey(const uchar *const old_data); /* Array of table->s->fields elements telling how to store fields in the @@ -477,15 +504,14 @@ Rdb_field_encoder *m_encoder_arr; /* Describes instructions on how to decode the field */ - class READ_FIELD - { - public: + class READ_FIELD { + public: /* Points to Rdb_field_encoder describing the field */ - Rdb_field_encoder* m_field_enc; + Rdb_field_encoder *m_field_enc; /* if true, decode the field, otherwise skip it */ - bool m_decode; + bool m_decode; /* Skip this many bytes before reading (or skipping) this field */ - int m_skip; + int m_skip; }; /* @@ -504,14 +530,16 @@ */ uint m_null_bytes_in_rec; - void get_storage_type(Rdb_field_encoder *encoder, uint kp); + void get_storage_type(Rdb_field_encoder *const encoder, const uint &kp); void setup_field_converters(); - int alloc_key_buffers(const TABLE* table_arg, const Rdb_tbl_def* tbl_def_arg) - __attribute__((__nonnull__, __warn_unused_result__)); + int alloc_key_buffers(const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg, + bool alloc_alter_buffers = false) + __attribute__((__nonnull__, __warn_unused_result__)); void free_key_buffers(); // the buffer size should be at least 2*Rdb_key_def::INDEX_NUMBER_SIZE - rocksdb::Range get_range(int i, uchar buf[]) const; + rocksdb::Range get_range(const int &i, uchar buf[]) const; /* Perf timers for data reads @@ -531,48 +559,59 @@ public: /* - Controls whether writes include checksums. This is updated from the session variable + Controls whether writes include checksums. This is updated from the session + variable at the start of each query. */ - bool m_store_checksums; + bool m_store_row_debug_checksums; /* Same as above but for verifying checksums when reading */ - bool m_verify_checksums; + bool m_verify_row_debug_checksums; int m_checksums_pct; - ha_rocksdb(my_core::handlerton *hton, my_core::TABLE_SHARE *table_arg); - ~ha_rocksdb() - { + ha_rocksdb(my_core::handlerton *const hton, + my_core::TABLE_SHARE *const table_arg); + ~ha_rocksdb() { int err __attribute__((__unused__)); - err= finalize_bulk_load(); + err = finalize_bulk_load(); DBUG_ASSERT(err == 0); + mysql_mutex_destroy(&m_bulk_load_mutex); } /** @brief The name that will be used for display purposes. */ - const char *table_type() const { return rocksdb_hton_name; } + const char *table_type() const override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(rocksdb_hton_name); + } /* The following is only used by SHOW KEYS: */ - const char *index_type(uint inx) { return "LSMTREE"; } + const char *index_type(uint inx) override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN("LSMTREE"); + } /** @brief The file extensions. */ - const char **bas_ext() const; + const char **bas_ext() const override; /* See if this is the same base table - this should only be true for different partitions of the same table. */ - bool same_table(const ha_rocksdb& other) const; + bool same_table(const ha_rocksdb &other) const; /** @brief This is a list of flags that indicate what functionality the storage engine implements. The current table flags are documented in handler.h */ - ulonglong table_flags() const override - { + ulonglong table_flags() const override { + DBUG_ENTER_FUNC(); + /* HA_BINLOG_STMT_CAPABLE We are saying that this engine is just statement capable to have @@ -582,12 +621,11 @@ If we don't set it, filesort crashes, because it assumes rowids are 1..8 byte numbers */ - return HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | - HA_REC_NOT_IN_SEQ | HA_CAN_INDEX_BLOBS | - (m_pk_can_be_decoded? HA_PRIMARY_KEY_IN_READ_INDEX : 0) | - HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | - HA_NULL_IN_KEY | - HA_PARTIAL_COLUMN_READ; + DBUG_RETURN(HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | + HA_REC_NOT_IN_SEQ | HA_CAN_INDEX_BLOBS | + (m_pk_can_be_decoded ? HA_PRIMARY_KEY_IN_READ_INDEX : 0) | + HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_NULL_IN_KEY | + HA_PARTIAL_COLUMN_READ); } bool init_with_fields() override; @@ -602,58 +640,62 @@ If all_parts is set, MySQL wants to know the flags for the combined index, up to and including 'part'. */ - ulong index_flags(uint inx, uint part, bool all_parts) const; + ulong index_flags(uint inx, uint part, bool all_parts) const override; - const key_map * keys_to_use_for_scanning() - { - return &key_map_full; + const key_map *keys_to_use_for_scanning() override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(&key_map_full); } - bool primary_key_is_clustered() - { - return true; + bool primary_key_is_clustered() override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(true); } - bool should_store_checksums() const - { - return m_store_checksums && (rand() % 100 < m_checksums_pct); + bool should_store_row_debug_checksums() const { + return m_store_row_debug_checksums && (rand() % 100 < m_checksums_pct); } - int rename_table(const char *from, const char *to) + int rename_table(const char *const from, const char *const to) override __attribute__((__nonnull__, __warn_unused_result__)); - int convert_record_from_storage_format(const rocksdb::Slice *key, - const rocksdb::Slice *value, - uchar *buf) - __attribute__((__nonnull__, __warn_unused_result__)); - - int convert_record_from_storage_format(const rocksdb::Slice *key, - uchar *buf) - __attribute__((__nonnull__, __warn_unused_result__)); + int convert_record_from_storage_format(const rocksdb::Slice *const key, + const rocksdb::Slice *const value, + uchar *const buf) + __attribute__((__nonnull__, __warn_unused_result__)); - void convert_record_to_storage_format(const rocksdb::Slice& pk_packed_slice, - Rdb_string_writer *pk_unpack_info, - rocksdb::Slice *packed_rec) - __attribute__((__nonnull__)); + int convert_record_from_storage_format(const rocksdb::Slice *const key, + uchar *const buf) + __attribute__((__nonnull__, __warn_unused_result__)); - static const char* get_key_name(const uint index, const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) - __attribute__((__nonnull__, __warn_unused_result__)); + void convert_record_to_storage_format(const rocksdb::Slice &pk_packed_slice, + Rdb_string_writer *const pk_unpack_info, + rocksdb::Slice *const packed_rec) + __attribute__((__nonnull__)); + + static const char *get_key_name(const uint index, + const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) + __attribute__((__nonnull__, __warn_unused_result__)); - static const char* get_key_comment(const uint index, const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) - __attribute__((__nonnull__, __warn_unused_result__)); + static const char *get_key_comment(const uint index, + const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) + __attribute__((__nonnull__, __warn_unused_result__)); - static bool is_hidden_pk(const uint index, const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) - __attribute__((__nonnull__, __warn_unused_result__)); + static bool is_hidden_pk(const uint index, const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) + __attribute__((__nonnull__, __warn_unused_result__)); - static uint pk_index(const TABLE* table_arg, const Rdb_tbl_def* tbl_def_arg) - __attribute__((__nonnull__, __warn_unused_result__)); + static uint pk_index(const TABLE *const table_arg, + const Rdb_tbl_def *const tbl_def_arg) + __attribute__((__nonnull__, __warn_unused_result__)); - static bool is_pk(const uint index, const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg) - __attribute__((__nonnull__, __warn_unused_result__)); + static bool is_pk(const uint index, const TABLE *table_arg, + const Rdb_tbl_def *tbl_def_arg) + __attribute__((__nonnull__, __warn_unused_result__)); /** @brief unireg.cc will call max_supported_record_length(), max_supported_keys(), @@ -662,11 +704,30 @@ send. Return *real* limits of your storage engine here; MySQL will do min(your_limits, MySQL_limits) automatically. */ - uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } + uint max_supported_record_length() const override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(HA_MAX_REC_LENGTH); + } + + uint max_supported_keys() const override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(MAX_INDEXES); + } + + uint max_supported_key_parts() const override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(MAX_REF_PARTS); + } + + uint max_supported_key_part_length() const override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(2048); + } - uint max_supported_keys() const { return MAX_INDEXES; } - uint max_supported_key_parts() const { return MAX_REF_PARTS; } - uint max_supported_key_part_length() const { return 2048; } /** @brief unireg.cc will call this to make sure that the storage engine can handle the data it is about to send. Return *real* limits of your storage engine @@ -676,210 +737,253 @@ There is no need to implement ..._key_... methods if your engine doesn't support indexes. */ - uint max_supported_key_length() const { return 16*1024; /* just to return something*/ } + uint max_supported_key_length() const override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(16 * 1024); /* just to return something*/ + } /** TODO: return actual upper bound of number of records in the table. (e.g. save number of records seen on full table scan and/or use file size as upper bound) */ - ha_rows estimate_rows_upper_bound() { return HA_POS_ERROR; } + ha_rows estimate_rows_upper_bound() override { + DBUG_ENTER_FUNC(); + + DBUG_RETURN(HA_POS_ERROR); + } - /* At the moment, we're ok with default handler::index_init() implementation. */ - int index_read_map(uchar * buf, const uchar * key, + /* At the moment, we're ok with default handler::index_init() implementation. + */ + int index_read_map(uchar *const buf, const uchar *const key, key_part_map keypart_map, - enum ha_rkey_function find_flag); - __attribute__((__warn_unused_result__)); + enum ha_rkey_function find_flag) override + __attribute__((__warn_unused_result__)); - int index_read_map_impl(uchar * buf, const uchar * key, + int index_read_map_impl(uchar *const buf, const uchar *const key, key_part_map keypart_map, enum ha_rkey_function find_flag, const key_range *end_key) - __attribute__((__warn_unused_result__));; + __attribute__((__warn_unused_result__)); - int index_read_last_map(uchar * buf, const uchar * key, - key_part_map keypart_map) - __attribute__((__warn_unused_result__));; - - int read_range_first(const key_range *start_key, - const key_range *end_key, - bool eq_range, bool sorted) - __attribute__((__warn_unused_result__));; + int index_read_last_map(uchar *const buf, const uchar *const key, + key_part_map keypart_map) override + __attribute__((__warn_unused_result__)); + + int read_range_first(const key_range *const start_key, + const key_range *const end_key, bool eq_range, + bool sorted) override + __attribute__((__warn_unused_result__)); - virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; } - virtual double read_time(uint, uint, ha_rows rows) override; + virtual double scan_time() override { + DBUG_ENTER_FUNC(); - int open(const char *name, int mode, uint test_if_locked) - __attribute__((__warn_unused_result__)); - int close(void) __attribute__((__warn_unused_result__)); - - int write_row(uchar *buf) __attribute__((__warn_unused_result__)); - int update_row(const uchar *old_data, uchar *new_data) - __attribute__((__warn_unused_result__)); - int delete_row(const uchar *buf) __attribute__((__warn_unused_result__)); - rocksdb::Status delete_or_singledelete(uint index, - Rdb_transaction *tx, - rocksdb::ColumnFamilyHandle* cf, - const rocksdb::Slice& key) - __attribute__((__warn_unused_result__)); - - int index_next(uchar *buf) __attribute__((__warn_unused_result__)); - int index_next_with_direction(uchar *buf, bool move_forward) - __attribute__((__warn_unused_result__)); - int index_prev(uchar *buf) __attribute__((__warn_unused_result__)); + DBUG_RETURN( + static_cast((stats.records + stats.deleted) / 20.0 + 10)); + } - int index_first(uchar *buf) __attribute__((__warn_unused_result__)); - int index_last(uchar *buf) __attribute__((__warn_unused_result__)); + virtual double read_time(uint, uint, ha_rows rows) override; - class Item* idx_cond_push(uint keyno, class Item* idx_cond); + int open(const char *const name, int mode, uint test_if_locked) override + __attribute__((__warn_unused_result__)); + int close(void) override __attribute__((__warn_unused_result__)); + + int write_row(uchar *const buf) override + __attribute__((__warn_unused_result__)); + int update_row(const uchar *const old_data, uchar *const new_data) override + __attribute__((__warn_unused_result__)); + int delete_row(const uchar *const buf) override + __attribute__((__warn_unused_result__)); + rocksdb::Status delete_or_singledelete(uint index, Rdb_transaction *const tx, + rocksdb::ColumnFamilyHandle *const cf, + const rocksdb::Slice &key) + __attribute__((__warn_unused_result__)); + + int index_next(uchar *const buf) override + __attribute__((__warn_unused_result__)); + int index_next_with_direction(uchar *const buf, bool move_forward) + __attribute__((__warn_unused_result__)); + int index_prev(uchar *const buf) override + __attribute__((__warn_unused_result__)); + + int index_first(uchar *const buf) override + __attribute__((__warn_unused_result__)); + int index_last(uchar *const buf) override + __attribute__((__warn_unused_result__)); + + class Item *idx_cond_push(uint keyno, class Item *const idx_cond) override; /* Default implementation from cancel_pushed_idx_cond() suits us */ private: - struct key_def_cf_info - { - rocksdb::ColumnFamilyHandle* cf_handle; + struct key_def_cf_info { + rocksdb::ColumnFamilyHandle *cf_handle; bool is_reverse_cf; bool is_auto_cf; }; - struct update_row_info - { - Rdb_transaction* tx; - const uchar* new_data; - const uchar* old_data; - rocksdb::Slice new_pk_slice; - rocksdb::Slice old_pk_slice; + struct update_row_info { + Rdb_transaction *tx; + const uchar *new_data; + const uchar *old_data; + rocksdb::Slice new_pk_slice; + rocksdb::Slice old_pk_slice; // "unpack_info" data for the new PK value Rdb_string_writer *new_pk_unpack_info; - longlong hidden_pk_id; - bool skip_unique_check; + longlong hidden_pk_id; + bool skip_unique_check; }; - int create_cfs(const TABLE *table_arg, Rdb_tbl_def *tbl_def_arg, - std::array* cfs); - __attribute__((__nonnull__, __warn_unused_result__)); - - int create_key_def(const TABLE *table_arg, uint i, - const Rdb_tbl_def* tbl_def_arg, - std::shared_ptr* new_key_def, - const struct key_def_cf_info& cf_info); - __attribute__((__nonnull__, __warn_unused_result__)); - - int create_inplace_key_defs(const TABLE *table_arg, - Rdb_tbl_def *tbl_def_arg, - const TABLE *old_table_arg, - const Rdb_tbl_def *old_tbl_def_arg, - const std::array& cfs); - __attribute__((__nonnull__, __warn_unused_result__)); - - std::unordered_map get_old_key_positions( - const TABLE* table_arg, - const Rdb_tbl_def* tbl_def_arg, - const TABLE* old_table_arg, - const Rdb_tbl_def* old_tbl_def_arg) - __attribute__((__nonnull__)); + /* + Used to check for duplicate entries during fast unique secondary index + creation. + */ + struct unique_sk_buf_info { + bool sk_buf_switch = false; + rocksdb::Slice sk_memcmp_key; + rocksdb::Slice sk_memcmp_key_old; + uchar *dup_sk_buf; + uchar *dup_sk_buf_old; - int compare_key_parts(const KEY* old_key, const KEY* new_key); - __attribute__((__nonnull__, __warn_unused_result__)); + /* + This method is meant to be called back to back during inplace creation + of unique indexes. It will switch between two buffers, which + will each store the memcmp form of secondary keys, which are then + converted to slices in sk_memcmp_key or sk_memcmp_key_old. + + Switching buffers on each iteration allows us to retain the + sk_memcmp_key_old value for duplicate comparison. + */ + inline uchar *swap_and_get_sk_buf() { + sk_buf_switch = !sk_buf_switch; + return sk_buf_switch ? dup_sk_buf : dup_sk_buf_old; + } + }; + + int create_cfs(const TABLE *const table_arg, Rdb_tbl_def *const tbl_def_arg, + std::array *const cfs) + const __attribute__((__nonnull__, __warn_unused_result__)); + + int create_key_def(const TABLE *const table_arg, const uint &i, + const Rdb_tbl_def *const tbl_def_arg, + std::shared_ptr *const new_key_def, + const struct key_def_cf_info &cf_info) const + __attribute__((__nonnull__, __warn_unused_result__)); + + int create_inplace_key_defs( + const TABLE *const table_arg, Rdb_tbl_def *vtbl_def_arg, + const TABLE *const old_table_arg, + const Rdb_tbl_def *const old_tbl_def_arg, + const std::array &cfs) const + __attribute__((__nonnull__, __warn_unused_result__)); + + std::unordered_map + get_old_key_positions(const TABLE *table_arg, const Rdb_tbl_def *tbl_def_arg, + const TABLE *old_table_arg, + const Rdb_tbl_def *old_tbl_def_arg) const + __attribute__((__nonnull__)); + + int compare_key_parts(const KEY *const old_key, + const KEY *const new_key) const; + __attribute__((__nonnull__, __warn_unused_result__)); int index_first_intern(uchar *buf) - __attribute__((__nonnull__, __warn_unused_result__)); + __attribute__((__nonnull__, __warn_unused_result__)); int index_last_intern(uchar *buf) - __attribute__((__nonnull__, __warn_unused_result__)); + __attribute__((__nonnull__, __warn_unused_result__)); - enum icp_result check_index_cond(); - int find_icp_matching_index_rec(bool move_forward, uchar *buf) - __attribute__((__nonnull__, __warn_unused_result__)); + enum icp_result check_index_cond() const; + int find_icp_matching_index_rec(const bool &move_forward, uchar *const buf) + __attribute__((__nonnull__, __warn_unused_result__)); void calc_updated_indexes(); - int update_write_row(const uchar *old_data, const uchar *new_data, + int update_write_row(const uchar *const old_data, const uchar *const new_data, const bool skip_unique_check) - __attribute__((__warn_unused_result__)); - int get_pk_for_update(struct update_row_info* row_info); - int check_and_lock_unique_pk(uint key_id, - const struct update_row_info& row_info, - bool* found, bool* pk_changed) - __attribute__((__warn_unused_result__)); - int check_and_lock_sk(uint key_id, const struct update_row_info& row_info, - bool* found) const - __attribute__((__warn_unused_result__)); - int check_uniqueness_and_lock(const struct update_row_info& row_info, - bool* pk_changed) - __attribute__((__warn_unused_result__)); - bool over_bulk_load_threshold(int* err) - __attribute__((__warn_unused_result__)); - int bulk_load_key(Rdb_transaction* tx, - const std::shared_ptr& kd, - const rocksdb::Slice& key, - const rocksdb::Slice& value) - __attribute__((__nonnull__, __warn_unused_result__)); - int update_pk(const std::shared_ptr& kd, - const struct update_row_info& row_info, - bool pk_changed) - __attribute__((__warn_unused_result__)); - int update_sk(const TABLE* table_arg, - const std::shared_ptr& kd, - const struct update_row_info& row_info) - __attribute__((__warn_unused_result__)); - int update_indexes(const struct update_row_info& row_info, bool pk_changed) - __attribute__((__warn_unused_result__)); - - int read_key_exact(const std::shared_ptr& kd, - rocksdb::Iterator* iter, bool using_full_key, - const rocksdb::Slice& key_slice) const - __attribute__((__nonnull__, __warn_unused_result__)); - int read_before_key(const std::shared_ptr& kd, - bool using_full_key, const rocksdb::Slice& key_slice) - __attribute__((__nonnull__, __warn_unused_result__)); - int read_after_key(const std::shared_ptr& kd, - bool using_full_key, const rocksdb::Slice& key_slice) - __attribute__((__nonnull__, __warn_unused_result__)); - - int position_to_correct_key(const std::shared_ptr& kd, - enum ha_rkey_function find_flag, - bool full_key_match, const uchar* key, - key_part_map keypart_map, - const rocksdb::Slice& key_slice, - bool* move_forward) - __attribute__((__warn_unused_result__)); - - int read_row_from_primary_key(uchar* buf) - __attribute__((__nonnull__, __warn_unused_result__)); - int read_row_from_secondary_key(uchar* buf, - const std::shared_ptr& kd, + __attribute__((__warn_unused_result__)); + int get_pk_for_update(struct update_row_info *const row_info); + int check_and_lock_unique_pk(const uint &key_id, + const struct update_row_info &row_info, + bool *const found, bool *const pk_changed) + __attribute__((__warn_unused_result__)); + int check_and_lock_sk(const uint &key_id, + const struct update_row_info &row_info, + bool *const found) const + __attribute__((__warn_unused_result__)); + int check_uniqueness_and_lock(const struct update_row_info &row_info, + bool *const pk_changed) + __attribute__((__warn_unused_result__)); + bool over_bulk_load_threshold(int *err) + __attribute__((__warn_unused_result__)); + int check_duplicate_sk(const TABLE *table_arg, const Rdb_key_def &index, + const rocksdb::Slice *key, + struct unique_sk_buf_info *sk_info) + __attribute__((__nonnull__, __warn_unused_result__)); + int bulk_load_key(Rdb_transaction *const tx, const Rdb_key_def &kd, + const rocksdb::Slice &key, const rocksdb::Slice &value) + __attribute__((__nonnull__, __warn_unused_result__)); + int update_pk(const Rdb_key_def &kd, const struct update_row_info &row_info, + const bool &pk_changed) __attribute__((__warn_unused_result__)); + int update_sk(const TABLE *const table_arg, const Rdb_key_def &kd, + const struct update_row_info &row_info) + __attribute__((__warn_unused_result__)); + int update_indexes(const struct update_row_info &row_info, + const bool &pk_changed) + __attribute__((__warn_unused_result__)); + + int read_key_exact(const Rdb_key_def &kd, rocksdb::Iterator *const iter, + const bool &using_full_key, + const rocksdb::Slice &key_slice) const + __attribute__((__nonnull__, __warn_unused_result__)); + int read_before_key(const Rdb_key_def &kd, const bool &using_full_key, + const rocksdb::Slice &key_slice) + __attribute__((__nonnull__, __warn_unused_result__)); + int read_after_key(const Rdb_key_def &kd, const bool &using_full_key, + const rocksdb::Slice &key_slice) + __attribute__((__nonnull__, __warn_unused_result__)); + + int position_to_correct_key( + const Rdb_key_def &kd, const enum ha_rkey_function &find_flag, + const bool &full_key_match, const uchar *const key, + const key_part_map &keypart_map, const rocksdb::Slice &key_slice, + bool *const move_forward) __attribute__((__warn_unused_result__)); + + int read_row_from_primary_key(uchar *const buf) + __attribute__((__nonnull__, __warn_unused_result__)); + int read_row_from_secondary_key(uchar *const buf, const Rdb_key_def &kd, bool move_forward) - __attribute__((__nonnull__, __warn_unused_result__)); - int try_keyonly_read_from_sk(uchar* buf, - const std::shared_ptr& kd, - const rocksdb::Slice& key, - const rocksdb::Slice& value, - uint rowid_size) - __attribute__((__nonnull__, __warn_unused_result__)); - - int calc_eq_cond_len(const std::shared_ptr& kd, - enum ha_rkey_function find_flag, - const rocksdb::Slice& slice, int bytes_changed_by_succ, - const key_range *end_key, uint* end_key_packed_size) - __attribute__((__warn_unused_result__)); - - Rdb_tbl_def* get_table_if_exists(const char* tablename) - __attribute__((__nonnull__, __warn_unused_result__)); - void read_thd_vars(THD *thd) - __attribute__((__nonnull__)); - bool contains_foreign_key(THD* thd) - __attribute__((__nonnull__, __warn_unused_result__)); + __attribute__((__nonnull__, __warn_unused_result__)); + + int calc_eq_cond_len(const Rdb_key_def &kd, + const enum ha_rkey_function &find_flag, + const rocksdb::Slice &slice, + const int &bytes_changed_by_succ, + const key_range *const end_key, + uint *const end_key_packed_size) + __attribute__((__warn_unused_result__)); + + Rdb_tbl_def *get_table_if_exists(const char *const tablename) + __attribute__((__nonnull__, __warn_unused_result__)); + void read_thd_vars(THD *const thd) __attribute__((__nonnull__)); + const char *thd_rocksdb_tmpdir() + __attribute__((__nonnull__, __warn_unused_result__)); - int inplace_populate_sk(const TABLE* table_arg, - const std::unordered_set>& indexes); + bool contains_foreign_key(THD *const thd) + __attribute__((__nonnull__, __warn_unused_result__)); + + int inplace_populate_sk( + TABLE *const table_arg, + const std::unordered_set> &indexes) + __attribute__((__nonnull__, __warn_unused_result__)); public: - int index_init(uint idx, bool sorted) __attribute__((__warn_unused_result__)); - int index_end() __attribute__((__warn_unused_result__)); + int index_init(uint idx, bool sorted) override + __attribute__((__warn_unused_result__)); + int index_end() override __attribute__((__warn_unused_result__)); - void unlock_row(); + void unlock_row() override; /** @brief Unlike index_init(), rnd_init() can be called two consecutive times @@ -889,123 +993,132 @@ cursor to the start of the table; no need to deallocate and allocate it again. This is a required method. */ - int rnd_init(bool scan) __attribute__((__warn_unused_result__)); - int rnd_end() __attribute__((__warn_unused_result__)); - - int rnd_next(uchar *buf) __attribute__((__warn_unused_result__)); - int rnd_next_with_direction(uchar *buf, bool move_forward) - __attribute__((__warn_unused_result__)); + int rnd_init(bool scan) override __attribute__((__warn_unused_result__)); + int rnd_end() override __attribute__((__warn_unused_result__)); - int rnd_pos(uchar *buf, uchar *pos) __attribute__((__warn_unused_result__)); - void position(const uchar *record); + int rnd_next(uchar *const buf) override + __attribute__((__warn_unused_result__)); + int rnd_next_with_direction(uchar *const buf, bool move_forward) + __attribute__((__warn_unused_result__)); + + int rnd_pos(uchar *const buf, uchar *const pos) override + __attribute__((__warn_unused_result__)); + void position(const uchar *const record) override; int info(uint) override; /* This function will always return success, therefore no annotation related * to checking the return value. Can't change the signature because it's * required by the interface. */ - int extra(enum ha_extra_function operation); + int extra(enum ha_extra_function operation) override; - int start_stmt(THD *thd, thr_lock_type lock_type) - __attribute__((__warn_unused_result__)); - int external_lock(THD *thd, int lock_type) - __attribute__((__warn_unused_result__)); - int truncate() __attribute__((__warn_unused_result__)); + int start_stmt(THD *const thd, thr_lock_type lock_type) override + __attribute__((__warn_unused_result__)); + int external_lock(THD *const thd, int lock_type) override + __attribute__((__warn_unused_result__)); + int truncate() override __attribute__((__warn_unused_result__)); + + int reset() override { + DBUG_ENTER_FUNC(); - int reset() override - { /* Free blob data */ m_retrieved_record.clear(); - return 0; + + DBUG_RETURN(HA_EXIT_SUCCESS); } - int check(THD* thd, HA_CHECK_OPT* check_opt) - __attribute__((__warn_unused_result__)); - void remove_rows(Rdb_tbl_def *tbl); - ha_rows records_in_range(uint inx, key_range *min_key, - key_range *max_key) - __attribute__((__warn_unused_result__)); - int delete_table(const char *from) __attribute__((__warn_unused_result__)); - int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info) - __attribute__((__warn_unused_result__)); - bool check_if_incompatible_data(HA_CREATE_INFO *info, - uint table_changes) - __attribute__((__warn_unused_result__)); - - THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type) - __attribute__((__warn_unused_result__)); + int check(THD *const thd, HA_CHECK_OPT *const check_opt) override + __attribute__((__warn_unused_result__)); + void remove_rows(Rdb_tbl_def *const tbl); + ha_rows records_in_range(uint inx, key_range *const min_key, + key_range *const max_key) override + __attribute__((__warn_unused_result__)); + int delete_table(const char *const from) override + __attribute__((__warn_unused_result__)); + int create(const char *const name, TABLE *const form, + HA_CREATE_INFO *const create_info) override + __attribute__((__warn_unused_result__)); + bool check_if_incompatible_data(HA_CREATE_INFO *const info, + uint table_changes) override + __attribute__((__warn_unused_result__)); + + THR_LOCK_DATA **store_lock(THD *const thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type) override + __attribute__((__warn_unused_result__)); - my_bool register_query_cache_table(THD *thd, char *table_key, + my_bool register_query_cache_table(THD *const thd, char *const table_key, uint key_length, - qc_engine_callback - *engine_callback, - ulonglong *engine_data) - { + qc_engine_callback *const engine_callback, + ulonglong *const engine_data) override { + DBUG_ENTER_FUNC(); + /* Currently, we don't support query cache */ - return FALSE; + DBUG_RETURN(FALSE); } - bool get_error_message(const int error, String *buf) - __attribute__((__nonnull__)); + bool get_error_message(const int error, String *const buf) override + __attribute__((__nonnull__)); void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, - ulonglong *first_value, - ulonglong *nb_reserved_values); - void update_create_info(HA_CREATE_INFO *create_info); - int optimize(THD *thd, HA_CHECK_OPT *check_opt) - __attribute__((__warn_unused_result__)); - int analyze(THD* thd, HA_CHECK_OPT* check_opt) - __attribute__((__warn_unused_result__)); + ulonglong *const first_value, + ulonglong *const nb_reserved_values) override; + void update_create_info(HA_CREATE_INFO *const create_info) override; + int optimize(THD *const thd, HA_CHECK_OPT *const check_opt) override + __attribute__((__warn_unused_result__)); + int analyze(THD *const thd, HA_CHECK_OPT *const check_opt) override + __attribute__((__warn_unused_result__)); + int calculate_stats(const TABLE *const table_arg, THD *const thd, + HA_CHECK_OPT *const check_opt) + __attribute__((__warn_unused_result__)); enum_alter_inplace_result check_if_supported_inplace_alter( - TABLE *altered_table, - my_core::Alter_inplace_info *ha_alter_info) override; + TABLE *altered_table, + my_core::Alter_inplace_info *const ha_alter_info) override; - bool prepare_inplace_alter_table(TABLE *altered_table, - my_core::Alter_inplace_info *ha_alter_info); - - bool inplace_alter_table(TABLE *altered_table, - my_core::Alter_inplace_info *ha_alter_info); - - bool commit_inplace_alter_table(TABLE *altered_table, - my_core::Alter_inplace_info *ha_alter_info, - bool commit); + bool prepare_inplace_alter_table( + TABLE *const altered_table, + my_core::Alter_inplace_info *const ha_alter_info) override; + + bool inplace_alter_table( + TABLE *const altered_table, + my_core::Alter_inplace_info *const ha_alter_info) override; + + bool + commit_inplace_alter_table(TABLE *const altered_table, + my_core::Alter_inplace_info *const ha_alter_info, + bool commit) override; int finalize_bulk_load() __attribute__((__warn_unused_result__)); - void set_use_read_free_rpl(const char* whitelist); - void set_skip_unique_check_tables(const char* whitelist); + void set_use_read_free_rpl(const char *const whitelist); - public: +public: virtual void rpl_before_delete_rows() override; virtual void rpl_after_delete_rows() override; virtual void rpl_before_update_rows() override; virtual void rpl_after_update_rows() override; virtual bool use_read_free_rpl(); - private: +private: /* Flags tracking if we are inside different replication operation */ bool m_in_rpl_delete_rows; bool m_in_rpl_update_rows; - bool m_force_skip_unique_check; }; /* Helper class for in-place alter, for storing handler context between inplace alter calls */ -struct Rdb_inplace_alter_ctx : public my_core::inplace_alter_handler_ctx -{ +struct Rdb_inplace_alter_ctx : public my_core::inplace_alter_handler_ctx { /* The new table definition */ - Rdb_tbl_def* m_new_tdef; + Rdb_tbl_def *const m_new_tdef; /* Stores the original key definitions */ - std::shared_ptr* m_old_key_descr; + std::shared_ptr *const m_old_key_descr; /* Stores the new key definitions */ - std::shared_ptr* m_new_key_descr; + std::shared_ptr *m_new_key_descr; /* Stores the old number of key definitions */ const uint m_old_n_keys; @@ -1014,10 +1127,10 @@ const uint m_new_n_keys; /* Stores the added key glids */ - std::unordered_set> m_added_indexes; + const std::unordered_set> m_added_indexes; /* Stores the dropped key glids */ - std::unordered_set m_dropped_index_ids; + const std::unordered_set m_dropped_index_ids; /* Stores number of keys to add */ const uint m_n_added_keys; @@ -1026,28 +1139,24 @@ const uint m_n_dropped_keys; Rdb_inplace_alter_ctx( - Rdb_tbl_def* new_tdef, std::shared_ptr* old_key_descr, - std::shared_ptr* new_key_descr, uint old_n_keys, + Rdb_tbl_def *new_tdef, std::shared_ptr *old_key_descr, + std::shared_ptr *new_key_descr, uint old_n_keys, uint new_n_keys, std::unordered_set> added_indexes, - std::unordered_set dropped_index_ids, - uint n_added_keys, uint n_dropped_keys) : - my_core::inplace_alter_handler_ctx(), m_new_tdef(new_tdef), - m_old_key_descr(old_key_descr), m_new_key_descr(new_key_descr), - m_old_n_keys(old_n_keys), m_new_n_keys(new_n_keys), - m_added_indexes(added_indexes), - m_dropped_index_ids(dropped_index_ids), - m_n_added_keys(n_added_keys), - m_n_dropped_keys(n_dropped_keys) - { - } + std::unordered_set dropped_index_ids, uint n_added_keys, + uint n_dropped_keys) + : my_core::inplace_alter_handler_ctx(), m_new_tdef(new_tdef), + m_old_key_descr(old_key_descr), m_new_key_descr(new_key_descr), + m_old_n_keys(old_n_keys), m_new_n_keys(new_n_keys), + m_added_indexes(added_indexes), m_dropped_index_ids(dropped_index_ids), + m_n_added_keys(n_added_keys), m_n_dropped_keys(n_dropped_keys) {} - ~Rdb_inplace_alter_ctx(){} + ~Rdb_inplace_alter_ctx() {} - private: +private: /* Disable Copying */ - Rdb_inplace_alter_ctx(const Rdb_inplace_alter_ctx&); - Rdb_inplace_alter_ctx& operator=(const Rdb_inplace_alter_ctx&); + Rdb_inplace_alter_ctx(const Rdb_inplace_alter_ctx &); + Rdb_inplace_alter_ctx &operator=(const Rdb_inplace_alter_ctx &); }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ha_rocksdb_proto.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ha_rocksdb_proto.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ha_rocksdb_proto.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ha_rocksdb_proto.h 2017-10-19 04:25:29.000000000 +0000 @@ -24,33 +24,35 @@ /* RocksDB includes */ #include "rocksdb/table.h" +#include "rocksdb/utilities/transaction_db.h" namespace myrocks { enum RDB_IO_ERROR_TYPE { RDB_IO_ERROR_TX_COMMIT, RDB_IO_ERROR_DICT_COMMIT, - RDB_IO_ERROR_BG_THREAD + RDB_IO_ERROR_BG_THREAD, + RDB_IO_ERROR_GENERAL }; void rdb_handle_io_error(rocksdb::Status status, RDB_IO_ERROR_TYPE err_type); -int rdb_normalize_tablename(const std::string& tablename, std::string* str) - __attribute__((__nonnull__, __warn_unused_result__)); +int rdb_normalize_tablename(const std::string &tablename, std::string *str) + __attribute__((__nonnull__, __warn_unused_result__)); -int rdb_split_normalized_tablename(const std::string& fullname, std::string *db, +int rdb_split_normalized_tablename(const std::string &fullname, std::string *db, std::string *table = nullptr, std::string *partition = nullptr) - __attribute__((__warn_unused_result__)); + __attribute__((__warn_unused_result__)); std::vector rdb_get_open_table_names(void); int rdb_get_table_perf_counters(const char *tablename, Rdb_perf_counters *counters) - __attribute__((__nonnull__(2))); + __attribute__((__nonnull__(2))); void rdb_get_global_perf_counters(Rdb_perf_counters *counters) - __attribute__((__nonnull__(1))); + __attribute__((__nonnull__(1))); void rdb_queue_save_stats_request(); @@ -58,23 +60,19 @@ Access to singleton objects. */ -rocksdb::DB *rdb_get_rocksdb_db(); +rocksdb::TransactionDB *rdb_get_rocksdb_db(); class Rdb_cf_manager; -Rdb_cf_manager& rdb_get_cf_manager(); +Rdb_cf_manager &rdb_get_cf_manager(); -rocksdb::BlockBasedTableOptions& rdb_get_table_options(); +rocksdb::BlockBasedTableOptions &rdb_get_table_options(); class Rdb_dict_manager; Rdb_dict_manager *rdb_get_dict_manager(void) - __attribute__((__warn_unused_result__)); + __attribute__((__warn_unused_result__)); class Rdb_ddl_manager; Rdb_ddl_manager *rdb_get_ddl_manager(void) - __attribute__((__warn_unused_result__)); + __attribute__((__warn_unused_result__)); -class Rdb_binlog_manager; -Rdb_binlog_manager *rdb_get_binlog_manager(void) - __attribute__((__warn_unused_result__)); - -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ib_ut0counter.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ib_ut0counter.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/ib_ut0counter.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/ib_ut0counter.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,210 @@ +/***************************************************************************** + +Copyright (c) 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, Suite 500, Boston, MA 02110-1335 USA + +*****************************************************************************/ + +/**************************************************//** +@file include/ut0counter.h + +Counter utility class + +Created 2012/04/12 by Sunny Bains +*******************************************************/ + +#ifndef UT0COUNTER_H +#define UT0COUNTER_H + +#include + +/** CPU cache line size */ +#define CACHE_LINE_SIZE 64 + +/** Default number of slots to use in ib_counter_t */ +#define IB_N_SLOTS 64 + +#ifdef __WIN__ +#define get_curr_thread_id() GetCurrentThreadId() +#else +#define get_curr_thread_id() pthread_self() +#endif + +#define UT_ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + +/** Get the offset into the counter array. */ +template +struct generic_indexer_t { + /** Default constructor/destructor should be OK. */ + + /** @return offset within m_counter */ + size_t offset(size_t index) const { + return(((index % N) + 1) * (CACHE_LINE_SIZE / sizeof(Type))); + } +}; + +#ifdef HAVE_SCHED_GETCPU +//#include // Including this causes problems with EMPTY symbol +#include // Include this instead +/** Use the cpu id to index into the counter array. If it fails then +use the thread id. */ +template +struct get_sched_indexer_t : public generic_indexer_t { + /** Default constructor/destructor should be OK. */ + + /* @return result from sched_getcpu(), the thread id if it fails. */ + size_t get_rnd_index() const { + + size_t cpu = sched_getcpu(); + if (cpu == (size_t) -1) { + cpu = get_curr_thread_id(); + } + + return(cpu); + } +}; +#endif /* HAVE_SCHED_GETCPU */ + +/** Use the thread id to index into the counter array. */ +template +struct thread_id_indexer_t : public generic_indexer_t { + /** Default constructor/destructor should are OK. */ + + /* @return a random number, currently we use the thread id. Where + thread id is represented as a pointer, it may not work as + effectively. */ + size_t get_rnd_index() const { + return get_curr_thread_id(); + } +}; + +/** For counters wher N=1 */ +template +struct single_indexer_t { + /** Default constructor/destructor should are OK. */ + + /** @return offset within m_counter */ + size_t offset(size_t index) const { + DBUG_ASSERT(N == 1); + return((CACHE_LINE_SIZE / sizeof(Type))); + } + + /* @return 1 */ + size_t get_rnd_index() const { + DBUG_ASSERT(N == 1); + return(1); + } +}; + +/** Class for using fuzzy counters. The counter is not protected by any +mutex and the results are not guaranteed to be 100% accurate but close +enough. Creates an array of counters and separates each element by the +CACHE_LINE_SIZE bytes */ +template < + typename Type, + int N = IB_N_SLOTS, + template class Indexer = thread_id_indexer_t> +class ib_counter_t { +public: + ib_counter_t() { memset(m_counter, 0x0, sizeof(m_counter)); } + + ~ib_counter_t() + { + DBUG_ASSERT(validate()); + } + + bool validate() { +#ifdef UNIV_DEBUG + size_t n = (CACHE_LINE_SIZE / sizeof(Type)); + + /* Check that we aren't writing outside our defined bounds. */ + for (size_t i = 0; i < UT_ARRAY_SIZE(m_counter); i += n) { + for (size_t j = 1; j < n - 1; ++j) { + DBUG_ASSERT(m_counter[i + j] == 0); + } + } +#endif /* UNIV_DEBUG */ + return(true); + } + + /** If you can't use a good index id. Increment by 1. */ + void inc() { add(1); } + + /** If you can't use a good index id. + * @param n - is the amount to increment */ + void add(Type n) { + size_t i = m_policy.offset(m_policy.get_rnd_index()); + + DBUG_ASSERT(i < UT_ARRAY_SIZE(m_counter)); + + m_counter[i] += n; + } + + /** Use this if you can use a unique indentifier, saves a + call to get_rnd_index(). + @param i - index into a slot + @param n - amount to increment */ + void add(size_t index, Type n) { + size_t i = m_policy.offset(index); + + DBUG_ASSERT(i < UT_ARRAY_SIZE(m_counter)); + + m_counter[i] += n; + } + + /** If you can't use a good index id. Decrement by 1. */ + void dec() { sub(1); } + + /** If you can't use a good index id. + * @param - n is the amount to decrement */ + void sub(Type n) { + size_t i = m_policy.offset(m_policy.get_rnd_index()); + + DBUG_ASSERT(i < UT_ARRAY_SIZE(m_counter)); + + m_counter[i] -= n; + } + + /** Use this if you can use a unique indentifier, saves a + call to get_rnd_index(). + @param i - index into a slot + @param n - amount to decrement */ + void sub(size_t index, Type n) { + size_t i = m_policy.offset(index); + + DBUG_ASSERT(i < UT_ARRAY_SIZE(m_counter)); + + m_counter[i] -= n; + } + + /* @return total value - not 100% accurate, since it is not atomic. */ + operator Type() const { + Type total = 0; + + for (size_t i = 0; i < N; ++i) { + total += m_counter[m_policy.offset(i)]; + } + + return(total); + } + +private: + /** Indexer into the array */ + Indexerm_policy; + + /** Slot 0 is unused. */ + Type m_counter[(N + 1) * (CACHE_LINE_SIZE / sizeof(Type))]; +}; + +#endif /* UT0COUNTER_H */ diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/logger.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/logger.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/logger.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/logger.h 2017-10-19 04:25:29.000000000 +0000 @@ -21,13 +21,10 @@ namespace myrocks { -class Rdb_logger : public rocksdb::Logger -{ - public: - void Logv(const rocksdb::InfoLogLevel log_level, - const char* format, - va_list ap) override - { +class Rdb_logger : public rocksdb::Logger { +public: + void Logv(const rocksdb::InfoLogLevel log_level, const char *format, + va_list ap) override { DBUG_ASSERT(format != nullptr); enum loglevel mysql_log_level; @@ -41,11 +38,11 @@ } if (log_level >= rocksdb::InfoLogLevel::ERROR_LEVEL) { - mysql_log_level= ERROR_LEVEL; + mysql_log_level = ERROR_LEVEL; } else if (log_level >= rocksdb::InfoLogLevel::WARN_LEVEL) { - mysql_log_level= WARNING_LEVEL; + mysql_log_level = WARNING_LEVEL; } else { - mysql_log_level= INFORMATION_LEVEL; + mysql_log_level = INFORMATION_LEVEL; } // log to MySQL @@ -54,20 +51,18 @@ error_log_print(mysql_log_level, f.c_str(), ap); } - void Logv(const char* format, va_list ap) override - { + void Logv(const char *format, va_list ap) override { DBUG_ASSERT(format != nullptr); // If no level is specified, it is by default at information level Logv(rocksdb::InfoLogLevel::INFO_LEVEL, format, ap); } - void SetRocksDBLogger(std::shared_ptr logger) - { + void SetRocksDBLogger(const std::shared_ptr logger) { m_logger = logger; } - private: +private: std::shared_ptr m_logger; }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/properties_collector.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/properties_collector.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/properties_collector.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/properties_collector.cc 2017-10-19 04:25:29.000000000 +0000 @@ -41,21 +41,17 @@ std::atomic rocksdb_num_sst_entry_other(0); my_bool rocksdb_compaction_sequential_deletes_count_sd = false; -Rdb_tbl_prop_coll::Rdb_tbl_prop_coll( - Rdb_ddl_manager* ddl_manager, - Rdb_compact_params params, - uint32_t cf_id, - const uint8_t table_stats_sampling_pct -) : - m_cf_id(cf_id), - m_ddl_manager(ddl_manager), - m_last_stats(nullptr), - m_rows(0l), m_window_pos(0l), m_deleted_rows(0l), m_max_deleted_rows(0l), - m_file_size(0), m_params(params), - m_table_stats_sampling_pct(table_stats_sampling_pct), - m_seed(time(nullptr)), - m_card_adj_extra(1.) -{ +Rdb_tbl_prop_coll::Rdb_tbl_prop_coll(Rdb_ddl_manager *const ddl_manager, + const Rdb_compact_params ¶ms, + const uint32_t &cf_id, + const uint8_t &table_stats_sampling_pct) + : m_cf_id(cf_id), m_ddl_manager(ddl_manager), m_last_stats(nullptr), + m_rows(0l), m_window_pos(0l), m_deleted_rows(0l), m_max_deleted_rows(0l), + m_file_size(0), m_params(params), + m_table_stats_sampling_pct(table_stats_sampling_pct), + m_seed(time(nullptr)), m_card_adj_extra(1.) { + DBUG_ASSERT(ddl_manager != nullptr); + // We need to adjust the index cardinality numbers based on the sampling // rate so that the output of "SHOW INDEX" command will reflect reality // more closely. It will still be an approximation, just a better one. @@ -69,12 +65,11 @@ /* This function is called by RocksDB for every key in the SST file */ -rocksdb::Status -Rdb_tbl_prop_coll::AddUserKey( - const rocksdb::Slice& key, const rocksdb::Slice& value, - rocksdb::EntryType type, rocksdb::SequenceNumber seq, - uint64_t file_size -) { +rocksdb::Status Rdb_tbl_prop_coll::AddUserKey(const rocksdb::Slice &key, + const rocksdb::Slice &value, + rocksdb::EntryType type, + rocksdb::SequenceNumber seq, + uint64_t file_size) { if (key.size() >= 4) { AdjustDeletedRows(type); @@ -86,10 +81,8 @@ return rocksdb::Status::OK(); } -void Rdb_tbl_prop_coll::AdjustDeletedRows(rocksdb::EntryType type) -{ - if (m_params.m_window > 0) - { +void Rdb_tbl_prop_coll::AdjustDeletedRows(rocksdb::EntryType type) { + if (m_params.m_window > 0) { // record the "is deleted" flag into the sliding window // the sliding window is implemented as a circular buffer // in m_deleted_rows_window vector @@ -97,42 +90,33 @@ // m_rows % m_deleted_rows_window.size() // m_deleted_rows is the current number of 1's in the vector // --update the counter for the element which will be overridden - bool is_delete= (type == rocksdb::kEntryDelete || - (type == rocksdb::kEntrySingleDelete && - rocksdb_compaction_sequential_deletes_count_sd)); + const bool is_delete = (type == rocksdb::kEntryDelete || + (type == rocksdb::kEntrySingleDelete && + rocksdb_compaction_sequential_deletes_count_sd)); // Only make changes if the value at the current position needs to change - if (is_delete != m_deleted_rows_window[m_window_pos]) - { + if (is_delete != m_deleted_rows_window[m_window_pos]) { // Set or clear the flag at the current position as appropriate - m_deleted_rows_window[m_window_pos]= is_delete; - if (!is_delete) - { + m_deleted_rows_window[m_window_pos] = is_delete; + if (!is_delete) { m_deleted_rows--; - } - else if (++m_deleted_rows > m_max_deleted_rows) - { + } else if (++m_deleted_rows > m_max_deleted_rows) { m_max_deleted_rows = m_deleted_rows; } } - if (++m_window_pos == m_params.m_window) - { + if (++m_window_pos == m_params.m_window) { m_window_pos = 0; } } } -Rdb_index_stats* Rdb_tbl_prop_coll::AccessStats( - const rocksdb::Slice& key) -{ - GL_INDEX_ID gl_index_id = { - .cf_id = m_cf_id, - .index_id = rdb_netbuf_to_uint32(reinterpret_cast(key.data())) - }; +Rdb_index_stats *Rdb_tbl_prop_coll::AccessStats(const rocksdb::Slice &key) { + GL_INDEX_ID gl_index_id = {.cf_id = m_cf_id, + .index_id = rdb_netbuf_to_uint32( + reinterpret_cast(key.data()))}; - if (m_last_stats == nullptr || m_last_stats->m_gl_index_id != gl_index_id) - { + if (m_last_stats == nullptr || m_last_stats->m_gl_index_id != gl_index_id) { m_keydef = nullptr; // starting a new table @@ -140,8 +124,7 @@ m_stats.emplace_back(gl_index_id); m_last_stats = &m_stats.back(); - if (m_ddl_manager) - { + if (m_ddl_manager) { // safe_find() returns a std::shared_ptr with the count // incremented (so it can't be deleted out from under us) and with // the mutex locked (if setup has not occurred yet). We must make @@ -150,8 +133,7 @@ // when we are switching to a new Rdb_key_def and when this object // is destructed. m_keydef = m_ddl_manager->safe_find(gl_index_id); - if (m_keydef != nullptr) - { + if (m_keydef != nullptr) { // resize the array to the number of columns. // It will be initialized with zeroes m_last_stats->m_distinct_keys_per_prefix.resize( @@ -165,13 +147,13 @@ return m_last_stats; } -void Rdb_tbl_prop_coll::CollectStatsForRow( - const rocksdb::Slice& key, const rocksdb::Slice& value, - rocksdb::EntryType type, uint64_t file_size) -{ - auto stats = AccessStats(key); +void Rdb_tbl_prop_coll::CollectStatsForRow(const rocksdb::Slice &key, + const rocksdb::Slice &value, + const rocksdb::EntryType &type, + const uint64_t &file_size) { + const auto stats = AccessStats(key); - stats->m_data_size += key.size()+value.size(); + stats->m_data_size += key.size() + value.size(); // Incrementing per-index entry-type statistics switch (type) { @@ -193,7 +175,8 @@ default: // NO_LINT_DEBUG sql_print_error("RocksDB: Unexpected entry type found: %u. " - "This should not happen so aborting the system.", type); + "This should not happen so aborting the system.", + type); abort_with_stack_traces(); break; } @@ -201,23 +184,19 @@ stats->m_actual_disk_size += file_size - m_file_size; m_file_size = file_size; - if (m_keydef != nullptr && ShouldCollectStats()) - { + if (m_keydef != nullptr && ShouldCollectStats()) { std::size_t column = 0; bool new_key = true; - if (!m_last_key.empty()) - { + if (!m_last_key.empty()) { rocksdb::Slice last(m_last_key.data(), m_last_key.size()); new_key = (m_keydef->compare_keys(&last, &key, &column) == 0); } - if (new_key) - { + if (new_key) { DBUG_ASSERT(column <= stats->m_distinct_keys_per_prefix.size()); - for (auto i = column; i < stats->m_distinct_keys_per_prefix.size(); i++) - { + for (auto i = column; i < stats->m_distinct_keys_per_prefix.size(); i++) { stats->m_distinct_keys_per_prefix[i]++; } @@ -226,31 +205,29 @@ // if one of the first n-1 columns is different // If the n-1 prefix is the same, no sense in storing // the new key - if (column < stats->m_distinct_keys_per_prefix.size()) - { + if (column < stats->m_distinct_keys_per_prefix.size()) { m_last_key.assign(key.data(), key.size()); } } } } -const char* Rdb_tbl_prop_coll::INDEXSTATS_KEY = "__indexstats__"; +const char *Rdb_tbl_prop_coll::INDEXSTATS_KEY = "__indexstats__"; /* This function is called by RocksDB to compute properties to store in sst file */ rocksdb::Status -Rdb_tbl_prop_coll::Finish( - rocksdb::UserCollectedProperties* properties -) { +Rdb_tbl_prop_coll::Finish(rocksdb::UserCollectedProperties *const properties) { uint64_t num_sst_entry_put = 0; uint64_t num_sst_entry_delete = 0; uint64_t num_sst_entry_singledelete = 0; uint64_t num_sst_entry_merge = 0; uint64_t num_sst_entry_other = 0; - for (auto it = m_stats.begin(); it != m_stats.end(); it++) - { + DBUG_ASSERT(properties != nullptr); + + for (auto it = m_stats.begin(); it != m_stats.end(); it++) { num_sst_entry_put += it->m_rows; num_sst_entry_delete += it->m_entry_deletes; num_sst_entry_singledelete += it->m_entry_single_deletes; @@ -258,42 +235,35 @@ num_sst_entry_other += it->m_entry_others; } - if (num_sst_entry_put > 0) - { + if (num_sst_entry_put > 0) { rocksdb_num_sst_entry_put += num_sst_entry_put; } - if (num_sst_entry_delete > 0) - { + if (num_sst_entry_delete > 0) { rocksdb_num_sst_entry_delete += num_sst_entry_delete; } - if (num_sst_entry_singledelete > 0) - { + if (num_sst_entry_singledelete > 0) { rocksdb_num_sst_entry_singledelete += num_sst_entry_singledelete; } - if (num_sst_entry_merge > 0) - { + if (num_sst_entry_merge > 0) { rocksdb_num_sst_entry_merge += num_sst_entry_merge; } - if (num_sst_entry_other > 0) - { + if (num_sst_entry_other > 0) { rocksdb_num_sst_entry_other += num_sst_entry_other; } properties->insert({INDEXSTATS_KEY, - Rdb_index_stats::materialize(m_stats, m_card_adj_extra)}); + Rdb_index_stats::materialize(m_stats, m_card_adj_extra)}); return rocksdb::Status::OK(); } bool Rdb_tbl_prop_coll::NeedCompact() const { - return - m_params.m_deletes && - (m_params.m_window > 0) && - (m_file_size > m_params.m_file_size) && - (m_max_deleted_rows > m_params.m_deletes); + return m_params.m_deletes && (m_params.m_window > 0) && + (m_file_size > m_params.m_file_size) && + (m_max_deleted_rows > m_params.m_deletes); } bool Rdb_tbl_prop_coll::ShouldCollectStats() { @@ -303,9 +273,9 @@ return true; } - int val = rand_r(&m_seed) % - (RDB_TBL_STATS_SAMPLE_PCT_MAX - RDB_TBL_STATS_SAMPLE_PCT_MIN + 1) + - RDB_TBL_STATS_SAMPLE_PCT_MIN; + const int val = rand_r(&m_seed) % (RDB_TBL_STATS_SAMPLE_PCT_MAX - + RDB_TBL_STATS_SAMPLE_PCT_MIN + 1) + + RDB_TBL_STATS_SAMPLE_PCT_MIN; DBUG_ASSERT(val >= RDB_TBL_STATS_SAMPLE_PCT_MIN); DBUG_ASSERT(val <= RDB_TBL_STATS_SAMPLE_PCT_MAX); @@ -333,14 +303,11 @@ } s.append(GetReadableStats(it)); } - #endif +#endif return rocksdb::UserCollectedProperties{{INDEXSTATS_KEY, s}}; } -std::string -Rdb_tbl_prop_coll::GetReadableStats( - const Rdb_index_stats& it -) { +std::string Rdb_tbl_prop_coll::GetReadableStats(const Rdb_index_stats &it) { std::string s; s.append("("); s.append(std::to_string(it.m_gl_index_id.cf_id)); @@ -376,31 +343,27 @@ */ void Rdb_tbl_prop_coll::read_stats_from_tbl_props( - const std::shared_ptr& table_props, - std::vector* out_stats_vector) -{ + const std::shared_ptr &table_props, + std::vector *const out_stats_vector) { DBUG_ASSERT(out_stats_vector != nullptr); - const auto& user_properties = table_props->user_collected_properties; - auto it2 = user_properties.find(std::string(INDEXSTATS_KEY)); - if (it2 != user_properties.end()) - { + const auto &user_properties = table_props->user_collected_properties; + const auto it2 = user_properties.find(std::string(INDEXSTATS_KEY)); + if (it2 != user_properties.end()) { auto result __attribute__((__unused__)) = Rdb_index_stats::unmaterialize(it2->second, out_stats_vector); DBUG_ASSERT(result == 0); } } - /* Serializes an array of Rdb_index_stats into a network string. */ -std::string Rdb_index_stats::materialize( - const std::vector& stats, - const float card_adj_extra) -{ +std::string +Rdb_index_stats::materialize(const std::vector &stats, + const float card_adj_extra) { String ret; rdb_netstr_append_uint16(&ret, INDEX_STATS_VERSION_ENTRY_TYPES); - for (auto i : stats) { + for (const auto &i : stats) { rdb_netstr_append_uint32(&ret, i.m_gl_index_id.cf_id); rdb_netstr_append_uint32(&ret, i.m_gl_index_id.index_id); DBUG_ASSERT(sizeof i.m_data_size <= 8); @@ -412,108 +375,98 @@ rdb_netstr_append_uint64(&ret, i.m_entry_single_deletes); rdb_netstr_append_uint64(&ret, i.m_entry_merges); rdb_netstr_append_uint64(&ret, i.m_entry_others); - for (auto num_keys : i.m_distinct_keys_per_prefix) { - float upd_num_keys = num_keys * card_adj_extra; + for (const auto &num_keys : i.m_distinct_keys_per_prefix) { + const float upd_num_keys = num_keys * card_adj_extra; rdb_netstr_append_uint64(&ret, static_cast(upd_num_keys)); } } - return std::string((char*) ret.ptr(), ret.length()); + return std::string((char *)ret.ptr(), ret.length()); } /** @brief Reads an array of Rdb_index_stats from a string. - @return 1 if it detects any inconsistency in the input - @return 0 if completes successfully + @return HA_EXIT_FAILURE if it detects any inconsistency in the input + @return HA_EXIT_SUCCESS if completes successfully */ -int Rdb_index_stats::unmaterialize( - const std::string& s, std::vector* ret) -{ - const uchar* p= rdb_std_str_to_uchar_ptr(s); - const uchar* p2= p + s.size(); +int Rdb_index_stats::unmaterialize(const std::string &s, + std::vector *const ret) { + const uchar *p = rdb_std_str_to_uchar_ptr(s); + const uchar *const p2 = p + s.size(); DBUG_ASSERT(ret != nullptr); - if (p+2 > p2) - { - return 1; + if (p + 2 > p2) { + return HA_EXIT_FAILURE; } - int version= rdb_netbuf_read_uint16(&p); + const int version = rdb_netbuf_read_uint16(&p); Rdb_index_stats stats; // Make sure version is within supported range. if (version < INDEX_STATS_VERSION_INITIAL || - version > INDEX_STATS_VERSION_ENTRY_TYPES) - { + version > INDEX_STATS_VERSION_ENTRY_TYPES) { // NO_LINT_DEBUG sql_print_error("Index stats version %d was outside of supported range. " - "This should not happen so aborting the system.", version); + "This should not happen so aborting the system.", + version); abort_with_stack_traces(); } - size_t needed = sizeof(stats.m_gl_index_id.cf_id)+ - sizeof(stats.m_gl_index_id.index_id)+ - sizeof(stats.m_data_size)+ - sizeof(stats.m_rows)+ - sizeof(stats.m_actual_disk_size)+ - sizeof(uint64); - if (version >= INDEX_STATS_VERSION_ENTRY_TYPES) - { - needed += sizeof(stats.m_entry_deletes)+ - sizeof(stats.m_entry_single_deletes)+ - sizeof(stats.m_entry_merges)+ - sizeof(stats.m_entry_others); - } - - while (p < p2) - { - if (p+needed > p2) - { - return 1; + size_t needed = sizeof(stats.m_gl_index_id.cf_id) + + sizeof(stats.m_gl_index_id.index_id) + + sizeof(stats.m_data_size) + sizeof(stats.m_rows) + + sizeof(stats.m_actual_disk_size) + sizeof(uint64); + if (version >= INDEX_STATS_VERSION_ENTRY_TYPES) { + needed += sizeof(stats.m_entry_deletes) + + sizeof(stats.m_entry_single_deletes) + + sizeof(stats.m_entry_merges) + sizeof(stats.m_entry_others); + } + + while (p < p2) { + if (p + needed > p2) { + return HA_EXIT_FAILURE; } rdb_netbuf_read_gl_index(&p, &stats.m_gl_index_id); - stats.m_data_size= rdb_netbuf_read_uint64(&p); - stats.m_rows= rdb_netbuf_read_uint64(&p); - stats.m_actual_disk_size= rdb_netbuf_read_uint64(&p); + stats.m_data_size = rdb_netbuf_read_uint64(&p); + stats.m_rows = rdb_netbuf_read_uint64(&p); + stats.m_actual_disk_size = rdb_netbuf_read_uint64(&p); stats.m_distinct_keys_per_prefix.resize(rdb_netbuf_read_uint64(&p)); - if (version >= INDEX_STATS_VERSION_ENTRY_TYPES) - { - stats.m_entry_deletes= rdb_netbuf_read_uint64(&p); - stats.m_entry_single_deletes= rdb_netbuf_read_uint64(&p); - stats.m_entry_merges= rdb_netbuf_read_uint64(&p); - stats.m_entry_others= rdb_netbuf_read_uint64(&p); - } - if (p+stats.m_distinct_keys_per_prefix.size() - *sizeof(stats.m_distinct_keys_per_prefix[0]) > p2) - { - return 1; - } - for (std::size_t i= 0; i < stats.m_distinct_keys_per_prefix.size(); i++) - { - stats.m_distinct_keys_per_prefix[i]= rdb_netbuf_read_uint64(&p); + if (version >= INDEX_STATS_VERSION_ENTRY_TYPES) { + stats.m_entry_deletes = rdb_netbuf_read_uint64(&p); + stats.m_entry_single_deletes = rdb_netbuf_read_uint64(&p); + stats.m_entry_merges = rdb_netbuf_read_uint64(&p); + stats.m_entry_others = rdb_netbuf_read_uint64(&p); + } + if (p + + stats.m_distinct_keys_per_prefix.size() * + sizeof(stats.m_distinct_keys_per_prefix[0]) > + p2) { + return HA_EXIT_FAILURE; + } + for (std::size_t i = 0; i < stats.m_distinct_keys_per_prefix.size(); i++) { + stats.m_distinct_keys_per_prefix[i] = rdb_netbuf_read_uint64(&p); } ret->push_back(stats); } - return 0; + return HA_EXIT_SUCCESS; } /* Merges one Rdb_index_stats into another. Can be used to come up with the stats for the index based on stats for each sst */ -void Rdb_index_stats::merge( - const Rdb_index_stats& s, bool increment, int64_t estimated_data_len) -{ +void Rdb_index_stats::merge(const Rdb_index_stats &s, const bool &increment, + const int64_t &estimated_data_len) { std::size_t i; + DBUG_ASSERT(estimated_data_len >= 0); + m_gl_index_id = s.m_gl_index_id; - if (m_distinct_keys_per_prefix.size() < s.m_distinct_keys_per_prefix.size()) - { + if (m_distinct_keys_per_prefix.size() < s.m_distinct_keys_per_prefix.size()) { m_distinct_keys_per_prefix.resize(s.m_distinct_keys_per_prefix.size()); } - if (increment) - { + if (increment) { m_rows += s.m_rows; m_data_size += s.m_data_size; @@ -524,32 +477,28 @@ we make a reasoned estimate for the data_file_length for the index in the current SST. */ - m_actual_disk_size += s.m_actual_disk_size ? s.m_actual_disk_size : - estimated_data_len * s.m_rows; + m_actual_disk_size += s.m_actual_disk_size ? s.m_actual_disk_size + : estimated_data_len * s.m_rows; m_entry_deletes += s.m_entry_deletes; m_entry_single_deletes += s.m_entry_single_deletes; m_entry_merges += s.m_entry_merges; m_entry_others += s.m_entry_others; - for (i = 0; i < s.m_distinct_keys_per_prefix.size(); i++) - { + for (i = 0; i < s.m_distinct_keys_per_prefix.size(); i++) { m_distinct_keys_per_prefix[i] += s.m_distinct_keys_per_prefix[i]; } - } - else - { + } else { m_rows -= s.m_rows; m_data_size -= s.m_data_size; - m_actual_disk_size -= s.m_actual_disk_size ? s.m_actual_disk_size : - estimated_data_len * s.m_rows; + m_actual_disk_size -= s.m_actual_disk_size ? s.m_actual_disk_size + : estimated_data_len * s.m_rows; m_entry_deletes -= s.m_entry_deletes; m_entry_single_deletes -= s.m_entry_single_deletes; m_entry_merges -= s.m_entry_merges; m_entry_others -= s.m_entry_others; - for (i = 0; i < s.m_distinct_keys_per_prefix.size(); i++) - { + for (i = 0; i < s.m_distinct_keys_per_prefix.size(); i++) { m_distinct_keys_per_prefix[i] -= s.m_distinct_keys_per_prefix[i]; } } } -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/properties_collector.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/properties_collector.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/properties_collector.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/properties_collector.h 2017-10-19 04:25:29.000000000 +0000 @@ -40,101 +40,87 @@ extern std::atomic rocksdb_num_sst_entry_other; extern my_bool rocksdb_compaction_sequential_deletes_count_sd; - -struct Rdb_compact_params -{ +struct Rdb_compact_params { uint64_t m_deletes, m_window, m_file_size; }; - -struct Rdb_index_stats -{ - enum { - INDEX_STATS_VERSION_INITIAL= 1, - INDEX_STATS_VERSION_ENTRY_TYPES= 2, +struct Rdb_index_stats { + enum { + INDEX_STATS_VERSION_INITIAL = 1, + INDEX_STATS_VERSION_ENTRY_TYPES = 2, }; GL_INDEX_ID m_gl_index_id; int64_t m_data_size, m_rows, m_actual_disk_size; int64_t m_entry_deletes, m_entry_single_deletes; int64_t m_entry_merges, m_entry_others; std::vector m_distinct_keys_per_prefix; - std::string m_name; // name is not persisted + std::string m_name; // name is not persisted - static std::string materialize(const std::vector& stats, + static std::string materialize(const std::vector &stats, const float card_adj_extra); - static int unmaterialize(const std::string& s, - std::vector* ret); + static int unmaterialize(const std::string &s, + std::vector *const ret); Rdb_index_stats() : Rdb_index_stats({0, 0}) {} - explicit Rdb_index_stats(GL_INDEX_ID gl_index_id) : - m_gl_index_id(gl_index_id), - m_data_size(0), - m_rows(0), - m_actual_disk_size(0), - m_entry_deletes(0), - m_entry_single_deletes(0), - m_entry_merges(0), - m_entry_others(0) {} + explicit Rdb_index_stats(GL_INDEX_ID gl_index_id) + : m_gl_index_id(gl_index_id), m_data_size(0), m_rows(0), + m_actual_disk_size(0), m_entry_deletes(0), m_entry_single_deletes(0), + m_entry_merges(0), m_entry_others(0) {} - void merge(const Rdb_index_stats& s, bool increment = true, - int64_t estimated_data_len = 0); + void merge(const Rdb_index_stats &s, const bool &increment = true, + const int64_t &estimated_data_len = 0); }; - -class Rdb_tbl_prop_coll : public rocksdb::TablePropertiesCollector -{ - public: - Rdb_tbl_prop_coll( - Rdb_ddl_manager* ddl_manager, - Rdb_compact_params params, - uint32_t cf_id, - const uint8_t table_stats_sampling_pct - ); +class Rdb_tbl_prop_coll : public rocksdb::TablePropertiesCollector { +public: + Rdb_tbl_prop_coll(Rdb_ddl_manager *const ddl_manager, + const Rdb_compact_params ¶ms, const uint32_t &cf_id, + const uint8_t &table_stats_sampling_pct); /* Override parent class's virtual methods of interest. */ - virtual rocksdb::Status AddUserKey( - const rocksdb::Slice& key, const rocksdb::Slice& value, - rocksdb::EntryType type, rocksdb::SequenceNumber seq, - uint64_t file_size); + virtual rocksdb::Status AddUserKey(const rocksdb::Slice &key, + const rocksdb::Slice &value, + rocksdb::EntryType type, + rocksdb::SequenceNumber seq, + uint64_t file_size); - virtual rocksdb::Status Finish(rocksdb::UserCollectedProperties* properties) override; + virtual rocksdb::Status + Finish(rocksdb::UserCollectedProperties *properties) override; - virtual const char* Name() const override { - return "Rdb_tbl_prop_coll"; - } + virtual const char *Name() const override { return "Rdb_tbl_prop_coll"; } rocksdb::UserCollectedProperties GetReadableProperties() const override; bool NeedCompact() const override; - public: - uint64_t GetMaxDeletedRows() const { - return m_max_deleted_rows; - } +public: + uint64_t GetMaxDeletedRows() const { return m_max_deleted_rows; } static void read_stats_from_tbl_props( - const std::shared_ptr& table_props, - std::vector* out_stats_vector); + const std::shared_ptr &table_props, + std::vector *out_stats_vector); - private: - static std::string GetReadableStats(const Rdb_index_stats& it); +private: + static std::string GetReadableStats(const Rdb_index_stats &it); bool ShouldCollectStats(); - void CollectStatsForRow(const rocksdb::Slice& key, - const rocksdb::Slice& value, rocksdb::EntryType type, uint64_t file_size); - Rdb_index_stats* AccessStats(const rocksdb::Slice& key); + void CollectStatsForRow(const rocksdb::Slice &key, + const rocksdb::Slice &value, + const rocksdb::EntryType &type, + const uint64_t &file_size); + Rdb_index_stats *AccessStats(const rocksdb::Slice &key); void AdjustDeletedRows(rocksdb::EntryType type); - private: +private: uint32_t m_cf_id; - std::shared_ptr m_keydef; - Rdb_ddl_manager* m_ddl_manager; + std::shared_ptr m_keydef; + Rdb_ddl_manager *m_ddl_manager; std::vector m_stats; - Rdb_index_stats* m_last_stats; - static const char* INDEXSTATS_KEY; + Rdb_index_stats *m_last_stats; + static const char *INDEXSTATS_KEY; // last added key std::string m_last_key; @@ -149,42 +135,44 @@ float m_card_adj_extra; }; - class Rdb_tbl_prop_coll_factory : public rocksdb::TablePropertiesCollectorFactory { - public: - explicit Rdb_tbl_prop_coll_factory(Rdb_ddl_manager* ddl_manager) - : m_ddl_manager(ddl_manager) { - } +public: + Rdb_tbl_prop_coll_factory(const Rdb_tbl_prop_coll_factory &) = delete; + Rdb_tbl_prop_coll_factory & + operator=(const Rdb_tbl_prop_coll_factory &) = delete; + + explicit Rdb_tbl_prop_coll_factory(Rdb_ddl_manager *ddl_manager) + : m_ddl_manager(ddl_manager) {} /* Override parent class's virtual methods of interest. */ - virtual rocksdb::TablePropertiesCollector* CreateTablePropertiesCollector( + virtual rocksdb::TablePropertiesCollector *CreateTablePropertiesCollector( rocksdb::TablePropertiesCollectorFactory::Context context) override { - return new Rdb_tbl_prop_coll( - m_ddl_manager, m_params, context.column_family_id, - m_table_stats_sampling_pct); + return new Rdb_tbl_prop_coll(m_ddl_manager, m_params, + context.column_family_id, + m_table_stats_sampling_pct); } - virtual const char* Name() const override { + virtual const char *Name() const override { return "Rdb_tbl_prop_coll_factory"; } - public: - void SetCompactionParams(const Rdb_compact_params& params) { +public: + void SetCompactionParams(const Rdb_compact_params ¶ms) { m_params = params; } - void SetTableStatsSamplingPct(const uint8_t table_stats_sampling_pct) { + void SetTableStatsSamplingPct(const uint8_t &table_stats_sampling_pct) { m_table_stats_sampling_pct = table_stats_sampling_pct; } - private: - Rdb_ddl_manager* m_ddl_manager; +private: + Rdb_ddl_manager *const m_ddl_manager; Rdb_compact_params m_params; uint8_t m_table_stats_sampling_pct; }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_buff.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_buff.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_buff.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_buff.h 2017-10-19 04:25:29.000000000 +0000 @@ -27,91 +27,86 @@ ("netstr") which stores data in Network Byte Order (Big Endian). */ -inline void rdb_netstr_append_uint64(my_core::String *out_netstr, uint64 val) -{ +inline void rdb_netstr_append_uint64(my_core::String *const out_netstr, + const uint64 &val) { DBUG_ASSERT(out_netstr != nullptr); // Convert from host machine byte order (usually Little Endian) to network // byte order (Big Endian). - uint64 net_val= htobe64(val); - out_netstr->append(reinterpret_cast(&net_val), sizeof(net_val)); + uint64 net_val = htobe64(val); + out_netstr->append(reinterpret_cast(&net_val), sizeof(net_val)); } -inline void rdb_netstr_append_uint32(my_core::String *out_netstr, uint32 val) -{ +inline void rdb_netstr_append_uint32(my_core::String *const out_netstr, + const uint32 &val) { DBUG_ASSERT(out_netstr != nullptr); // Convert from host machine byte order (usually Little Endian) to network // byte order (Big Endian). - uint32 net_val= htobe32(val); - out_netstr->append(reinterpret_cast(&net_val), sizeof(net_val)); + uint32 net_val = htobe32(val); + out_netstr->append(reinterpret_cast(&net_val), sizeof(net_val)); } -inline void rdb_netstr_append_uint16(my_core::String *out_netstr, uint16 val) -{ +inline void rdb_netstr_append_uint16(my_core::String *const out_netstr, + const uint16 &val) { DBUG_ASSERT(out_netstr != nullptr); // Convert from host machine byte order (usually Little Endian) to network // byte order (Big Endian). - uint16 net_val= htobe16(val); - out_netstr->append(reinterpret_cast(&net_val), sizeof(net_val)); + uint16 net_val = htobe16(val); + out_netstr->append(reinterpret_cast(&net_val), sizeof(net_val)); } - /* Basic network buffer ("netbuf") write helper functions. */ -inline void rdb_netbuf_store_uint64(uchar *dst_netbuf, uint64 n) -{ +inline void rdb_netbuf_store_uint64(uchar *const dst_netbuf, const uint64 &n) { + DBUG_ASSERT(dst_netbuf != nullptr); + // Convert from host byte order (usually Little Endian) to network byte order // (Big Endian). - uint64 net_val= htobe64(n); + uint64 net_val = htobe64(n); memcpy(dst_netbuf, &net_val, sizeof(net_val)); } -inline void rdb_netbuf_store_uint32(uchar *dst_netbuf, uint32 n) -{ +inline void rdb_netbuf_store_uint32(uchar *const dst_netbuf, const uint32 &n) { DBUG_ASSERT(dst_netbuf != nullptr); // Convert from host byte order (usually Little Endian) to network byte order // (Big Endian). - uint32 net_val= htobe32(n); + uint32 net_val = htobe32(n); memcpy(dst_netbuf, &net_val, sizeof(net_val)); } -inline void rdb_netbuf_store_uint16(uchar *dst_netbuf, uint16 n) -{ +inline void rdb_netbuf_store_uint16(uchar *const dst_netbuf, const uint16 &n) { DBUG_ASSERT(dst_netbuf != nullptr); // Convert from host byte order (usually Little Endian) to network byte order // (Big Endian). - uint16 net_val= htobe16(n); + uint16 net_val = htobe16(n); memcpy(dst_netbuf, &net_val, sizeof(net_val)); } -inline void rdb_netbuf_store_byte(uchar *dst_netbuf, uchar c) -{ +inline void rdb_netbuf_store_byte(uchar *const dst_netbuf, const uchar &c) { DBUG_ASSERT(dst_netbuf != nullptr); - *dst_netbuf= c; + *dst_netbuf = c; } -inline void rdb_netbuf_store_index(uchar *dst_netbuf, uint32 number) -{ +inline void rdb_netbuf_store_index(uchar *const dst_netbuf, + const uint32 &number) { DBUG_ASSERT(dst_netbuf != nullptr); rdb_netbuf_store_uint32(dst_netbuf, number); } - /* Basic conversion helper functions from network byte order (Big Endian) to host machine byte order (usually Little Endian). */ -inline uint64 rdb_netbuf_to_uint64(const uchar *netbuf) -{ +inline uint64 rdb_netbuf_to_uint64(const uchar *const netbuf) { DBUG_ASSERT(netbuf != nullptr); uint64 net_val; @@ -122,8 +117,7 @@ return be64toh(net_val); } -inline uint32 rdb_netbuf_to_uint32(const uchar *netbuf) -{ +inline uint32 rdb_netbuf_to_uint32(const uchar *const netbuf) { DBUG_ASSERT(netbuf != nullptr); uint32 net_val; @@ -134,8 +128,7 @@ return be32toh(net_val); } -inline uint16 rdb_netbuf_to_uint16(const uchar *netbuf) -{ +inline uint16 rdb_netbuf_to_uint16(const uchar *const netbuf) { DBUG_ASSERT(netbuf != nullptr); uint16 net_val; @@ -146,14 +139,12 @@ return be16toh(net_val); } -inline uchar rdb_netbuf_to_byte(const uchar* netbuf) -{ +inline uchar rdb_netbuf_to_byte(const uchar *const netbuf) { DBUG_ASSERT(netbuf != nullptr); - return(uchar)netbuf[0]; + return (uchar)netbuf[0]; } - /* Basic network buffer ("netbuf") read helper functions. Network buffer stores data in Network Byte Order (Big Endian). @@ -161,13 +152,12 @@ the netbuf pointer gets advanced to the following byte. */ -inline uint64 rdb_netbuf_read_uint64(const uchar **netbuf_ptr) -{ +inline uint64 rdb_netbuf_read_uint64(const uchar **netbuf_ptr) { DBUG_ASSERT(netbuf_ptr != nullptr); // Convert from network byte order (Big Endian) to host machine byte order // (usually Little Endian). - uint64 host_val= rdb_netbuf_to_uint64(*netbuf_ptr); + const uint64 host_val = rdb_netbuf_to_uint64(*netbuf_ptr); // Advance pointer. *netbuf_ptr += sizeof(host_val); @@ -175,13 +165,12 @@ return host_val; } -inline uint32 rdb_netbuf_read_uint32(const uchar **netbuf_ptr) -{ +inline uint32 rdb_netbuf_read_uint32(const uchar **netbuf_ptr) { DBUG_ASSERT(netbuf_ptr != nullptr); // Convert from network byte order (Big Endian) to host machine byte order // (usually Little Endian). - uint32 host_val= rdb_netbuf_to_uint32(*netbuf_ptr); + const uint32 host_val = rdb_netbuf_to_uint32(*netbuf_ptr); // Advance pointer. *netbuf_ptr += sizeof(host_val); @@ -189,13 +178,12 @@ return host_val; } -inline uint16 rdb_netbuf_read_uint16(const uchar **netbuf_ptr) -{ +inline uint16 rdb_netbuf_read_uint16(const uchar **netbuf_ptr) { DBUG_ASSERT(netbuf_ptr != nullptr); // Convert from network byte order (Big Endian) to host machine byte order // (usually Little Endian). - uint16 host_val= rdb_netbuf_to_uint16(*netbuf_ptr); + const uint16 host_val = rdb_netbuf_to_uint16(*netbuf_ptr); // Advance pointer. *netbuf_ptr += sizeof(host_val); @@ -204,13 +192,12 @@ } inline void rdb_netbuf_read_gl_index(const uchar **netbuf_ptr, - GL_INDEX_ID *gl_index_id) -{ + GL_INDEX_ID *const gl_index_id) { DBUG_ASSERT(gl_index_id != nullptr); DBUG_ASSERT(netbuf_ptr != nullptr); - gl_index_id->cf_id= rdb_netbuf_read_uint32(netbuf_ptr); - gl_index_id->index_id= rdb_netbuf_read_uint32(netbuf_ptr); + gl_index_id->cf_id = rdb_netbuf_read_uint32(netbuf_ptr); + gl_index_id->index_id = rdb_netbuf_read_uint32(netbuf_ptr); } /* @@ -219,77 +206,77 @@ - it prevents one from reading beyond the end of the string. */ -class Rdb_string_reader -{ - const char* m_ptr; +class Rdb_string_reader { + const char *m_ptr; uint m_len; - public: - explicit Rdb_string_reader(const std::string &str) - { - m_len= str.length(); - if (m_len) - { - m_ptr= &str.at(0); + +private: + Rdb_string_reader &operator=(const Rdb_string_reader &) = default; + +public: + Rdb_string_reader(const Rdb_string_reader &) = default; + /* named constructor */ + static Rdb_string_reader read_or_empty(const rocksdb::Slice *const slice) { + if (!slice) { + return Rdb_string_reader(""); + } else { + return Rdb_string_reader(slice); } - else - { + } + + explicit Rdb_string_reader(const std::string &str) { + m_len = str.length(); + if (m_len) { + m_ptr = &str.at(0); + } else { /* One can a create a Rdb_string_reader for reading from an empty string (although attempts to read anything will fail). We must not access str.at(0), since len==0, we can set ptr to any value. */ - m_ptr= nullptr; + m_ptr = nullptr; } } - explicit Rdb_string_reader(const rocksdb::Slice *slice) - { - m_ptr= slice->data(); - m_len= slice->size(); + explicit Rdb_string_reader(const rocksdb::Slice *const slice) { + m_ptr = slice->data(); + m_len = slice->size(); } /* Read the next @param size bytes. Returns pointer to the bytes read, or nullptr if the remaining string doesn't have that many bytes. */ - const char *read(uint size) - { + const char *read(const uint &size) { const char *res; - if (m_len < size) - { - res= nullptr; - } - else - { - res= m_ptr; + if (m_len < size) { + res = nullptr; + } else { + res = m_ptr; m_ptr += size; m_len -= size; } return res; } - bool read_uint8(uint* res) - { + bool read_uint8(uint *const res) { const uchar *p; - if (!(p= reinterpret_cast(read(1)))) - return true; // error - else - { - *res= *p; - return false; // Ok + if (!(p = reinterpret_cast(read(1)))) + return true; // error + else { + *res = *p; + return false; // Ok } } - bool read_uint16(uint* res) - { + bool read_uint16(uint *const res) { const uchar *p; - if (!(p= reinterpret_cast(read(2)))) - return true; // error - else - { - *res= rdb_netbuf_to_uint16(p); - return false; // Ok + if (!(p = reinterpret_cast(read(2)))) + return true; // error + else { + *res = rdb_netbuf_to_uint16(p); + return false; // Ok } } @@ -303,7 +290,6 @@ const char *get_current_ptr() const { return m_ptr; } }; - /* @brief A buffer one can write the data to. @@ -319,126 +305,117 @@ */ -class Rdb_string_writer -{ +class Rdb_string_writer { std::vector m_data; - public: + +public: + Rdb_string_writer(const Rdb_string_writer &) = delete; + Rdb_string_writer &operator=(const Rdb_string_writer &) = delete; + Rdb_string_writer() = default; + void clear() { m_data.clear(); } - void write_uint8(uint val) - { + void write_uint8(const uint &val) { m_data.push_back(static_cast(val)); } - void write_uint16(uint val) - { - auto size= m_data.size(); + void write_uint16(const uint &val) { + const auto size = m_data.size(); m_data.resize(size + 2); rdb_netbuf_store_uint16(m_data.data() + size, val); } - void write_uint32(uint val) - { - auto size= m_data.size(); + void write_uint32(const uint &val) { + const auto size = m_data.size(); m_data.resize(size + 4); rdb_netbuf_store_uint32(m_data.data() + size, val); } - void write(uchar *new_data, size_t len) - { + void write(const uchar *const new_data, const size_t &len) { + DBUG_ASSERT(new_data != nullptr); m_data.insert(m_data.end(), new_data, new_data + len); } - uchar* ptr() { return m_data.data(); } + uchar *ptr() { return m_data.data(); } size_t get_current_pos() const { return m_data.size(); } - void write_uint8_at(size_t pos, uint new_val) - { + void write_uint8_at(const size_t &pos, const uint &new_val) { // This function will only overwrite what was written DBUG_ASSERT(pos < get_current_pos()); - m_data.data()[pos]= new_val; + m_data.data()[pos] = new_val; } - void write_uint16_at(size_t pos, uint new_val) - { + void write_uint16_at(const size_t &pos, const uint &new_val) { // This function will only overwrite what was written DBUG_ASSERT(pos < get_current_pos() && (pos + 1) < get_current_pos()); rdb_netbuf_store_uint16(m_data.data() + pos, new_val); } }; - /* A helper class for writing bits into Rdb_string_writer. The class assumes (but doesn't check) that nobody tries to write anything to the Rdb_string_writer that it is writing to. */ -class Rdb_bit_writer -{ +class Rdb_bit_writer { Rdb_string_writer *m_writer; uchar m_offset; - public: - explicit Rdb_bit_writer(Rdb_string_writer* writer_arg) - : m_writer(writer_arg), - m_offset(0) - { - } - void write(uint size, uint value) - { +public: + Rdb_bit_writer(const Rdb_bit_writer &) = delete; + Rdb_bit_writer &operator=(const Rdb_bit_writer &) = delete; + + explicit Rdb_bit_writer(Rdb_string_writer *writer_arg) + : m_writer(writer_arg), m_offset(0) {} + + void write(uint size, const uint &value) { DBUG_ASSERT((value & ((1 << size) - 1)) == value); - while (size > 0) - { - if (m_offset == 0) - { + while (size > 0) { + if (m_offset == 0) { m_writer->write_uint8(0); } // number of bits to put in this byte - uint bits = std::min(size, (uint)(8 - m_offset)); - uchar *last_byte= m_writer->ptr() + m_writer->get_current_pos() - 1; - *last_byte |= - (uchar) ((value >> (size - bits)) & ((1 << bits) - 1)) << m_offset; + const uint bits = std::min(size, (uint)(8 - m_offset)); + uchar *const last_byte = + m_writer->ptr() + m_writer->get_current_pos() - 1; + *last_byte |= (uchar)((value >> (size - bits)) & ((1 << bits) - 1)) + << m_offset; size -= bits; m_offset = (m_offset + bits) & 0x7; } } }; -class Rdb_bit_reader -{ +class Rdb_bit_reader { const uchar *m_cur; uchar m_offset; uint m_ret; - Rdb_string_reader *m_reader; - public: - explicit Rdb_bit_reader(Rdb_string_reader *reader) - : m_cur(nullptr), - m_offset(0), - m_reader(reader) - { - } + Rdb_string_reader *const m_reader; + +public: + Rdb_bit_reader(const Rdb_bit_reader &) = delete; + Rdb_bit_reader &operator=(const Rdb_bit_reader &) = delete; + + explicit Rdb_bit_reader(Rdb_string_reader *const reader) + : m_cur(nullptr), m_offset(0), m_reader(reader) {} // Returns a pointer to an uint containing the bits read. On subsequent // reads, the value being pointed to will be overwritten. Returns nullptr // on failure. - uint *read(uint size) - { - m_ret= 0; + uint *read(uint size) { + m_ret = 0; DBUG_ASSERT(size <= 32); - while (size > 0) - { - if (m_offset == 0) - { - m_cur= (const uchar *)m_reader->read(1); - if (m_cur == nullptr) - { + while (size > 0) { + if (m_offset == 0) { + m_cur = (const uchar *)m_reader->read(1); + if (m_cur == nullptr) { return nullptr; } } // how many bits from the current byte? - uint bits = std::min((uint)(8 - m_offset), size); + const uint bits = std::min((uint)(8 - m_offset), size); m_ret <<= bits; m_ret |= (*m_cur >> m_offset) & ((1 << bits) - 1); size -= bits; @@ -449,4 +426,4 @@ } }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_manager.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_manager.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_manager.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_manager.cc 2017-10-19 04:25:29.000000000 +0000 @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif /* This C++ files header file */ @@ -28,8 +28,7 @@ namespace myrocks { /* Check if ColumnFamily name says it's a reverse-ordered CF */ -bool Rdb_cf_manager::is_cf_name_reverse(const char *name) -{ +bool Rdb_cf_manager::is_cf_name_reverse(const char *const name) { /* nullptr means the default CF is used.. (TODO: can the default CF be * reverse?) */ if (name && !strncmp(name, "rev:", 4)) @@ -43,9 +42,8 @@ #endif void Rdb_cf_manager::init( - Rdb_cf_options* cf_options, - std::vector *handles) -{ + Rdb_cf_options *const cf_options, + std::vector *const handles) { mysql_mutex_init(ex_key_cfm, &m_mutex, MY_MUTEX_INIT_FAST); DBUG_ASSERT(cf_options != nullptr); @@ -61,33 +59,28 @@ } } - -void Rdb_cf_manager::cleanup() -{ +void Rdb_cf_manager::cleanup() { for (auto it : m_cf_name_map) { delete it.second; } mysql_mutex_destroy(&m_mutex); } - /** Generate Column Family name for per-index column families @param res OUT Column Family name */ -void Rdb_cf_manager::get_per_index_cf_name(const std::string& db_table_name, - const char *index_name, - std::string *res) -{ +void Rdb_cf_manager::get_per_index_cf_name(const std::string &db_table_name, + const char *const index_name, + std::string *const res) { DBUG_ASSERT(index_name != nullptr); DBUG_ASSERT(res != nullptr); *res = db_table_name + "." + index_name; } - /* @brief Find column family by name. If it doesn't exist, create it @@ -95,52 +88,50 @@ @detail See Rdb_cf_manager::get_cf */ -rocksdb::ColumnFamilyHandle* -Rdb_cf_manager::get_or_create_cf(rocksdb::DB *rdb, - const char *cf_name, - const std::string& db_table_name, - const char *index_name, - bool *is_automatic) -{ +rocksdb::ColumnFamilyHandle * +Rdb_cf_manager::get_or_create_cf(rocksdb::DB *const rdb, const char *cf_name, + const std::string &db_table_name, + const char *const index_name, + bool *const is_automatic) { DBUG_ASSERT(rdb != nullptr); DBUG_ASSERT(is_automatic != nullptr); - rocksdb::ColumnFamilyHandle* cf_handle; + rocksdb::ColumnFamilyHandle *cf_handle; mysql_mutex_lock(&m_mutex); - *is_automatic= false; + *is_automatic = false; if (cf_name == nullptr) - cf_name= DEFAULT_CF_NAME; + cf_name = DEFAULT_CF_NAME; std::string per_index_name; - if (!strcmp(cf_name, PER_INDEX_CF_NAME)) - { + if (!strcmp(cf_name, PER_INDEX_CF_NAME)) { get_per_index_cf_name(db_table_name, index_name, &per_index_name); - cf_name= per_index_name.c_str(); - *is_automatic= true; + cf_name = per_index_name.c_str(); + *is_automatic = true; } - auto it = m_cf_name_map.find(cf_name); + const auto it = m_cf_name_map.find(cf_name); if (it != m_cf_name_map.end()) - cf_handle= it->second; - else - { + cf_handle = it->second; + else { /* Create a Column Family. */ - std::string cf_name_str(cf_name); + const std::string cf_name_str(cf_name); rocksdb::ColumnFamilyOptions opts; m_cf_options->get_cf_options(cf_name_str, &opts); - sql_print_information("RocksDB: creating column family %s", cf_name_str.c_str()); - sql_print_information(" write_buffer_size=%ld", opts.write_buffer_size); + sql_print_information("RocksDB: creating column family %s", + cf_name_str.c_str()); + sql_print_information(" write_buffer_size=%ld", opts.write_buffer_size); sql_print_information(" target_file_size_base=%" PRIu64, opts.target_file_size_base); - rocksdb::Status s= rdb->CreateColumnFamily(opts, cf_name_str, &cf_handle); + const rocksdb::Status s = + rdb->CreateColumnFamily(opts, cf_name_str, &cf_handle); if (s.ok()) { m_cf_name_map[cf_handle->GetName()] = cf_handle; m_cf_id_map[cf_handle->GetID()] = cf_handle; } else { - cf_handle= nullptr; + cf_handle = nullptr; } } mysql_mutex_unlock(&m_mutex); @@ -148,7 +139,6 @@ return cf_handle; } - /* Find column family by its cf_name. @@ -161,31 +151,27 @@ db_table_name and index_name. */ -rocksdb::ColumnFamilyHandle* -Rdb_cf_manager::get_cf(const char *cf_name, - const std::string& db_table_name, - const char *index_name, - bool *is_automatic) const -{ - DBUG_ASSERT(cf_name != nullptr); +rocksdb::ColumnFamilyHandle * +Rdb_cf_manager::get_cf(const char *cf_name, const std::string &db_table_name, + const char *const index_name, + bool *const is_automatic) const { DBUG_ASSERT(is_automatic != nullptr); - rocksdb::ColumnFamilyHandle* cf_handle; + rocksdb::ColumnFamilyHandle *cf_handle; - *is_automatic= false; + *is_automatic = false; mysql_mutex_lock(&m_mutex); if (cf_name == nullptr) - cf_name= DEFAULT_CF_NAME; + cf_name = DEFAULT_CF_NAME; std::string per_index_name; - if (!strcmp(cf_name, PER_INDEX_CF_NAME)) - { + if (!strcmp(cf_name, PER_INDEX_CF_NAME)) { get_per_index_cf_name(db_table_name, index_name, &per_index_name); - cf_name= per_index_name.c_str(); - *is_automatic= true; + cf_name = per_index_name.c_str(); + *is_automatic = true; } - auto it = m_cf_name_map.find(cf_name); + const auto it = m_cf_name_map.find(cf_name); cf_handle = (it != m_cf_name_map.end()) ? it->second : nullptr; mysql_mutex_unlock(&m_mutex); @@ -193,12 +179,11 @@ return cf_handle; } -rocksdb::ColumnFamilyHandle* Rdb_cf_manager::get_cf(const uint32_t id) const -{ - rocksdb::ColumnFamilyHandle* cf_handle = nullptr; +rocksdb::ColumnFamilyHandle *Rdb_cf_manager::get_cf(const uint32_t &id) const { + rocksdb::ColumnFamilyHandle *cf_handle = nullptr; mysql_mutex_lock(&m_mutex); - auto it = m_cf_id_map.find(id); + const auto it = m_cf_id_map.find(id); if (it != m_cf_id_map.end()) cf_handle = it->second; mysql_mutex_unlock(&m_mutex); @@ -206,9 +191,7 @@ return cf_handle; } -std::vector -Rdb_cf_manager::get_cf_names(void) const -{ +std::vector Rdb_cf_manager::get_cf_names(void) const { std::vector names; mysql_mutex_lock(&m_mutex); @@ -219,13 +202,13 @@ return names; } -std::vector -Rdb_cf_manager::get_all_cf(void) const -{ - std::vector list; +std::vector +Rdb_cf_manager::get_all_cf(void) const { + std::vector list; mysql_mutex_lock(&m_mutex); for (auto it : m_cf_id_map) { + DBUG_ASSERT(it.second != nullptr); list.push_back(it.second); } mysql_mutex_unlock(&m_mutex); @@ -233,4 +216,4 @@ return list; } -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_manager.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_manager.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_manager.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_manager.h 2017-10-19 04:25:29.000000000 +0000 @@ -46,28 +46,32 @@ - CFs are created in a synchronized way. We can't remove them, yet. */ -class Rdb_cf_manager -{ - std::map m_cf_name_map; - std::map m_cf_id_map; +class Rdb_cf_manager { + std::map m_cf_name_map; + std::map m_cf_id_map; mutable mysql_mutex_t m_mutex; - static - void get_per_index_cf_name(const std::string& db_table_name, - const char *index_name, std::string *res); + static void get_per_index_cf_name(const std::string &db_table_name, + const char *const index_name, + std::string *const res); - Rdb_cf_options* m_cf_options= nullptr; + Rdb_cf_options *m_cf_options = nullptr; public: - static bool is_cf_name_reverse(const char *name); + Rdb_cf_manager(const Rdb_cf_manager &) = delete; + Rdb_cf_manager &operator=(const Rdb_cf_manager &) = delete; + Rdb_cf_manager() = default; + + static bool is_cf_name_reverse(const char *const name); /* - This is called right after the DB::Open() call. The parameters describe column + This is called right after the DB::Open() call. The parameters describe + column families that are present in the database. The first CF is the default CF. */ - void init(Rdb_cf_options* cf_options, - std::vector *handles); + void init(Rdb_cf_options *cf_options, + std::vector *const handles); void cleanup(); /* @@ -75,32 +79,33 @@ - cf_name=nullptr means use default column family - cf_name=_auto_ means use 'dbname.tablename.indexname' */ - rocksdb::ColumnFamilyHandle* get_or_create_cf( - rocksdb::DB *rdb, const char *cf_name, const std::string& db_table_name, - const char *index_name, bool *is_automatic); + rocksdb::ColumnFamilyHandle * + get_or_create_cf(rocksdb::DB *const rdb, const char *cf_name, + const std::string &db_table_name, + const char *const index_name, bool *const is_automatic); /* Used by table open */ - rocksdb::ColumnFamilyHandle* get_cf(const char *cf_name, - const std::string& db_table_name, - const char *index_name, - bool *is_automatic) const; + rocksdb::ColumnFamilyHandle *get_cf(const char *cf_name, + const std::string &db_table_name, + const char *const index_name, + bool *const is_automatic) const; /* Look up cf by id; used by datadic */ - rocksdb::ColumnFamilyHandle* get_cf(const uint32_t id) const; + rocksdb::ColumnFamilyHandle *get_cf(const uint32_t &id) const; /* Used to iterate over column families for show status */ std::vector get_cf_names(void) const; /* Used to iterate over column families */ - std::vector get_all_cf(void) const; + std::vector get_all_cf(void) const; // void drop_cf(); -- not implemented so far. - void get_cf_options( - const std::string &cf_name, - rocksdb::ColumnFamilyOptions *opts) __attribute__((__nonnull__)) { - m_cf_options->get_cf_options(cf_name, opts); + void get_cf_options(const std::string &cf_name, + rocksdb::ColumnFamilyOptions *const opts) + __attribute__((__nonnull__)) { + m_cf_options->get_cf_options(cf_name, opts); } }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_options.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_options.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_options.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_options.cc 2017-10-19 04:25:29.000000000 +0000 @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif /* This C++ files header file */ @@ -41,23 +41,23 @@ Rdb_rev_comparator Rdb_cf_options::s_rev_pk_comparator; bool Rdb_cf_options::init( - size_t default_write_buffer_size, - const rocksdb::BlockBasedTableOptions& table_options, - std::shared_ptr prop_coll_factory, - const char * default_cf_options, - const char * override_cf_options) -{ + const rocksdb::BlockBasedTableOptions &table_options, + std::shared_ptr prop_coll_factory, + const char *const default_cf_options, + const char *const override_cf_options) { + DBUG_ASSERT(default_cf_options != nullptr); + DBUG_ASSERT(override_cf_options != nullptr); + m_default_cf_opts.comparator = &s_pk_comparator; m_default_cf_opts.compaction_filter_factory.reset( - new Rdb_compact_filter_factory); - m_default_cf_opts.write_buffer_size = default_write_buffer_size; + new Rdb_compact_filter_factory); m_default_cf_opts.table_factory.reset( - rocksdb::NewBlockBasedTableFactory(table_options)); + rocksdb::NewBlockBasedTableFactory(table_options)); if (prop_coll_factory) { m_default_cf_opts.table_properties_collector_factories.push_back( - prop_coll_factory); + prop_coll_factory); } if (!set_default(std::string(default_cf_options)) || @@ -69,34 +69,27 @@ } void Rdb_cf_options::get(const std::string &cf_name, - rocksdb::ColumnFamilyOptions *opts) -{ + rocksdb::ColumnFamilyOptions *const opts) { DBUG_ASSERT(opts != nullptr); // set defaults - rocksdb::GetColumnFamilyOptionsFromString(*opts, - m_default_config, - opts); + rocksdb::GetColumnFamilyOptionsFromString(*opts, m_default_config, opts); // set per-cf config if we have one Name_to_config_t::iterator it = m_name_map.find(cf_name); if (it != m_name_map.end()) { - rocksdb::GetColumnFamilyOptionsFromString(*opts, - it->second, - opts); + rocksdb::GetColumnFamilyOptionsFromString(*opts, it->second, opts); } } -bool Rdb_cf_options::set_default(const std::string &default_config) -{ +bool Rdb_cf_options::set_default(const std::string &default_config) { rocksdb::ColumnFamilyOptions options; if (!default_config.empty() && - !rocksdb::GetColumnFamilyOptionsFromString(options, - default_config, - &options).ok()) { - fprintf(stderr, - "Invalid default column family config: %s\n", + !rocksdb::GetColumnFamilyOptionsFromString(options, default_config, + &options) + .ok()) { + fprintf(stderr, "Invalid default column family config: %s\n", default_config.c_str()); return false; } @@ -106,8 +99,7 @@ } // Skip over any spaces in the input string. -void Rdb_cf_options::skip_spaces(const std::string& input, size_t* pos) -{ +void Rdb_cf_options::skip_spaces(const std::string &input, size_t *const pos) { DBUG_ASSERT(pos != nullptr); while (*pos < input.size() && isspace(input[*pos])) @@ -117,25 +109,23 @@ // Find a valid column family name. Note that all characters except a // semicolon are valid (should this change?) and all spaces are trimmed from // the beginning and end but are not removed between other characters. -bool Rdb_cf_options::find_column_family(const std::string& input, size_t* pos, - std::string* key) -{ +bool Rdb_cf_options::find_column_family(const std::string &input, + size_t *const pos, + std::string *const key) { DBUG_ASSERT(pos != nullptr); DBUG_ASSERT(key != nullptr); - size_t beg_pos = *pos; + const size_t beg_pos = *pos; size_t end_pos = *pos - 1; // Loop through the characters in the string until we see a '='. - for ( ; *pos < input.size() && input[*pos] != '='; ++(*pos)) - { + for (; *pos < input.size() && input[*pos] != '='; ++(*pos)) { // If this is not a space, move the end position to the current position. if (input[*pos] != ' ') end_pos = *pos; } - if (end_pos == beg_pos - 1) - { + if (end_pos == beg_pos - 1) { // NO_LINT_DEBUG sql_print_warning("No column family found (options: %s)", input.c_str()); return false; @@ -148,18 +138,16 @@ // Find a valid options portion. Everything is deemed valid within the options // portion until we hit as many close curly braces as we have seen open curly // braces. -bool Rdb_cf_options::find_options(const std::string& input, size_t* pos, - std::string* options) -{ +bool Rdb_cf_options::find_options(const std::string &input, size_t *const pos, + std::string *const options) { DBUG_ASSERT(pos != nullptr); DBUG_ASSERT(options != nullptr); // Make sure we have an open curly brace at the current position. - if (*pos < input.size() && input[*pos] != '{') - { + if (*pos < input.size() && input[*pos] != '{') { // NO_LINT_DEBUG sql_print_warning("Invalid cf options, '{' expected (options: %s)", - input.c_str()); + input.c_str()); return false; } @@ -169,33 +157,30 @@ // Set up our brace_count, the begin position and current end position. size_t brace_count = 1; - size_t beg_pos = *pos; + const size_t beg_pos = *pos; // Loop through the characters in the string until we find the appropriate // number of closing curly braces. - while (*pos < input.size()) - { - switch (input[*pos]) - { - case '}': - // If this is a closing curly brace and we bring the count down to zero - // we can exit the loop with a valid options string. - if (--brace_count == 0) - { - *options = input.substr(beg_pos, *pos - beg_pos); - ++(*pos); // Move past the last closing curly brace - return true; - } - - break; - - case '{': - // If this is an open curly brace increment the count. - ++brace_count; - break; + while (*pos < input.size()) { + switch (input[*pos]) { + case '}': + // If this is a closing curly brace and we bring the count down to zero + // we can exit the loop with a valid options string. + if (--brace_count == 0) { + *options = input.substr(beg_pos, *pos - beg_pos); + ++(*pos); // Move past the last closing curly brace + return true; + } + + break; + + case '{': + // If this is an open curly brace increment the count. + ++brace_count; + break; - default: - break; + default: + break; } // Move to the next character. @@ -206,15 +191,14 @@ // Generate an error. // NO_LINT_DEBUG sql_print_warning("Mismatched cf options, '}' expected (options: %s)", - input.c_str()); + input.c_str()); return false; } -bool Rdb_cf_options::find_cf_options_pair(const std::string& input, - size_t* pos, - std::string* cf, - std::string* opt_str) -{ +bool Rdb_cf_options::find_cf_options_pair(const std::string &input, + size_t *const pos, + std::string *const cf, + std::string *const opt_str) { DBUG_ASSERT(pos != nullptr); DBUG_ASSERT(cf != nullptr); DBUG_ASSERT(opt_str != nullptr); @@ -227,11 +211,10 @@ return false; // If we are at the end of the input then we generate an error. - if (*pos == input.size()) - { + if (*pos == input.size()) { // NO_LINT_DEBUG sql_print_warning("Invalid cf options, '=' expected (options: %s)", - input.c_str()); + input.c_str()); return false; } @@ -248,13 +231,11 @@ skip_spaces(input, pos); // We should either be at the end of the input string or at a semicolon. - if (*pos < input.size()) - { - if (input[*pos] != ';') - { + if (*pos < input.size()) { + if (input[*pos] != ';') { // NO_LINT_DEBUG sql_print_warning("Invalid cf options, ';' expected (options: %s)", - input.c_str()); + input.c_str()); return false; } @@ -264,8 +245,7 @@ return true; } -bool Rdb_cf_options::set_override(const std::string &override_config) -{ +bool Rdb_cf_options::set_override(const std::string &override_config) { // TODO(???): support updates? std::string cf; @@ -275,15 +255,13 @@ // Loop through the characters of the string until we reach the end. size_t pos = 0; - while (pos < override_config.size()) - { + while (pos < override_config.size()) { // Attempt to find ={}. if (!find_cf_options_pair(override_config, &pos, &cf, &opt_str)) return false; // Generate an error if we have already seen this column family. - if (configs.find(cf) != configs.end()) - { + if (configs.find(cf) != configs.end()) { // NO_LINT_DEBUG sql_print_warning( "Duplicate entry for %s in override options (options: %s)", @@ -292,9 +270,8 @@ } // Generate an error if the is not valid according to RocksDB. - if (!rocksdb::GetColumnFamilyOptionsFromString( - options, opt_str, &options).ok()) - { + if (!rocksdb::GetColumnFamilyOptionsFromString(options, opt_str, &options) + .ok()) { // NO_LINT_DEBUG sql_print_warning( "Invalid cf config for %s in override options (options: %s)", @@ -312,29 +289,24 @@ return true; } -const rocksdb::Comparator* Rdb_cf_options::get_cf_comparator( - const std::string& cf_name) -{ - if (Rdb_cf_manager::is_cf_name_reverse(cf_name.c_str())) - { +const rocksdb::Comparator * +Rdb_cf_options::get_cf_comparator(const std::string &cf_name) { + if (Rdb_cf_manager::is_cf_name_reverse(cf_name.c_str())) { return &s_rev_pk_comparator; - } - else - { + } else { return &s_pk_comparator; } } void Rdb_cf_options::get_cf_options(const std::string &cf_name, - rocksdb::ColumnFamilyOptions *opts) -{ + rocksdb::ColumnFamilyOptions *const opts) { DBUG_ASSERT(opts != nullptr); *opts = m_default_cf_opts; get(cf_name, opts); // Set the comparator according to 'rev:' - opts->comparator= get_cf_comparator(cf_name); + opts->comparator = get_cf_comparator(cf_name); } -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_options.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_options.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_cf_options.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_cf_options.h 2017-10-19 04:25:29.000000000 +0000 @@ -38,43 +38,47 @@ and also there is a default value which applies to column families not found in the map. */ -class Rdb_cf_options -{ - public: - void get(const std::string &cf_name, rocksdb::ColumnFamilyOptions *opts); - - bool init( - size_t default_write_buffer_size, - const rocksdb::BlockBasedTableOptions& table_options, - std::shared_ptr prop_coll_factory, - const char * default_cf_options, - const char * override_cf_options); +class Rdb_cf_options { +public: + Rdb_cf_options(const Rdb_cf_options &) = delete; + Rdb_cf_options &operator=(const Rdb_cf_options &) = delete; + Rdb_cf_options() = default; + + void get(const std::string &cf_name, + rocksdb::ColumnFamilyOptions *const opts); + + bool init(const rocksdb::BlockBasedTableOptions &table_options, + std::shared_ptr + prop_coll_factory, + const char *const default_cf_options, + const char *const override_cf_options); - const rocksdb::ColumnFamilyOptions& get_defaults() const { + const rocksdb::ColumnFamilyOptions &get_defaults() const { return m_default_cf_opts; } - static const rocksdb::Comparator* get_cf_comparator( - const std::string& cf_name); + static const rocksdb::Comparator * + get_cf_comparator(const std::string &cf_name); - void get_cf_options( - const std::string &cf_name, - rocksdb::ColumnFamilyOptions *opts) __attribute__((__nonnull__)); + void get_cf_options(const std::string &cf_name, + rocksdb::ColumnFamilyOptions *const opts) + __attribute__((__nonnull__)); - private: +private: bool set_default(const std::string &default_config); bool set_override(const std::string &overide_config); /* Helper string manipulation functions */ - static void skip_spaces(const std::string& input, size_t* pos); - static bool find_column_family(const std::string& input, size_t* pos, - std::string* key); - static bool find_options(const std::string& input, size_t* pos, - std::string* options); - static bool find_cf_options_pair(const std::string& input, size_t* pos, - std::string* cf, std::string* opt_str); + static void skip_spaces(const std::string &input, size_t *const pos); + static bool find_column_family(const std::string &input, size_t *const pos, + std::string *const key); + static bool find_options(const std::string &input, size_t *const pos, + std::string *const options); + static bool find_cf_options_pair(const std::string &input, size_t *const pos, + std::string *const cf, + std::string *const opt_str); - private: +private: static Rdb_pk_comparator s_pk_comparator; static Rdb_rev_comparator s_rev_pk_comparator; @@ -89,4 +93,4 @@ rocksdb::ColumnFamilyOptions m_default_cf_opts; }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_compact_filter.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_compact_filter.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_compact_filter.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_compact_filter.h 2017-10-19 04:25:29.000000000 +0000 @@ -17,7 +17,7 @@ #pragma once #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif /* C++ system header files */ @@ -32,9 +32,11 @@ namespace myrocks { -class Rdb_compact_filter : public rocksdb::CompactionFilter -{ - public: +class Rdb_compact_filter : public rocksdb::CompactionFilter { +public: + Rdb_compact_filter(const Rdb_compact_filter &) = delete; + Rdb_compact_filter &operator=(const Rdb_compact_filter &) = delete; + explicit Rdb_compact_filter(uint32_t _cf_id) : m_cf_id(_cf_id) {} ~Rdb_compact_filter() {} @@ -42,32 +44,28 @@ // V1 Filter is thread safe on our usage (creating from Factory). // Make sure to protect instance variables when switching to thread // unsafe in the future. - virtual bool Filter(int level, - const rocksdb::Slice& key, - const rocksdb::Slice& existing_value, - std::string* new_value, - bool* value_changed) const override - { + virtual bool Filter(int level, const rocksdb::Slice &key, + const rocksdb::Slice &existing_value, + std::string *new_value, + bool *value_changed) const override { DBUG_ASSERT(key.size() >= sizeof(uint32)); GL_INDEX_ID gl_index_id; - gl_index_id.cf_id= m_cf_id; - gl_index_id.index_id= rdb_netbuf_to_uint32((const uchar*)key.data()); + gl_index_id.cf_id = m_cf_id; + gl_index_id.index_id = rdb_netbuf_to_uint32((const uchar *)key.data()); DBUG_ASSERT(gl_index_id.index_id >= 1); - if (gl_index_id != m_prev_index) // processing new index id + if (gl_index_id != m_prev_index) // processing new index id { - if (m_num_deleted > 0) - { - m_num_deleted= 0; + if (m_num_deleted > 0) { + m_num_deleted = 0; } - m_should_delete= + m_should_delete = rdb_get_dict_manager()->is_drop_index_ongoing(gl_index_id); - m_prev_index= gl_index_id; + m_prev_index = gl_index_id; } - if (m_should_delete) - { + if (m_should_delete) { m_num_deleted++; } @@ -76,40 +74,35 @@ virtual bool IgnoreSnapshots() const override { return true; } - virtual const char* Name() const override - { - return "Rdb_compact_filter"; - } + virtual const char *Name() const override { return "Rdb_compact_filter"; } - private: +private: // Column family for this compaction filter const uint32_t m_cf_id; // Index id of the previous record - mutable GL_INDEX_ID m_prev_index= {0, 0}; + mutable GL_INDEX_ID m_prev_index = {0, 0}; // Number of rows deleted for the same index id - mutable uint64 m_num_deleted= 0; + mutable uint64 m_num_deleted = 0; // Current index id should be deleted or not (should be deleted if true) - mutable bool m_should_delete= false; + mutable bool m_should_delete = false; }; -class Rdb_compact_filter_factory : public rocksdb::CompactionFilterFactory -{ - public: +class Rdb_compact_filter_factory : public rocksdb::CompactionFilterFactory { +public: + Rdb_compact_filter_factory(const Rdb_compact_filter_factory &) = delete; + Rdb_compact_filter_factory & + operator=(const Rdb_compact_filter_factory &) = delete; Rdb_compact_filter_factory() {} ~Rdb_compact_filter_factory() {} - const char* Name() const override - { - return "Rdb_compact_filter_factory"; - } + const char *Name() const override { return "Rdb_compact_filter_factory"; } std::unique_ptr CreateCompactionFilter( - const rocksdb::CompactionFilter::Context& context) override - { + const rocksdb::CompactionFilter::Context &context) override { return std::unique_ptr( - new Rdb_compact_filter(context.column_family_id)); + new Rdb_compact_filter(context.column_family_id)); } }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_comparator.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_comparator.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_comparator.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_comparator.h 2017-10-19 04:25:29.000000000 +0000 @@ -24,6 +24,9 @@ /* RocksDB header files */ #include "rocksdb/comparator.h" +/* MyRocks header files */ +#include "./rdb_utils.h" + namespace myrocks { /* @@ -32,62 +35,65 @@ (todo: knowledge about this format is shared between this class and Rdb_key_def) */ -class Rdb_pk_comparator : public rocksdb::Comparator -{ - public: - static int bytewise_compare(const rocksdb::Slice& a, const rocksdb::Slice& b) - { - size_t a_size= a.size(); - size_t b_size= b.size(); - size_t len= (a_size < b_size) ? a_size : b_size; +class Rdb_pk_comparator : public rocksdb::Comparator { +public: + Rdb_pk_comparator(const Rdb_pk_comparator &) = delete; + Rdb_pk_comparator &operator=(const Rdb_pk_comparator &) = delete; + Rdb_pk_comparator() = default; + + static int bytewise_compare(const rocksdb::Slice &a, + const rocksdb::Slice &b) { + const size_t a_size = a.size(); + const size_t b_size = b.size(); + const size_t len = (a_size < b_size) ? a_size : b_size; int res; - if ((res= memcmp(a.data(), b.data(), len))) + if ((res = memcmp(a.data(), b.data(), len))) return res; /* Ok, res== 0 */ - if (a_size != b_size) - { - return a_size < b_size? -1 : 1; + if (a_size != b_size) { + return a_size < b_size ? -1 : 1; } - return 0; + return HA_EXIT_SUCCESS; } /* Override virtual methods of interest */ - int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override - { - return bytewise_compare(a,b); + int Compare(const rocksdb::Slice &a, const rocksdb::Slice &b) const override { + return bytewise_compare(a, b); } - const char* Name() const override { return "RocksDB_SE_v3.10"; } + const char *Name() const override { return "RocksDB_SE_v3.10"; } - //TODO: advanced funcs: + // TODO: advanced funcs: // - FindShortestSeparator // - FindShortSuccessor // for now, do-nothing implementations: - void FindShortestSeparator(std::string* start, - const rocksdb::Slice& limit) const override {} - void FindShortSuccessor(std::string* key) const override {} + void FindShortestSeparator(std::string *start, + const rocksdb::Slice &limit) const override {} + void FindShortSuccessor(std::string *key) const override {} }; -class Rdb_rev_comparator : public rocksdb::Comparator -{ - public: - static int bytewise_compare(const rocksdb::Slice& a, const rocksdb::Slice& b) - { +class Rdb_rev_comparator : public rocksdb::Comparator { +public: + Rdb_rev_comparator(const Rdb_rev_comparator &) = delete; + Rdb_rev_comparator &operator=(const Rdb_rev_comparator &) = delete; + Rdb_rev_comparator() = default; + + static int bytewise_compare(const rocksdb::Slice &a, + const rocksdb::Slice &b) { return -Rdb_pk_comparator::bytewise_compare(a, b); } - int Compare(const rocksdb::Slice& a, const rocksdb::Slice& b) const override - { + int Compare(const rocksdb::Slice &a, const rocksdb::Slice &b) const override { return -Rdb_pk_comparator::bytewise_compare(a, b); } - const char* Name() const override { return "rev:RocksDB_SE_v3.10"; } - void FindShortestSeparator(std::string* start, - const rocksdb::Slice& limit) const override {} - void FindShortSuccessor(std::string* key) const override {} + const char *Name() const override { return "rev:RocksDB_SE_v3.10"; } + void FindShortestSeparator(std::string *start, + const rocksdb::Slice &limit) const override {} + void FindShortSuccessor(std::string *key) const override {} }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_datadic.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_datadic.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_datadic.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_datadic.cc 2017-10-19 04:25:29.000000000 +0000 @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif /* This C++ file's header file */ @@ -44,76 +44,56 @@ namespace myrocks { void get_mem_comparable_space(const CHARSET_INFO *cs, - const std::vector **xfrm, - size_t *xfrm_len, + const std::vector **xfrm, size_t *xfrm_len, size_t *mb_len); /* Rdb_key_def class implementation */ -Rdb_key_def::Rdb_key_def( - uint indexnr_arg, uint keyno_arg, - rocksdb::ColumnFamilyHandle* cf_handle_arg, - uint16_t index_dict_version_arg, - uchar index_type_arg, - uint16_t kv_format_version_arg, - bool is_reverse_cf_arg, bool is_auto_cf_arg, - const char* _name, - Rdb_index_stats _stats -) : - m_index_number(indexnr_arg), - m_cf_handle(cf_handle_arg), - m_index_dict_version(index_dict_version_arg), - m_index_type(index_type_arg), - m_kv_format_version(kv_format_version_arg), - m_is_reverse_cf(is_reverse_cf_arg), - m_is_auto_cf(is_auto_cf_arg), - m_name(_name), - m_stats(_stats), - m_pk_part_no(nullptr), - m_pack_info(nullptr), - m_keyno(keyno_arg), - m_key_parts(0), - m_maxlength(0) // means 'not intialized' +Rdb_key_def::Rdb_key_def(uint indexnr_arg, uint keyno_arg, + rocksdb::ColumnFamilyHandle *cf_handle_arg, + uint16_t index_dict_version_arg, uchar index_type_arg, + uint16_t kv_format_version_arg, bool is_reverse_cf_arg, + bool is_auto_cf_arg, const char *_name, + Rdb_index_stats _stats) + : m_index_number(indexnr_arg), m_cf_handle(cf_handle_arg), + m_index_dict_version(index_dict_version_arg), + m_index_type(index_type_arg), m_kv_format_version(kv_format_version_arg), + m_is_reverse_cf(is_reverse_cf_arg), m_is_auto_cf(is_auto_cf_arg), + m_name(_name), m_stats(_stats), m_pk_part_no(nullptr), + m_pack_info(nullptr), m_keyno(keyno_arg), m_key_parts(0), + m_prefix_extractor(nullptr), m_maxlength(0) // means 'not intialized' { mysql_mutex_init(0, &m_mutex, MY_MUTEX_INIT_FAST); rdb_netbuf_store_index(m_index_number_storage_form, m_index_number); DBUG_ASSERT(m_cf_handle != nullptr); } -Rdb_key_def::Rdb_key_def(const Rdb_key_def& k) : - m_index_number(k.m_index_number), - m_cf_handle(k.m_cf_handle), - m_is_reverse_cf(k.m_is_reverse_cf), - m_is_auto_cf(k.m_is_auto_cf), - m_name(k.m_name), - m_stats(k.m_stats), - m_pk_part_no(k.m_pk_part_no), - m_pack_info(k.m_pack_info), - m_keyno(k.m_keyno), - m_key_parts(k.m_key_parts), - m_maxlength(k.m_maxlength) -{ +Rdb_key_def::Rdb_key_def(const Rdb_key_def &k) + : m_index_number(k.m_index_number), m_cf_handle(k.m_cf_handle), + m_is_reverse_cf(k.m_is_reverse_cf), m_is_auto_cf(k.m_is_auto_cf), + m_name(k.m_name), m_stats(k.m_stats), m_pk_part_no(k.m_pk_part_no), + m_pack_info(k.m_pack_info), m_keyno(k.m_keyno), + m_key_parts(k.m_key_parts), m_prefix_extractor(k.m_prefix_extractor), + m_maxlength(k.m_maxlength) { mysql_mutex_init(0, &m_mutex, MY_MUTEX_INIT_FAST); rdb_netbuf_store_index(m_index_number_storage_form, m_index_number); - if (k.m_pack_info) - { - size_t size= sizeof(Rdb_field_packing) * k.m_key_parts; - m_pack_info= reinterpret_cast(my_malloc(size, MYF(0))); + if (k.m_pack_info) { + const size_t size = sizeof(Rdb_field_packing) * k.m_key_parts; + m_pack_info = + reinterpret_cast(my_malloc(size, MYF(0))); memcpy(m_pack_info, k.m_pack_info, size); } - if (k.m_pk_part_no) - { - size_t size = sizeof(uint)*m_key_parts; - m_pk_part_no= reinterpret_cast(my_malloc(size, MYF(0))); + if (k.m_pk_part_no) { + const size_t size = sizeof(uint) * m_key_parts; + m_pk_part_no = reinterpret_cast(my_malloc(size, MYF(0))); memcpy(m_pk_part_no, k.m_pk_part_no, size); } } -Rdb_key_def::~Rdb_key_def() -{ +Rdb_key_def::~Rdb_key_def() { mysql_mutex_destroy(&m_mutex); my_free(m_pk_part_no); @@ -123,8 +103,8 @@ m_pack_info = nullptr; } -void Rdb_key_def::setup(const TABLE *tbl, const Rdb_tbl_def *tbl_def) -{ +void Rdb_key_def::setup(const TABLE *const tbl, + const Rdb_tbl_def *const tbl_def) { DBUG_ASSERT(tbl != nullptr); DBUG_ASSERT(tbl_def != nullptr); @@ -132,45 +112,38 @@ Set max_length based on the table. This can be called concurrently from multiple threads, so there is a mutex to protect this code. */ - const bool is_hidden_pk= (m_index_type == INDEX_TYPE_HIDDEN_PRIMARY); - const bool hidden_pk_exists= table_has_hidden_pk(tbl); - const bool secondary_key= (m_index_type == INDEX_TYPE_SECONDARY); - if (!m_maxlength) - { + const bool is_hidden_pk = (m_index_type == INDEX_TYPE_HIDDEN_PRIMARY); + const bool hidden_pk_exists = table_has_hidden_pk(tbl); + const bool secondary_key = (m_index_type == INDEX_TYPE_SECONDARY); + if (!m_maxlength) { mysql_mutex_lock(&m_mutex); - if (m_maxlength != 0) - { + if (m_maxlength != 0) { mysql_mutex_unlock(&m_mutex); return; } - KEY *key_info= nullptr; - KEY *pk_info= nullptr; - if (!is_hidden_pk) - { - key_info= &tbl->key_info[m_keyno]; + KEY *key_info = nullptr; + KEY *pk_info = nullptr; + if (!is_hidden_pk) { + key_info = &tbl->key_info[m_keyno]; if (!hidden_pk_exists) - pk_info= &tbl->key_info[tbl->s->primary_key]; - m_name= std::string(key_info->name); - } - else - { - m_name= HIDDEN_PK_NAME; + pk_info = &tbl->key_info[tbl->s->primary_key]; + m_name = std::string(key_info->name); + } else { + m_name = HIDDEN_PK_NAME; } if (secondary_key) - m_pk_key_parts= hidden_pk_exists ? 1 : pk_info->actual_key_parts; - else - { - pk_info= nullptr; - m_pk_key_parts= 0; + m_pk_key_parts = hidden_pk_exists ? 1 : pk_info->actual_key_parts; + else { + pk_info = nullptr; + m_pk_key_parts = 0; } // "unique" secondary keys support: - m_key_parts= is_hidden_pk ? 1 : key_info->actual_key_parts; + m_key_parts = is_hidden_pk ? 1 : key_info->actual_key_parts; - if (secondary_key) - { + if (secondary_key) { /* In most cases, SQL layer puts PK columns as invisible suffix at the end of secondary key. There are cases where this doesn't happen: @@ -189,115 +162,102 @@ } if (secondary_key) - m_pk_part_no= reinterpret_cast(my_malloc(sizeof(uint)*m_key_parts, - MYF(0))); + m_pk_part_no = reinterpret_cast( + my_malloc(sizeof(uint) * m_key_parts, MYF(0))); else - m_pk_part_no= nullptr; - - size_t size= sizeof(Rdb_field_packing) * m_key_parts; - m_pack_info= reinterpret_cast(my_malloc(size, MYF(0))); + m_pk_part_no = nullptr; - size_t max_len= INDEX_NUMBER_SIZE; - int unpack_len= 0; - int max_part_len= 0; - bool simulating_extkey= false; - uint dst_i= 0; + const size_t size = sizeof(Rdb_field_packing) * m_key_parts; + m_pack_info = + reinterpret_cast(my_malloc(size, MYF(0))); + + size_t max_len = INDEX_NUMBER_SIZE; + int unpack_len = 0; + int max_part_len = 0; + bool simulating_extkey = false; + uint dst_i = 0; - uint keyno_to_set= m_keyno; - uint keypart_to_set= 0; + uint keyno_to_set = m_keyno; + uint keypart_to_set = 0; - if (is_hidden_pk) - { - Field *field= nullptr; + if (is_hidden_pk) { + Field *field = nullptr; m_pack_info[dst_i].setup(this, field, keyno_to_set, 0, 0); - m_pack_info[dst_i].m_unpack_data_offset= unpack_len; - max_len += m_pack_info[dst_i].m_max_image_len; - max_part_len= std::max(max_part_len, m_pack_info[dst_i].m_max_image_len); + m_pack_info[dst_i].m_unpack_data_offset = unpack_len; + max_len += m_pack_info[dst_i].m_max_image_len; + max_part_len = std::max(max_part_len, m_pack_info[dst_i].m_max_image_len); dst_i++; - } - else - { - KEY_PART_INFO *key_part= key_info->key_part; + } else { + KEY_PART_INFO *key_part = key_info->key_part; /* this loop also loops over the 'extended key' tail */ - for (uint src_i= 0; src_i < m_key_parts; src_i++, keypart_to_set++) - { - Field *field= key_part ? key_part->field : nullptr; + for (uint src_i = 0; src_i < m_key_parts; src_i++, keypart_to_set++) { + Field *const field = key_part ? key_part->field : nullptr; - if (simulating_extkey && !hidden_pk_exists) - { + if (simulating_extkey && !hidden_pk_exists) { + DBUG_ASSERT(secondary_key); /* Check if this field is already present in the key definition */ - bool found= false; - for (uint j= 0; j < key_info->actual_key_parts; j++) - { - if (field->field_index == key_info->key_part[j].field->field_index) - { - found= true; + bool found = false; + for (uint j = 0; j < key_info->actual_key_parts; j++) { + if (field->field_index == + key_info->key_part[j].field->field_index && + key_part->length == key_info->key_part[j].length) { + found = true; break; } } - if (found) - { + if (found) { key_part++; continue; } } if (field && field->real_maybe_null()) - max_len +=1; // NULL-byte + max_len += 1; // NULL-byte m_pack_info[dst_i].setup(this, field, keyno_to_set, keypart_to_set, key_part ? key_part->length : 0); - m_pack_info[dst_i].m_unpack_data_offset= unpack_len; + m_pack_info[dst_i].m_unpack_data_offset = unpack_len; - if (pk_info) - { - m_pk_part_no[dst_i]= -1; - for (uint j= 0; j < m_pk_key_parts; j++) - { - if (field->field_index == pk_info->key_part[j].field->field_index) - { - m_pk_part_no[dst_i]= j; + if (pk_info) { + m_pk_part_no[dst_i] = -1; + for (uint j = 0; j < m_pk_key_parts; j++) { + if (field->field_index == pk_info->key_part[j].field->field_index) { + m_pk_part_no[dst_i] = j; break; } } - } - else if (secondary_key && hidden_pk_exists) - { + } else if (secondary_key && hidden_pk_exists) { /* The hidden pk can never be part of the sk. So it is always appended to the end of the sk. */ - m_pk_part_no[dst_i]= -1; + m_pk_part_no[dst_i] = -1; if (simulating_extkey) - m_pk_part_no[dst_i]= 0; + m_pk_part_no[dst_i] = 0; } - max_len += m_pack_info[dst_i].m_max_image_len; + max_len += m_pack_info[dst_i].m_max_image_len; - max_part_len= std::max(max_part_len, - m_pack_info[dst_i].m_max_image_len); + max_part_len = + std::max(max_part_len, m_pack_info[dst_i].m_max_image_len); key_part++; /* For "unique" secondary indexes, pretend they have "index extensions" */ - if (secondary_key && src_i+1 == key_info->actual_key_parts) - { - simulating_extkey= true; - if (!hidden_pk_exists) - { - keyno_to_set= tbl->s->primary_key; - key_part= pk_info->key_part; - keypart_to_set= (uint)-1; - } - else - { - keyno_to_set= tbl_def->m_key_count - 1; - key_part= nullptr; - keypart_to_set= 0; + if (secondary_key && src_i + 1 == key_info->actual_key_parts) { + simulating_extkey = true; + if (!hidden_pk_exists) { + keyno_to_set = tbl->s->primary_key; + key_part = pk_info->key_part; + keypart_to_set = (uint)-1; + } else { + keyno_to_set = tbl_def->m_key_count - 1; + key_part = nullptr; + keypart_to_set = 0; } } @@ -305,21 +265,61 @@ } } - m_key_parts= dst_i; + m_key_parts = dst_i; /* Initialize the memory needed by the stats structure */ m_stats.m_distinct_keys_per_prefix.resize(get_key_parts()); + /* Cache prefix extractor for bloom filter usage later */ + rocksdb::Options opt = rdb_get_rocksdb_db()->GetOptions(get_cf()); + m_prefix_extractor = opt.prefix_extractor; + /* This should be the last member variable set before releasing the mutex so that other threads can't see the object partially set up. */ - m_maxlength= max_len; + m_maxlength = max_len; mysql_mutex_unlock(&m_mutex); } } +/** + Read a memcmp key part from a slice using the passed in reader. + + Returns -1 if field was null, 1 if error, 0 otherwise. +*/ +int Rdb_key_def::read_memcmp_key_part(const TABLE *table_arg, + Rdb_string_reader *reader, + const uint part_num) const { + /* It is impossible to unpack the column. Skip it. */ + if (m_pack_info[part_num].m_maybe_null) { + const char *nullp; + if (!(nullp = reader->read(1))) + return 1; + if (*nullp == 0) { + /* This is a NULL value */ + return -1; + } else { + /* If NULL marker is not '0', it can be only '1' */ + if (*nullp != 1) + return 1; + } + } + + Rdb_field_packing *fpi = &m_pack_info[part_num]; + DBUG_ASSERT(table_arg->s != nullptr); + + bool is_hidden_pk_part = (part_num + 1 == m_key_parts) && + (table_arg->s->primary_key == MAX_INDEXES); + Field *field = nullptr; + if (!is_hidden_pk_part) + field = fpi->get_field_in_table(table_arg); + if (fpi->m_skip_func(fpi, field, reader)) + return 1; + + return 0; +} /** Get a mem-comparable form of Primary Key from mem-comparable form of this key @@ -346,27 +346,25 @@ set of queries for which we would check the checksum twice. */ -uint Rdb_key_def::get_primary_key_tuple(TABLE *table, - const std::shared_ptr& pk_descr, - const rocksdb::Slice *key, - uchar *pk_buffer) const -{ +uint Rdb_key_def::get_primary_key_tuple(const TABLE *const table, + const Rdb_key_def &pk_descr, + const rocksdb::Slice *const key, + uchar *const pk_buffer) const { DBUG_ASSERT(table != nullptr); - DBUG_ASSERT(pk_descr != nullptr); DBUG_ASSERT(key != nullptr); DBUG_ASSERT(pk_buffer); - uint size= 0; - uchar *buf= pk_buffer; + uint size = 0; + uchar *buf = pk_buffer; DBUG_ASSERT(m_pk_key_parts); /* Put the PK number */ - rdb_netbuf_store_index(buf, pk_descr->m_index_number); + rdb_netbuf_store_index(buf, pk_descr.m_index_number); buf += INDEX_NUMBER_SIZE; size += INDEX_NUMBER_SIZE; - const char* start_offs[MAX_REF_PARTS]; - const char* end_offs[MAX_REF_PARTS]; + const char *start_offs[MAX_REF_PARTS]; + const char *end_offs[MAX_REF_PARTS]; int pk_key_part; uint i; Rdb_string_reader reader(key); @@ -375,56 +373,22 @@ if ((!reader.read(INDEX_NUMBER_SIZE))) return RDB_INVALID_KEY_LEN; - for (i= 0; i < m_key_parts; i++) - { - if ((pk_key_part= m_pk_part_no[i]) != -1) - { - start_offs[pk_key_part]= reader.get_current_ptr(); - } - - bool have_value= true; - /* It is impossible to unpack the column. Skip it. */ - if (m_pack_info[i].m_maybe_null) - { - const char* nullp; - if (!(nullp= reader.read(1))) - return RDB_INVALID_KEY_LEN; - if (*nullp == 0) - { - /* This is a NULL value */ - have_value= false; - } - else - { - /* If NULL marker is not '0', it can be only '1' */ - if (*nullp != 1) - return RDB_INVALID_KEY_LEN; - } + for (i = 0; i < m_key_parts; i++) { + if ((pk_key_part = m_pk_part_no[i]) != -1) { + start_offs[pk_key_part] = reader.get_current_ptr(); } - if (have_value) - { - Rdb_field_packing *fpi= &m_pack_info[i]; - - DBUG_ASSERT(table->s != nullptr); - bool is_hidden_pk_part= (i + 1 == m_key_parts) && - (table->s->primary_key == MAX_INDEXES); - Field *field= nullptr; - if (!is_hidden_pk_part) - field= fpi->get_field_in_table(table); - if (fpi->m_skip_func(fpi, field, &reader)) - return RDB_INVALID_KEY_LEN; + if (read_memcmp_key_part(table, &reader, i) > 0) { + return RDB_INVALID_KEY_LEN; } - if (pk_key_part != -1) - { - end_offs[pk_key_part]= reader.get_current_ptr(); + if (pk_key_part != -1) { + end_offs[pk_key_part] = reader.get_current_ptr(); } } - for (i= 0; i < m_pk_key_parts; i++) - { - uint part_size= end_offs[i] - start_offs[i]; + for (i = 0; i < m_pk_key_parts; i++) { + const uint part_size = end_offs[i] - start_offs[i]; memcpy(buf, start_offs[i], end_offs[i] - start_offs[i]); buf += part_size; size += part_size; @@ -433,6 +397,46 @@ return size; } +/** + Get a mem-comparable form of Secondary Key from mem-comparable form of this + key, without the extended primary key tail. + + @param + key Index tuple from this key in mem-comparable form + sk_buffer OUT Put here mem-comparable form of the Secondary Key. + n_null_fields OUT Put number of null fields contained within sk entry +*/ +uint Rdb_key_def::get_memcmp_sk_parts(const TABLE *table, + const rocksdb::Slice &key, + uchar *sk_buffer, + uint *n_null_fields) const { + DBUG_ASSERT(table != nullptr); + DBUG_ASSERT(sk_buffer != nullptr); + DBUG_ASSERT(n_null_fields != nullptr); + DBUG_ASSERT(m_keyno != table->s->primary_key && !table_has_hidden_pk(table)); + + uchar *buf = sk_buffer; + + int res; + Rdb_string_reader reader(&key); + const char *start = reader.get_current_ptr(); + + // Skip the index number + if ((!reader.read(INDEX_NUMBER_SIZE))) + return RDB_INVALID_KEY_LEN; + + for (uint i = 0; i < table->key_info[m_keyno].user_defined_key_parts; i++) { + if ((res = read_memcmp_key_part(table, &reader, i)) > 0) { + return RDB_INVALID_KEY_LEN; + } else if (res == -1) { + (*n_null_fields)++; + } + } + + uint sk_memcmp_len = reader.get_current_ptr() - start; + memcpy(buf, start, sk_memcmp_len); + return sk_memcmp_len; +} /** Convert index tuple into storage (i.e. mem-comparable) format @@ -445,29 +449,28 @@ size is at least max_storage_fmt_length() bytes. */ -uint Rdb_key_def::pack_index_tuple(TABLE *tbl, uchar *pack_buffer, - uchar *packed_tuple, const uchar *key_tuple, - key_part_map keypart_map) const -{ +uint Rdb_key_def::pack_index_tuple(TABLE *const tbl, uchar *const pack_buffer, + uchar *const packed_tuple, + const uchar *const key_tuple, + const key_part_map &keypart_map) const { DBUG_ASSERT(tbl != nullptr); DBUG_ASSERT(pack_buffer != nullptr); DBUG_ASSERT(packed_tuple != nullptr); DBUG_ASSERT(key_tuple != nullptr); /* We were given a record in KeyTupleFormat. First, save it to record */ - uint key_len= calculate_key_len(tbl, m_keyno, key_tuple, keypart_map); + const uint key_len = calculate_key_len(tbl, m_keyno, key_tuple, keypart_map); key_restore(tbl->record[0], key_tuple, &tbl->key_info[m_keyno], key_len); - uint n_used_parts= my_count_bits(keypart_map); + uint n_used_parts = my_count_bits(keypart_map); if (keypart_map == HA_WHOLE_KEY) - n_used_parts= 0; // Full key is used + n_used_parts = 0; // Full key is used /* Then, convert the record into a mem-comparable form */ return pack_record(tbl, pack_buffer, tbl->record[0], packed_tuple, nullptr, false, 0, n_used_parts); } - /** @brief Check if "unpack info" data includes checksum. @@ -477,16 +480,13 @@ checksums. */ -bool Rdb_key_def::unpack_info_has_checksum(const rocksdb::Slice &unpack_info) -{ - const uchar* ptr= (const uchar*)unpack_info.data(); - size_t size= unpack_info.size(); +bool Rdb_key_def::unpack_info_has_checksum(const rocksdb::Slice &unpack_info) { + const uchar *ptr = (const uchar *)unpack_info.data(); + size_t size = unpack_info.size(); // Skip unpack info if present. - if (size >= RDB_UNPACK_HEADER_SIZE && - ptr[0] == RDB_UNPACK_DATA_TAG) - { - uint16 skip_len= rdb_netbuf_to_uint16(ptr + 1); + if (size >= RDB_UNPACK_HEADER_SIZE && ptr[0] == RDB_UNPACK_DATA_TAG) { + const uint16 skip_len = rdb_netbuf_to_uint16(ptr + 1); SHIP_ASSERT(size >= skip_len); size -= skip_len; @@ -499,26 +499,22 @@ /* @return Number of bytes that were changed */ -int Rdb_key_def::successor(uchar *packed_tuple, uint len) -{ +int Rdb_key_def::successor(uchar *const packed_tuple, const uint &len) { DBUG_ASSERT(packed_tuple != nullptr); - int changed= 0; - uchar *p= packed_tuple + len - 1; - for (; p > packed_tuple; p--) - { + int changed = 0; + uchar *p = packed_tuple + len - 1; + for (; p > packed_tuple; p--) { changed++; - if (*p != uchar(0xFF)) - { - *p= *p + 1; + if (*p != uchar(0xFF)) { + *p = *p + 1; break; } - *p='\0'; + *p = '\0'; } return changed; } - /** Get index columns from the record and pack them into mem-comparable form. @@ -541,25 +537,25 @@ Length of the packed tuple */ -uint Rdb_key_def::pack_record(const TABLE *tbl, uchar *pack_buffer, - const uchar *record, uchar *packed_tuple, - Rdb_string_writer *unpack_info, - bool should_store_checksums, - longlong hidden_pk_id, uint n_key_parts, - uint *n_null_fields) const -{ +uint Rdb_key_def::pack_record(const TABLE *const tbl, uchar *const pack_buffer, + const uchar *const record, + uchar *const packed_tuple, + Rdb_string_writer *const unpack_info, + const bool &should_store_row_debug_checksums, + const longlong &hidden_pk_id, uint n_key_parts, + uint *const n_null_fields) const { DBUG_ASSERT(tbl != nullptr); DBUG_ASSERT(pack_buffer != nullptr); DBUG_ASSERT(record != nullptr); DBUG_ASSERT(packed_tuple != nullptr); // Checksums for PKs are made when record is packed. // We should never attempt to make checksum just from PK values - DBUG_ASSERT_IMP(should_store_checksums, + DBUG_ASSERT_IMP(should_store_row_debug_checksums, (m_index_type == INDEX_TYPE_SECONDARY)); - uchar *tuple= packed_tuple; - size_t unpack_len_pos= size_t(-1); - const bool hidden_pk_exists= table_has_hidden_pk(tbl); + uchar *tuple = packed_tuple; + size_t unpack_len_pos = size_t(-1); + const bool hidden_pk_exists = table_has_hidden_pk(tbl); rdb_netbuf_store_index(tuple, m_index_number); tuple += INDEX_NUMBER_SIZE; @@ -568,69 +564,60 @@ // The following includes the 'extended key' tail. // The 'extended key' includes primary key. This is done to 'uniqify' // non-unique indexes - bool use_all_columns = n_key_parts == 0 || n_key_parts == MAX_REF_PARTS; + const bool use_all_columns = n_key_parts == 0 || n_key_parts == MAX_REF_PARTS; // If hidden pk exists, but hidden pk wasnt passed in, we can't pack the // hidden key part. So we skip it (its always 1 part). if (hidden_pk_exists && !hidden_pk_id && use_all_columns) - n_key_parts= m_key_parts - 1; + n_key_parts = m_key_parts - 1; else if (use_all_columns) - n_key_parts= m_key_parts; + n_key_parts = m_key_parts; if (n_null_fields) *n_null_fields = 0; - if (unpack_info) - { + if (unpack_info) { unpack_info->clear(); unpack_info->write_uint8(RDB_UNPACK_DATA_TAG); - unpack_len_pos= unpack_info->get_current_pos(); + unpack_len_pos = unpack_info->get_current_pos(); // we don't know the total length yet, so write a zero unpack_info->write_uint16(0); } - for (uint i=0; i < n_key_parts; i++) - { + for (uint i = 0; i < n_key_parts; i++) { // Fill hidden pk id into the last key part for secondary keys for tables // with no pk - if (hidden_pk_exists && hidden_pk_id && i + 1 == n_key_parts) - { + if (hidden_pk_exists && hidden_pk_id && i + 1 == n_key_parts) { m_pack_info[i].fill_hidden_pk_val(&tuple, hidden_pk_id); break; } - Field *field= m_pack_info[i].get_field_in_table(tbl); + Field *const field = m_pack_info[i].get_field_in_table(tbl); DBUG_ASSERT(field != nullptr); // Old Field methods expected the record pointer to be at tbl->record[0]. // The quick and easy way to fix this was to pass along the offset // for the pointer. - my_ptrdiff_t ptr_diff= record - tbl->record[0]; + const my_ptrdiff_t ptr_diff = record - tbl->record[0]; - if (field->real_maybe_null()) - { + if (field->real_maybe_null()) { DBUG_ASSERT(is_storage_available(tuple - packed_tuple, 1)); - if (field->is_real_null(ptr_diff)) - { + if (field->is_real_null(ptr_diff)) { /* NULL value. store '\0' so that it sorts before non-NULL values */ *tuple++ = 0; /* That's it, don't store anything else */ if (n_null_fields) (*n_null_fields)++; continue; - } - else - { + } else { /* Not a NULL value. Store '1' */ *tuple++ = 1; } } - bool create_unpack_info= - (unpack_info && // we were requested to generate unpack_info - m_pack_info[i].uses_unpack_info() && // and this keypart uses it - index_format_min_check(PRIMARY_FORMAT_VERSION_UPDATE1, - SECONDARY_FORMAT_VERSION_UPDATE1)); + const bool create_unpack_info = + (unpack_info && // we were requested to generate unpack_info + m_pack_info[i].uses_unpack_info()); // and this keypart uses it Rdb_pack_field_context pack_ctx(unpack_info); // Set the offset for methods which do not take an offset as an argument @@ -638,21 +625,19 @@ m_pack_info[i].m_max_image_len)); field->move_field_offset(ptr_diff); - m_pack_info[i].m_pack_func(&m_pack_info[i], field, - pack_buffer, &tuple, &pack_ctx); + m_pack_info[i].m_pack_func(&m_pack_info[i], field, pack_buffer, &tuple, + &pack_ctx); /* Make "unpack info" to be stored in the value */ - if (create_unpack_info) - { + if (create_unpack_info) { m_pack_info[i].m_make_unpack_info_func(m_pack_info[i].m_charset_codec, field, &pack_ctx); } field->move_field_offset(-ptr_diff); } - if (unpack_info) - { - size_t len= unpack_info->get_current_pos(); + if (unpack_info) { + const size_t len = unpack_info->get_current_pos(); DBUG_ASSERT(len <= std::numeric_limits::max()); // Don't store the unpack_info if it has only the header (that is, there's @@ -661,12 +646,9 @@ // empty (provided m_maybe_unpack_info==true, see // ha_rocksdb::convert_record_to_storage_format) if (len == RDB_UNPACK_HEADER_SIZE && - m_index_type != Rdb_key_def::INDEX_TYPE_PRIMARY) - { + m_index_type != Rdb_key_def::INDEX_TYPE_PRIMARY) { unpack_info->clear(); - } - else - { + } else { unpack_info->write_uint16_at(unpack_len_pos, len); } @@ -676,11 +658,10 @@ // so the checksums are computed and stored by // ha_rocksdb::convert_record_to_storage_format // - if (should_store_checksums) - { - uint32_t key_crc32= crc32(0, packed_tuple, tuple - packed_tuple); - uint32_t val_crc32= crc32(0, unpack_info->ptr(), - unpack_info->get_current_pos()); + if (should_store_row_debug_checksums) { + const uint32_t key_crc32 = crc32(0, packed_tuple, tuple - packed_tuple); + const uint32_t val_crc32 = + crc32(0, unpack_info->ptr(), unpack_info->get_current_pos()); unpack_info->write_uint8(RDB_CHECKSUM_DATA_TAG); unpack_info->write_uint32(key_crc32); @@ -705,12 +686,11 @@ Length of the packed tuple */ -uint Rdb_key_def::pack_hidden_pk(longlong hidden_pk_id, - uchar *packed_tuple) const -{ +uint Rdb_key_def::pack_hidden_pk(const longlong &hidden_pk_id, + uchar *const packed_tuple) const { DBUG_ASSERT(packed_tuple != nullptr); - uchar *tuple= packed_tuple; + uchar *tuple = packed_tuple; rdb_netbuf_store_index(tuple, m_index_number); tuple += INDEX_NUMBER_SIZE; DBUG_ASSERT(m_key_parts == 1); @@ -723,23 +703,22 @@ return tuple - packed_tuple; } - /* Function of type rdb_index_field_pack_t */ -void rdb_pack_with_make_sort_key(Rdb_field_packing *fpi, Field *field, - uchar *buf __attribute__((__unused__)), +void rdb_pack_with_make_sort_key(Rdb_field_packing *const fpi, + Field *const field, + uchar *const buf __attribute__((__unused__)), uchar **dst, - Rdb_pack_field_context *pack_ctx - __attribute__((__unused__))) -{ + Rdb_pack_field_context *const pack_ctx + __attribute__((__unused__))) { DBUG_ASSERT(fpi != nullptr); DBUG_ASSERT(field != nullptr); DBUG_ASSERT(dst != nullptr); DBUG_ASSERT(*dst != nullptr); - const int max_len= fpi->m_max_image_len; + const int max_len = fpi->m_max_image_len; field->make_sort_key(*dst, max_len); *dst += max_len; } @@ -753,12 +732,9 @@ -1 if two kes are equal 1 - Data format error. */ -int Rdb_key_def::compare_keys( - const rocksdb::Slice *key1, - const rocksdb::Slice *key2, - std::size_t* column_index -) const -{ +int Rdb_key_def::compare_keys(const rocksdb::Slice *key1, + const rocksdb::Slice *key2, + std::size_t *const column_index) const { DBUG_ASSERT(key1 != nullptr); DBUG_ASSERT(key2 != nullptr); DBUG_ASSERT(column_index != nullptr); @@ -772,61 +748,56 @@ // Skip the index number if ((!reader1.read(INDEX_NUMBER_SIZE))) - return 1; + return HA_EXIT_FAILURE; if ((!reader2.read(INDEX_NUMBER_SIZE))) - return 1; + return HA_EXIT_FAILURE; - for (uint i= 0; i < m_key_parts ; i++) - { - Rdb_field_packing *fpi= &m_pack_info[i]; - if (fpi->m_maybe_null) - { - auto nullp1= reader1.read(1); - auto nullp2= reader2.read(1); - if (nullp1 == nullptr || nullp2 == nullptr) - return 1; //error + for (uint i = 0; i < m_key_parts; i++) { + const Rdb_field_packing *const fpi = &m_pack_info[i]; + if (fpi->m_maybe_null) { + const auto nullp1 = reader1.read(1); + const auto nullp2 = reader2.read(1); - if (*nullp1 != *nullp2) - { + if (nullp1 == nullptr || nullp2 == nullptr) { + return HA_EXIT_FAILURE; + } + + if (*nullp1 != *nullp2) { *column_index = i; - return 0; + return HA_EXIT_SUCCESS; } - if (*nullp1 == 0) - { + if (*nullp1 == 0) { /* This is a NULL value */ continue; } } - auto before_skip1 = reader1.get_current_ptr(); - auto before_skip2 = reader2.get_current_ptr(); + const auto before_skip1 = reader1.get_current_ptr(); + const auto before_skip2 = reader2.get_current_ptr(); DBUG_ASSERT(fpi->m_skip_func); if (fpi->m_skip_func(fpi, nullptr, &reader1)) - return 1; + return HA_EXIT_FAILURE; if (fpi->m_skip_func(fpi, nullptr, &reader2)) - return 1; - auto size1 = reader1.get_current_ptr() - before_skip1; - auto size2 = reader2.get_current_ptr() - before_skip2; - if (size1 != size2) - { + return HA_EXIT_FAILURE; + const auto size1 = reader1.get_current_ptr() - before_skip1; + const auto size2 = reader2.get_current_ptr() - before_skip2; + if (size1 != size2) { *column_index = i; - return 0; + return HA_EXIT_SUCCESS; } if (memcmp(before_skip1, before_skip2, size1) != 0) { *column_index = i; - return 0; + return HA_EXIT_SUCCESS; } } *column_index = m_key_parts; - return 0; - + return HA_EXIT_SUCCESS; } - /* @brief Given a zero-padded key, determine its real key length @@ -835,8 +806,8 @@ Fixed-size skip functions just read. */ -size_t Rdb_key_def::key_length(TABLE *table, const rocksdb::Slice &key) const -{ +size_t Rdb_key_def::key_length(const TABLE *const table, + const rocksdb::Slice &key) const { DBUG_ASSERT(table != nullptr); Rdb_string_reader reader(&key); @@ -844,19 +815,17 @@ if ((!reader.read(INDEX_NUMBER_SIZE))) return size_t(-1); - for (uint i= 0; i < m_key_parts ; i++) - { - Rdb_field_packing *fpi= &m_pack_info[i]; - Field *field= nullptr; + for (uint i = 0; i < m_key_parts; i++) { + const Rdb_field_packing *fpi = &m_pack_info[i]; + const Field *field = nullptr; if (m_index_type != INDEX_TYPE_HIDDEN_PRIMARY) - field= fpi->get_field_in_table(table); + field = fpi->get_field_in_table(table); if (fpi->m_skip_func(fpi, field, &reader)) return size_t(-1); } return key.size() - reader.remaining_bytes(); } - /* Take mem-comparable form and unpack_info and unpack it to Table->record @@ -866,198 +835,165 @@ @return UNPACK_SUCCESS - Ok UNPACK_FAILURE - Data format error. - UNPACK_INFO_MISSING - Unpack info was unavailable and was required for - unpacking. */ -int Rdb_key_def::unpack_record(TABLE *table, uchar *buf, - const rocksdb::Slice *packed_key, - const rocksdb::Slice *unpack_info, - bool verify_checksums) const -{ +int Rdb_key_def::unpack_record(TABLE *const table, uchar *const buf, + const rocksdb::Slice *const packed_key, + const rocksdb::Slice *const unpack_info, + const bool &verify_row_debug_checksums) const { Rdb_string_reader reader(packed_key); - Rdb_string_reader unp_reader(""); - const bool is_hidden_pk= (m_index_type == INDEX_TYPE_HIDDEN_PRIMARY); - const bool hidden_pk_exists= table_has_hidden_pk(table); - const bool secondary_key= (m_index_type == INDEX_TYPE_SECONDARY); + Rdb_string_reader unp_reader = Rdb_string_reader::read_or_empty(unpack_info); + + const bool is_hidden_pk = (m_index_type == INDEX_TYPE_HIDDEN_PRIMARY); + const bool hidden_pk_exists = table_has_hidden_pk(table); + const bool secondary_key = (m_index_type == INDEX_TYPE_SECONDARY); // There is no checksuming data after unpack_info for primary keys, because // the layout there is different. The checksum is verified in // ha_rocksdb::convert_record_from_storage_format instead. - DBUG_ASSERT_IMP(!secondary_key, !verify_checksums); - - if (unpack_info) - { - unp_reader= Rdb_string_reader(unpack_info); - } + DBUG_ASSERT_IMP(!secondary_key, !verify_row_debug_checksums); // Old Field methods expected the record pointer to be at tbl->record[0]. // The quick and easy way to fix this was to pass along the offset // for the pointer. - my_ptrdiff_t ptr_diff= buf - table->record[0]; + const my_ptrdiff_t ptr_diff = buf - table->record[0]; // Skip the index number - if ((!reader.read(INDEX_NUMBER_SIZE))) - { - return 1; + if ((!reader.read(INDEX_NUMBER_SIZE))) { + return HA_EXIT_FAILURE; } // For secondary keys, we expect the value field to contain unpack data and // checksum data in that order. One or both can be missing, but they cannot // be reordered. - bool has_unpack_info= unp_reader.remaining_bytes() && - *unp_reader.get_current_ptr() == RDB_UNPACK_DATA_TAG; - if (has_unpack_info && !unp_reader.read(RDB_UNPACK_HEADER_SIZE)) - { - return 1; + const bool has_unpack_info = + unp_reader.remaining_bytes() && + *unp_reader.get_current_ptr() == RDB_UNPACK_DATA_TAG; + if (has_unpack_info && !unp_reader.read(RDB_UNPACK_HEADER_SIZE)) { + return HA_EXIT_FAILURE; } - for (uint i= 0; i < m_key_parts ; i++) - { - Rdb_field_packing *fpi= &m_pack_info[i]; + for (uint i = 0; i < m_key_parts; i++) { + Rdb_field_packing *const fpi = &m_pack_info[i]; /* Hidden pk field is packed at the end of the secondary keys, but the SQL layer does not know about it. Skip retrieving field if hidden pk. */ if ((secondary_key && hidden_pk_exists && i + 1 == m_key_parts) || - is_hidden_pk) - { + is_hidden_pk) { DBUG_ASSERT(fpi->m_unpack_func); - if (fpi->m_skip_func(fpi, nullptr, &reader)) - { - return 1; + if (fpi->m_skip_func(fpi, nullptr, &reader)) { + return HA_EXIT_FAILURE; } continue; } - Field *field= fpi->get_field_in_table(table); + Field *const field = fpi->get_field_in_table(table); - bool do_unpack= secondary_key || - !fpi->uses_unpack_info() || - (m_kv_format_version >= Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1); - if (fpi->m_unpack_func && do_unpack) - { + if (fpi->m_unpack_func) { /* It is possible to unpack this column. Do it. */ - if (fpi->m_maybe_null) - { - const char* nullp; - if (!(nullp= reader.read(1))) - return 1; - if (*nullp == 0) - { + if (fpi->m_maybe_null) { + const char *nullp; + if (!(nullp = reader.read(1))) + return HA_EXIT_FAILURE; + if (*nullp == 0) { /* Set the NULL-bit of this field */ field->set_null(ptr_diff); /* Also set the field to its default value */ - uint field_offset= field->ptr - table->record[0]; - memcpy(buf + field_offset, - table->s->default_values + field_offset, + uint field_offset = field->ptr - table->record[0]; + memcpy(buf + field_offset, table->s->default_values + field_offset, field->pack_length()); continue; - } - else if (*nullp == 1) + } else if (*nullp == 1) field->set_notnull(ptr_diff); else - return 1; + return HA_EXIT_FAILURE; } // If we need unpack info, but there is none, tell the unpack function // this by passing unp_reader as nullptr. If we never read unpack_info // during unpacking anyway, then there won't an error. - int res; - bool maybe_missing_unpack= !has_unpack_info && fpi->uses_unpack_info(); - res= fpi->m_unpack_func(fpi, field, field->ptr + ptr_diff, - &reader, - maybe_missing_unpack ? nullptr : &unp_reader); + const bool maybe_missing_unpack = + !has_unpack_info && fpi->uses_unpack_info(); + const int res = + fpi->m_unpack_func(fpi, field, field->ptr + ptr_diff, &reader, + maybe_missing_unpack ? nullptr : &unp_reader); if (res) return res; - } - else - { + } else { /* It is impossible to unpack the column. Skip it. */ - if (fpi->m_maybe_null) - { - const char* nullp; - if (!(nullp= reader.read(1))) - return 1; - if (*nullp == 0) - { + if (fpi->m_maybe_null) { + const char *nullp; + if (!(nullp = reader.read(1))) + return HA_EXIT_FAILURE; + if (*nullp == 0) { /* This is a NULL value */ continue; } /* If NULL marker is not '0', it can be only '1' */ if (*nullp != 1) - return 1; + return HA_EXIT_FAILURE; } if (fpi->m_skip_func(fpi, field, &reader)) - return 1; + return HA_EXIT_FAILURE; } } /* Check checksum values if present */ - const char* ptr; - if ((ptr= unp_reader.read(1)) && *ptr == RDB_CHECKSUM_DATA_TAG) - { - if (verify_checksums) - { - uint32_t stored_key_chksum= rdb_netbuf_to_uint32( - (const uchar*)unp_reader.read(RDB_CHECKSUM_SIZE)); - uint32_t stored_val_chksum= rdb_netbuf_to_uint32( - (const uchar*)unp_reader.read(RDB_CHECKSUM_SIZE)); - - uint32_t computed_key_chksum= - crc32(0, (const uchar*)packed_key->data(), packed_key->size()); - uint32_t computed_val_chksum= - crc32(0, (const uchar*) unpack_info->data(), - unpack_info->size() - RDB_CHECKSUM_CHUNK_SIZE); + const char *ptr; + if ((ptr = unp_reader.read(1)) && *ptr == RDB_CHECKSUM_DATA_TAG) { + if (verify_row_debug_checksums) { + uint32_t stored_key_chksum = rdb_netbuf_to_uint32( + (const uchar *)unp_reader.read(RDB_CHECKSUM_SIZE)); + const uint32_t stored_val_chksum = rdb_netbuf_to_uint32( + (const uchar *)unp_reader.read(RDB_CHECKSUM_SIZE)); + + const uint32_t computed_key_chksum = + crc32(0, (const uchar *)packed_key->data(), packed_key->size()); + const uint32_t computed_val_chksum = + crc32(0, (const uchar *)unpack_info->data(), + unpack_info->size() - RDB_CHECKSUM_CHUNK_SIZE); DBUG_EXECUTE_IF("myrocks_simulate_bad_key_checksum1", stored_key_chksum++;); - if (stored_key_chksum != computed_key_chksum) - { - report_checksum_mismatch(true, packed_key->data(), - packed_key->size()); - return 1; + if (stored_key_chksum != computed_key_chksum) { + report_checksum_mismatch(true, packed_key->data(), packed_key->size()); + return HA_EXIT_FAILURE; } - if (stored_val_chksum != computed_val_chksum) - { - report_checksum_mismatch( - false, unpack_info->data(), - unpack_info->size() - RDB_CHECKSUM_CHUNK_SIZE); - return 1; + if (stored_val_chksum != computed_val_chksum) { + report_checksum_mismatch(false, unpack_info->data(), + unpack_info->size() - RDB_CHECKSUM_CHUNK_SIZE); + return HA_EXIT_FAILURE; } - } - else - { + } else { /* The checksums are present but we are not checking checksums */ } } if (reader.remaining_bytes()) - return 1; + return HA_EXIT_FAILURE; - return 0; + return HA_EXIT_SUCCESS; } -bool Rdb_key_def::table_has_hidden_pk(const TABLE* table) -{ +bool Rdb_key_def::table_has_hidden_pk(const TABLE *const table) { return table->s->primary_key == MAX_INDEXES; } -void Rdb_key_def::report_checksum_mismatch(bool is_key, const char *data, - size_t data_size) const -{ - std::string buf; +void Rdb_key_def::report_checksum_mismatch(const bool &is_key, + const char *const data, + const size_t data_size) const { // NO_LINT_DEBUG sql_print_error("Checksum mismatch in %s of key-value pair for index 0x%x", - is_key? "key" : "value", get_index_number()); + is_key ? "key" : "value", get_index_number()); - buf = rdb_hexdump(data, data_size, 1000); + const std::string buf = rdb_hexdump(data, data_size, RDB_MAX_HEXDUMP_LEN); // NO_LINT_DEBUG sql_print_error("Data with incorrect checksum (%" PRIu64 " bytes): %s", (uint64_t)data_size, buf.c_str()); @@ -1065,18 +1001,17 @@ my_error(ER_INTERNAL_ERROR, MYF(0), "Record checksum mismatch"); } -bool Rdb_key_def::index_format_min_check(int pk_min, int sk_min) const -{ - switch (m_index_type) - { - case INDEX_TYPE_PRIMARY: - case INDEX_TYPE_HIDDEN_PRIMARY: - return (m_kv_format_version >= pk_min); - case INDEX_TYPE_SECONDARY: - return (m_kv_format_version >= sk_min); - default: - DBUG_ASSERT(0); - return false; +bool Rdb_key_def::index_format_min_check(const int &pk_min, + const int &sk_min) const { + switch (m_index_type) { + case INDEX_TYPE_PRIMARY: + case INDEX_TYPE_HIDDEN_PRIMARY: + return (m_kv_format_version >= pk_min); + case INDEX_TYPE_SECONDARY: + return (m_kv_format_version >= sk_min); + default: + DBUG_ASSERT(0); + return false; } } @@ -1088,13 +1023,12 @@ Function of type rdb_index_field_skip_t */ -int rdb_skip_max_length(const Rdb_field_packing *fpi, - const Field *field __attribute__((__unused__)), - Rdb_string_reader *reader) -{ +int rdb_skip_max_length(const Rdb_field_packing *const fpi, + const Field *const field __attribute__((__unused__)), + Rdb_string_reader *const reader) { if (!reader->read(fpi->m_max_image_len)) - return 1; - return 0; + return HA_EXIT_FAILURE; + return HA_EXIT_SUCCESS; } /* @@ -1103,7 +1037,7 @@ rdb_unpack_binary_or_utf8_varchar. */ -const uint RDB_ESCAPE_LENGTH= 9; +const uint RDB_ESCAPE_LENGTH = 9; static_assert((RDB_ESCAPE_LENGTH - 1) % 2 == 0, "RDB_ESCAPE_LENGTH-1 must be even."); @@ -1111,51 +1045,45 @@ Function of type rdb_index_field_skip_t */ -static int rdb_skip_variable_length( - const Rdb_field_packing *fpi __attribute__((__unused__)), - const Field *field, Rdb_string_reader *reader) -{ +static int rdb_skip_variable_length(const Rdb_field_packing *const fpi + __attribute__((__unused__)), + const Field *const field, + Rdb_string_reader *const reader) { const uchar *ptr; - bool finished= false; + bool finished = false; size_t dst_len; /* How much data can be there */ - if (field) - { - const Field_varstring* field_var= - static_cast(field); - dst_len= field_var->pack_length() - field_var->length_bytes; - } - else - { - dst_len= UINT_MAX; + if (field) { + const Field_varstring *const field_var = + static_cast(field); + dst_len = field_var->pack_length() - field_var->length_bytes; + } else { + dst_len = UINT_MAX; } /* Decode the length-emitted encoding here */ - while ((ptr= (const uchar*)reader->read(RDB_ESCAPE_LENGTH))) - { + while ((ptr = (const uchar *)reader->read(RDB_ESCAPE_LENGTH))) { /* See rdb_pack_with_varchar_encoding. */ - uchar pad= 255 - ptr[RDB_ESCAPE_LENGTH - 1]; // number of padding bytes - uchar used_bytes= RDB_ESCAPE_LENGTH - 1 - pad; + const uchar pad = + 255 - ptr[RDB_ESCAPE_LENGTH - 1]; // number of padding bytes + const uchar used_bytes = RDB_ESCAPE_LENGTH - 1 - pad; - if (used_bytes > RDB_ESCAPE_LENGTH - 1 || used_bytes > dst_len) - { - return 1; /* cannot store that much, invalid data */ + if (used_bytes > RDB_ESCAPE_LENGTH - 1 || used_bytes > dst_len) { + return HA_EXIT_FAILURE; /* cannot store that much, invalid data */ } - if (used_bytes < RDB_ESCAPE_LENGTH - 1) - { - finished= true; + if (used_bytes < RDB_ESCAPE_LENGTH - 1) { + finished = true; break; } dst_len -= used_bytes; } - if (!finished) - { - return 1; + if (!finished) { + return HA_EXIT_FAILURE; } - return 0; + return HA_EXIT_SUCCESS; } const int VARCHAR_CMP_LESS_THAN_SPACES = 1; @@ -1166,138 +1094,135 @@ Skip a keypart that uses Variable-Length Space-Padded encoding */ -static int rdb_skip_variable_space_pad( - const Rdb_field_packing *fpi, - const Field *field, Rdb_string_reader *reader) -{ +static int rdb_skip_variable_space_pad(const Rdb_field_packing *const fpi, + const Field *const field, + Rdb_string_reader *const reader) { const uchar *ptr; - bool finished= false; + bool finished = false; - size_t dst_len= UINT_MAX; /* How much data can be there */ + size_t dst_len = UINT_MAX; /* How much data can be there */ - if (field) - { - const Field_varstring* field_var= - static_cast(field); - dst_len= field_var->pack_length() - field_var->length_bytes; + if (field) { + const Field_varstring *const field_var = + static_cast(field); + dst_len = field_var->pack_length() - field_var->length_bytes; } /* Decode the length-emitted encoding here */ - while ((ptr= (const uchar*)reader->read(fpi->m_segment_size))) - { + while ((ptr = (const uchar *)reader->read(fpi->m_segment_size))) { // See rdb_pack_with_varchar_space_pad - uchar c= ptr[fpi->m_segment_size-1]; - if (c == VARCHAR_CMP_EQUAL_TO_SPACES) - { + const uchar c = ptr[fpi->m_segment_size - 1]; + if (c == VARCHAR_CMP_EQUAL_TO_SPACES) { // This is the last segment - finished= true; + finished = true; break; - } - else if (c == VARCHAR_CMP_LESS_THAN_SPACES || - c == VARCHAR_CMP_GREATER_THAN_SPACES) - { + } else if (c == VARCHAR_CMP_LESS_THAN_SPACES || + c == VARCHAR_CMP_GREATER_THAN_SPACES) { // This is not the last segment - if ((fpi->m_segment_size-1) > dst_len) - { + if ((fpi->m_segment_size - 1) > dst_len) { // The segment is full of data but the table field can't hold that // much! This must be data corruption. - return 1; + return HA_EXIT_FAILURE; } - dst_len -= (fpi->m_segment_size-1); - } - else - { + dst_len -= (fpi->m_segment_size - 1); + } else { // Encountered a value that's none of the VARCHAR_CMP* constants // It's data corruption. - return 1; + return HA_EXIT_FAILURE; } } - return finished? 0: 1; + return finished ? HA_EXIT_SUCCESS : HA_EXIT_FAILURE; } - /* Function of type rdb_index_field_unpack_t */ -int rdb_unpack_integer( - Rdb_field_packing *fpi, Field *field, uchar *to, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader __attribute__((__unused__))) -{ - const int length= fpi->m_max_image_len; +int rdb_unpack_integer(Rdb_field_packing *const fpi, Field *const field, + uchar *const to, Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader + __attribute__((__unused__))) { + const int length = fpi->m_max_image_len; const uchar *from; - if (!(from= (const uchar*)reader->read(length))) + if (!(from = (const uchar *)reader->read(length))) return UNPACK_FAILURE; /* Mem-comparable image doesn't have enough bytes */ #ifdef WORDS_BIGENDIAN { - if (((Field_num*)field)->unsigned_flag) - to[0]= from[0]; + if (((Field_num *)field)->unsigned_flag) + to[0] = from[0]; else - to[0]= (char)(from[0] ^ 128); // Reverse the sign bit. + to[0] = (char)(from[0] ^ 128); // Reverse the sign bit. memcpy(to + 1, from + 1, length - 1); } #else { - const int sign_byte= from[0]; - if (((Field_num*)field)->unsigned_flag) - to[length - 1]= sign_byte; + const int sign_byte = from[0]; + if (((Field_num *)field)->unsigned_flag) + to[length - 1] = sign_byte; else - to[length - 1]= static_cast(sign_byte ^ 128); // Reverse the sign bit. - for (int i= 0, j= length - 1; i < length-1; ++i, --j) - to[i]= from[j]; + to[length - 1] = + static_cast(sign_byte ^ 128); // Reverse the sign bit. + for (int i = 0, j = length - 1; i < length - 1; ++i, --j) + to[i] = from[j]; } #endif return UNPACK_SUCCESS; } #if !defined(WORDS_BIGENDIAN) -static void rdb_swap_double_bytes(uchar *dst, const uchar *src) -{ +static void rdb_swap_double_bytes(uchar *const dst, const uchar *const src) { #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) // A few systems store the most-significant _word_ first on little-endian - dst[0] = src[3]; dst[1] = src[2]; dst[2] = src[1]; dst[3] = src[0]; - dst[4] = src[7]; dst[5] = src[6]; dst[6] = src[5]; dst[7] = src[4]; + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; + dst[4] = src[7]; + dst[5] = src[6]; + dst[6] = src[5]; + dst[7] = src[4]; #else - dst[0] = src[7]; dst[1] = src[6]; dst[2] = src[5]; dst[3] = src[4]; - dst[4] = src[3]; dst[5] = src[2]; dst[6] = src[1]; dst[7] = src[0]; + dst[0] = src[7]; + dst[1] = src[6]; + dst[2] = src[5]; + dst[3] = src[4]; + dst[4] = src[3]; + dst[5] = src[2]; + dst[6] = src[1]; + dst[7] = src[0]; #endif } -static void rdb_swap_float_bytes(uchar *dst, const uchar *src) -{ - dst[0] = src[3]; dst[1] = src[2]; dst[2] = src[1]; dst[3] = src[0]; +static void rdb_swap_float_bytes(uchar *const dst, const uchar *const src) { + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; } #else #define rdb_swap_double_bytes nullptr -#define rdb_swap_float_bytes nullptr +#define rdb_swap_float_bytes nullptr #endif static int rdb_unpack_floating_point( - uchar *dst, Rdb_string_reader *reader, - size_t size, int exp_digit, - const uchar *zero_pattern, - const uchar *zero_val, - void (*swap_func)(uchar *, const uchar *)) -{ - const uchar* from; - - from= (const uchar*) reader->read(size); + uchar *const dst, Rdb_string_reader *const reader, const size_t &size, + const int &exp_digit, const uchar *const zero_pattern, + const uchar *const zero_val, void (*swap_func)(uchar *, const uchar *)) { + const uchar *const from = (const uchar *)reader->read(size); if (from == nullptr) return UNPACK_FAILURE; /* Mem-comparable image doesn't have enough bytes */ /* Check to see if the value is zero */ - if (memcmp(from, zero_pattern, size) == 0) - { + if (memcmp(from, zero_pattern, size) == 0) { memcpy(dst, zero_val, size); return UNPACK_SUCCESS; } #if defined(WORDS_BIGENDIAN) // On big-endian, output can go directly into result - uchar *tmp = dst; + uchar *const tmp = dst; #else // Otherwise use a temporary buffer to make byte-swapping easier later uchar tmp[8]; @@ -1305,18 +1230,15 @@ memcpy(tmp, from, size); - if (tmp[0] & 0x80) - { + if (tmp[0] & 0x80) { // If the high bit is set the original value was positive so // remove the high bit and subtract one from the exponent. - ushort exp_part= ((ushort) tmp[0] << 8) | (ushort) tmp[1]; - exp_part &= 0x7FFF; // clear high bit; - exp_part -= (ushort) 1 << (16 - 1 - exp_digit); // subtract from exponent - tmp[0] = (uchar) (exp_part >> 8); - tmp[1] = (uchar) exp_part; - } - else - { + ushort exp_part = ((ushort)tmp[0] << 8) | (ushort)tmp[1]; + exp_part &= 0x7FFF; // clear high bit; + exp_part -= (ushort)1 << (16 - 1 - exp_digit); // subtract from exponent + tmp[0] = (uchar)(exp_part >> 8); + tmp[1] = (uchar)exp_part; + } else { // Otherwise the original value was negative and all bytes have been // negated. for (size_t ii = 0; ii < size; ii++) @@ -1337,7 +1259,6 @@ #define DBL_EXP_DIG (sizeof(double) * 8 - DBL_MANT_DIG) #endif - /* Function of type rdb_index_field_unpack_t @@ -1346,20 +1267,19 @@ Note also that this code assumes that NaN and +/-Infinity are never allowed in the database. */ -static int rdb_unpack_double( - Rdb_field_packing *fpi __attribute__((__unused__)), - Field *field __attribute__((__unused__)), - uchar *field_ptr, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader __attribute__((__unused__))) -{ - static double zero_val = 0.0; - static const uchar zero_pattern[8] = { 128, 0, 0, 0, 0, 0, 0, 0 }; - - return rdb_unpack_floating_point(field_ptr, reader, - sizeof(double), - DBL_EXP_DIG, zero_pattern, (const uchar *) &zero_val, - rdb_swap_double_bytes); +static int rdb_unpack_double(Rdb_field_packing *const fpi + __attribute__((__unused__)), + Field *const field __attribute__((__unused__)), + uchar *const field_ptr, + Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader + __attribute__((__unused__))) { + static double zero_val = 0.0; + static const uchar zero_pattern[8] = {128, 0, 0, 0, 0, 0, 0, 0}; + + return rdb_unpack_floating_point( + field_ptr, reader, sizeof(double), DBL_EXP_DIG, zero_pattern, + (const uchar *)&zero_val, rdb_swap_double_bytes); } #if !defined(FLT_EXP_DIG) @@ -1374,19 +1294,18 @@ Note also that this code assumes that NaN and +/-Infinity are never allowed in the database. */ -static int rdb_unpack_float( - Rdb_field_packing *, Field *field __attribute__((__unused__)), - uchar *field_ptr, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader __attribute__((__unused__))) -{ - static float zero_val = 0.0; - static const uchar zero_pattern[4] = { 128, 0, 0, 0 }; - - return rdb_unpack_floating_point(field_ptr, reader, - sizeof(float), - FLT_EXP_DIG, zero_pattern, (const uchar *) &zero_val, - rdb_swap_float_bytes); +static int rdb_unpack_float(Rdb_field_packing *const, + Field *const field __attribute__((__unused__)), + uchar *const field_ptr, + Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader + __attribute__((__unused__))) { + static float zero_val = 0.0; + static const uchar zero_pattern[4] = {128, 0, 0, 0}; + + return rdb_unpack_floating_point( + field_ptr, reader, sizeof(float), FLT_EXP_DIG, zero_pattern, + (const uchar *)&zero_val, rdb_swap_float_bytes); } /* @@ -1394,91 +1313,81 @@ Unpack by doing the reverse action to Field_newdate::make_sort_key. */ -int rdb_unpack_newdate( - Rdb_field_packing *fpi, Field *field, - uchar *field_ptr, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader __attribute__((__unused__))) -{ - const char* from; +int rdb_unpack_newdate(Rdb_field_packing *const fpi, Field *constfield, + uchar *const field_ptr, Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader + __attribute__((__unused__))) { + const char *from; DBUG_ASSERT(fpi->m_max_image_len == 3); - if (!(from= reader->read(3))) + if (!(from = reader->read(3))) return UNPACK_FAILURE; /* Mem-comparable image doesn't have enough bytes */ - field_ptr[0]= from[2]; - field_ptr[1]= from[1]; - field_ptr[2]= from[0]; + field_ptr[0] = from[2]; + field_ptr[1] = from[1]; + field_ptr[2] = from[0]; return UNPACK_SUCCESS; } - /* Function of type rdb_index_field_unpack_t, used to Unpack the string by copying it over. This is for BINARY(n) where the value occupies the whole length. */ -static int rdb_unpack_binary_str( - Rdb_field_packing *fpi, Field *field, - uchar *to, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader __attribute__((__unused__))) -{ - const char* from; - if (!(from= reader->read(fpi->m_max_image_len))) +static int rdb_unpack_binary_str(Rdb_field_packing *const fpi, + Field *const field, uchar *const to, + Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader + __attribute__((__unused__))) { + const char *from; + if (!(from = reader->read(fpi->m_max_image_len))) return UNPACK_FAILURE; /* Mem-comparable image doesn't have enough bytes */ memcpy(to, from, fpi->m_max_image_len); return UNPACK_SUCCESS; } - /* Function of type rdb_index_field_unpack_t. For UTF-8, we need to convert 2-byte wide-character entities back into UTF8 sequences. */ -static int rdb_unpack_utf8_str( - Rdb_field_packing *fpi, Field *field, - uchar *dst, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader __attribute__((__unused__))) -{ - my_core::CHARSET_INFO *cset= (my_core::CHARSET_INFO*)field->charset(); +static int rdb_unpack_utf8_str(Rdb_field_packing *const fpi, Field *const field, + uchar *dst, Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader + __attribute__((__unused__))) { + my_core::CHARSET_INFO *const cset = (my_core::CHARSET_INFO *)field->charset(); const uchar *src; - if (!(src= (const uchar*)reader->read(fpi->m_max_image_len))) + if (!(src = (const uchar *)reader->read(fpi->m_max_image_len))) return UNPACK_FAILURE; /* Mem-comparable image doesn't have enough bytes */ - const uchar *src_end= src + fpi->m_max_image_len; - uchar *dst_end= dst + field->pack_length(); + const uchar *const src_end = src + fpi->m_max_image_len; + uchar *const dst_end = dst + field->pack_length(); - while (src < src_end) - { - my_wc_t wc= (src[0] <<8) | src[1]; + while (src < src_end) { + my_wc_t wc = (src[0] << 8) | src[1]; src += 2; - int res= cset->cset->wc_mb(cset, wc, dst, dst_end); - DBUG_ASSERT(res > 0 && res <=3); + int res = cset->cset->wc_mb(cset, wc, dst, dst_end); + DBUG_ASSERT(res > 0 && res <= 3); if (res < 0) return UNPACK_FAILURE; dst += res; } - cset->cset->fill(cset, reinterpret_cast(dst), - dst_end - dst, cset->pad_char); + cset->cset->fill(cset, reinterpret_cast(dst), dst_end - dst, + cset->pad_char); return UNPACK_SUCCESS; } - /* Function of type rdb_index_field_pack_t */ static void rdb_pack_with_varchar_encoding( - Rdb_field_packing *fpi, Field *field, uchar *buf, uchar **dst, - Rdb_pack_field_context *pack_ctx __attribute__((__unused__))) -{ + Rdb_field_packing *const fpi, Field *const field, uchar *buf, uchar **dst, + Rdb_pack_field_context *const pack_ctx __attribute__((__unused__))) { /* Use a flag byte every Nth byte. Set it to (255 - #pad) where #pad is 0 when the var length field filled all N-1 previous bytes and #pad is @@ -1489,66 +1398,58 @@ * 4 bytes (1, 2, 3, 0) this is encoded as: 1, 2, 3, 0, 0, 0, 0, 252 And the 4 byte string compares as greater than the 3 byte string */ - const CHARSET_INFO *charset= field->charset(); - Field_varstring *field_var= (Field_varstring*)field; + const CHARSET_INFO *const charset = field->charset(); + Field_varstring *const field_var = (Field_varstring *)field; - size_t value_length= (field_var->length_bytes == 1) ? - (uint) *field->ptr : - uint2korr(field->ptr); - size_t xfrm_len; - xfrm_len= charset->coll->strnxfrm(charset, - buf, fpi->m_max_image_len, - field_var->char_length(), - field_var->ptr + field_var->length_bytes, - value_length, - 0); + const size_t value_length = (field_var->length_bytes == 1) + ? (uint)*field->ptr + : uint2korr(field->ptr); + size_t xfrm_len = charset->coll->strnxfrm( + charset, buf, fpi->m_max_image_len, field_var->char_length(), + field_var->ptr + field_var->length_bytes, value_length, 0); /* Got a mem-comparable image in 'buf'. Now, produce varlength encoding */ - size_t encoded_size= 0; - uchar *ptr= *dst; - while (1) - { - size_t copy_len= std::min((size_t)RDB_ESCAPE_LENGTH-1, xfrm_len); - size_t padding_bytes= RDB_ESCAPE_LENGTH - 1 - copy_len; + size_t encoded_size = 0; + uchar *ptr = *dst; + while (1) { + const size_t copy_len = std::min((size_t)RDB_ESCAPE_LENGTH - 1, xfrm_len); + const size_t padding_bytes = RDB_ESCAPE_LENGTH - 1 - copy_len; memcpy(ptr, buf, copy_len); ptr += copy_len; buf += copy_len; // pad with zeros if necessary; - for (size_t idx= 0; idx < padding_bytes; idx++) - *(ptr++)= 0; + for (size_t idx = 0; idx < padding_bytes; idx++) + *(ptr++) = 0; *(ptr++) = 255 - padding_bytes; - xfrm_len -= copy_len; + xfrm_len -= copy_len; encoded_size += RDB_ESCAPE_LENGTH; - if (padding_bytes !=0) + if (padding_bytes != 0) break; } *dst += encoded_size; } - /* Compare the string in [buf..buf_end) with a string that is an infinite sequence of strings in space_xfrm */ -static -int rdb_compare_string_with_spaces(const uchar *buf, const uchar *buf_end, - const std::vector *space_xfrm) -{ - int cmp= 0; - while (buf < buf_end) - { - size_t bytes = std::min((size_t) (buf_end - buf), space_xfrm->size()); - if ((cmp= memcmp(buf, space_xfrm->data(), bytes)) != 0) +static int +rdb_compare_string_with_spaces(const uchar *buf, const uchar *const buf_end, + const std::vector *const space_xfrm) { + int cmp = 0; + while (buf < buf_end) { + size_t bytes = std::min((size_t)(buf_end - buf), space_xfrm->size()); + if ((cmp = memcmp(buf, space_xfrm->data(), bytes)) != 0) break; buf += bytes; } return cmp; } -static const int RDB_TRIMMED_CHARS_OFFSET= 8; +static const int RDB_TRIMMED_CHARS_OFFSET = 8; /* Pack the data with Variable-Length Space-Padded Encoding. @@ -1620,66 +1521,57 @@ rdb_skip_variable_space_pad */ -static void rdb_pack_with_varchar_space_pad( - Rdb_field_packing *fpi, Field *field, uchar *buf, uchar **dst, - Rdb_pack_field_context *pack_ctx) -{ - Rdb_string_writer *unpack_info= pack_ctx->writer; - const CHARSET_INFO *charset= field->charset(); - auto field_var= static_cast(field); - - size_t value_length= (field_var->length_bytes == 1) ? - (uint) *field->ptr : - uint2korr(field->ptr); - - size_t trimmed_len= - charset->cset->lengthsp(charset, - (const char*)field_var->ptr + - field_var->length_bytes, - value_length); - size_t xfrm_len; - xfrm_len= charset->coll->strnxfrm(charset, - buf, fpi->m_max_image_len, - field_var->char_length(), - field_var->ptr + field_var->length_bytes, - trimmed_len, - 0); +static void +rdb_pack_with_varchar_space_pad(Rdb_field_packing *const fpi, + Field *const field, uchar *buf, uchar **dst, + Rdb_pack_field_context *const pack_ctx) { + Rdb_string_writer *const unpack_info = pack_ctx->writer; + const CHARSET_INFO *const charset = field->charset(); + const auto field_var = static_cast(field); + + const size_t value_length = (field_var->length_bytes == 1) + ? (uint)*field->ptr + : uint2korr(field->ptr); + + const size_t trimmed_len = charset->cset->lengthsp( + charset, (const char *)field_var->ptr + field_var->length_bytes, + value_length); + const size_t xfrm_len = charset->coll->strnxfrm( + charset, buf, fpi->m_max_image_len, field_var->char_length(), + field_var->ptr + field_var->length_bytes, trimmed_len, 0); /* Got a mem-comparable image in 'buf'. Now, produce varlength encoding */ - uchar *buf_end= buf + xfrm_len; + uchar *const buf_end = buf + xfrm_len; - size_t encoded_size= 0; - uchar *ptr= *dst; + size_t encoded_size = 0; + uchar *ptr = *dst; size_t padding_bytes; - while (true) - { - size_t copy_len= std::min(fpi->m_segment_size-1, buf_end - buf); - padding_bytes= fpi->m_segment_size - 1 - copy_len; + while (true) { + const size_t copy_len = + std::min(fpi->m_segment_size - 1, buf_end - buf); + padding_bytes = fpi->m_segment_size - 1 - copy_len; memcpy(ptr, buf, copy_len); ptr += copy_len; buf += copy_len; - if (padding_bytes) - { + if (padding_bytes) { memcpy(ptr, fpi->space_xfrm->data(), padding_bytes); - ptr+= padding_bytes; - *ptr= VARCHAR_CMP_EQUAL_TO_SPACES; // last segment - } - else - { + ptr += padding_bytes; + *ptr = VARCHAR_CMP_EQUAL_TO_SPACES; // last segment + } else { // Compare the string suffix with a hypothetical infinite string of // spaces. It could be that the first difference is beyond the end of // current chunk. - int cmp= rdb_compare_string_with_spaces(buf, buf_end, fpi->space_xfrm); + const int cmp = + rdb_compare_string_with_spaces(buf, buf_end, fpi->space_xfrm); if (cmp < 0) - *ptr= VARCHAR_CMP_LESS_THAN_SPACES; + *ptr = VARCHAR_CMP_LESS_THAN_SPACES; else if (cmp > 0) - *ptr= VARCHAR_CMP_GREATER_THAN_SPACES; - else - { + *ptr = VARCHAR_CMP_GREATER_THAN_SPACES; + else { // It turns out all the rest are spaces. - *ptr= VARCHAR_CMP_EQUAL_TO_SPACES; + *ptr = VARCHAR_CMP_EQUAL_TO_SPACES; } } encoded_size += fpi->m_segment_size; @@ -1691,23 +1583,20 @@ // m_unpack_info_stores_value means unpack_info stores the whole original // value. There is no need to store the number of trimmed/padded endspaces // in that case. - if (unpack_info && !fpi->m_unpack_info_stores_value) - { + if (unpack_info && !fpi->m_unpack_info_stores_value) { // (value_length - trimmed_len) is the number of trimmed space *characters* // then, padding_bytes is the number of *bytes* added as padding // then, we add 8, because we don't store negative values. DBUG_ASSERT(padding_bytes % fpi->space_xfrm_len == 0); - DBUG_ASSERT((value_length - trimmed_len)% fpi->space_mb_len == 0); - size_t removed_chars= RDB_TRIMMED_CHARS_OFFSET + - (value_length - trimmed_len) / fpi->space_mb_len - - padding_bytes/fpi->space_xfrm_len; + DBUG_ASSERT((value_length - trimmed_len) % fpi->space_mb_len == 0); + const size_t removed_chars = + RDB_TRIMMED_CHARS_OFFSET + + (value_length - trimmed_len) / fpi->space_mb_len - + padding_bytes / fpi->space_xfrm_len; - if (fpi->m_unpack_info_uses_two_bytes) - { + if (fpi->m_unpack_info_uses_two_bytes) { unpack_info->write_uint16(removed_chars); - } - else - { + } else { DBUG_ASSERT(removed_chars < 0x100); unpack_info->write_uint8(removed_chars); } @@ -1720,36 +1609,32 @@ Function of type rdb_index_field_unpack_t */ -static int rdb_unpack_binary_or_utf8_varchar( - Rdb_field_packing *fpi, Field *field, - uchar *dst, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader __attribute__((__unused__))) -{ +static int rdb_unpack_binary_or_utf8_varchar(Rdb_field_packing *const fpi, + Field *const field, uchar *dst, + Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader + __attribute__((__unused__))) { const uchar *ptr; - size_t len= 0; - bool finished= false; - uchar *d0= dst; - Field_varstring* field_var= (Field_varstring*)field; + size_t len = 0; + bool finished = false; + uchar *d0 = dst; + Field_varstring *const field_var = (Field_varstring *)field; dst += field_var->length_bytes; // How much we can unpack - size_t dst_len= field_var->pack_length() - field_var->length_bytes; - uchar *dst_end= dst + dst_len; + size_t dst_len = field_var->pack_length() - field_var->length_bytes; + uchar *const dst_end = dst + dst_len; /* Decode the length-emitted encoding here */ - while ((ptr= (const uchar*)reader->read(RDB_ESCAPE_LENGTH))) - { + while ((ptr = (const uchar *)reader->read(RDB_ESCAPE_LENGTH))) { /* See rdb_pack_with_varchar_encoding. */ - uchar pad= 255 - ptr[RDB_ESCAPE_LENGTH - 1]; // number of padding bytes - uchar used_bytes= RDB_ESCAPE_LENGTH - 1 - pad; + uchar pad = 255 - ptr[RDB_ESCAPE_LENGTH - 1]; // number of padding bytes + uchar used_bytes = RDB_ESCAPE_LENGTH - 1 - pad; - if (used_bytes > RDB_ESCAPE_LENGTH - 1) - { + if (used_bytes > RDB_ESCAPE_LENGTH - 1) { return UNPACK_FAILURE; /* cannot store that much, invalid data */ } - if (dst_len < used_bytes) - { + if (dst_len < used_bytes) { /* Encoded index tuple is longer than the size in the record buffer? */ return UNPACK_FAILURE; } @@ -1757,10 +1642,8 @@ /* Now, we need to decode used_bytes of data and append them to the value. */ - if (fpi->m_varchar_charset == &my_charset_utf8_bin) - { - if (used_bytes & 1) - { + if (fpi->m_varchar_charset == &my_charset_utf8_bin) { + if (used_bytes & 1) { /* UTF-8 characters are encoded into two-byte entities. There is no way we can have an odd number of bytes after encoding. @@ -1768,33 +1651,29 @@ return UNPACK_FAILURE; } - const uchar *src= ptr; - const uchar *src_end= ptr + used_bytes; - while (src < src_end) - { - my_wc_t wc= (src[0] <<8) | src[1]; + const uchar *src = ptr; + const uchar *src_end = ptr + used_bytes; + while (src < src_end) { + my_wc_t wc = (src[0] << 8) | src[1]; src += 2; - const CHARSET_INFO *cset= fpi->m_varchar_charset; - int res= cset->cset->wc_mb(cset, wc, dst, dst_end); - DBUG_ASSERT(res > 0 && res <=3); + const CHARSET_INFO *cset = fpi->m_varchar_charset; + int res = cset->cset->wc_mb(cset, wc, dst, dst_end); + DBUG_ASSERT(res > 0 && res <= 3); if (res < 0) return UNPACK_FAILURE; dst += res; len += res; dst_len -= res; } - } - else - { + } else { memcpy(dst, ptr, used_bytes); dst += used_bytes; dst_len -= used_bytes; len += used_bytes; } - if (used_bytes < RDB_ESCAPE_LENGTH - 1) - { - finished= true; + if (used_bytes < RDB_ESCAPE_LENGTH - 1) { + finished = true; break; } } @@ -1803,12 +1682,9 @@ return UNPACK_FAILURE; /* Save the length */ - if (field_var->length_bytes == 1) - { - d0[0]= len; - } - else - { + if (field_var->length_bytes == 1) { + d0[0] = len; + } else { DBUG_ASSERT(field_var->length_bytes == 2); int2store(d0, len); } @@ -1823,66 +1699,54 @@ rdb_skip_variable_space_pad - skip function */ static int rdb_unpack_binary_or_utf8_varchar_space_pad( - Rdb_field_packing *fpi, Field *field, - uchar *dst, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader) -{ + Rdb_field_packing *const fpi, Field *const field, uchar *dst, + Rdb_string_reader *const reader, Rdb_string_reader *const unp_reader) { const uchar *ptr; - size_t len= 0; - bool finished= false; - Field_varstring* field_var= static_cast(field); - uchar *d0= dst; - uchar *dst_end= dst + field_var->pack_length(); + size_t len = 0; + bool finished = false; + Field_varstring *const field_var = static_cast(field); + uchar *d0 = dst; + uchar *dst_end = dst + field_var->pack_length(); dst += field_var->length_bytes; - uint space_padding_bytes= 0; + uint space_padding_bytes = 0; uint extra_spaces; - if ((fpi->m_unpack_info_uses_two_bytes? - unp_reader->read_uint16(&extra_spaces): - unp_reader->read_uint8(&extra_spaces))) - { + if ((fpi->m_unpack_info_uses_two_bytes + ? unp_reader->read_uint16(&extra_spaces) + : unp_reader->read_uint8(&extra_spaces))) { return UNPACK_FAILURE; } - if (extra_spaces <= RDB_TRIMMED_CHARS_OFFSET) - { - space_padding_bytes= -(static_cast(extra_spaces) - - RDB_TRIMMED_CHARS_OFFSET); - extra_spaces= 0; - } - else + if (extra_spaces <= RDB_TRIMMED_CHARS_OFFSET) { + space_padding_bytes = + -(static_cast(extra_spaces) - RDB_TRIMMED_CHARS_OFFSET); + extra_spaces = 0; + } else extra_spaces -= RDB_TRIMMED_CHARS_OFFSET; space_padding_bytes *= fpi->space_xfrm_len; /* Decode the length-emitted encoding here */ - while ((ptr= (const uchar*)reader->read(fpi->m_segment_size))) - { - char last_byte= ptr[fpi->m_segment_size - 1]; + while ((ptr = (const uchar *)reader->read(fpi->m_segment_size))) { + const char last_byte = ptr[fpi->m_segment_size - 1]; size_t used_bytes; - if (last_byte == VARCHAR_CMP_EQUAL_TO_SPACES) // this is the last segment - { - if (space_padding_bytes > (fpi->m_segment_size-1)) - return UNPACK_FAILURE; // Cannot happen, corrupted data - used_bytes= (fpi->m_segment_size-1) - space_padding_bytes; - finished= true; - } - else + if (last_byte == VARCHAR_CMP_EQUAL_TO_SPACES) // this is the last segment { + if (space_padding_bytes > (fpi->m_segment_size - 1)) + return UNPACK_FAILURE; // Cannot happen, corrupted data + used_bytes = (fpi->m_segment_size - 1) - space_padding_bytes; + finished = true; + } else { if (last_byte != VARCHAR_CMP_LESS_THAN_SPACES && - last_byte != VARCHAR_CMP_GREATER_THAN_SPACES) - { - return UNPACK_FAILURE; // Invalid value + last_byte != VARCHAR_CMP_GREATER_THAN_SPACES) { + return UNPACK_FAILURE; // Invalid value } - used_bytes= fpi->m_segment_size-1; + used_bytes = fpi->m_segment_size - 1; } // Now, need to decode used_bytes of data and append them to the value. - if (fpi->m_varchar_charset == &my_charset_utf8_bin) - { - if (used_bytes & 1) - { + if (fpi->m_varchar_charset == &my_charset_utf8_bin) { + if (used_bytes & 1) { /* UTF-8 characters are encoded into two-byte entities. There is no way we can have an odd number of bytes after encoding. @@ -1890,23 +1754,20 @@ return UNPACK_FAILURE; } - const uchar *src= ptr; - const uchar *src_end= ptr + used_bytes; - while (src < src_end) - { - my_wc_t wc= (src[0] <<8) | src[1]; + const uchar *src = ptr; + const uchar *const src_end = ptr + used_bytes; + while (src < src_end) { + my_wc_t wc = (src[0] << 8) | src[1]; src += 2; - const CHARSET_INFO *cset= fpi->m_varchar_charset; - int res= cset->cset->wc_mb(cset, wc, dst, dst_end); - DBUG_ASSERT(res <=3); + const CHARSET_INFO *cset = fpi->m_varchar_charset; + int res = cset->cset->wc_mb(cset, wc, dst, dst_end); + DBUG_ASSERT(res <= 3); if (res <= 0) return UNPACK_FAILURE; dst += res; len += res; } - } - else - { + } else { if (dst + used_bytes > dst_end) return UNPACK_FAILURE; memcpy(dst, ptr, used_bytes); @@ -1914,10 +1775,8 @@ len += used_bytes; } - if (finished) - { - if (extra_spaces) - { + if (finished) { + if (extra_spaces) { // Both binary and UTF-8 charset store space as ' ', // so the following is ok: if (dst + extra_spaces > dst_end) @@ -1933,12 +1792,9 @@ return UNPACK_FAILURE; /* Save the length */ - if (field_var->length_bytes == 1) - { - d0[0]= len; - } - else - { + if (field_var->length_bytes == 1) { + d0[0] = len; + } else { DBUG_ASSERT(field_var->length_bytes == 2); int2store(d0, len); } @@ -1951,14 +1807,13 @@ Function of type rdb_make_unpack_info_t */ -static void rdb_make_unpack_unknown( - const Rdb_collation_codec *codec __attribute__((__unused__)), - const Field *field, Rdb_pack_field_context *pack_ctx) -{ +static void rdb_make_unpack_unknown(const Rdb_collation_codec *codec + __attribute__((__unused__)), + const Field *const field, + Rdb_pack_field_context *const pack_ctx) { pack_ctx->writer->write(field->ptr, field->pack_length()); } - /* This point of this function is only to indicate that unpack_info is available. @@ -1967,36 +1822,30 @@ that is, rdb_pack_with_varchar_space_pad. */ -static void rdb_dummy_make_unpack_info( - const Rdb_collation_codec *codec __attribute__((__unused__)), - const Field *field __attribute__((__unused__)), - Rdb_pack_field_context *pack_ctx __attribute__((__unused__))) -{ -} +static void rdb_dummy_make_unpack_info(const Rdb_collation_codec *codec + __attribute__((__unused__)), + const Field *field + __attribute__((__unused__)), + Rdb_pack_field_context *pack_ctx + __attribute__((__unused__))) {} /* Function of type rdb_index_field_unpack_t */ -static int rdb_unpack_unknown(Rdb_field_packing *fpi, Field *field, - uchar *dst, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader) -{ +static int rdb_unpack_unknown(Rdb_field_packing *const fpi, Field *const field, + uchar *const dst, Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader) { const uchar *ptr; - uint len = fpi->m_unpack_data_len; + const uint len = fpi->m_unpack_data_len; // We don't use anything from the key, so skip over it. - if (rdb_skip_max_length(fpi, field, reader)) - { + if (rdb_skip_max_length(fpi, field, reader)) { return UNPACK_FAILURE; } - // Unpack info is needed but none available. - if (len > 0 && unp_reader == nullptr) - { - return UNPACK_INFO_MISSING; - } - if ((ptr= (const uchar*)unp_reader->read(len))) - { + + DBUG_ASSERT_IMP(len > 0, unp_reader != nullptr); + + if ((ptr = (const uchar *)unp_reader->read(len))) { memcpy(dst, ptr, len); return UNPACK_SUCCESS; } @@ -2008,16 +1857,14 @@ */ static void rdb_make_unpack_unknown_varchar( - const Rdb_collation_codec *codec __attribute__((__unused__)), - const Field *field, Rdb_pack_field_context *pack_ctx) -{ - auto f= static_cast(field); - uint len= f->length_bytes == 1 ? (uint) *f->ptr : uint2korr(f->ptr); - len+= f->length_bytes; + const Rdb_collation_codec *const codec __attribute__((__unused__)), + const Field *const field, Rdb_pack_field_context *const pack_ctx) { + const auto f = static_cast(field); + uint len = f->length_bytes == 1 ? (uint)*f->ptr : uint2korr(f->ptr); + len += f->length_bytes; pack_ctx->writer->write(field->ptr, len); } - /* Function of type rdb_index_field_unpack_t @@ -2032,33 +1879,27 @@ rdb_make_unpack_unknown, rdb_unpack_unknown */ -static int rdb_unpack_unknown_varchar(Rdb_field_packing *fpi, Field *field, - uchar *dst, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader) -{ +static int rdb_unpack_unknown_varchar(Rdb_field_packing *const fpi, + Field *const field, uchar *dst, + Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader) { const uchar *ptr; - uchar *d0= dst; - auto f= static_cast(field); + uchar *const d0 = dst; + const auto f = static_cast(field); dst += f->length_bytes; - uint len_bytes= f->length_bytes; + const uint len_bytes = f->length_bytes; // We don't use anything from the key, so skip over it. - if (fpi->m_skip_func(fpi, field, reader)) - { + if (fpi->m_skip_func(fpi, field, reader)) { return UNPACK_FAILURE; } - // Unpack info is needed but none available. + DBUG_ASSERT(len_bytes > 0); - if (unp_reader == nullptr) - { - return UNPACK_INFO_MISSING; - } - if ((ptr= (const uchar*)unp_reader->read(len_bytes))) - { + DBUG_ASSERT(unp_reader != nullptr); + + if ((ptr = (const uchar *)unp_reader->read(len_bytes))) { memcpy(d0, ptr, len_bytes); - uint len= len_bytes == 1 ? (uint) *ptr : uint2korr(ptr); - if ((ptr= (const uchar*)unp_reader->read(len))) - { + const uint len = len_bytes == 1 ? (uint)*ptr : uint2korr(ptr); + if ((ptr = (const uchar *)unp_reader->read(len))) { memcpy(dst, ptr, len); return UNPACK_SUCCESS; } @@ -2066,46 +1907,33 @@ return UNPACK_FAILURE; } - /* Write unpack_data for a "simple" collation */ -static void rdb_write_unpack_simple(Rdb_bit_writer *writer, - const Rdb_collation_codec *codec, - const uchar *src, size_t src_len) -{ - for (uint i= 0; i < src_len; i++) - { +static void rdb_write_unpack_simple(Rdb_bit_writer *const writer, + const Rdb_collation_codec *const codec, + const uchar *const src, + const size_t src_len) { + for (uint i = 0; i < src_len; i++) { writer->write(codec->m_enc_size[src[i]], codec->m_enc_idx[src[i]]); } } - -static uint rdb_read_unpack_simple(Rdb_bit_reader *reader, - const Rdb_collation_codec *codec, - const uchar *src, size_t src_len, - uchar *dst) -{ - for (uint i= 0; i < src_len; i++) - { - if (codec->m_dec_size[src[i]] > 0) - { +static uint rdb_read_unpack_simple(Rdb_bit_reader *const reader, + const Rdb_collation_codec *const codec, + const uchar *const src, + const size_t &src_len, uchar *const dst) { + for (uint i = 0; i < src_len; i++) { + if (codec->m_dec_size[src[i]] > 0) { uint *ret; - // Unpack info is needed but none available. - if (reader == nullptr) - { - return UNPACK_INFO_MISSING; - } + DBUG_ASSERT(reader != nullptr); - if ((ret= reader->read(codec->m_dec_size[src[i]])) == nullptr) - { + if ((ret = reader->read(codec->m_dec_size[src[i]])) == nullptr) { return UNPACK_FAILURE; } - dst[i]= codec->m_dec_idx[*ret][src[i]]; - } - else - { - dst[i]= codec->m_dec_idx[0][src[i]]; + dst[i] = codec->m_dec_idx[*ret][src[i]]; + } else { + dst[i] = codec->m_dec_idx[0][src[i]]; } } @@ -2120,13 +1948,13 @@ */ static void -rdb_make_unpack_simple_varchar(const Rdb_collation_codec* codec, - const Field *field, - Rdb_pack_field_context *pack_ctx) -{ - auto f= static_cast(field); - uchar *src= f->ptr + f->length_bytes; - size_t src_len= f->length_bytes == 1 ? (uint) *f->ptr : uint2korr(f->ptr); +rdb_make_unpack_simple_varchar(const Rdb_collation_codec *const codec, + const Field *const field, + Rdb_pack_field_context *const pack_ctx) { + const auto f = static_cast(field); + uchar *const src = f->ptr + f->length_bytes; + const size_t src_len = + f->length_bytes == 1 ? (uint)*f->ptr : uint2korr(f->ptr); Rdb_bit_writer bit_writer(pack_ctx->writer); // The std::min compares characters with bytes, but for simple collations, // mbmaxlen = 1. @@ -2142,91 +1970,75 @@ rdb_unpack_binary_or_utf8_varchar_space_pad - a similar unpacking function */ -int -rdb_unpack_simple_varchar_space_pad(Rdb_field_packing *fpi, Field *field, - uchar *dst, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader) -{ +int rdb_unpack_simple_varchar_space_pad(Rdb_field_packing *const fpi, + Field *const field, uchar *dst, + Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader) { const uchar *ptr; - size_t len= 0; - bool finished= false; - uchar *d0= dst; - Field_varstring* field_var= static_cast(field); + size_t len = 0; + bool finished = false; + uchar *d0 = dst; + const Field_varstring *const field_var = + static_cast(field); // For simple collations, char_length is also number of bytes. DBUG_ASSERT((size_t)fpi->m_max_image_len >= field_var->char_length()); - uchar *dst_end= dst + field_var->pack_length(); + uchar *dst_end = dst + field_var->pack_length(); dst += field_var->length_bytes; Rdb_bit_reader bit_reader(unp_reader); - uint space_padding_bytes= 0; + uint space_padding_bytes = 0; uint extra_spaces; - if (!unp_reader) - { - return UNPACK_INFO_MISSING; - } + DBUG_ASSERT(unp_reader != nullptr); - if ((fpi->m_unpack_info_uses_two_bytes? - unp_reader->read_uint16(&extra_spaces): - unp_reader->read_uint8(&extra_spaces))) - { + if ((fpi->m_unpack_info_uses_two_bytes + ? unp_reader->read_uint16(&extra_spaces) + : unp_reader->read_uint8(&extra_spaces))) { return UNPACK_FAILURE; } - if (extra_spaces <= 8) - { - space_padding_bytes= -(static_cast(extra_spaces) - 8); - extra_spaces= 0; - } - else + if (extra_spaces <= 8) { + space_padding_bytes = -(static_cast(extra_spaces) - 8); + extra_spaces = 0; + } else extra_spaces -= 8; space_padding_bytes *= fpi->space_xfrm_len; /* Decode the length-emitted encoding here */ - while ((ptr= (const uchar*)reader->read(fpi->m_segment_size))) - { - char last_byte= ptr[fpi->m_segment_size - 1]; // number of padding bytes + while ((ptr = (const uchar *)reader->read(fpi->m_segment_size))) { + const char last_byte = + ptr[fpi->m_segment_size - 1]; // number of padding bytes size_t used_bytes; - if (last_byte == VARCHAR_CMP_EQUAL_TO_SPACES) - { + if (last_byte == VARCHAR_CMP_EQUAL_TO_SPACES) { // this is the last one - if (space_padding_bytes > (fpi->m_segment_size-1)) - return UNPACK_FAILURE; // Cannot happen, corrupted data - used_bytes= (fpi->m_segment_size-1) - space_padding_bytes; - finished= true; - } - else - { + if (space_padding_bytes > (fpi->m_segment_size - 1)) + return UNPACK_FAILURE; // Cannot happen, corrupted data + used_bytes = (fpi->m_segment_size - 1) - space_padding_bytes; + finished = true; + } else { if (last_byte != VARCHAR_CMP_LESS_THAN_SPACES && - last_byte != VARCHAR_CMP_GREATER_THAN_SPACES) - { + last_byte != VARCHAR_CMP_GREATER_THAN_SPACES) { return UNPACK_FAILURE; } - used_bytes= fpi->m_segment_size-1; + used_bytes = fpi->m_segment_size - 1; } - if (dst + used_bytes > dst_end) - { + if (dst + used_bytes > dst_end) { // The value on disk is longer than the field definition allows? return UNPACK_FAILURE; } uint ret; - if ((ret= rdb_read_unpack_simple(&bit_reader, - fpi->m_charset_codec, ptr, used_bytes, - dst)) != UNPACK_SUCCESS) - { + if ((ret = rdb_read_unpack_simple(&bit_reader, fpi->m_charset_codec, ptr, + used_bytes, dst)) != UNPACK_SUCCESS) { return ret; } dst += used_bytes; len += used_bytes; - if (finished) - { - if (extra_spaces) - { + if (finished) { + if (extra_spaces) { if (dst + extra_spaces > dst_end) return UNPACK_FAILURE; // pad_char has a 1-byte form in all charsets that @@ -2242,19 +2054,15 @@ return UNPACK_FAILURE; /* Save the length */ - if (field_var->length_bytes == 1) - { - d0[0]= len; - } - else - { + if (field_var->length_bytes == 1) { + d0[0] = len; + } else { DBUG_ASSERT(field_var->length_bytes == 2); int2store(d0, len); } return UNPACK_SUCCESS; } - /* Function of type rdb_make_unpack_info_t @@ -2266,11 +2074,10 @@ The VARCHAR variant is in rdb_make_unpack_simple_varchar */ -static void rdb_make_unpack_simple(const Rdb_collation_codec *codec, - const Field *field, - Rdb_pack_field_context *pack_ctx) -{ - uchar *src= field->ptr; +static void rdb_make_unpack_simple(const Rdb_collation_codec *const codec, + const Field *const field, + Rdb_pack_field_context *const pack_ctx) { + const uchar *const src = field->ptr; Rdb_bit_writer bit_writer(pack_ctx->writer); rdb_write_unpack_simple(&bit_writer, codec, src, field->pack_length()); } @@ -2279,18 +2086,15 @@ Function of type rdb_index_field_unpack_t */ -static int rdb_unpack_simple(Rdb_field_packing *fpi, - Field *field __attribute__((__unused__)), - uchar *dst, - Rdb_string_reader *reader, - Rdb_string_reader *unp_reader) -{ +static int rdb_unpack_simple(Rdb_field_packing *const fpi, + Field *const field __attribute__((__unused__)), + uchar *const dst, Rdb_string_reader *const reader, + Rdb_string_reader *const unp_reader) { const uchar *ptr; - uint len = fpi->m_max_image_len; + const uint len = fpi->m_max_image_len; Rdb_bit_reader bit_reader(unp_reader); - if (!(ptr= (const uchar*)reader->read(len))) - { + if (!(ptr = (const uchar *)reader->read(len))) { return UNPACK_FAILURE; } @@ -2298,15 +2102,17 @@ fpi->m_charset_codec, ptr, len, dst); } - // See Rdb_charset_space_info::spaces_xfrm -const int RDB_SPACE_XFRM_SIZE= 32; +const int RDB_SPACE_XFRM_SIZE = 32; // A class holding information about how space character is represented in a // charset. -class Rdb_charset_space_info -{ - public: +class Rdb_charset_space_info { +public: + Rdb_charset_space_info(const Rdb_charset_space_info &) = delete; + Rdb_charset_space_info &operator=(const Rdb_charset_space_info &) = delete; + Rdb_charset_space_info() = default; + // A few strxfrm'ed space characters, at least RDB_SPACE_XFRM_SIZE bytes std::vector spaces_xfrm; @@ -2320,8 +2126,7 @@ }; static std::array, MY_ALL_CHARSETS_SIZE> -rdb_mem_comparable_space; - + rdb_mem_comparable_space; /* @brief @@ -2342,43 +2147,33 @@ uses the charset). */ -static -void rdb_get_mem_comparable_space(const CHARSET_INFO *cs, - const std::vector **xfrm, - size_t *xfrm_len, - size_t *mb_len) -{ +static void rdb_get_mem_comparable_space(const CHARSET_INFO *const cs, + const std::vector **xfrm, + size_t *const xfrm_len, + size_t *const mb_len) { DBUG_ASSERT(cs->number < MY_ALL_CHARSETS_SIZE); - if (!rdb_mem_comparable_space[cs->number].get()) - { + if (!rdb_mem_comparable_space[cs->number].get()) { mysql_mutex_lock(&rdb_mem_cmp_space_mutex); - if (!rdb_mem_comparable_space[cs->number].get()) - { + if (!rdb_mem_comparable_space[cs->number].get()) { // Upper bound of how many bytes can be occupied by multi-byte form of a // character in any charset. - const int MAX_MULTI_BYTE_CHAR_SIZE= 4; + const int MAX_MULTI_BYTE_CHAR_SIZE = 4; DBUG_ASSERT(cs->mbmaxlen <= MAX_MULTI_BYTE_CHAR_SIZE); // multi-byte form of the ' ' (space) character uchar space_mb[MAX_MULTI_BYTE_CHAR_SIZE]; - size_t space_mb_len= cs->cset->wc_mb(cs, (my_wc_t) cs->pad_char, - space_mb, - space_mb + sizeof(space_mb)); - - uchar space[20]; // mem-comparable image of the space character - - size_t space_len= cs->coll->strnxfrm(cs, - space, sizeof(space), - 1, - space_mb, - space_mb_len, - 0); - Rdb_charset_space_info *info= new Rdb_charset_space_info; - info->space_xfrm_len= space_len; - info->space_mb_len= space_mb_len; - while (info->spaces_xfrm.size() < RDB_SPACE_XFRM_SIZE) - { + const size_t space_mb_len = cs->cset->wc_mb( + cs, (my_wc_t)cs->pad_char, space_mb, space_mb + sizeof(space_mb)); + + uchar space[20]; // mem-comparable image of the space character + + const size_t space_len = cs->coll->strnxfrm(cs, space, sizeof(space), 1, + space_mb, space_mb_len, 0); + Rdb_charset_space_info *const info = new Rdb_charset_space_info; + info->space_xfrm_len = space_len; + info->space_mb_len = space_mb_len; + while (info->spaces_xfrm.size() < RDB_SPACE_XFRM_SIZE) { info->spaces_xfrm.insert(info->spaces_xfrm.end(), space, space + space_len); } @@ -2387,79 +2182,69 @@ mysql_mutex_unlock(&rdb_mem_cmp_space_mutex); } - *xfrm= &rdb_mem_comparable_space[cs->number]->spaces_xfrm; - *xfrm_len= rdb_mem_comparable_space[cs->number]->space_xfrm_len; - *mb_len= rdb_mem_comparable_space[cs->number]->space_mb_len; + *xfrm = &rdb_mem_comparable_space[cs->number]->spaces_xfrm; + *xfrm_len = rdb_mem_comparable_space[cs->number]->space_xfrm_len; + *mb_len = rdb_mem_comparable_space[cs->number]->space_mb_len; } mysql_mutex_t rdb_mem_cmp_space_mutex; -std::array - rdb_collation_data; +std::array + rdb_collation_data; mysql_mutex_t rdb_collation_data_mutex; -static bool rdb_is_collation_supported(const my_core::CHARSET_INFO * cs) -{ +static bool rdb_is_collation_supported(const my_core::CHARSET_INFO *const cs) { return (cs->coll == &my_collation_8bit_simple_ci_handler); } -static const Rdb_collation_codec *rdb_init_collation_mapping( - const my_core::CHARSET_INFO *cs) -{ +static const Rdb_collation_codec * +rdb_init_collation_mapping(const my_core::CHARSET_INFO *const cs) { DBUG_ASSERT(cs && cs->state & MY_CS_AVAILABLE); - const Rdb_collation_codec *codec= rdb_collation_data[cs->number]; + const Rdb_collation_codec *codec = rdb_collation_data[cs->number]; - if (codec == nullptr && rdb_is_collation_supported(cs)) - { + if (codec == nullptr && rdb_is_collation_supported(cs)) { mysql_mutex_lock(&rdb_collation_data_mutex); - codec= rdb_collation_data[cs->number]; - if (codec == nullptr) - { - Rdb_collation_codec *cur= nullptr; + codec = rdb_collation_data[cs->number]; + if (codec == nullptr) { + Rdb_collation_codec *cur = nullptr; // Compute reverse mapping for simple collations. - if (cs->coll == &my_collation_8bit_simple_ci_handler) - { - cur= new Rdb_collation_codec; + if (cs->coll == &my_collation_8bit_simple_ci_handler) { + cur = new Rdb_collation_codec; std::map> rev_map; - size_t max_conflict_size= 0; - for (int src = 0; src < 256; src++) - { - uchar dst= cs->sort_order[src]; + size_t max_conflict_size = 0; + for (int src = 0; src < 256; src++) { + uchar dst = cs->sort_order[src]; rev_map[dst].push_back(src); - max_conflict_size= std::max(max_conflict_size, rev_map[dst].size()); + max_conflict_size = std::max(max_conflict_size, rev_map[dst].size()); } cur->m_dec_idx.resize(max_conflict_size); - for (auto const &p : rev_map) - { - uchar dst= p.first; - for (uint idx = 0; idx < p.second.size(); idx++) - { - uchar src= p.second[idx]; - uchar bits= my_bit_log2(my_round_up_to_next_power(p.second.size())); - cur->m_enc_idx[src]= idx; - cur->m_enc_size[src]= bits; - cur->m_dec_size[dst]= bits; - cur->m_dec_idx[idx][dst]= src; + for (auto const &p : rev_map) { + uchar dst = p.first; + for (uint idx = 0; idx < p.second.size(); idx++) { + uchar src = p.second[idx]; + uchar bits = + my_bit_log2(my_round_up_to_next_power(p.second.size())); + cur->m_enc_idx[src] = idx; + cur->m_enc_size[src] = bits; + cur->m_dec_size[dst] = bits; + cur->m_dec_idx[idx][dst] = src; } } - cur->m_make_unpack_info_func= - {{ rdb_make_unpack_simple_varchar, rdb_make_unpack_simple }}; - cur->m_unpack_func= - {{ rdb_unpack_simple_varchar_space_pad, rdb_unpack_simple }}; - } - else - { + cur->m_make_unpack_info_func = { + {rdb_make_unpack_simple_varchar, rdb_make_unpack_simple}}; + cur->m_unpack_func = { + {rdb_unpack_simple_varchar_space_pad, rdb_unpack_simple}}; + } else { // Out of luck for now. } - if (cur != nullptr) - { - codec= cur; - cur->m_cs= cs; - rdb_collation_data[cs->number]= cur; + if (cur != nullptr) { + codec = cur; + cur->m_cs = cs; + rdb_collation_data[cs->number] = cur; } } mysql_mutex_unlock(&rdb_collation_data_mutex); @@ -2468,24 +2253,17 @@ return codec; } - -static int get_segment_size_from_collation(const CHARSET_INFO* cs) -{ +static int get_segment_size_from_collation(const CHARSET_INFO *const cs) { int ret; - if (cs == &my_charset_utf8mb4_bin || - cs == &my_charset_utf16_bin || - cs == &my_charset_utf16le_bin || - cs == &my_charset_utf32_bin) - { + if (cs == &my_charset_utf8mb4_bin || cs == &my_charset_utf16_bin || + cs == &my_charset_utf16le_bin || cs == &my_charset_utf32_bin) { /* In these collations, a character produces one weight, which is 3 bytes. Segment has 3 characters, add one byte for VARCHAR_CMP_* marker, and we get 3*3+1=10 */ - ret= 10; - } - else - { + ret = 10; + } else { /* All other collations. There are two classes: - Unicode-based, except for collations mentioned in the if-condition. @@ -2499,13 +2277,12 @@ In both cases, take 8 bytes payload + 1 byte for VARCHAR_CMP* marker. */ - ret= 9; + ret = 9; } DBUG_ASSERT(ret < RDB_SPACE_XFRM_SIZE); return ret; } - /* @brief Setup packing of index field into its mem-comparable form @@ -2526,212 +2303,173 @@ FALSE - Otherwise */ -bool Rdb_field_packing::setup(const Rdb_key_def *key_descr, const Field *field, - uint keynr_arg, uint key_part_arg, - uint16 key_length) -{ - int res= false; - enum_field_types type= field ? field->real_type() : MYSQL_TYPE_LONGLONG; - - m_keynr= keynr_arg; - m_key_part= key_part_arg; - - m_maybe_null= field ? field->real_maybe_null() : false; - m_unpack_func= nullptr; - m_make_unpack_info_func= nullptr; - m_unpack_data_len= 0; - space_xfrm= nullptr; // safety +bool Rdb_field_packing::setup(const Rdb_key_def *const key_descr, + const Field *const field, const uint &keynr_arg, + const uint &key_part_arg, + const uint16 &key_length) { + int res = false; + enum_field_types type = field ? field->real_type() : MYSQL_TYPE_LONGLONG; + + m_keynr = keynr_arg; + m_key_part = key_part_arg; + + m_maybe_null = field ? field->real_maybe_null() : false; + m_unpack_func = nullptr; + m_make_unpack_info_func = nullptr; + m_unpack_data_len = 0; + space_xfrm = nullptr; // safety /* Calculate image length. By default, is is pack_length() */ - m_max_image_len= field ? field->pack_length() : - ROCKSDB_SIZEOF_HIDDEN_PK_COLUMN; - m_skip_func= rdb_skip_max_length; - m_pack_func= rdb_pack_with_make_sort_key; + m_max_image_len = + field ? field->pack_length() : ROCKSDB_SIZEOF_HIDDEN_PK_COLUMN; + m_skip_func = rdb_skip_max_length; + m_pack_func = rdb_pack_with_make_sort_key; switch (type) { - case MYSQL_TYPE_LONGLONG: - case MYSQL_TYPE_LONG: - case MYSQL_TYPE_INT24: - case MYSQL_TYPE_SHORT: - case MYSQL_TYPE_TINY: - m_unpack_func= rdb_unpack_integer; - return true; + case MYSQL_TYPE_LONGLONG: + case MYSQL_TYPE_LONG: + case MYSQL_TYPE_INT24: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_TINY: + m_unpack_func = rdb_unpack_integer; + return true; - case MYSQL_TYPE_DOUBLE: - m_unpack_func= rdb_unpack_double; - return true; + case MYSQL_TYPE_DOUBLE: + m_unpack_func = rdb_unpack_double; + return true; - case MYSQL_TYPE_FLOAT: - m_unpack_func= rdb_unpack_float; - return true; + case MYSQL_TYPE_FLOAT: + m_unpack_func = rdb_unpack_float; + return true; - case MYSQL_TYPE_NEWDECIMAL: - /* - Decimal is packed with Field_new_decimal::make_sort_key, which just - does memcpy. - Unpacking decimal values was supported only after fix for issue#253, - because of that ha_rocksdb::get_storage_type() handles decimal values - in a special way. - */ - case MYSQL_TYPE_DATETIME2: - case MYSQL_TYPE_TIMESTAMP2: - /* These are packed with Field_temporal_with_date_and_timef::make_sort_key */ - case MYSQL_TYPE_TIME2: /* TIME is packed with Field_timef::make_sort_key */ - case MYSQL_TYPE_YEAR: /* YEAR is packed with Field_tiny::make_sort_key */ - /* Everything that comes here is packed with just a memcpy(). */ - m_unpack_func= rdb_unpack_binary_str; - return true; + case MYSQL_TYPE_NEWDECIMAL: + /* + Decimal is packed with Field_new_decimal::make_sort_key, which just + does memcpy. + Unpacking decimal values was supported only after fix for issue#253, + because of that ha_rocksdb::get_storage_type() handles decimal values + in a special way. + */ + case MYSQL_TYPE_DATETIME2: + case MYSQL_TYPE_TIMESTAMP2: + /* These are packed with Field_temporal_with_date_and_timef::make_sort_key */ + case MYSQL_TYPE_TIME2: /* TIME is packed with Field_timef::make_sort_key */ + case MYSQL_TYPE_YEAR: /* YEAR is packed with Field_tiny::make_sort_key */ + /* Everything that comes here is packed with just a memcpy(). */ + m_unpack_func = rdb_unpack_binary_str; + return true; - case MYSQL_TYPE_NEWDATE: - /* - This is packed by Field_newdate::make_sort_key. It assumes the data is - 3 bytes, and packing is done by swapping the byte order (for both big- - and little-endian) - */ - m_unpack_func= rdb_unpack_newdate; - return true; - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - { - if (key_descr && - key_descr->index_format_min_check( - Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1, - Rdb_key_def::SECONDARY_FORMAT_VERSION_UPDATE1)) - { - // The my_charset_bin collation is special in that it will consider - // shorter strings sorting as less than longer strings. - // - // See Field_blob::make_sort_key for details. - m_max_image_len= key_length + - (field->charset() == &my_charset_bin - ? reinterpret_cast(field)->pack_length_no_ptr() - : 0); - // Return false because indexes on text/blob will always require - // a prefix. With a prefix, the optimizer will not be able to do an - // index-only scan since there may be content occuring after the prefix - // length. - return false; - } + case MYSQL_TYPE_NEWDATE: + /* + This is packed by Field_newdate::make_sort_key. It assumes the data is + 3 bytes, and packing is done by swapping the byte order (for both big- + and little-endian) + */ + m_unpack_func = rdb_unpack_newdate; + return true; + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: { + if (key_descr) { + // The my_charset_bin collation is special in that it will consider + // shorter strings sorting as less than longer strings. + // + // See Field_blob::make_sort_key for details. + m_max_image_len = + key_length + (field->charset() == &my_charset_bin + ? reinterpret_cast(field) + ->pack_length_no_ptr() + : 0); + // Return false because indexes on text/blob will always require + // a prefix. With a prefix, the optimizer will not be able to do an + // index-only scan since there may be content occuring after the prefix + // length. + return false; } - default: - break; + } + default: + break; } - m_unpack_info_stores_value= false; + m_unpack_info_stores_value = false; /* Handle [VAR](CHAR|BINARY) */ - if (type == MYSQL_TYPE_VARCHAR || type == MYSQL_TYPE_STRING) - { + if (type == MYSQL_TYPE_VARCHAR || type == MYSQL_TYPE_STRING) { /* For CHAR-based columns, check how strxfrm image will take. field->field_length = field->char_length() * cs->mbmaxlen. */ - const CHARSET_INFO *cs= field->charset(); - m_max_image_len= cs->coll->strnxfrmlen(cs, field->field_length); + const CHARSET_INFO *cs = field->charset(); + m_max_image_len = cs->coll->strnxfrmlen(cs, field->field_length); } - const bool is_varchar= (type == MYSQL_TYPE_VARCHAR); - const CHARSET_INFO *cs= field->charset(); + const bool is_varchar = (type == MYSQL_TYPE_VARCHAR); + const CHARSET_INFO *cs = field->charset(); // max_image_len before chunking is taken into account - int max_image_len_before_chunks= m_max_image_len; + const int max_image_len_before_chunks = m_max_image_len; - if (is_varchar) - { + if (is_varchar) { // The default for varchar is variable-length, without space-padding for // comparisons - m_varchar_charset= cs; - m_skip_func= rdb_skip_variable_length; - m_pack_func= rdb_pack_with_varchar_encoding; - m_max_image_len= - (m_max_image_len/(RDB_ESCAPE_LENGTH-1) + 1) * RDB_ESCAPE_LENGTH; + m_varchar_charset = cs; + m_skip_func = rdb_skip_variable_length; + m_pack_func = rdb_pack_with_varchar_encoding; + m_max_image_len = + (m_max_image_len / (RDB_ESCAPE_LENGTH - 1) + 1) * RDB_ESCAPE_LENGTH; - auto field_var= static_cast(field); - m_unpack_info_uses_two_bytes= (field_var->field_length + 8 >= 0x100); + const auto field_var = static_cast(field); + m_unpack_info_uses_two_bytes = (field_var->field_length + 8 >= 0x100); } - if (type == MYSQL_TYPE_VARCHAR || type == MYSQL_TYPE_STRING) - { + if (type == MYSQL_TYPE_VARCHAR || type == MYSQL_TYPE_STRING) { // See http://dev.mysql.com/doc/refman/5.7/en/string-types.html for // information about character-based datatypes are compared. - bool use_unknown_collation= false; + bool use_unknown_collation = false; DBUG_EXECUTE_IF("myrocks_enable_unknown_collation_index_only_scans", - use_unknown_collation= true;); + use_unknown_collation = true;); - if (cs == &my_charset_bin) - { + if (cs == &my_charset_bin) { // - SQL layer pads BINARY(N) so that it always is N bytes long. // - For VARBINARY(N), values may have different lengths, so we're using // variable-length encoding. This is also the only charset where the // values are not space-padded for comparison. - m_unpack_func= is_varchar? rdb_unpack_binary_or_utf8_varchar : - rdb_unpack_binary_str; - res= true; - } - else if (cs == &my_charset_latin1_bin || cs == &my_charset_utf8_bin) - { + m_unpack_func = is_varchar ? rdb_unpack_binary_or_utf8_varchar + : rdb_unpack_binary_str; + res = true; + } else if (cs == &my_charset_latin1_bin || cs == &my_charset_utf8_bin) { // For _bin collations, mem-comparable form of the string is the string // itself. - if (is_varchar) - { - if (!key_descr || - key_descr->index_format_min_check( - Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1, - Rdb_key_def::SECONDARY_FORMAT_VERSION_UPDATE1)) - { - // VARCHARs - // - are compared as if they were space-padded - // - but are not actually space-padded (reading the value back - // produces the original value, without the padding) - m_unpack_func= rdb_unpack_binary_or_utf8_varchar_space_pad; - m_skip_func= rdb_skip_variable_space_pad; - m_pack_func= rdb_pack_with_varchar_space_pad; - m_make_unpack_info_func= rdb_dummy_make_unpack_info; - m_segment_size= get_segment_size_from_collation(cs); - m_max_image_len= - (max_image_len_before_chunks/(m_segment_size-1) + 1) * - m_segment_size; - rdb_get_mem_comparable_space(cs, &space_xfrm, &space_xfrm_len, - &space_mb_len); - } - else - { - // Older variant where VARCHARs were not compared as space-padded: - m_unpack_func= rdb_unpack_binary_or_utf8_varchar; - m_skip_func= rdb_skip_variable_length; - m_pack_func= rdb_pack_with_varchar_encoding; - } - } - else - { + if (is_varchar) { + // VARCHARs - are compared as if they were space-padded - but are + // not actually space-padded (reading the value back produces the + // original value, without the padding) + m_unpack_func = rdb_unpack_binary_or_utf8_varchar_space_pad; + m_skip_func = rdb_skip_variable_space_pad; + m_pack_func = rdb_pack_with_varchar_space_pad; + m_make_unpack_info_func = rdb_dummy_make_unpack_info; + m_segment_size = get_segment_size_from_collation(cs); + m_max_image_len = + (max_image_len_before_chunks / (m_segment_size - 1) + 1) * + m_segment_size; + rdb_get_mem_comparable_space(cs, &space_xfrm, &space_xfrm_len, + &space_mb_len); + } else { // SQL layer pads CHAR(N) values to their maximum length. // We just store that and restore it back. - m_unpack_func= (cs == &my_charset_latin1_bin)? rdb_unpack_binary_str: - rdb_unpack_utf8_str; + m_unpack_func = (cs == &my_charset_latin1_bin) ? rdb_unpack_binary_str + : rdb_unpack_utf8_str; } - res= true; - } - else - { + res = true; + } else { // This is [VAR]CHAR(n) and the collation is not $(charset_name)_bin - res= true; // index-only scans are possible - m_unpack_data_len= is_varchar ? 0 : field->field_length; - uint idx= is_varchar ? 0 : 1; - const Rdb_collation_codec *codec= nullptr; - - if (is_varchar) - { - if (cs->levels_for_order != 1) - { - // NO_LINT_DEBUG - sql_print_warning("RocksDB: you're trying to create an index " - "with a multi-level collation %s", cs->name); - // NO_LINT_DEBUG - sql_print_warning("MyRocks will handle this collation internally " - " as if it had a NO_PAD attribute."); - } + res = true; // index-only scans are possible + m_unpack_data_len = is_varchar ? 0 : field->field_length; + const uint idx = is_varchar ? 0 : 1; + const Rdb_collation_codec *codec = nullptr; + + if (is_varchar) { // VARCHAR requires space-padding for doing comparisons // // The check for cs->levels_for_order is to catch @@ -2741,98 +2479,84 @@ // either. // Currently we handle these collations as NO_PAD, even if they have // PAD_SPACE attribute. - if ((!key_descr || - key_descr->index_format_min_check( - Rdb_key_def::PRIMARY_FORMAT_VERSION_UPDATE1, - Rdb_key_def::SECONDARY_FORMAT_VERSION_UPDATE1)) && - cs->levels_for_order == 1) - { - m_pack_func= rdb_pack_with_varchar_space_pad; - m_skip_func= rdb_skip_variable_space_pad; - m_segment_size= get_segment_size_from_collation(cs); - m_max_image_len= - (max_image_len_before_chunks/(m_segment_size-1) + 1) * + if (cs->levels_for_order == 1) { + m_pack_func = rdb_pack_with_varchar_space_pad; + m_skip_func = rdb_skip_variable_space_pad; + m_segment_size = get_segment_size_from_collation(cs); + m_max_image_len = + (max_image_len_before_chunks / (m_segment_size - 1) + 1) * m_segment_size; rdb_get_mem_comparable_space(cs, &space_xfrm, &space_xfrm_len, &space_mb_len); - } - else - { - m_pack_func= rdb_pack_with_varchar_encoding; - m_skip_func= rdb_skip_variable_length; + } else { + // NO_LINT_DEBUG + sql_print_warning("RocksDB: you're trying to create an index " + "with a multi-level collation %s", + cs->name); + // NO_LINT_DEBUG + sql_print_warning("MyRocks will handle this collation internally " + " as if it had a NO_PAD attribute."); + m_pack_func = rdb_pack_with_varchar_encoding; + m_skip_func = rdb_skip_variable_length; } } - if ((codec= rdb_init_collation_mapping(cs)) != nullptr) - { + if ((codec = rdb_init_collation_mapping(cs)) != nullptr) { // The collation allows to store extra information in the unpack_info // which can be used to restore the original value from the // mem-comparable form. - m_make_unpack_info_func= codec->m_make_unpack_info_func[idx]; - m_unpack_func= codec->m_unpack_func[idx]; - m_charset_codec= codec; - } - else if (use_unknown_collation) - { + m_make_unpack_info_func = codec->m_make_unpack_info_func[idx]; + m_unpack_func = codec->m_unpack_func[idx]; + m_charset_codec = codec; + } else if (use_unknown_collation) { // We have no clue about how this collation produces mem-comparable // form. Our way of restoring the original value is to keep a copy of // the original value in unpack_info. - m_unpack_info_stores_value= true; - m_make_unpack_info_func= is_varchar ? rdb_make_unpack_unknown_varchar - : rdb_make_unpack_unknown; - m_unpack_func= is_varchar ? rdb_unpack_unknown_varchar - : rdb_unpack_unknown; - } - else - { + m_unpack_info_stores_value = true; + m_make_unpack_info_func = is_varchar ? rdb_make_unpack_unknown_varchar + : rdb_make_unpack_unknown; + m_unpack_func = + is_varchar ? rdb_unpack_unknown_varchar : rdb_unpack_unknown; + } else { // Same as above: we don't know how to restore the value from its // mem-comparable form. // Here, we just indicate to the SQL layer we can't do it. DBUG_ASSERT(m_unpack_func == nullptr); - m_unpack_info_stores_value= false; - res= false; // Indicate that index-only reads are not possible + m_unpack_info_stores_value = false; + res = false; // Indicate that index-only reads are not possible } } // Make an adjustment: unpacking partially covered columns is not // possible. field->table is populated when called through // Rdb_key_def::setup, but not during ha_rocksdb::index_flags. - if (field->table) - { + if (field->table) { // Get the original Field object and compare lengths. If this key part is // a prefix of a column, then we can't do index-only scans. - if (field->table->field[field->field_index]->field_length != key_length) - { - m_unpack_func= nullptr; - m_make_unpack_info_func= nullptr; - m_unpack_info_stores_value= true; - res= false; - } - } - else - { - if (field->field_length != key_length) - { - m_unpack_func= nullptr; - m_make_unpack_info_func= nullptr; - m_unpack_info_stores_value= true; - res= false; + if (field->table->field[field->field_index]->field_length != key_length) { + m_unpack_func = nullptr; + m_make_unpack_info_func = nullptr; + m_unpack_info_stores_value = true; + res = false; + } + } else { + if (field->field_length != key_length) { + m_unpack_func = nullptr; + m_make_unpack_info_func = nullptr; + m_unpack_info_stores_value = true; + res = false; } } } return res; } - -Field *Rdb_field_packing::get_field_in_table(const TABLE *tbl) const -{ +Field *Rdb_field_packing::get_field_in_table(const TABLE *const tbl) const { return tbl->key_info[m_keynr].key_part[m_key_part].field; } - void Rdb_field_packing::fill_hidden_pk_val(uchar **dst, - longlong hidden_pk_id) const -{ + const longlong &hidden_pk_id) const { DBUG_ASSERT(m_max_image_len == 8); String to; @@ -2842,27 +2566,24 @@ *dst += m_max_image_len; } - /////////////////////////////////////////////////////////////////////////////////////////// // Rdb_ddl_manager /////////////////////////////////////////////////////////////////////////////////////////// -Rdb_tbl_def::~Rdb_tbl_def() -{ - auto ddl_manager= rdb_get_ddl_manager(); +Rdb_tbl_def::~Rdb_tbl_def() { + auto ddl_manager = rdb_get_ddl_manager(); /* Don't free key definitions */ - if (m_key_descr_arr) - { - for (uint i= 0; i < m_key_count; i++) { + if (m_key_descr_arr) { + for (uint i = 0; i < m_key_count; i++) { if (ddl_manager && m_key_descr_arr[i]) { ddl_manager->erase_index_num(m_key_descr_arr[i]->get_gl_index_id()); } - m_key_descr_arr[i]= nullptr; + m_key_descr_arr[i] = nullptr; } delete[] m_key_descr_arr; - m_key_descr_arr= nullptr; + m_key_descr_arr = nullptr; } } @@ -2877,23 +2598,22 @@ ( cf_id, index_nr ) */ -bool Rdb_tbl_def::put_dict(Rdb_dict_manager* dict, rocksdb::WriteBatch *batch, - uchar *key, size_t keylen) -{ +bool Rdb_tbl_def::put_dict(Rdb_dict_manager *const dict, + rocksdb::WriteBatch *const batch, uchar *const key, + const size_t &keylen) { StringBuffer<8 * Rdb_key_def::PACKED_SIZE> indexes; indexes.alloc(Rdb_key_def::VERSION_SIZE + m_key_count * Rdb_key_def::PACKED_SIZE * 2); rdb_netstr_append_uint16(&indexes, Rdb_key_def::DDL_ENTRY_INDEX_VERSION); - for (uint i = 0; i < m_key_count; i++) - { - const std::shared_ptr& kd= m_key_descr_arr[i]; + for (uint i = 0; i < m_key_count; i++) { + const Rdb_key_def &kd = *m_key_descr_arr[i]; - uchar flags = - (kd->m_is_reverse_cf ? Rdb_key_def::REVERSE_CF_FLAG : 0) | - (kd->m_is_auto_cf ? Rdb_key_def::AUTO_CF_FLAG : 0); + const uchar flags = + (kd.m_is_reverse_cf ? Rdb_key_def::REVERSE_CF_FLAG : 0) | + (kd.m_is_auto_cf ? Rdb_key_def::AUTO_CF_FLAG : 0); - uint cf_id= kd->get_cf()->GetID(); + const uint cf_id = kd.get_cf()->GetID(); /* If cf_id already exists, cf_flags must be the same. To prevent race condition, reading/modifying/committing CF flags @@ -2902,60 +2622,53 @@ control, we can switch to use it and removing mutex. */ uint existing_cf_flags; - if (dict->get_cf_flags(cf_id, &existing_cf_flags)) - { - if (existing_cf_flags != flags) - { + if (dict->get_cf_flags(cf_id, &existing_cf_flags)) { + if (existing_cf_flags != flags) { my_printf_error(ER_UNKNOWN_ERROR, "Column Family Flag is different from existing flag. " "Assign a new CF flag, or do not change existing " - "CF flag.", MYF(0)); + "CF flag.", + MYF(0)); return true; } - } - else - { + } else { dict->add_cf_flags(batch, cf_id, flags); } rdb_netstr_append_uint32(&indexes, cf_id); - rdb_netstr_append_uint32(&indexes, kd->m_index_number); - dict->add_or_update_index_cf_mapping(batch, kd->m_index_type, - kd->m_kv_format_version, - kd->m_index_number, cf_id); + rdb_netstr_append_uint32(&indexes, kd.m_index_number); + dict->add_or_update_index_cf_mapping(batch, kd.m_index_type, + kd.m_kv_format_version, + kd.m_index_number, cf_id); } - rocksdb::Slice skey((char*)key, keylen); - rocksdb::Slice svalue(indexes.c_ptr(), indexes.length()); + const rocksdb::Slice skey((char *)key, keylen); + const rocksdb::Slice svalue(indexes.c_ptr(), indexes.length()); dict->put_key(batch, skey, svalue); return false; } -void Rdb_tbl_def::check_if_is_mysql_system_table() -{ +void Rdb_tbl_def::check_if_is_mysql_system_table() { static const char *const system_dbs[] = { - "mysql", - "performance_schema", - "information_schema", + "mysql", "performance_schema", "information_schema", }; - m_is_mysql_system_table= false; + m_is_mysql_system_table = false; for (uint ii = 0; ii < array_elements(system_dbs); ii++) { if (strcmp(m_dbname.c_str(), system_dbs[ii]) == 0) { - m_is_mysql_system_table= true; + m_is_mysql_system_table = true; break; } } } -void Rdb_tbl_def::set_name(const std::string& name) -{ +void Rdb_tbl_def::set_name(const std::string &name) { int err __attribute__((__unused__)); - m_dbname_tablename= name; - err= rdb_split_normalized_tablename(name, &m_dbname, &m_tablename, - &m_partition); + m_dbname_tablename = name; + err = rdb_split_normalized_tablename(name, &m_dbname, &m_tablename, + &m_partition); DBUG_ASSERT(err == 0); check_if_is_mysql_system_table(); @@ -2967,68 +2680,54 @@ It manufactures a key (db+table name in our case) from a record (Rdb_tbl_def in our case). */ -const uchar* Rdb_ddl_manager::get_hash_key( - Rdb_tbl_def *rec, size_t *length, - my_bool not_used __attribute__((__unused__))) -{ - const std::string& dbname_tablename= rec->full_tablename(); - *length= dbname_tablename.size(); - return reinterpret_cast(dbname_tablename.c_str()); +const uchar *Rdb_ddl_manager::get_hash_key(Rdb_tbl_def *const rec, + size_t *const length, + my_bool not_used + __attribute__((__unused__))) { + const std::string &dbname_tablename = rec->full_tablename(); + *length = dbname_tablename.size(); + return reinterpret_cast(dbname_tablename.c_str()); } - /* Static function of type void (*my_hash_free_element_func_t)(void*) that gets invoked by the m_ddl_hash object of type my_core::HASH. It deletes a record (Rdb_tbl_def in our case). */ -void Rdb_ddl_manager::free_hash_elem(void* data) -{ - Rdb_tbl_def* elem= reinterpret_cast(data); +void Rdb_ddl_manager::free_hash_elem(void *const data) { + Rdb_tbl_def *elem = reinterpret_cast(data); delete elem; } -void Rdb_ddl_manager::erase_index_num(GL_INDEX_ID gl_index_id) -{ +void Rdb_ddl_manager::erase_index_num(const GL_INDEX_ID &gl_index_id) { m_index_num_to_keydef.erase(gl_index_id); } - -namespace // anonymous namespace = not visible outside this source file -{ -struct Rdb_validate_tbls : public Rdb_tables_scanner +namespace // anonymous namespace = not visible outside this source file { - using tbl_info_t= std::pair; - using tbl_list_t= std::map>; +struct Rdb_validate_tbls : public Rdb_tables_scanner { + using tbl_info_t = std::pair; + using tbl_list_t = std::map>; tbl_list_t m_list; - int add_table(Rdb_tbl_def* tdef) override; + int add_table(Rdb_tbl_def *tdef) override; - bool compare_to_actual_tables( - const std::string& datadir, - bool* has_errors); - - bool scan_for_frms( - const std::string& datadir, - const std::string& dbname, - bool* has_errors); - - bool check_frm_file( - const std::string& fullpath, - const std::string& dbname, - const std::string& tablename, - bool* has_errors); -}; -} // anonymous namespace + bool compare_to_actual_tables(const std::string &datadir, bool *has_errors); + + bool scan_for_frms(const std::string &datadir, const std::string &dbname, + bool *has_errors); + bool check_frm_file(const std::string &fullpath, const std::string &dbname, + const std::string &tablename, bool *has_errors); +}; +} // anonymous namespace /* Get a list of tables that we expect to have .frm files for. This will use the information just read from the RocksDB data dictionary. */ -int Rdb_validate_tbls::add_table(Rdb_tbl_def* tdef) -{ +int Rdb_validate_tbls::add_table(Rdb_tbl_def *tdef) { DBUG_ASSERT(tdef != nullptr); /* Add the database/table into the list */ @@ -3036,19 +2735,17 @@ m_list[tdef->base_dbname()].insert( tbl_info_t(tdef->base_tablename(), is_partition)); - return 0; + return HA_EXIT_SUCCESS; } /* Access the .frm file for this dbname/tablename and see if it is a RocksDB table (or partition table). */ -bool Rdb_validate_tbls::check_frm_file( - const std::string& fullpath, - const std::string& dbname, - const std::string& tablename, - bool* has_errors) -{ +bool Rdb_validate_tbls::check_frm_file(const std::string &fullpath, + const std::string &dbname, + const std::string &tablename, + bool *has_errors) { /* Check this .frm file to see what engine it uses */ String fullfilename(fullpath.c_str(), &my_charset_bin); fullfilename.append(FN_DIRSEP); @@ -3063,42 +2760,34 @@ */ enum legacy_db_type eng_type; frm_type_enum type = dd_frm_type(nullptr, fullfilename.c_ptr(), &eng_type); - if (type == FRMTYPE_ERROR) - { + if (type == FRMTYPE_ERROR) { sql_print_warning("RocksDB: Failed to open/read .from file: %s", - fullfilename.ptr()); + fullfilename.ptr()); return false; } - if (type == FRMTYPE_TABLE) - { + if (type == FRMTYPE_TABLE) { /* For a RocksDB table do we have a reference in the data dictionary? */ - if (eng_type == DB_TYPE_ROCKSDB) - { + if (eng_type == DB_TYPE_ROCKSDB) { /* Attempt to remove the table entry from the list of tables. If this fails then we know we had a .frm file that wasn't registered in RocksDB. */ tbl_info_t element(tablename, false); - if (m_list.count(dbname) == 0 || - m_list[dbname].erase(element) == 0) - { + if (m_list.count(dbname) == 0 || m_list[dbname].erase(element) == 0) { sql_print_warning("RocksDB: Schema mismatch - " "A .frm file exists for table %s.%s, " "but that table is not registered in RocksDB", dbname.c_str(), tablename.c_str()); *has_errors = true; } - } - else if (eng_type == DB_TYPE_PARTITION_DB) - { + } else if (eng_type == DB_TYPE_PARTITION_DB) { /* For partition tables, see if it is in the m_list as a partition, but don't generate an error if it isn't there - we don't know that the .frm is for RocksDB. */ - if (m_list.count(dbname) > 0) - { + if (m_list.count(dbname) > 0) { m_list[dbname].erase(tbl_info_t(tablename, true)); } } @@ -3108,38 +2797,32 @@ } /* Scan the database subdirectory for .frm files */ -bool Rdb_validate_tbls::scan_for_frms( - const std::string& datadir, - const std::string& dbname, - bool* has_errors) -{ - bool result = true; - std::string fullpath = datadir + dbname; - struct st_my_dir* dir_info = my_dir(fullpath.c_str(), MYF(MY_DONT_SORT)); +bool Rdb_validate_tbls::scan_for_frms(const std::string &datadir, + const std::string &dbname, + bool *has_errors) { + bool result = true; + std::string fullpath = datadir + dbname; + struct st_my_dir *dir_info = my_dir(fullpath.c_str(), MYF(MY_DONT_SORT)); /* Access the directory */ - if (dir_info == nullptr) - { + if (dir_info == nullptr) { sql_print_warning("RocksDB: Could not open database directory: %s", - fullpath.c_str()); + fullpath.c_str()); return false; } /* Scan through the files in the directory */ - struct fileinfo* file_info = dir_info->dir_entry; - for (uint ii = 0; ii < dir_info->number_off_files; ii++, file_info++) - { + struct fileinfo *file_info = dir_info->dir_entry; + for (uint ii = 0; ii < dir_info->number_off_files; ii++, file_info++) { /* Find .frm files that are not temp files (those that start with '#') */ - const char* ext = strrchr(file_info->name, '.'); + const char *ext = strrchr(file_info->name, '.'); if (ext != nullptr && !is_prefix(file_info->name, tmp_file_prefix) && - strcmp(ext, ".frm") == 0) - { - std::string tablename = std::string(file_info->name, - ext - file_info->name); + strcmp(ext, ".frm") == 0) { + std::string tablename = + std::string(file_info->name, ext - file_info->name); /* Check to see if the .frm file is from RocksDB */ - if (!check_frm_file(fullpath, dbname, tablename, has_errors)) - { + if (!check_frm_file(fullpath, dbname, tablename, has_errors)) { result = false; break; } @@ -3147,8 +2830,7 @@ } /* Remove any databases who have no more tables listed */ - if (m_list.count(dbname) == 1 && m_list[dbname].size() == 0) - { + if (m_list.count(dbname) == 1 && m_list[dbname].size() == 0) { m_list.erase(dbname); } @@ -3162,24 +2844,20 @@ Scan the datadir for all databases (subdirectories) and get a list of .frm files they contain */ -bool Rdb_validate_tbls::compare_to_actual_tables( - const std::string& datadir, - bool* has_errors) -{ - bool result = true; - struct st_my_dir* dir_info; - struct fileinfo* file_info; +bool Rdb_validate_tbls::compare_to_actual_tables(const std::string &datadir, + bool *has_errors) { + bool result = true; + struct st_my_dir *dir_info; + struct fileinfo *file_info; dir_info = my_dir(datadir.c_str(), MYF(MY_DONT_SORT | MY_WANT_STAT)); - if (dir_info == nullptr) - { + if (dir_info == nullptr) { sql_print_warning("RocksDB: could not open datadir: %s", datadir.c_str()); return false; } file_info = dir_info->dir_entry; - for (uint ii = 0; ii < dir_info->number_off_files; ii++, file_info++) - { + for (uint ii = 0; ii < dir_info->number_off_files; ii++, file_info++) { /* Ignore files/dirs starting with '.' */ if (file_info->name[0] == '.') continue; @@ -3189,8 +2867,7 @@ continue; /* Scan all the .frm files in the directory */ - if (!scan_for_frms(datadir, file_info->name, has_errors)) - { + if (!scan_for_frms(datadir, file_info->name, has_errors)) { result = false; break; } @@ -3206,21 +2883,18 @@ Validate that all the tables in the RocksDB database dictionary match the .frm files in the datdir */ -bool Rdb_ddl_manager::validate_schemas(void) -{ - bool has_errors= false; - std::string datadir= std::string(mysql_real_data_home); +bool Rdb_ddl_manager::validate_schemas(void) { + bool has_errors = false; + const std::string datadir = std::string(mysql_real_data_home); Rdb_validate_tbls table_list; /* Get the list of tables from the database dictionary */ - if (scan_for_tables(&table_list) != 0) - { + if (scan_for_tables(&table_list) != 0) { return false; } /* Compare that to the list of actual .frm files */ - if (!table_list.compare_to_actual_tables(datadir, &has_errors)) - { + if (!table_list.compare_to_actual_tables(datadir, &has_errors)) { return false; } @@ -3228,14 +2902,12 @@ Any tables left in the tables list are ones that are registered in RocksDB but don't have .frm files. */ - for (const auto& db : table_list.m_list) - { - for (const auto& table : db.second) - { + for (const auto &db : table_list.m_list) { + for (const auto &table : db.second) { sql_print_warning("RocksDB: Schema mismatch - " "Table %s.%s is registered in RocksDB " - "but does not have a .frm file", db.first.c_str(), - table.first.c_str()); + "but does not have a .frm file", + db.first.c_str(), table.first.c_str()); has_errors = true; } } @@ -3243,108 +2915,99 @@ return !has_errors; } -bool Rdb_ddl_manager::init(Rdb_dict_manager *dict_arg, - Rdb_cf_manager *cf_manager, - uint32_t validate_tables) -{ - m_dict= dict_arg; +bool Rdb_ddl_manager::init(Rdb_dict_manager *const dict_arg, + Rdb_cf_manager *const cf_manager, + const uint32_t &validate_tables) { + const ulong TABLE_HASH_SIZE = 32; + m_dict = dict_arg; mysql_rwlock_init(0, &m_rwlock); - (void) my_hash_init(&m_ddl_hash, - /*system_charset_info*/ &my_charset_bin, - 32, 0, 0, - (my_hash_get_key) Rdb_ddl_manager::get_hash_key, - Rdb_ddl_manager::free_hash_elem, - 0); + (void)my_hash_init(&m_ddl_hash, + /*system_charset_info*/ &my_charset_bin, TABLE_HASH_SIZE, + 0, 0, (my_hash_get_key)Rdb_ddl_manager::get_hash_key, + Rdb_ddl_manager::free_hash_elem, 0); /* Read the data dictionary and populate the hash */ uchar ddl_entry[Rdb_key_def::INDEX_NUMBER_SIZE]; rdb_netbuf_store_index(ddl_entry, Rdb_key_def::DDL_ENTRY_INDEX_START_NUMBER); - rocksdb::Slice ddl_entry_slice((char*)ddl_entry, - Rdb_key_def::INDEX_NUMBER_SIZE); + const rocksdb::Slice ddl_entry_slice((char *)ddl_entry, + Rdb_key_def::INDEX_NUMBER_SIZE); /* Reading data dictionary should always skip bloom filter */ - rocksdb::Iterator* it= m_dict->new_iterator(); - int i= 0; + rocksdb::Iterator *it = m_dict->new_iterator(); + int i = 0; - uint max_index_id_in_dict= 0; + uint max_index_id_in_dict = 0; m_dict->get_max_index_id(&max_index_id_in_dict); - for (it->Seek(ddl_entry_slice); it->Valid(); it->Next()) - { + for (it->Seek(ddl_entry_slice); it->Valid(); it->Next()) { const uchar *ptr; const uchar *ptr_end; - rocksdb::Slice key= it->key(); - rocksdb::Slice val= it->value(); + const rocksdb::Slice key = it->key(); + const rocksdb::Slice val = it->value(); if (key.size() >= Rdb_key_def::INDEX_NUMBER_SIZE && memcmp(key.data(), ddl_entry, Rdb_key_def::INDEX_NUMBER_SIZE)) break; - if (key.size() <= Rdb_key_def::INDEX_NUMBER_SIZE) - { + if (key.size() <= Rdb_key_def::INDEX_NUMBER_SIZE) { sql_print_error("RocksDB: Table_store: key has length %d (corruption?)", (int)key.size()); return true; } - Rdb_tbl_def *tdef= new Rdb_tbl_def(key, Rdb_key_def::INDEX_NUMBER_SIZE); + Rdb_tbl_def *const tdef = + new Rdb_tbl_def(key, Rdb_key_def::INDEX_NUMBER_SIZE); // Now, read the DDLs. - int real_val_size= val.size() - Rdb_key_def::VERSION_SIZE; - if (real_val_size % Rdb_key_def::PACKED_SIZE*2) - { + const int real_val_size = val.size() - Rdb_key_def::VERSION_SIZE; + if (real_val_size % Rdb_key_def::PACKED_SIZE * 2) { sql_print_error("RocksDB: Table_store: invalid keylist for table %s", tdef->full_tablename().c_str()); return true; } - tdef->m_key_count= real_val_size / (Rdb_key_def::PACKED_SIZE*2); - tdef->m_key_descr_arr= new std::shared_ptr[tdef->m_key_count]; + tdef->m_key_count = real_val_size / (Rdb_key_def::PACKED_SIZE * 2); + tdef->m_key_descr_arr = new std::shared_ptr[tdef->m_key_count]; - ptr= reinterpret_cast(val.data()); - int version= rdb_netbuf_read_uint16(&ptr); - if (version != Rdb_key_def::DDL_ENTRY_INDEX_VERSION) - { + ptr = reinterpret_cast(val.data()); + const int version = rdb_netbuf_read_uint16(&ptr); + if (version != Rdb_key_def::DDL_ENTRY_INDEX_VERSION) { sql_print_error("RocksDB: DDL ENTRY Version was not expected." "Expected: %d, Actual: %d", Rdb_key_def::DDL_ENTRY_INDEX_VERSION, version); return true; } - ptr_end= ptr + real_val_size; - for (uint keyno= 0; ptr < ptr_end; keyno++) - { + ptr_end = ptr + real_val_size; + for (uint keyno = 0; ptr < ptr_end; keyno++) { GL_INDEX_ID gl_index_id; rdb_netbuf_read_gl_index(&ptr, &gl_index_id); - uint16 m_index_dict_version= 0; - uchar m_index_type= 0; - uint16 kv_version= 0; - uint flags= 0; + uint16 m_index_dict_version = 0; + uchar m_index_type = 0; + uint16 kv_version = 0; + uint flags = 0; if (!m_dict->get_index_info(gl_index_id, &m_index_dict_version, - &m_index_type, &kv_version)) - { + &m_index_type, &kv_version)) { sql_print_error("RocksDB: Could not get index information " "for Index Number (%u,%u), table %s", gl_index_id.cf_id, gl_index_id.index_id, tdef->full_tablename().c_str()); return true; } - if (max_index_id_in_dict < gl_index_id.index_id) - { + if (max_index_id_in_dict < gl_index_id.index_id) { sql_print_error("RocksDB: Found max index id %u from data dictionary " "but also found larger index id %u from dictionary. " "This should never happen and possibly a bug.", max_index_id_in_dict, gl_index_id.index_id); return true; } - if (!m_dict->get_cf_flags(gl_index_id.cf_id, &flags)) - { + if (!m_dict->get_cf_flags(gl_index_id.cf_id, &flags)) { sql_print_error("RocksDB: Could not get Column Family Flags " "for CF Number %d, table %s", - gl_index_id.cf_id, - tdef->full_tablename().c_str()); + gl_index_id.cf_id, tdef->full_tablename().c_str()); return true; } - rocksdb::ColumnFamilyHandle* cfh = cf_manager->get_cf(gl_index_id.cf_id); + rocksdb::ColumnFamilyHandle *const cfh = + cf_manager->get_cf(gl_index_id.cf_id); DBUG_ASSERT(cfh != nullptr); /* @@ -3352,13 +3015,11 @@ initialization requires that there is an open TABLE* where we could look at Field* objects and set max_length and other attributes */ - tdef->m_key_descr_arr[keyno]= - std::make_shared(gl_index_id.index_id, keyno, cfh, - m_index_dict_version, - m_index_type, kv_version, - flags & Rdb_key_def::REVERSE_CF_FLAG, - flags & Rdb_key_def::AUTO_CF_FLAG, "", - m_dict->get_stats(gl_index_id)); + tdef->m_key_descr_arr[keyno] = std::make_shared( + gl_index_id.index_id, keyno, cfh, m_index_dict_version, m_index_type, + kv_version, flags & Rdb_key_def::REVERSE_CF_FLAG, + flags & Rdb_key_def::AUTO_CF_FLAG, "", + m_dict->get_stats(gl_index_id)); } put(tdef); i++; @@ -3378,39 +3039,34 @@ // index ids used by applications should not conflict with // data dictionary index ids - if (max_index_id_in_dict < Rdb_key_def::END_DICT_INDEX_ID) - { - max_index_id_in_dict= Rdb_key_def::END_DICT_INDEX_ID; + if (max_index_id_in_dict < Rdb_key_def::END_DICT_INDEX_ID) { + max_index_id_in_dict = Rdb_key_def::END_DICT_INDEX_ID; } - m_sequence.init(max_index_id_in_dict+1); + m_sequence.init(max_index_id_in_dict + 1); - if (!it->status().ok()) - { - std::string s= it->status().ToString(); + if (!it->status().ok()) { + const std::string s = it->status().ToString(); sql_print_error("RocksDB: Table_store: load error: %s", s.c_str()); return true; } delete it; - sql_print_information("RocksDB: Table_store: loaded DDL data for %d tables", i); + sql_print_information("RocksDB: Table_store: loaded DDL data for %d tables", + i); return false; } - -Rdb_tbl_def* Rdb_ddl_manager::find(const std::string& table_name, bool lock) -{ - if (lock) - { +Rdb_tbl_def *Rdb_ddl_manager::find(const std::string &table_name, + const bool &lock) { + if (lock) { mysql_rwlock_rdlock(&m_rwlock); } - Rdb_tbl_def* rec= reinterpret_cast( - my_hash_search(&m_ddl_hash, - reinterpret_cast(table_name.c_str()), - table_name.size())); + Rdb_tbl_def *const rec = reinterpret_cast(my_hash_search( + &m_ddl_hash, reinterpret_cast(table_name.c_str()), + table_name.size())); - if (lock) - { + if (lock) { mysql_rwlock_unlock(&m_rwlock); } @@ -3421,21 +3077,18 @@ // lock on m_rwlock to make sure the Rdb_key_def is not discarded while we // are finding it. Copying it into 'ret' increments the count making sure // that the object will not be discarded until we are finished with it. -std::shared_ptr Rdb_ddl_manager::safe_find(GL_INDEX_ID gl_index_id) -{ - std::shared_ptr ret(nullptr); +std::shared_ptr +Rdb_ddl_manager::safe_find(GL_INDEX_ID gl_index_id) { + std::shared_ptr ret(nullptr); mysql_rwlock_rdlock(&m_rwlock); - auto it= m_index_num_to_keydef.find(gl_index_id); - if (it != m_index_num_to_keydef.end()) - { - auto table_def = find(it->second.first, false); - if (table_def && it->second.second < table_def->m_key_count) - { - auto& kd= table_def->m_key_descr_arr[it->second.second]; - if (kd->max_storage_fmt_length() != 0) - { + auto it = m_index_num_to_keydef.find(gl_index_id); + if (it != m_index_num_to_keydef.end()) { + const auto table_def = find(it->second.first, false); + if (table_def && it->second.second < table_def->m_key_count) { + const auto &kd = table_def->m_key_descr_arr[it->second.second]; + if (kd->max_storage_fmt_length() != 0) { ret = kd; } } @@ -3447,10 +3100,9 @@ } // this method assumes at least read-only lock on m_rwlock -const std::shared_ptr& Rdb_ddl_manager::find( - GL_INDEX_ID gl_index_id) -{ - auto it= m_index_num_to_keydef.find(gl_index_id); +const std::shared_ptr & +Rdb_ddl_manager::find(GL_INDEX_ID gl_index_id) { + auto it = m_index_num_to_keydef.find(gl_index_id); if (it != m_index_num_to_keydef.end()) { auto table_def = find(it->second.first, false); if (table_def) { @@ -3466,62 +3118,55 @@ } void Rdb_ddl_manager::set_stats( - const std::unordered_map& stats) -{ + const std::unordered_map &stats) { mysql_rwlock_wrlock(&m_rwlock); for (auto src : stats) { - auto keydef = find(src.second.m_gl_index_id); + const auto &keydef = find(src.second.m_gl_index_id); if (keydef) { keydef->m_stats = src.second; + m_stats2store[keydef->m_stats.m_gl_index_id] = keydef->m_stats; } } mysql_rwlock_unlock(&m_rwlock); } void Rdb_ddl_manager::adjust_stats( - const std::vector& new_data, - const std::vector& deleted_data) -{ + const std::vector &new_data, + const std::vector &deleted_data) { mysql_rwlock_wrlock(&m_rwlock); int i = 0; - for (const auto& data : {new_data, deleted_data}) - { - for (const auto& src : data) - { - auto keydef= find(src.m_gl_index_id); - if (keydef) - { + for (const auto &data : {new_data, deleted_data}) { + for (const auto &src : data) { + const auto &keydef = find(src.m_gl_index_id); + if (keydef) { keydef->m_stats.merge(src, i == 0, keydef->max_storage_fmt_length()); m_stats2store[keydef->m_stats.m_gl_index_id] = keydef->m_stats; } } i++; } - bool should_save_stats= !m_stats2store.empty(); + const bool should_save_stats = !m_stats2store.empty(); mysql_rwlock_unlock(&m_rwlock); - if (should_save_stats) - { + if (should_save_stats) { // Queue an async persist_stats(false) call to the background thread. rdb_queue_save_stats_request(); } } -void Rdb_ddl_manager::persist_stats(bool sync) -{ +void Rdb_ddl_manager::persist_stats(const bool &sync) { mysql_rwlock_wrlock(&m_rwlock); - auto local_stats2store = std::move(m_stats2store); + const auto local_stats2store = std::move(m_stats2store); m_stats2store.clear(); mysql_rwlock_unlock(&m_rwlock); // Persist stats - std::unique_ptr wb = m_dict->begin(); + const std::unique_ptr wb = m_dict->begin(); std::vector stats; - std::transform( - local_stats2store.begin(), local_stats2store.end(), - std::back_inserter(stats), - []( - const std::pair& s - ) {return s.second;}); + std::transform(local_stats2store.begin(), local_stats2store.end(), + std::back_inserter(stats), + [](const std::pair &s) { + return s.second; + }); m_dict->add_stats(wb.get(), stats); m_dict->commit(wb.get(), sync); } @@ -3531,32 +3176,28 @@ on-disk data dictionary. */ -int Rdb_ddl_manager::put_and_write(Rdb_tbl_def *tbl, - rocksdb::WriteBatch *batch) -{ +int Rdb_ddl_manager::put_and_write(Rdb_tbl_def *const tbl, + rocksdb::WriteBatch *const batch) { uchar buf[FN_LEN * 2 + Rdb_key_def::INDEX_NUMBER_SIZE]; - uint pos= 0; + uint pos = 0; rdb_netbuf_store_index(buf, Rdb_key_def::DDL_ENTRY_INDEX_START_NUMBER); - pos+= Rdb_key_def::INDEX_NUMBER_SIZE; + pos += Rdb_key_def::INDEX_NUMBER_SIZE; - const std::string& dbname_tablename= tbl->full_tablename(); + const std::string &dbname_tablename = tbl->full_tablename(); memcpy(buf + pos, dbname_tablename.c_str(), dbname_tablename.size()); pos += dbname_tablename.size(); int res; - if ((res= tbl->put_dict(m_dict, batch, buf, pos))) - { + if ((res = tbl->put_dict(m_dict, batch, buf, pos))) { return res; } - if ((res= put(tbl))) - { + if ((res = put(tbl))) { return res; } - return 0; + return HA_EXIT_SUCCESS; } - /* Return 0 - ok, other value - error */ /* TODO: This function modifies m_ddl_hash and m_index_num_to_keydef. @@ -3564,28 +3205,26 @@ See the discussion here: https://reviews.facebook.net/D35925#inline-259167 Tracked by https://github.com/facebook/mysql-5.6/issues/33 */ -int Rdb_ddl_manager::put(Rdb_tbl_def *tbl, bool lock) -{ +int Rdb_ddl_manager::put(Rdb_tbl_def *const tbl, const bool &lock) { Rdb_tbl_def *rec; my_bool result; - const std::string& dbname_tablename= tbl->full_tablename(); + const std::string &dbname_tablename = tbl->full_tablename(); if (lock) mysql_rwlock_wrlock(&m_rwlock); // We have to do this find because 'tbl' is not yet in the list. We need // to find the one we are replacing ('rec') - rec= reinterpret_cast(find(dbname_tablename, false)); - if (rec) - { + rec = find(dbname_tablename, false); + if (rec) { // this will free the old record. - my_hash_delete(&m_ddl_hash, reinterpret_cast(rec)); + my_hash_delete(&m_ddl_hash, reinterpret_cast(rec)); } - result= my_hash_insert(&m_ddl_hash, reinterpret_cast(tbl)); + result = my_hash_insert(&m_ddl_hash, reinterpret_cast(tbl)); - for (uint keyno= 0; keyno < tbl->m_key_count; keyno++) { - m_index_num_to_keydef[tbl->m_key_descr_arr[keyno]->get_gl_index_id()]= - std::make_pair(dbname_tablename, keyno); + for (uint keyno = 0; keyno < tbl->m_key_count; keyno++) { + m_index_num_to_keydef[tbl->m_key_descr_arr[keyno]->get_gl_index_id()] = + std::make_pair(dbname_tablename, keyno); } if (lock) @@ -3593,90 +3232,81 @@ return result; } - -void Rdb_ddl_manager::remove(Rdb_tbl_def *tbl, - rocksdb::WriteBatch *batch, bool lock) -{ +void Rdb_ddl_manager::remove(Rdb_tbl_def *const tbl, + rocksdb::WriteBatch *const batch, + const bool &lock) { if (lock) mysql_rwlock_wrlock(&m_rwlock); uchar buf[FN_LEN * 2 + Rdb_key_def::INDEX_NUMBER_SIZE]; - uint pos= 0; + uint pos = 0; rdb_netbuf_store_index(buf, Rdb_key_def::DDL_ENTRY_INDEX_START_NUMBER); - pos+= Rdb_key_def::INDEX_NUMBER_SIZE; + pos += Rdb_key_def::INDEX_NUMBER_SIZE; - const std::string& dbname_tablename= tbl->full_tablename(); + const std::string &dbname_tablename = tbl->full_tablename(); memcpy(buf + pos, dbname_tablename.c_str(), dbname_tablename.size()); pos += dbname_tablename.size(); - rocksdb::Slice tkey((char*)buf, pos); + const rocksdb::Slice tkey((char *)buf, pos); m_dict->delete_key(batch, tkey); /* The following will also delete the object: */ - my_hash_delete(&m_ddl_hash, reinterpret_cast(tbl)); + my_hash_delete(&m_ddl_hash, reinterpret_cast(tbl)); if (lock) mysql_rwlock_unlock(&m_rwlock); } - -bool Rdb_ddl_manager::rename(const std::string& from, const std::string& to, - rocksdb::WriteBatch *batch) -{ +bool Rdb_ddl_manager::rename(const std::string &from, const std::string &to, + rocksdb::WriteBatch *const batch) { Rdb_tbl_def *rec; Rdb_tbl_def *new_rec; - bool res= true; + bool res = true; uchar new_buf[FN_LEN * 2 + Rdb_key_def::INDEX_NUMBER_SIZE]; - uint new_pos= 0; + uint new_pos = 0; mysql_rwlock_wrlock(&m_rwlock); - if (!(rec= find(from, false))) - { + if (!(rec = find(from, false))) { mysql_rwlock_unlock(&m_rwlock); return true; } - new_rec= new Rdb_tbl_def(to); + new_rec = new Rdb_tbl_def(to); - new_rec->m_key_count= rec->m_key_count; - new_rec->m_auto_incr_val= - rec->m_auto_incr_val.load(std::memory_order_relaxed); - new_rec->m_key_descr_arr= rec->m_key_descr_arr; + new_rec->m_key_count = rec->m_key_count; + new_rec->m_auto_incr_val = + rec->m_auto_incr_val.load(std::memory_order_relaxed); + new_rec->m_key_descr_arr = rec->m_key_descr_arr; // so that it's not free'd when deleting the old rec - rec->m_key_descr_arr= nullptr; + rec->m_key_descr_arr = nullptr; // Create a new key rdb_netbuf_store_index(new_buf, Rdb_key_def::DDL_ENTRY_INDEX_START_NUMBER); - new_pos+= Rdb_key_def::INDEX_NUMBER_SIZE; + new_pos += Rdb_key_def::INDEX_NUMBER_SIZE; - const std::string& dbname_tablename= new_rec->full_tablename(); + const std::string &dbname_tablename = new_rec->full_tablename(); memcpy(new_buf + new_pos, dbname_tablename.c_str(), dbname_tablename.size()); new_pos += dbname_tablename.size(); // Create a key to add - if (!new_rec->put_dict(m_dict, batch, new_buf, new_pos)) - { + if (!new_rec->put_dict(m_dict, batch, new_buf, new_pos)) { remove(rec, batch, false); put(new_rec, false); - res= false; // ok + res = false; // ok } mysql_rwlock_unlock(&m_rwlock); return res; } - -void Rdb_ddl_manager::cleanup() -{ +void Rdb_ddl_manager::cleanup() { my_hash_free(&m_ddl_hash); mysql_rwlock_destroy(&m_rwlock); m_sequence.cleanup(); } - -int Rdb_ddl_manager::scan_for_tables(Rdb_tables_scanner* tables_scanner) -{ +int Rdb_ddl_manager::scan_for_tables(Rdb_tables_scanner *const tables_scanner) { int i, ret; Rdb_tbl_def *rec; @@ -3684,12 +3314,11 @@ mysql_rwlock_rdlock(&m_rwlock); - ret= 0; - i= 0; + ret = 0; + i = 0; - while ((rec = reinterpret_cast(my_hash_element(&m_ddl_hash, - i)))) - { + while (( + rec = reinterpret_cast(my_hash_element(&m_ddl_hash, i)))) { ret = tables_scanner->add_table(rec); if (ret) break; @@ -3700,321 +3329,89 @@ return ret; } +bool Rdb_dict_manager::init(rocksdb::DB *const rdb_dict, + Rdb_cf_manager *const cf_manager) { + DBUG_ASSERT(rdb_dict != nullptr); + DBUG_ASSERT(cf_manager != nullptr); -/* - Rdb_binlog_manager class implementation -*/ - -bool Rdb_binlog_manager::init(Rdb_dict_manager *dict_arg) -{ - DBUG_ASSERT(dict_arg != nullptr); - m_dict= dict_arg; - - rdb_netbuf_store_index(m_key_buf, Rdb_key_def::BINLOG_INFO_INDEX_NUMBER); - m_key_slice = rocksdb::Slice(reinterpret_cast(m_key_buf), - Rdb_key_def::INDEX_NUMBER_SIZE); - return false; -} - -void Rdb_binlog_manager::cleanup() -{ -} - -/** - Set binlog name, pos and optionally gtid into WriteBatch. - This function should be called as part of transaction commit, - since binlog info is set only at transaction commit. - Actual write into RocksDB is not done here, so checking if - write succeeded or not is not possible here. - @param binlog_name Binlog name - @param binlog_pos Binlog pos - @param binlog_gtid Binlog GTID - @param batch WriteBatch -*/ -void Rdb_binlog_manager::update(const char* binlog_name, - const my_off_t binlog_pos, - const char* binlog_gtid, - rocksdb::WriteBatchBase* batch) -{ - if (binlog_name && binlog_pos) - { - // max binlog length (512) + binlog pos (4) + binlog gtid (57) < 1024 - uchar value_buf[1024]; - m_dict->put_key(batch, m_key_slice, - pack_value(value_buf, binlog_name, - binlog_pos, binlog_gtid)); - } -} - -/** - Read binlog committed entry stored in RocksDB, then unpack - @param[OUT] binlog_name Binlog name - @param[OUT] binlog_pos Binlog pos - @param[OUT] binlog_gtid Binlog GTID - @return - true is binlog info was found (valid behavior) - false otherwise -*/ -bool Rdb_binlog_manager::read(char *binlog_name, my_off_t *binlog_pos, - char *binlog_gtid) -{ - bool ret= false; - if (binlog_name) - { - std::string value; - rocksdb::Status status= m_dict->get_value(m_key_slice, &value); - if(status.ok()) - { - if (!unpack_value((const uchar*)value.c_str(), - binlog_name, binlog_pos, binlog_gtid)) - ret= true; - } - } - return ret; -} - -/** - Pack binlog_name, binlog_pos, binlog_gtid into preallocated - buffer, then converting and returning a RocksDB Slice - @param buf Preallocated buffer to set binlog info. - @param binlog_name Binlog name - @param binlog_pos Binlog pos - @param binlog_gtid Binlog GTID - @return rocksdb::Slice converted from buf and its length -*/ -rocksdb::Slice Rdb_binlog_manager::pack_value(uchar *buf, - const char* binlog_name, - const my_off_t binlog_pos, - const char* binlog_gtid) -{ - uint pack_len= 0; - - // store version - rdb_netbuf_store_uint16(buf, Rdb_key_def::BINLOG_INFO_INDEX_NUMBER_VERSION); - pack_len += Rdb_key_def::VERSION_SIZE; - - // store binlog file name length - DBUG_ASSERT(strlen(binlog_name) <= 65535); - uint16_t binlog_name_len = strlen(binlog_name); - rdb_netbuf_store_uint16(buf+pack_len, binlog_name_len); - pack_len += 2; - - // store binlog file name - memcpy(buf+pack_len, binlog_name, binlog_name_len); - pack_len += binlog_name_len; - - // store binlog pos - rdb_netbuf_store_uint32(buf+pack_len, binlog_pos); - pack_len += 4; - - // store binlog gtid length. - // If gtid was not set, store 0 instead - uint16_t binlog_gtid_len = binlog_gtid? strlen(binlog_gtid) : 0; - rdb_netbuf_store_uint16(buf+pack_len, binlog_gtid_len); - pack_len += 2; - - if (binlog_gtid_len > 0) - { - // store binlog gtid - memcpy(buf+pack_len, binlog_gtid, binlog_gtid_len); - pack_len += binlog_gtid_len; - } - - return rocksdb::Slice((char*)buf, pack_len); -} - -/** - Unpack value then split into binlog_name, binlog_pos (and binlog_gtid) - @param[IN] value Binlog state info fetched from RocksDB - @param[OUT] binlog_name Binlog name - @param[OUT] binlog_pos Binlog pos - @param[OUT] binlog_gtid Binlog GTID - @return true on error -*/ -bool Rdb_binlog_manager::unpack_value(const uchar *value, char *binlog_name, - my_off_t *binlog_pos, - char *binlog_gtid) -{ - uint pack_len= 0; + mysql_mutex_init(0, &m_mutex, MY_MUTEX_INIT_FAST); - DBUG_ASSERT(binlog_pos != nullptr); + m_db = rdb_dict; + bool is_automatic; - // read version - uint16_t version= rdb_netbuf_to_uint16(value); - pack_len += Rdb_key_def::VERSION_SIZE; - if (version != Rdb_key_def::BINLOG_INFO_INDEX_NUMBER_VERSION) - return true; + m_system_cfh = cf_manager->get_or_create_cf(m_db, DEFAULT_SYSTEM_CF_NAME, "", + nullptr, &is_automatic); - // read binlog file name length - uint16_t binlog_name_len= rdb_netbuf_to_uint16(value+pack_len); - pack_len += 2; - if (binlog_name_len) - { - // read and set binlog name - memcpy(binlog_name, value+pack_len, binlog_name_len); - binlog_name[binlog_name_len]= '\0'; - pack_len += binlog_name_len; - - // read and set binlog pos - *binlog_pos= rdb_netbuf_to_uint32(value+pack_len); - pack_len += 4; - - // read gtid length - uint16_t binlog_gtid_len= rdb_netbuf_to_uint16(value+pack_len); - pack_len += 2; - if (binlog_gtid && binlog_gtid_len > 0) - { - // read and set gtid - memcpy(binlog_gtid, value+pack_len, binlog_gtid_len); - binlog_gtid[binlog_gtid_len]= '\0'; - pack_len += binlog_gtid_len; - } - } - return false; -} + rdb_netbuf_store_index(m_key_buf_max_index_id, Rdb_key_def::MAX_INDEX_ID); -/** - Inserts a row into mysql.slave_gtid_info table. Doing this inside - storage engine is more efficient than inserting/updating through MySQL. + m_key_slice_max_index_id = + rocksdb::Slice(reinterpret_cast(m_key_buf_max_index_id), + Rdb_key_def::INDEX_NUMBER_SIZE); - @param[IN] id Primary key of the table. - @param[IN] db Database name. This is column 2 of the table. - @param[IN] gtid Gtid in human readable form. This is column 3 of the table. - @param[IN] write_batch Handle to storage engine writer. -*/ -void Rdb_binlog_manager::update_slave_gtid_info( - uint id, const char* db, const char* gtid, - rocksdb::WriteBatchBase* write_batch) -{ - if (id && db && gtid) { - // Make sure that if the slave_gtid_info table exists we have a - // pointer to it via m_slave_gtid_info_tbl. - if (!m_slave_gtid_info_tbl.load()) { - m_slave_gtid_info_tbl.store( - rdb_get_ddl_manager()->find("mysql.slave_gtid_info")); - } - if (!m_slave_gtid_info_tbl.load()) { - // slave_gtid_info table is not present. Simply return. - return; - } - DBUG_ASSERT(m_slave_gtid_info_tbl.load()->m_key_count == 1); + resume_drop_indexes(); + rollback_ongoing_index_creation(); - const std::shared_ptr& kd= - m_slave_gtid_info_tbl.load()->m_key_descr_arr[0]; - String value; - - // Build key - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE + 4]= {0}; - uchar* buf= key_buf; - rdb_netbuf_store_index(buf, kd->get_index_number()); - buf += Rdb_key_def::INDEX_NUMBER_SIZE; - rdb_netbuf_store_uint32(buf, id); - buf += 4; - rocksdb::Slice key_slice = - rocksdb::Slice((const char*)key_buf, buf-key_buf); - - // Build value - uchar value_buf[128]= {0}; - DBUG_ASSERT(gtid); - uint db_len= strlen(db); - uint gtid_len= strlen(gtid); - buf= value_buf; - // 1 byte used for flags. Empty here. - buf++; - - // Write column 1. - DBUG_ASSERT(strlen(db) <= 64); - rdb_netbuf_store_byte(buf, db_len); - buf++; - memcpy(buf, db, db_len); - buf += db_len; - - // Write column 2. - DBUG_ASSERT(gtid_len <= 56); - rdb_netbuf_store_byte(buf, gtid_len); - buf++; - memcpy(buf, gtid, gtid_len); - buf += gtid_len; - rocksdb::Slice value_slice = - rocksdb::Slice((const char*)value_buf, buf-value_buf); + // If system CF was created then we need to set its flags as well to make + // sure that CF is properly initialized. + if (m_system_cfh != nullptr) { + const std::unique_ptr wb = begin(); + rocksdb::WriteBatch *const batch = wb.get(); - write_batch->Put(kd->get_cf(), key_slice, value_slice); + add_cf_flags(batch, m_system_cfh->GetID(), 0); + commit(batch); } -} - -bool Rdb_dict_manager::init(rocksdb::DB *rdb_dict, Rdb_cf_manager *cf_manager) -{ - mysql_mutex_init(0, &m_mutex, MY_MUTEX_INIT_FAST); - m_db= rdb_dict; - bool is_automatic; - m_system_cfh= cf_manager->get_or_create_cf(m_db, DEFAULT_SYSTEM_CF_NAME, - "", nullptr, &is_automatic); - rdb_netbuf_store_index(m_key_buf_max_index_id, - Rdb_key_def::MAX_INDEX_ID); - m_key_slice_max_index_id= rocksdb::Slice( - reinterpret_cast(m_key_buf_max_index_id), - Rdb_key_def::INDEX_NUMBER_SIZE); - resume_drop_indexes(); - rollback_ongoing_index_creation(); return (m_system_cfh == nullptr); } -std::unique_ptr Rdb_dict_manager::begin() -{ +std::unique_ptr Rdb_dict_manager::begin() const { return std::unique_ptr(new rocksdb::WriteBatch); } -void Rdb_dict_manager::put_key(rocksdb::WriteBatchBase *batch, +void Rdb_dict_manager::put_key(rocksdb::WriteBatchBase *const batch, const rocksdb::Slice &key, - const rocksdb::Slice &value) -{ + const rocksdb::Slice &value) const { batch->Put(m_system_cfh, key, value); } rocksdb::Status Rdb_dict_manager::get_value(const rocksdb::Slice &key, - std::string *value) const -{ + std::string *const value) const { rocksdb::ReadOptions options; - options.total_order_seek= true; + options.total_order_seek = true; return m_db->Get(options, m_system_cfh, key, value); } void Rdb_dict_manager::delete_key(rocksdb::WriteBatchBase *batch, - const rocksdb::Slice &key) const -{ + const rocksdb::Slice &key) const { batch->Delete(m_system_cfh, key); } -rocksdb::Iterator* Rdb_dict_manager::new_iterator() -{ +rocksdb::Iterator *Rdb_dict_manager::new_iterator() const { /* Reading data dictionary should always skip bloom filter */ rocksdb::ReadOptions read_options; - read_options.total_order_seek= true; + read_options.total_order_seek = true; return m_db->NewIterator(read_options, m_system_cfh); } -int Rdb_dict_manager::commit(rocksdb::WriteBatch *batch, bool sync) -{ +int Rdb_dict_manager::commit(rocksdb::WriteBatch *const batch, + const bool &sync) const { if (!batch) - return 1; - int res= 0; + return HA_EXIT_FAILURE; + int res = 0; rocksdb::WriteOptions options; - options.sync= sync; - rocksdb::Status s= m_db->Write(options, batch); - res= !s.ok(); // we return true when something failed - if (res) - { + options.sync = sync; + rocksdb::Status s = m_db->Write(options, batch); + res = !s.ok(); // we return true when something failed + if (res) { rdb_handle_io_error(s, RDB_IO_ERROR_DICT_COMMIT); } batch->Clear(); return res; } -void Rdb_dict_manager::dump_index_id(uchar *netbuf, +void Rdb_dict_manager::dump_index_id(uchar *const netbuf, Rdb_key_def::DATA_DICT_TYPE dict_type, - const GL_INDEX_ID &gl_index_id) -{ + const GL_INDEX_ID &gl_index_id) { rdb_netbuf_store_uint32(netbuf, dict_type); rdb_netbuf_store_uint32(netbuf + Rdb_key_def::INDEX_NUMBER_SIZE, gl_index_id.cf_id); @@ -4022,152 +3419,151 @@ gl_index_id.index_id); } -void Rdb_dict_manager::delete_with_prefix(rocksdb::WriteBatch* batch, - Rdb_key_def::DATA_DICT_TYPE dict_type, - const GL_INDEX_ID &gl_index_id) const -{ - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*3]= {0}; +void Rdb_dict_manager::delete_with_prefix( + rocksdb::WriteBatch *const batch, Rdb_key_def::DATA_DICT_TYPE dict_type, + const GL_INDEX_ID &gl_index_id) const { + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 3] = {0}; dump_index_id(key_buf, dict_type, gl_index_id); - rocksdb::Slice key= rocksdb::Slice((char*)key_buf, sizeof(key_buf)); + rocksdb::Slice key = rocksdb::Slice((char *)key_buf, sizeof(key_buf)); delete_key(batch, key); } void Rdb_dict_manager::add_or_update_index_cf_mapping( - rocksdb::WriteBatch* batch, - const uchar m_index_type, - const uint16_t kv_version, - const uint32_t index_id, - const uint32_t cf_id) -{ - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*3]= {0}; - uchar value_buf[256]= {0}; - GL_INDEX_ID gl_index_id= {cf_id, index_id}; + rocksdb::WriteBatch *batch, const uchar m_index_type, + const uint16_t kv_version, const uint32_t index_id, + const uint32_t cf_id) const { + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 3] = {0}; + uchar value_buf[256] = {0}; + GL_INDEX_ID gl_index_id = {cf_id, index_id}; dump_index_id(key_buf, Rdb_key_def::INDEX_INFO, gl_index_id); - rocksdb::Slice key= rocksdb::Slice((char*)key_buf, sizeof(key_buf)); + const rocksdb::Slice key = rocksdb::Slice((char *)key_buf, sizeof(key_buf)); - uchar* ptr= value_buf; + uchar *ptr = value_buf; rdb_netbuf_store_uint16(ptr, Rdb_key_def::INDEX_INFO_VERSION_LATEST); - ptr+= 2; + ptr += 2; rdb_netbuf_store_byte(ptr, m_index_type); - ptr+= 1; + ptr += 1; rdb_netbuf_store_uint16(ptr, kv_version); - ptr+= 2; + ptr += 2; - rocksdb::Slice value= rocksdb::Slice((char*)value_buf, ptr-value_buf); + const rocksdb::Slice value = + rocksdb::Slice((char *)value_buf, ptr - value_buf); batch->Put(m_system_cfh, key, value); } -void Rdb_dict_manager::add_cf_flags(rocksdb::WriteBatch* batch, - const uint32_t cf_id, - const uint32_t cf_flags) -{ - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*2]= {0}; - uchar value_buf[Rdb_key_def::VERSION_SIZE+ - Rdb_key_def::INDEX_NUMBER_SIZE]= {0}; +void Rdb_dict_manager::add_cf_flags(rocksdb::WriteBatch *const batch, + const uint32_t &cf_id, + const uint32_t &cf_flags) const { + DBUG_ASSERT(batch != nullptr); + + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2] = {0}; + uchar value_buf[Rdb_key_def::VERSION_SIZE + Rdb_key_def::INDEX_NUMBER_SIZE] = + {0}; rdb_netbuf_store_uint32(key_buf, Rdb_key_def::CF_DEFINITION); rdb_netbuf_store_uint32(key_buf + Rdb_key_def::INDEX_NUMBER_SIZE, cf_id); - rocksdb::Slice key= rocksdb::Slice((char*)key_buf, sizeof(key_buf)); + const rocksdb::Slice key = rocksdb::Slice((char *)key_buf, sizeof(key_buf)); rdb_netbuf_store_uint16(value_buf, Rdb_key_def::CF_DEFINITION_VERSION); rdb_netbuf_store_uint32(value_buf + Rdb_key_def::VERSION_SIZE, cf_flags); - rocksdb::Slice value= rocksdb::Slice((char*)value_buf, sizeof(value_buf)); + const rocksdb::Slice value = + rocksdb::Slice((char *)value_buf, sizeof(value_buf)); batch->Put(m_system_cfh, key, value); } -void Rdb_dict_manager::delete_index_info(rocksdb::WriteBatch* batch, - const GL_INDEX_ID &gl_index_id) const -{ +void Rdb_dict_manager::delete_index_info(rocksdb::WriteBatch *batch, + const GL_INDEX_ID &gl_index_id) const { delete_with_prefix(batch, Rdb_key_def::INDEX_INFO, gl_index_id); } - bool Rdb_dict_manager::get_index_info(const GL_INDEX_ID &gl_index_id, uint16_t *m_index_dict_version, uchar *m_index_type, - uint16_t *kv_version) -{ - bool found= false; - bool error= false; + uint16_t *kv_version) const { + bool found = false; + bool error = false; std::string value; - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*3]= {0}; + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 3] = {0}; dump_index_id(key_buf, Rdb_key_def::INDEX_INFO, gl_index_id); - rocksdb::Slice key= rocksdb::Slice((char*)key_buf, sizeof(key_buf)); + const rocksdb::Slice &key = rocksdb::Slice((char *)key_buf, sizeof(key_buf)); - rocksdb::Status status= get_value(key, &value); - if (status.ok()) - { - const uchar* val= (const uchar*)value.c_str(); - const uchar* ptr= val; - *m_index_dict_version= rdb_netbuf_to_uint16(val); - *kv_version= 0; - *m_index_type= 0; - ptr+= 2; + const rocksdb::Status &status = get_value(key, &value); + if (status.ok()) { + const uchar *const val = (const uchar *)value.c_str(); + const uchar *ptr = val; + *m_index_dict_version = rdb_netbuf_to_uint16(val); + *kv_version = 0; + *m_index_type = 0; + ptr += 2; switch (*m_index_dict_version) { case Rdb_key_def::INDEX_INFO_VERSION_VERIFY_KV_FORMAT: case Rdb_key_def::INDEX_INFO_VERSION_GLOBAL_ID: - *m_index_type= rdb_netbuf_to_byte(ptr); - ptr+= 1; - *kv_version= rdb_netbuf_to_uint16(ptr); - found= true; + *m_index_type = rdb_netbuf_to_byte(ptr); + ptr += 1; + *kv_version = rdb_netbuf_to_uint16(ptr); + found = true; break; default: - error= true; + error = true; break; } - switch (*m_index_type) - { + switch (*m_index_type) { case Rdb_key_def::INDEX_TYPE_PRIMARY: - case Rdb_key_def::INDEX_TYPE_HIDDEN_PRIMARY: - { - error= *kv_version > Rdb_key_def::PRIMARY_FORMAT_VERSION_LATEST; + case Rdb_key_def::INDEX_TYPE_HIDDEN_PRIMARY: { + error = *kv_version > Rdb_key_def::PRIMARY_FORMAT_VERSION_LATEST; break; } case Rdb_key_def::INDEX_TYPE_SECONDARY: - error= *kv_version > Rdb_key_def::SECONDARY_FORMAT_VERSION_LATEST; + error = *kv_version > Rdb_key_def::SECONDARY_FORMAT_VERSION_LATEST; break; default: - error= true; + error = true; break; } } - if (error) - { + if (error) { // NO_LINT_DEBUG sql_print_error("RocksDB: Found invalid key version number (%u, %u, %u) " "from data dictionary. This should never happen " - "and it may be a bug.", *m_index_dict_version, - *m_index_type, *kv_version); + "and it may be a bug.", + *m_index_dict_version, *m_index_type, *kv_version); abort_with_stack_traces(); } return found; } -bool Rdb_dict_manager::get_cf_flags(const uint32_t cf_id, uint32_t *cf_flags) -{ - bool found= false; +bool Rdb_dict_manager::get_cf_flags(const uint32_t &cf_id, + uint32_t *const cf_flags) const { + DBUG_ASSERT(cf_flags != nullptr); + + bool found = false; std::string value; - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*2]= {0}; + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 2] = {0}; + rdb_netbuf_store_uint32(key_buf, Rdb_key_def::CF_DEFINITION); rdb_netbuf_store_uint32(key_buf + Rdb_key_def::INDEX_NUMBER_SIZE, cf_id); - rocksdb::Slice key= rocksdb::Slice((char*)key_buf, sizeof(key_buf)); - rocksdb::Status status= get_value(key, &value); - if (status.ok()) - { - const uchar* val= (const uchar*)value.c_str(); - uint16_t version= rdb_netbuf_to_uint16(val); - if (version == Rdb_key_def::CF_DEFINITION_VERSION) - { - *cf_flags= rdb_netbuf_to_uint32(val+Rdb_key_def::VERSION_SIZE); - found= true; + const rocksdb::Slice key = + rocksdb::Slice(reinterpret_cast(key_buf), sizeof(key_buf)); + const rocksdb::Status status = get_value(key, &value); + + if (status.ok()) { + const uchar *val = (const uchar *)value.c_str(); + DBUG_ASSERT(val); + + const uint16_t version = rdb_netbuf_to_uint16(val); + + if (version == Rdb_key_def::CF_DEFINITION_VERSION) { + *cf_flags = rdb_netbuf_to_uint32(val + Rdb_key_def::VERSION_SIZE); + found = true; } } + return found; } @@ -4177,22 +3573,20 @@ ongoing creation. */ void Rdb_dict_manager::get_ongoing_index_operation( - std::vector* gl_index_ids, - Rdb_key_def::DATA_DICT_TYPE dd_type) -{ + std::unordered_set *gl_index_ids, + Rdb_key_def::DATA_DICT_TYPE dd_type) const { DBUG_ASSERT(dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING || dd_type == Rdb_key_def::DDL_CREATE_INDEX_ONGOING); uchar index_buf[Rdb_key_def::INDEX_NUMBER_SIZE]; rdb_netbuf_store_uint32(index_buf, dd_type); - rocksdb::Slice index_slice(reinterpret_cast(index_buf), - Rdb_key_def::INDEX_NUMBER_SIZE); + const rocksdb::Slice index_slice(reinterpret_cast(index_buf), + Rdb_key_def::INDEX_NUMBER_SIZE); - rocksdb::Iterator* it= new_iterator(); - for (it->Seek(index_slice); it->Valid(); it->Next()) - { - rocksdb::Slice key= it->key(); - const uchar* ptr= (const uchar*)key.data(); + rocksdb::Iterator *it = new_iterator(); + for (it->Seek(index_slice); it->Valid(); it->Next()) { + rocksdb::Slice key = it->key(); + const uchar *const ptr = (const uchar *)key.data(); /* Ongoing drop/create index operations require key to be of the form: @@ -4202,8 +3596,7 @@ ddl_type with different format. */ if (key.size() != Rdb_key_def::INDEX_NUMBER_SIZE * 3 || - rdb_netbuf_to_uint32(ptr) != dd_type) - { + rdb_netbuf_to_uint32(ptr) != dd_type) { break; } @@ -4211,10 +3604,11 @@ // Rdb_key_def::DDL_DROP_INDEX_ONGOING_VERSION = 1 as a value. // If increasing version number, we need to add version check logic here. GL_INDEX_ID gl_index_id; - gl_index_id.cf_id= rdb_netbuf_to_uint32(ptr+Rdb_key_def::INDEX_NUMBER_SIZE); - gl_index_id.index_id= rdb_netbuf_to_uint32( - ptr + 2 * Rdb_key_def::INDEX_NUMBER_SIZE); - gl_index_ids->push_back(gl_index_id); + gl_index_id.cf_id = + rdb_netbuf_to_uint32(ptr + Rdb_key_def::INDEX_NUMBER_SIZE); + gl_index_id.index_id = + rdb_netbuf_to_uint32(ptr + 2 * Rdb_key_def::INDEX_NUMBER_SIZE); + gl_index_ids->insert(gl_index_id); } delete it; } @@ -4225,22 +3619,19 @@ or not. */ bool Rdb_dict_manager::is_index_operation_ongoing( - const GL_INDEX_ID& gl_index_id, - Rdb_key_def::DATA_DICT_TYPE dd_type) -{ + const GL_INDEX_ID &gl_index_id, Rdb_key_def::DATA_DICT_TYPE dd_type) const { DBUG_ASSERT(dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING || dd_type == Rdb_key_def::DDL_CREATE_INDEX_ONGOING); - bool found= false; + bool found = false; std::string value; - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*3]= {0}; + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 3] = {0}; dump_index_id(key_buf, dd_type, gl_index_id); - rocksdb::Slice key= rocksdb::Slice((char*)key_buf, sizeof(key_buf)); + const rocksdb::Slice key = rocksdb::Slice((char *)key_buf, sizeof(key_buf)); - rocksdb::Status status= get_value(key, &value); - if (status.ok()) - { - found= true; + const rocksdb::Status status = get_value(key, &value); + if (status.ok()) { + found = true; } return found; } @@ -4250,31 +3641,27 @@ by drop_index_thread, or to track online index creation. */ void Rdb_dict_manager::start_ongoing_index_operation( - rocksdb::WriteBatch* batch, - const GL_INDEX_ID& gl_index_id, - Rdb_key_def::DATA_DICT_TYPE dd_type) -{ + rocksdb::WriteBatch *const batch, const GL_INDEX_ID &gl_index_id, + Rdb_key_def::DATA_DICT_TYPE dd_type) const { DBUG_ASSERT(dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING || dd_type == Rdb_key_def::DDL_CREATE_INDEX_ONGOING); - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*3]= {0}; - uchar value_buf[Rdb_key_def::VERSION_SIZE]= {0}; + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 3] = {0}; + uchar value_buf[Rdb_key_def::VERSION_SIZE] = {0}; dump_index_id(key_buf, dd_type, gl_index_id); // version as needed - if (dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING) - { + if (dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING) { rdb_netbuf_store_uint16(value_buf, Rdb_key_def::DDL_DROP_INDEX_ONGOING_VERSION); - } - else - { + } else { rdb_netbuf_store_uint16(value_buf, Rdb_key_def::DDL_CREATE_INDEX_ONGOING_VERSION); } - rocksdb::Slice key= rocksdb::Slice((char*)key_buf, sizeof(key_buf)); - rocksdb::Slice value= rocksdb::Slice((char*)value_buf, sizeof(value_buf)); + const rocksdb::Slice key = rocksdb::Slice((char *)key_buf, sizeof(key_buf)); + const rocksdb::Slice value = + rocksdb::Slice((char *)value_buf, sizeof(value_buf)); batch->Put(m_system_cfh, key, value); } @@ -4282,10 +3669,9 @@ Removing index_id from data dictionary to confirm drop_index_thread completed dropping entire key/values of the index_id */ -void Rdb_dict_manager::end_ongoing_index_operation(rocksdb::WriteBatch* batch, - const GL_INDEX_ID& gl_index_id, - Rdb_key_def::DATA_DICT_TYPE dd_type) -{ +void Rdb_dict_manager::end_ongoing_index_operation( + rocksdb::WriteBatch *const batch, const GL_INDEX_ID &gl_index_id, + Rdb_key_def::DATA_DICT_TYPE dd_type) const { DBUG_ASSERT(dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING || dd_type == Rdb_key_def::DDL_CREATE_INDEX_ONGOING); @@ -4296,9 +3682,8 @@ Returning true if there is no target index ids to be removed by drop_index_thread */ -bool Rdb_dict_manager::is_drop_index_empty() -{ - std::vector gl_index_ids; +bool Rdb_dict_manager::is_drop_index_empty() const { + std::unordered_set gl_index_ids; get_ongoing_drop_indexes(&gl_index_ids); return gl_index_ids.empty(); } @@ -4308,13 +3693,11 @@ that dropping indexes started, and adding data dictionary so that all associated indexes to be removed */ -void Rdb_dict_manager::add_drop_table(std::shared_ptr* key_descr, - uint32 n_keys, - rocksdb::WriteBatch *batch) -{ +void Rdb_dict_manager::add_drop_table( + std::shared_ptr *const key_descr, const uint32 &n_keys, + rocksdb::WriteBatch *const batch) const { std::unordered_set dropped_index_ids; - for (uint32 i = 0; i < n_keys; i++) - { + for (uint32 i = 0; i < n_keys; i++) { dropped_index_ids.insert(key_descr[i]->get_gl_index_id()); } @@ -4327,11 +3710,9 @@ all associated indexes to be removed */ void Rdb_dict_manager::add_drop_index( - const std::unordered_set& gl_index_ids, - rocksdb::WriteBatch *batch) -{ - for (const auto& gl_index_id : gl_index_ids) - { + const std::unordered_set &gl_index_ids, + rocksdb::WriteBatch *const batch) const { + for (const auto &gl_index_id : gl_index_ids) { log_start_drop_index(gl_index_id, "Begin"); start_drop_index(batch, gl_index_id); } @@ -4343,14 +3724,12 @@ indexes to be added. */ void Rdb_dict_manager::add_create_index( - const std::unordered_set& gl_index_ids, - rocksdb::WriteBatch *batch) -{ - for (const auto& gl_index_id : gl_index_ids) - { + const std::unordered_set &gl_index_ids, + rocksdb::WriteBatch *const batch) const { + for (const auto &gl_index_id : gl_index_ids) { // NO_LINT_DEBUG sql_print_information("RocksDB: Begin index creation (%u,%u)", - gl_index_id.cf_id, gl_index_id.index_id); + gl_index_id.cf_id, gl_index_id.index_id); start_create_index(batch, gl_index_id); } } @@ -4360,30 +3739,41 @@ finished dropping any index, or at the completion of online index creation. */ void Rdb_dict_manager::finish_indexes_operation( - const std::unordered_set& gl_index_ids, - Rdb_key_def::DATA_DICT_TYPE dd_type) -{ + const std::unordered_set &gl_index_ids, + Rdb_key_def::DATA_DICT_TYPE dd_type) const { DBUG_ASSERT(dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING || dd_type == Rdb_key_def::DDL_CREATE_INDEX_ONGOING); - std::unique_ptr wb= begin(); - rocksdb::WriteBatch *batch= wb.get(); + const std::unique_ptr wb = begin(); + rocksdb::WriteBatch *const batch = wb.get(); - for (const auto& gl_index_id : gl_index_ids) - { - if (is_index_operation_ongoing(gl_index_id, dd_type)) - { + std::unordered_set incomplete_create_indexes; + get_ongoing_create_indexes(&incomplete_create_indexes); + + for (const auto &gl_index_id : gl_index_ids) { + if (is_index_operation_ongoing(gl_index_id, dd_type)) { // NO_LINT_DEBUG sql_print_information("RocksDB: Finished %s (%u,%u)", - dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING ? - "filtering dropped index" : "index creation", - gl_index_id.cf_id, gl_index_id.index_id); + dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING + ? "filtering dropped index" + : "index creation", + gl_index_id.cf_id, gl_index_id.index_id); end_ongoing_index_operation(batch, gl_index_id, dd_type); + + /* + Remove the corresponding incomplete create indexes from data + dictionary as well + */ + if (dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING) { + if (incomplete_create_indexes.count(gl_index_id)) { + end_ongoing_index_operation(batch, gl_index_id, + Rdb_key_def::DDL_CREATE_INDEX_ONGOING); + } + } } - if (dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING) - { + if (dd_type == Rdb_key_def::DDL_DROP_INDEX_ONGOING) { delete_index_info(batch, gl_index_id); } } @@ -4395,164 +3785,154 @@ Rdb_dict_manager (at startup). If there is any index ids that are drop ongoing, printing out messages for diagnostics purposes. */ -void Rdb_dict_manager::resume_drop_indexes() -{ - std::vector gl_index_ids; +void Rdb_dict_manager::resume_drop_indexes() const { + std::unordered_set gl_index_ids; get_ongoing_drop_indexes(&gl_index_ids); - uint max_index_id_in_dict= 0; + uint max_index_id_in_dict = 0; get_max_index_id(&max_index_id_in_dict); - for (const auto& gl_index_id : gl_index_ids) - { + for (const auto &gl_index_id : gl_index_ids) { log_start_drop_index(gl_index_id, "Resume"); - if (max_index_id_in_dict < gl_index_id.index_id) - { + if (max_index_id_in_dict < gl_index_id.index_id) { sql_print_error("RocksDB: Found max index id %u from data dictionary " "but also found dropped index id (%u,%u) from drop_index " "dictionary. This should never happen and is possibly a " - "bug.", max_index_id_in_dict, gl_index_id.cf_id, + "bug.", + max_index_id_in_dict, gl_index_id.cf_id, gl_index_id.index_id); abort_with_stack_traces(); } } } -void Rdb_dict_manager::rollback_ongoing_index_creation() -{ - std::unique_ptr wb= begin(); - rocksdb::WriteBatch *batch= wb.get(); +void Rdb_dict_manager::rollback_ongoing_index_creation() const { + const std::unique_ptr wb = begin(); + rocksdb::WriteBatch *const batch = wb.get(); - std::vector gl_index_ids; + std::unordered_set gl_index_ids; get_ongoing_create_indexes(&gl_index_ids); - for (const auto& gl_index_id : gl_index_ids) - { + for (const auto &gl_index_id : gl_index_ids) { // NO_LINT_DEBUG sql_print_information("RocksDB: Removing incomplete create index (%u,%u)", - gl_index_id.cf_id, gl_index_id.index_id); + gl_index_id.cf_id, gl_index_id.index_id); start_drop_index(batch, gl_index_id); - end_ongoing_index_operation(batch, gl_index_id, - Rdb_key_def::DDL_CREATE_INDEX_ONGOING); } commit(batch); } void Rdb_dict_manager::log_start_drop_table( - const std::shared_ptr* key_descr, - uint32 n_keys, - const char* log_action) -{ + const std::shared_ptr *const key_descr, const uint32 &n_keys, + const char *const log_action) const { for (uint32 i = 0; i < n_keys; i++) { log_start_drop_index(key_descr[i]->get_gl_index_id(), log_action); } } void Rdb_dict_manager::log_start_drop_index(GL_INDEX_ID gl_index_id, - const char* log_action) -{ - uint16 m_index_dict_version= 0; - uchar m_index_type= 0; - uint16 kv_version= 0; - if (!get_index_info(gl_index_id, &m_index_dict_version, - &m_index_type, &kv_version)) - { - sql_print_error("RocksDB: Failed to get column family info " - "from index id (%u,%u). MyRocks data dictionary may " - "get corrupted.", gl_index_id.cf_id, gl_index_id.index_id); - abort_with_stack_traces(); + const char *log_action) const { + uint16 m_index_dict_version = 0; + uchar m_index_type = 0; + uint16 kv_version = 0; + + if (!get_index_info(gl_index_id, &m_index_dict_version, &m_index_type, + &kv_version)) { + /* + If we don't find the index info, it could be that it's because it was a + partially created index that isn't in the data dictionary yet that needs + to be rolled back. + */ + std::unordered_set incomplete_create_indexes; + get_ongoing_create_indexes(&incomplete_create_indexes); + + if (!incomplete_create_indexes.count(gl_index_id)) { + /* If it's not a partially created index, something is very wrong. */ + sql_print_error("RocksDB: Failed to get column family info " + "from index id (%u,%u). MyRocks data dictionary may " + "get corrupted.", + gl_index_id.cf_id, gl_index_id.index_id); + abort_with_stack_traces(); + } } sql_print_information("RocksDB: %s filtering dropped index (%u,%u)", log_action, gl_index_id.cf_id, gl_index_id.index_id); } -bool Rdb_dict_manager::get_max_index_id(uint32_t *index_id) -{ - bool found= false; +bool Rdb_dict_manager::get_max_index_id(uint32_t *const index_id) const { + bool found = false; std::string value; - rocksdb::Status status= get_value(m_key_slice_max_index_id, &value); - if (status.ok()) - { - const uchar* val= (const uchar*)value.c_str(); - uint16_t version= rdb_netbuf_to_uint16(val); - if (version == Rdb_key_def::MAX_INDEX_ID_VERSION) - { - *index_id= rdb_netbuf_to_uint32(val+Rdb_key_def::VERSION_SIZE); - found= true; + const rocksdb::Status status = get_value(m_key_slice_max_index_id, &value); + if (status.ok()) { + const uchar *const val = (const uchar *)value.c_str(); + const uint16_t &version = rdb_netbuf_to_uint16(val); + if (version == Rdb_key_def::MAX_INDEX_ID_VERSION) { + *index_id = rdb_netbuf_to_uint32(val + Rdb_key_def::VERSION_SIZE); + found = true; } } return found; } -bool Rdb_dict_manager::update_max_index_id(rocksdb::WriteBatch* batch, - const uint32_t index_id) -{ +bool Rdb_dict_manager::update_max_index_id(rocksdb::WriteBatch *const batch, + const uint32_t &index_id) const { DBUG_ASSERT(batch != nullptr); - uint32_t old_index_id= -1; - if (get_max_index_id(&old_index_id)) - { - if (old_index_id > index_id) - { + uint32_t old_index_id = -1; + if (get_max_index_id(&old_index_id)) { + if (old_index_id > index_id) { sql_print_error("RocksDB: Found max index id %u from data dictionary " "but trying to update to older value %u. This should " - "never happen and possibly a bug.", old_index_id, - index_id); + "never happen and possibly a bug.", + old_index_id, index_id); return true; } } - uchar value_buf[Rdb_key_def::VERSION_SIZE + Rdb_key_def::INDEX_NUMBER_SIZE]= - {0}; + uchar value_buf[Rdb_key_def::VERSION_SIZE + Rdb_key_def::INDEX_NUMBER_SIZE] = + {0}; rdb_netbuf_store_uint16(value_buf, Rdb_key_def::MAX_INDEX_ID_VERSION); rdb_netbuf_store_uint32(value_buf + Rdb_key_def::VERSION_SIZE, index_id); - rocksdb::Slice value= rocksdb::Slice((char*)value_buf, sizeof(value_buf)); + const rocksdb::Slice value = + rocksdb::Slice((char *)value_buf, sizeof(value_buf)); batch->Put(m_system_cfh, m_key_slice_max_index_id, value); return false; } void Rdb_dict_manager::add_stats( - rocksdb::WriteBatch* batch, - const std::vector& stats -) -{ + rocksdb::WriteBatch *const batch, + const std::vector &stats) const { DBUG_ASSERT(batch != nullptr); - for (const auto& it : stats) { - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*3]= {0}; + for (const auto &it : stats) { + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 3] = {0}; dump_index_id(key_buf, Rdb_key_def::INDEX_STATISTICS, it.m_gl_index_id); // IndexStats::materialize takes complete care of serialization including // storing the version - auto value = Rdb_index_stats::materialize( - std::vector{it}, 1.); + const auto value = + Rdb_index_stats::materialize(std::vector{it}, 1.); - batch->Put( - m_system_cfh, - rocksdb::Slice((char*)key_buf, sizeof(key_buf)), - value - ); + batch->Put(m_system_cfh, rocksdb::Slice((char *)key_buf, sizeof(key_buf)), + value); } } -Rdb_index_stats Rdb_dict_manager::get_stats(GL_INDEX_ID gl_index_id) -{ - uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE*3]= {0}; +Rdb_index_stats Rdb_dict_manager::get_stats(GL_INDEX_ID gl_index_id) const { + uchar key_buf[Rdb_key_def::INDEX_NUMBER_SIZE * 3] = {0}; dump_index_id(key_buf, Rdb_key_def::INDEX_STATISTICS, gl_index_id); std::string value; - rocksdb::Status status= get_value( - rocksdb::Slice(reinterpret_cast(key_buf), sizeof(key_buf)), - &value); - if (status.ok()) - { + const rocksdb::Status status = get_value( + rocksdb::Slice(reinterpret_cast(key_buf), sizeof(key_buf)), + &value); + if (status.ok()) { std::vector v; // unmaterialize checks if the version matches - if (Rdb_index_stats::unmaterialize(value, &v)== 0 && v.size() == 1) - { + if (Rdb_index_stats::unmaterialize(value, &v) == 0 && v.size() == 1) { return v[0]; } } @@ -4560,17 +3940,17 @@ return Rdb_index_stats(); } -uint Rdb_seq_generator::get_and_update_next_number(Rdb_dict_manager *dict) -{ +uint Rdb_seq_generator::get_and_update_next_number( + Rdb_dict_manager *const dict) { DBUG_ASSERT(dict != nullptr); uint res; mysql_mutex_lock(&m_mutex); - res= m_next_number++; + res = m_next_number++; - std::unique_ptr wb= dict->begin(); - rocksdb::WriteBatch *batch= wb.get(); + const std::unique_ptr wb = dict->begin(); + rocksdb::WriteBatch *const batch = wb.get(); DBUG_ASSERT(batch != nullptr); dict->update_max_index_id(batch, res); @@ -4581,4 +3961,4 @@ return res; } -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_datadic.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_datadic.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_datadic.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_datadic.h 2017-10-19 04:25:29.000000000 +0000 @@ -56,12 +56,13 @@ In order to accommodate both cases, we require both calls to be made and unpack_info is passed as context data between the two. */ -class Rdb_pack_field_context -{ - public: - explicit Rdb_pack_field_context(Rdb_string_writer *writer_arg) : - writer(writer_arg) - {} +class Rdb_pack_field_context { +public: + Rdb_pack_field_context(const Rdb_pack_field_context &) = delete; + Rdb_pack_field_context &operator=(const Rdb_pack_field_context &) = delete; + + explicit Rdb_pack_field_context(Rdb_string_writer *const writer_arg) + : writer(writer_arg) {} // NULL means we're not producing unpack_info. Rdb_string_writer *writer; @@ -73,51 +74,50 @@ C-style "virtual table" allowing different handling of packing logic based on the field type. See Rdb_field_packing::setup() implementation. */ -using rdb_make_unpack_info_t= void (*)(const Rdb_collation_codec *codec, - const Field *field, - Rdb_pack_field_context *pack_ctx); -using rdb_index_field_unpack_t= int (*)(Rdb_field_packing *fpi, Field *field, - uchar *field_ptr, - Rdb_string_reader *reader, - Rdb_string_reader *unpack_reader); -using rdb_index_field_skip_t= int (*)(const Rdb_field_packing *fpi, - const Field *field, - Rdb_string_reader *reader); -using rdb_index_field_pack_t= void (*)(Rdb_field_packing *fpi, Field *field, - uchar* buf, uchar **dst, - Rdb_pack_field_context *pack_ctx); +using rdb_make_unpack_info_t = void (*)(const Rdb_collation_codec *codec, + const Field *field, + Rdb_pack_field_context *pack_ctx); +using rdb_index_field_unpack_t = int (*)(Rdb_field_packing *fpi, Field *field, + uchar *field_ptr, + Rdb_string_reader *reader, + Rdb_string_reader *unpack_reader); +using rdb_index_field_skip_t = int (*)(const Rdb_field_packing *fpi, + const Field *field, + Rdb_string_reader *reader); +using rdb_index_field_pack_t = void (*)(Rdb_field_packing *fpi, Field *field, + uchar *buf, uchar **dst, + Rdb_pack_field_context *pack_ctx); -const uint RDB_INVALID_KEY_LEN= uint(-1); +const uint RDB_INVALID_KEY_LEN = uint(-1); /* How much one checksum occupies when stored in the record */ -const size_t RDB_CHECKSUM_SIZE= sizeof(uint32_t); +const size_t RDB_CHECKSUM_SIZE = sizeof(uint32_t); /* How much the checksum data occupies in record, in total. It is storing two checksums plus 1 tag-byte. */ -const size_t RDB_CHECKSUM_CHUNK_SIZE= 2 * RDB_CHECKSUM_SIZE + 1; +const size_t RDB_CHECKSUM_CHUNK_SIZE = 2 * RDB_CHECKSUM_SIZE + 1; /* Checksum data starts from CHECKSUM_DATA_TAG which is followed by two CRC32 checksums. */ -const char RDB_CHECKSUM_DATA_TAG= 0x01; +const char RDB_CHECKSUM_DATA_TAG = 0x01; /* Unpack data is variable length. It is a 1 tag-byte plus a two byte length field. The length field includes the header as well. */ -const char RDB_UNPACK_DATA_TAG= 0x02; -const size_t RDB_UNPACK_DATA_LEN_SIZE= sizeof(uint16_t); -const size_t RDB_UNPACK_HEADER_SIZE= sizeof(RDB_UNPACK_DATA_TAG) + - RDB_UNPACK_DATA_LEN_SIZE; +const char RDB_UNPACK_DATA_TAG = 0x02; +const size_t RDB_UNPACK_DATA_LEN_SIZE = sizeof(uint16_t); +const size_t RDB_UNPACK_HEADER_SIZE = + sizeof(RDB_UNPACK_DATA_TAG) + RDB_UNPACK_DATA_LEN_SIZE; // Possible return values for rdb_index_field_unpack_t functions. enum { - UNPACK_SUCCESS= 0, - UNPACK_FAILURE= 1, - UNPACK_INFO_MISSING= 2, + UNPACK_SUCCESS = 0, + UNPACK_FAILURE = 1, }; /* @@ -160,56 +160,55 @@ reads. */ -class Rdb_key_def -{ +class Rdb_key_def { public: /* Convert a key from KeyTupleFormat to mem-comparable form */ - uint pack_index_tuple(TABLE *tbl, uchar *pack_buffer, uchar *packed_tuple, - const uchar *key_tuple, key_part_map keypart_map) const; + uint pack_index_tuple(TABLE *const tbl, uchar *const pack_buffer, + uchar *const packed_tuple, const uchar *const key_tuple, + const key_part_map &keypart_map) const; /* Convert a key from Table->record format to mem-comparable form */ - uint pack_record(const TABLE *tbl, uchar *pack_buffer, const uchar *record, - uchar *packed_tuple, Rdb_string_writer *unpack_info, - bool should_store_checksums, - longlong hidden_pk_id= 0, uint n_key_parts= 0, - uint *n_null_fields= nullptr) const; + uint pack_record(const TABLE *const tbl, uchar *const pack_buffer, + const uchar *const record, uchar *const packed_tuple, + Rdb_string_writer *const unpack_info, + const bool &should_store_row_debug_checksums, + const longlong &hidden_pk_id = 0, uint n_key_parts = 0, + uint *const n_null_fields = nullptr) const; /* Pack the hidden primary key into mem-comparable form. */ - uint pack_hidden_pk(longlong hidden_pk_id, - uchar *packed_tuple) const; - int unpack_record(TABLE *table, uchar *buf, const rocksdb::Slice *packed_key, - const rocksdb::Slice *unpack_info, bool verify_checksums) - const; + uint pack_hidden_pk(const longlong &hidden_pk_id, + uchar *const packed_tuple) const; + int unpack_record(TABLE *const table, uchar *const buf, + const rocksdb::Slice *const packed_key, + const rocksdb::Slice *const unpack_info, + const bool &verify_row_debug_checksums) const; - static bool unpack_info_has_checksum(const rocksdb::Slice& unpack_info); + static bool unpack_info_has_checksum(const rocksdb::Slice &unpack_info); int compare_keys(const rocksdb::Slice *key1, const rocksdb::Slice *key2, - std::size_t* column_index) const; + std::size_t *const column_index) const; - size_t key_length(TABLE *table, const rocksdb::Slice &key) const; + size_t key_length(const TABLE *const table, const rocksdb::Slice &key) const; /* Get the key that is the "infimum" for this index */ - inline void get_infimum_key(uchar *key, uint *size) const - { + inline void get_infimum_key(uchar *const key, uint *const size) const { rdb_netbuf_store_index(key, m_index_number); - *size= INDEX_NUMBER_SIZE; + *size = INDEX_NUMBER_SIZE; } /* Get the key that is a "supremum" for this index */ - inline void get_supremum_key(uchar *key, uint *size) const - { - rdb_netbuf_store_index(key, m_index_number+1); - *size= INDEX_NUMBER_SIZE; + inline void get_supremum_key(uchar *const key, uint *const size) const { + rdb_netbuf_store_index(key, m_index_number + 1); + *size = INDEX_NUMBER_SIZE; } /* Make a key that is right after the given key. */ - static int successor(uchar *packed_tuple, uint len); + static int successor(uchar *const packed_tuple, const uint &len); /* This can be used to compare prefixes. if X is a prefix of Y, then we consider that X = Y. */ // b describes the lookup key, which can be a prefix of a. - int cmp_full_keys(const rocksdb::Slice& a, const rocksdb::Slice& b) const - { + int cmp_full_keys(const rocksdb::Slice &a, const rocksdb::Slice &b) const { DBUG_ASSERT(covers_key(a)); DBUG_ASSERT(covers_key(b)); @@ -217,8 +216,7 @@ } /* Check if given mem-comparable key belongs to this index */ - bool covers_key(const rocksdb::Slice &slice) const - { + bool covers_key(const rocksdb::Slice &slice) const { if (slice.size() < INDEX_NUMBER_SIZE) return false; @@ -235,42 +233,35 @@ form) */ bool value_matches_prefix(const rocksdb::Slice &value, - const rocksdb::Slice &prefix) const - { + const rocksdb::Slice &prefix) const { return covers_key(value) && !cmp_full_keys(value, prefix); } - uint32 get_keyno() const - { - return m_keyno; - } + uint32 get_keyno() const { return m_keyno; } - uint32 get_index_number() const - { - return m_index_number; - } + uint32 get_index_number() const { return m_index_number; } - GL_INDEX_ID get_gl_index_id() const - { - GL_INDEX_ID gl_index_id = { m_cf_handle->GetID(), m_index_number }; + GL_INDEX_ID get_gl_index_id() const { + const GL_INDEX_ID gl_index_id = {m_cf_handle->GetID(), m_index_number}; return gl_index_id; } + int read_memcmp_key_part(const TABLE *table_arg, Rdb_string_reader *reader, + const uint part_num) const; + /* Must only be called for secondary keys: */ - uint get_primary_key_tuple(TABLE *tbl, - const std::shared_ptr& pk_descr, - const rocksdb::Slice *key, uchar *pk_buffer) const; + uint get_primary_key_tuple(const TABLE *const tbl, + const Rdb_key_def &pk_descr, + const rocksdb::Slice *const key, + uchar *const pk_buffer) const; + + uint get_memcmp_sk_parts(const TABLE *table, const rocksdb::Slice &key, + uchar *sk_buffer, uint *n_null_fields) const; /* Return max length of mem-comparable form */ - uint max_storage_fmt_length() const - { - return m_maxlength; - } + uint max_storage_fmt_length() const { return m_maxlength; } - uint get_key_parts() const - { - return m_key_parts; - } + uint get_key_parts() const { return m_key_parts; } /* Get a field object for key part #part_no @@ -282,59 +273,60 @@ Internally, we always extend all indexes with PK columns. This function uses our definition of how the index is Extended. */ - inline Field* get_table_field_for_part_no(TABLE *table, uint part_no) const; + inline Field *get_table_field_for_part_no(TABLE *table, uint part_no) const; + + const std::string &get_name() const { return m_name; } - const std::string& get_name() const { - return m_name; + const rocksdb::SliceTransform *get_extractor() const { + return m_prefix_extractor.get(); } - Rdb_key_def(const Rdb_key_def& k); + Rdb_key_def &operator=(const Rdb_key_def &) = delete; + Rdb_key_def(const Rdb_key_def &k); Rdb_key_def(uint indexnr_arg, uint keyno_arg, - rocksdb::ColumnFamilyHandle* cf_handle_arg, - uint16_t index_dict_version_arg, - uchar index_type_arg, - uint16_t kv_format_version_arg, - bool is_reverse_cf_arg, bool is_auto_cf_arg, - const char* name, - Rdb_index_stats stats= Rdb_index_stats()); + rocksdb::ColumnFamilyHandle *cf_handle_arg, + uint16_t index_dict_version_arg, uchar index_type_arg, + uint16_t kv_format_version_arg, bool is_reverse_cf_arg, + bool is_auto_cf_arg, const char *name, + Rdb_index_stats stats = Rdb_index_stats()); ~Rdb_key_def(); enum { - INDEX_NUMBER_SIZE= 4, - VERSION_SIZE= 2, - CF_NUMBER_SIZE= 4, - CF_FLAG_SIZE= 4, - PACKED_SIZE= 4, // one int + INDEX_NUMBER_SIZE = 4, + VERSION_SIZE = 2, + CF_NUMBER_SIZE = 4, + CF_FLAG_SIZE = 4, + PACKED_SIZE = 4, // one int }; // bit flags for combining bools when writing to disk enum { - REVERSE_CF_FLAG= 1, - AUTO_CF_FLAG= 2, + REVERSE_CF_FLAG = 1, + AUTO_CF_FLAG = 2, }; // Data dictionary types enum DATA_DICT_TYPE { - DDL_ENTRY_INDEX_START_NUMBER= 1, - INDEX_INFO= 2, - CF_DEFINITION= 3, - BINLOG_INFO_INDEX_NUMBER= 4, - DDL_DROP_INDEX_ONGOING= 5, - INDEX_STATISTICS= 6, - MAX_INDEX_ID= 7, - DDL_CREATE_INDEX_ONGOING= 8, - END_DICT_INDEX_ID= 255 + DDL_ENTRY_INDEX_START_NUMBER = 1, + INDEX_INFO = 2, + CF_DEFINITION = 3, + BINLOG_INFO_INDEX_NUMBER = 4, + DDL_DROP_INDEX_ONGOING = 5, + INDEX_STATISTICS = 6, + MAX_INDEX_ID = 7, + DDL_CREATE_INDEX_ONGOING = 8, + END_DICT_INDEX_ID = 255 }; // Data dictionary schema version. Introduce newer versions // if changing schema layout enum { - DDL_ENTRY_INDEX_VERSION= 1, - CF_DEFINITION_VERSION= 1, - BINLOG_INFO_INDEX_NUMBER_VERSION= 1, - DDL_DROP_INDEX_ONGOING_VERSION= 1, - MAX_INDEX_ID_VERSION= 1, - DDL_CREATE_INDEX_ONGOING_VERSION= 1, + DDL_ENTRY_INDEX_VERSION = 1, + CF_DEFINITION_VERSION = 1, + BINLOG_INFO_INDEX_NUMBER_VERSION = 1, + DDL_DROP_INDEX_ONGOING_VERSION = 1, + MAX_INDEX_ID_VERSION = 1, + DDL_CREATE_INDEX_ONGOING_VERSION = 1, // Version for index stats is stored in IndexStats struct }; @@ -342,7 +334,7 @@ // INDEX_INFO layout. Update INDEX_INFO_VERSION_LATEST to point to the // latest version number. enum { - INDEX_INFO_VERSION_INITIAL= 1, // Obsolete + INDEX_INFO_VERSION_INITIAL = 1, // Obsolete INDEX_INFO_VERSION_KV_FORMAT, INDEX_INFO_VERSION_GLOBAL_ID, // There is no change to data format in this version, but this version @@ -351,69 +343,67 @@ // check inadvertently. INDEX_INFO_VERSION_VERIFY_KV_FORMAT, // This normally point to the latest (currently it does). - INDEX_INFO_VERSION_LATEST= INDEX_INFO_VERSION_VERIFY_KV_FORMAT, + INDEX_INFO_VERSION_LATEST = INDEX_INFO_VERSION_VERIFY_KV_FORMAT, }; // MyRocks index types enum { - INDEX_TYPE_PRIMARY= 1, - INDEX_TYPE_SECONDARY= 2, - INDEX_TYPE_HIDDEN_PRIMARY= 3, + INDEX_TYPE_PRIMARY = 1, + INDEX_TYPE_SECONDARY = 2, + INDEX_TYPE_HIDDEN_PRIMARY = 3, }; // Key/Value format version for each index type enum { - PRIMARY_FORMAT_VERSION_INITIAL= 10, + PRIMARY_FORMAT_VERSION_INITIAL = 10, // This change includes: // - For columns that can be unpacked with unpack_info, PK // stores the unpack_info. // - DECIMAL datatype is no longer stored in the row (because // it can be decoded from its mem-comparable form) // - VARCHAR-columns use endspace-padding. - PRIMARY_FORMAT_VERSION_UPDATE1= 11, - PRIMARY_FORMAT_VERSION_LATEST= PRIMARY_FORMAT_VERSION_UPDATE1, + PRIMARY_FORMAT_VERSION_UPDATE1 = 11, + PRIMARY_FORMAT_VERSION_LATEST = PRIMARY_FORMAT_VERSION_UPDATE1, - SECONDARY_FORMAT_VERSION_INITIAL= 10, + SECONDARY_FORMAT_VERSION_INITIAL = 10, // This change the SK format to include unpack_info. - SECONDARY_FORMAT_VERSION_UPDATE1= 11, - SECONDARY_FORMAT_VERSION_LATEST= SECONDARY_FORMAT_VERSION_UPDATE1, + SECONDARY_FORMAT_VERSION_UPDATE1 = 11, + SECONDARY_FORMAT_VERSION_LATEST = SECONDARY_FORMAT_VERSION_UPDATE1, }; - void setup(const TABLE *table, const Rdb_tbl_def *tbl_def); + void setup(const TABLE *const table, const Rdb_tbl_def *const tbl_def); rocksdb::ColumnFamilyHandle *get_cf() const { return m_cf_handle; } /* Check if keypart #kp can be unpacked from index tuple */ - inline bool can_unpack(uint kp) const; + inline bool can_unpack(const uint &kp) const; /* Check if keypart #kp needs unpack info */ - inline bool has_unpack_info(uint kp) const; + inline bool has_unpack_info(const uint &kp) const; /* Check if given table has a primary key */ - static bool table_has_hidden_pk(const TABLE* table); + static bool table_has_hidden_pk(const TABLE *const table); - void report_checksum_mismatch(bool is_key, const char *data, - size_t data_size) const; + void report_checksum_mismatch(const bool &is_key, const char *const data, + const size_t data_size) const; /* Check if index is at least pk_min if it is a PK, or at least sk_min if SK.*/ - bool index_format_min_check(int pk_min, int sk_min) const; + bool index_format_min_check(const int &pk_min, const int &sk_min) const; private: - #ifndef DBUG_OFF - inline bool is_storage_available(int offset, int needed) const - { - int storage_length= static_cast(max_storage_fmt_length()); + inline bool is_storage_available(const int &offset, const int &needed) const { + const int storage_length = static_cast(max_storage_fmt_length()); return (storage_length - offset) >= needed; } -#endif // DBUG_OFF +#endif // DBUG_OFF /* Global number of this index (used as prefix in StorageFormat) */ const uint32 m_index_number; uchar m_index_number_storage_form[INDEX_NUMBER_SIZE]; - rocksdb::ColumnFamilyHandle* m_cf_handle; + rocksdb::ColumnFamilyHandle *m_cf_handle; public: uint16_t m_index_dict_version; @@ -426,9 +416,9 @@ bool m_is_auto_cf; std::string m_name; mutable Rdb_index_stats m_stats; -private: - friend class Rdb_tbl_def; // for m_index_number above +private: + friend class Rdb_tbl_def; // for m_index_number above /* Number of key parts in the primary key*/ uint m_pk_key_parts; @@ -450,6 +440,9 @@ */ uint m_key_parts; + /* Prefix extractor for the column family of the key definiton */ + std::shared_ptr m_prefix_extractor; + /* Maximum length of the mem-comparable form. */ uint m_maxlength; @@ -474,8 +467,7 @@ // // We have m_dec_idx[idx][dst] = src to get our original character back. // -struct Rdb_collation_codec -{ +struct Rdb_collation_codec { const my_core::CHARSET_INFO *m_cs; // The first element unpacks VARCHAR(n), the second one - CHAR(n). std::array m_make_unpack_info_func; @@ -490,13 +482,15 @@ extern mysql_mutex_t rdb_collation_data_mutex; extern mysql_mutex_t rdb_mem_cmp_space_mutex; -extern std::array - rdb_collation_data; +extern std::array + rdb_collation_data; - -class Rdb_field_packing -{ +class Rdb_field_packing { public: + Rdb_field_packing(const Rdb_field_packing &) = delete; + Rdb_field_packing &operator=(const Rdb_field_packing &) = delete; + Rdb_field_packing() = default; + /* Length of mem-comparable image of the field, in bytes */ int m_max_image_len; @@ -512,25 +506,22 @@ const CHARSET_INFO *m_varchar_charset; // (Valid when Variable Length Space Padded Encoding is used): - uint m_segment_size; // size of segment used + uint m_segment_size; // size of segment used // number of bytes used to store number of trimmed (or added) // spaces in the upack_info bool m_unpack_info_uses_two_bytes; - const std::vector* space_xfrm; + const std::vector *space_xfrm; size_t space_xfrm_len; size_t space_mb_len; - const Rdb_collation_codec* m_charset_codec; + const Rdb_collation_codec *m_charset_codec; /* @return TRUE: this field makes use of unpack_info. */ - bool uses_unpack_info() const - { - return (m_make_unpack_info_func != nullptr); - } + bool uses_unpack_info() const { return (m_make_unpack_info_func != nullptr); } /* TRUE means unpack_info stores the original field value */ bool m_unpack_info_stores_value; @@ -576,11 +567,13 @@ */ uint m_keynr; uint m_key_part; + public: - bool setup(const Rdb_key_def *key_descr, const Field *field, - uint keynr_arg, uint key_part_arg, uint16 key_length); - Field *get_field_in_table(const TABLE *tbl) const; - void fill_hidden_pk_val(uchar **dst, longlong hidden_pk_id) const; + bool setup(const Rdb_key_def *const key_descr, const Field *const field, + const uint &keynr_arg, const uint &key_part_arg, + const uint16 &key_length); + Field *get_field_in_table(const TABLE *const tbl) const; + void fill_hidden_pk_val(uchar **dst, const longlong &hidden_pk_id) const; }; /* @@ -590,9 +583,10 @@ For encoding/decoding of index tuples, see Rdb_key_def. */ -class Rdb_field_encoder -{ - public: +class Rdb_field_encoder { +public: + Rdb_field_encoder(const Rdb_field_encoder &) = delete; + Rdb_field_encoder &operator=(const Rdb_field_encoder &) = delete; /* STORE_NONE is set when a column can be decoded solely from their mem-comparable form. @@ -611,7 +605,7 @@ uint m_null_offset; uint16 m_field_index; - uchar m_null_mask; // 0 means the field cannot be null + uchar m_null_mask; // 0 means the field cannot be null my_core::enum_field_types m_field_type; @@ -619,33 +613,28 @@ bool maybe_null() const { return m_null_mask != 0; } - bool uses_variable_len_encoding() const - { + bool uses_variable_len_encoding() const { return (m_field_type == MYSQL_TYPE_BLOB || m_field_type == MYSQL_TYPE_VARCHAR); } }; -inline Field* Rdb_key_def::get_table_field_for_part_no(TABLE *table, - uint part_no) const -{ +inline Field *Rdb_key_def::get_table_field_for_part_no(TABLE *table, + uint part_no) const { DBUG_ASSERT(part_no < get_key_parts()); return m_pack_info[part_no].get_field_in_table(table); } -inline bool Rdb_key_def::can_unpack(uint kp) const -{ +inline bool Rdb_key_def::can_unpack(const uint &kp) const { DBUG_ASSERT(kp < m_key_parts); return (m_pack_info[kp].m_unpack_func != nullptr); } -inline bool Rdb_key_def::has_unpack_info(uint kp) const -{ +inline bool Rdb_key_def::has_unpack_info(const uint &kp) const { DBUG_ASSERT(kp < m_key_parts); return m_pack_info[kp].uses_unpack_info(); } - /* A table definition. This is an entry in the mapping @@ -655,9 +644,8 @@ That's why we keep auto_increment value here, too. */ -class Rdb_tbl_def -{ - private: +class Rdb_tbl_def { +private: void check_if_is_mysql_system_table(); /* Stores 'dbname.tablename' */ @@ -668,24 +656,24 @@ std::string m_tablename; std::string m_partition; - void set_name(const std::string& name); + void set_name(const std::string &name); + +public: + Rdb_tbl_def(const Rdb_tbl_def &) = delete; + Rdb_tbl_def &operator=(const Rdb_tbl_def &) = delete; - public: - explicit Rdb_tbl_def(const std::string& name) : - m_key_descr_arr(nullptr), m_hidden_pk_val(1), m_auto_incr_val(1) - { + explicit Rdb_tbl_def(const std::string &name) + : m_key_descr_arr(nullptr), m_hidden_pk_val(1), m_auto_incr_val(1) { set_name(name); } - Rdb_tbl_def(const char* name, size_t len) : - m_key_descr_arr(nullptr), m_hidden_pk_val(1), m_auto_incr_val(1) - { + Rdb_tbl_def(const char *const name, const size_t &len) + : m_key_descr_arr(nullptr), m_hidden_pk_val(1), m_auto_incr_val(1) { set_name(std::string(name, len)); } - explicit Rdb_tbl_def(const rocksdb::Slice& slice, size_t pos= 0) : - m_key_descr_arr(nullptr), m_hidden_pk_val(1), m_auto_incr_val(1) - { + explicit Rdb_tbl_def(const rocksdb::Slice &slice, const size_t &pos = 0) + : m_key_descr_arr(nullptr), m_hidden_pk_val(1), m_auto_incr_val(1) { set_name(std::string(slice.data() + pos, slice.size() - pos)); } @@ -695,7 +683,7 @@ uint m_key_count; /* Array of index descriptors */ - std::shared_ptr* m_key_descr_arr; + std::shared_ptr *m_key_descr_arr; std::atomic m_hidden_pk_val; std::atomic m_auto_incr_val; @@ -703,47 +691,43 @@ /* Is this a system table */ bool m_is_mysql_system_table; - bool put_dict(Rdb_dict_manager *dict, rocksdb::WriteBatch *batch, - uchar *key, size_t keylen); + bool put_dict(Rdb_dict_manager *const dict, rocksdb::WriteBatch *const batch, + uchar *const key, const size_t &keylen); - const std::string& full_tablename() const { return m_dbname_tablename; } - const std::string& base_dbname() const { return m_dbname; } - const std::string& base_tablename() const { return m_tablename; } - const std::string& base_partition() const { return m_partition; } + const std::string &full_tablename() const { return m_dbname_tablename; } + const std::string &base_dbname() const { return m_dbname; } + const std::string &base_tablename() const { return m_tablename; } + const std::string &base_partition() const { return m_partition; } }; - /* A thread-safe sequential number generator. Its performance is not a concern hence it is ok to protect it by a mutex. */ -class Rdb_seq_generator -{ - uint m_next_number= 0; +class Rdb_seq_generator { + uint m_next_number = 0; mysql_mutex_t m_mutex; -public: - void init(uint initial_number) - { - mysql_mutex_init(0 , &m_mutex, MY_MUTEX_INIT_FAST); - m_next_number= initial_number; - } - uint get_and_update_next_number(Rdb_dict_manager *dict); +public: + Rdb_seq_generator(const Rdb_seq_generator &) = delete; + Rdb_seq_generator &operator=(const Rdb_seq_generator &) = delete; + Rdb_seq_generator() = default; - void cleanup() - { - mysql_mutex_destroy(&m_mutex); + void init(const uint &initial_number) { + mysql_mutex_init(0, &m_mutex, MY_MUTEX_INIT_FAST); + m_next_number = initial_number; } -}; + uint get_and_update_next_number(Rdb_dict_manager *const dict); -interface Rdb_tables_scanner -{ - virtual int add_table(Rdb_tbl_def* tdef) =0; + void cleanup() { mysql_mutex_destroy(&m_mutex); } }; +interface Rdb_tables_scanner { + virtual int add_table(Rdb_tbl_def * tdef) = 0; +}; /* This contains a mapping of @@ -753,10 +737,9 @@ objects are shared among all threads. */ -class Rdb_ddl_manager -{ - Rdb_dict_manager *m_dict= nullptr; - my_core::HASH m_ddl_hash; // Contains Rdb_tbl_def elements +class Rdb_ddl_manager { + Rdb_dict_manager *m_dict = nullptr; + my_core::HASH m_ddl_hash; // Contains Rdb_tbl_def elements // maps index id to std::map> m_index_num_to_keydef; mysql_rwlock_t m_rwlock; @@ -766,93 +749,57 @@ // It is produced by event listener (ie compaction and flush threads) // and consumed by the rocksdb background thread std::map m_stats2store; + + const std::shared_ptr &find(GL_INDEX_ID gl_index_id); + public: + Rdb_ddl_manager(const Rdb_ddl_manager &) = delete; + Rdb_ddl_manager &operator=(const Rdb_ddl_manager &) = delete; + Rdb_ddl_manager() {} + /* Load the data dictionary from on-disk storage */ - bool init(Rdb_dict_manager *dict_arg, Rdb_cf_manager *cf_manager, - uint32_t validate_tables); + bool init(Rdb_dict_manager *const dict_arg, Rdb_cf_manager *const cf_manager, + const uint32_t &validate_tables); void cleanup(); - Rdb_tbl_def* find(const std::string& table_name, bool lock= true); - const std::shared_ptr& find(GL_INDEX_ID gl_index_id); - std::shared_ptr safe_find(GL_INDEX_ID gl_index_id); - void set_stats( - const std::unordered_map& stats); - void adjust_stats( - const std::vector& new_data, - const std::vector& deleted_data - =std::vector()); - void persist_stats(bool sync = false); + Rdb_tbl_def *find(const std::string &table_name, const bool &lock = true); + std::shared_ptr safe_find(GL_INDEX_ID gl_index_id); + void set_stats(const std::unordered_map &stats); + void adjust_stats(const std::vector &new_data, + const std::vector &deleted_data = + std::vector()); + void persist_stats(const bool &sync = false); /* Modify the mapping and write it to on-disk storage */ - int put_and_write(Rdb_tbl_def *key_descr, rocksdb::WriteBatch *batch); - void remove(Rdb_tbl_def *rec, rocksdb::WriteBatch *batch, bool lock= true); - bool rename(const std::string& from, const std::string& to, - rocksdb::WriteBatch *batch); + int put_and_write(Rdb_tbl_def *const key_descr, + rocksdb::WriteBatch *const batch); + void remove(Rdb_tbl_def *const rec, rocksdb::WriteBatch *const batch, + const bool &lock = true); + bool rename(const std::string &from, const std::string &to, + rocksdb::WriteBatch *const batch); - uint get_and_update_next_number(Rdb_dict_manager *dict) - { return m_sequence.get_and_update_next_number(dict); } + uint get_and_update_next_number(Rdb_dict_manager *const dict) { + return m_sequence.get_and_update_next_number(dict); + } /* Walk the data dictionary */ - int scan_for_tables(Rdb_tables_scanner* tables_scanner); + int scan_for_tables(Rdb_tables_scanner *tables_scanner); - void erase_index_num(GL_INDEX_ID gl_index_id); + void erase_index_num(const GL_INDEX_ID &gl_index_id); private: /* Put the data into in-memory table (only) */ - int put(Rdb_tbl_def *key_descr, bool lock= true); + int put(Rdb_tbl_def *const key_descr, const bool &lock = true); /* Helper functions to be passed to my_core::HASH object */ - static const uchar* get_hash_key(Rdb_tbl_def *rec, size_t *length, + static const uchar *get_hash_key(Rdb_tbl_def *const rec, size_t *const length, my_bool not_used __attribute__((unused))); - static void free_hash_elem(void* data); + static void free_hash_elem(void *const data); bool validate_schemas(); }; - -/* - Writing binlog information into RocksDB at commit(), - and retrieving binlog information at crash recovery. - commit() and recovery are always executed by at most single client - at the same time, so concurrency control is not needed. - - Binlog info is stored in RocksDB as the following. - key: BINLOG_INFO_INDEX_NUMBER - value: packed single row: - binlog_name_length (2 byte form) - binlog_name - binlog_position (4 byte form) - binlog_gtid_length (2 byte form) - binlog_gtid -*/ -class Rdb_binlog_manager -{ -public: - bool init(Rdb_dict_manager *dict); - void cleanup(); - void update(const char* binlog_name, const my_off_t binlog_pos, - const char* binlog_gtid, rocksdb::WriteBatchBase* batch); - bool read(char* binlog_name, my_off_t* binlog_pos, char* binlog_gtid); - void update_slave_gtid_info(uint id, const char* db, const char* gtid, - rocksdb::WriteBatchBase *write_batch); - -private: - Rdb_dict_manager *m_dict= nullptr; - uchar m_key_buf[Rdb_key_def::INDEX_NUMBER_SIZE]= {0}; - rocksdb::Slice m_key_slice; - - rocksdb::Slice pack_value(uchar *buf, - const char *binlog_name, - const my_off_t binlog_pos, - const char *binlog_gtid); - bool unpack_value(const uchar *value, char *binlog_name, - my_off_t *binlog_pos, char *binlog_gtid); - - std::atomic m_slave_gtid_info_tbl; -}; - - /* Rdb_dict_manager manages how MySQL on RocksDB (MyRocks) stores its internal data dictionary. @@ -904,151 +851,140 @@ begin() and commit() to make it easier to do atomic operations. */ -class Rdb_dict_manager -{ +class Rdb_dict_manager { private: mysql_mutex_t m_mutex; - rocksdb::DB *m_db= nullptr; - rocksdb::ColumnFamilyHandle *m_system_cfh= nullptr; + rocksdb::DB *m_db = nullptr; + rocksdb::ColumnFamilyHandle *m_system_cfh = nullptr; /* Utility to put INDEX_INFO and CF_DEFINITION */ - uchar m_key_buf_max_index_id[Rdb_key_def::INDEX_NUMBER_SIZE]= {0}; + uchar m_key_buf_max_index_id[Rdb_key_def::INDEX_NUMBER_SIZE] = {0}; rocksdb::Slice m_key_slice_max_index_id; - static void dump_index_id(uchar *netbuf, + static void dump_index_id(uchar *const netbuf, Rdb_key_def::DATA_DICT_TYPE dict_type, const GL_INDEX_ID &gl_index_id); - void delete_with_prefix(rocksdb::WriteBatch* batch, + void delete_with_prefix(rocksdb::WriteBatch *const batch, Rdb_key_def::DATA_DICT_TYPE dict_type, const GL_INDEX_ID &gl_index_id) const; /* Functions for fast DROP TABLE/INDEX */ - void resume_drop_indexes(); - void log_start_drop_table(const std::shared_ptr* key_descr, - uint32 n_keys, - const char* log_action); + void resume_drop_indexes() const; + void log_start_drop_table(const std::shared_ptr *const key_descr, + const uint32 &n_keys, + const char *const log_action) const; void log_start_drop_index(GL_INDEX_ID gl_index_id, - const char* log_action); + const char *log_action) const; + public: - bool init(rocksdb::DB *rdb_dict, Rdb_cf_manager *cf_manager); + Rdb_dict_manager(const Rdb_dict_manager &) = delete; + Rdb_dict_manager &operator=(const Rdb_dict_manager &) = delete; + Rdb_dict_manager() = default; - inline void cleanup() - { - mysql_mutex_destroy(&m_mutex); - } + bool init(rocksdb::DB *const rdb_dict, Rdb_cf_manager *const cf_manager); - inline void lock() - { - mysql_mutex_lock(&m_mutex); - } + inline void cleanup() { mysql_mutex_destroy(&m_mutex); } - inline void unlock() - { - mysql_mutex_unlock(&m_mutex); - } + inline void lock() { mysql_mutex_lock(&m_mutex); } + + inline void unlock() { mysql_mutex_unlock(&m_mutex); } /* Raw RocksDB operations */ - std::unique_ptr begin(); - int commit(rocksdb::WriteBatch *batch, bool sync = true); - rocksdb::Status get_value(const rocksdb::Slice& key, - std::string *value) const; - void put_key(rocksdb::WriteBatchBase *batch, const rocksdb::Slice &key, - const rocksdb::Slice &value); + std::unique_ptr begin() const; + int commit(rocksdb::WriteBatch *const batch, const bool &sync = true) const; + rocksdb::Status get_value(const rocksdb::Slice &key, + std::string *const value) const; + void put_key(rocksdb::WriteBatchBase *const batch, const rocksdb::Slice &key, + const rocksdb::Slice &value) const; void delete_key(rocksdb::WriteBatchBase *batch, const rocksdb::Slice &key) const; - rocksdb::Iterator *new_iterator(); + rocksdb::Iterator *new_iterator() const; /* Internal Index id => CF */ void add_or_update_index_cf_mapping(rocksdb::WriteBatch *batch, const uchar index_type, const uint16_t kv_version, const uint index_id, - const uint cf_id); - void delete_index_info(rocksdb::WriteBatch* batch, + const uint cf_id) const; + void delete_index_info(rocksdb::WriteBatch *batch, const GL_INDEX_ID &index_id) const; bool get_index_info(const GL_INDEX_ID &gl_index_id, - uint16_t *index_dict_version, - uchar *index_type, uint16_t *kv_version); + uint16_t *index_dict_version, uchar *index_type, + uint16_t *kv_version) const; /* CF id => CF flags */ - void add_cf_flags(rocksdb::WriteBatch *batch, - const uint cf_id, - const uint cf_flags); - bool get_cf_flags(const uint cf_id, uint *cf_flags); + void add_cf_flags(rocksdb::WriteBatch *const batch, const uint &cf_id, + const uint &cf_flags) const; + bool get_cf_flags(const uint &cf_id, uint *const cf_flags) const; /* Functions for fast CREATE/DROP TABLE/INDEX */ - void get_ongoing_index_operation(std::vector* gl_index_ids, - Rdb_key_def::DATA_DICT_TYPE dd_type); - bool is_index_operation_ongoing(const GL_INDEX_ID& gl_index_id, - Rdb_key_def::DATA_DICT_TYPE dd_type); - void start_ongoing_index_operation(rocksdb::WriteBatch* batch, - const GL_INDEX_ID& gl_index_id, - Rdb_key_def::DATA_DICT_TYPE dd_type); - void end_ongoing_index_operation(rocksdb::WriteBatch* batch, - const GL_INDEX_ID& gl_index_id, - Rdb_key_def::DATA_DICT_TYPE dd_type); - bool is_drop_index_empty(); - void add_drop_table(std::shared_ptr* key_descr, uint32 n_keys, - rocksdb::WriteBatch *batch); - void add_drop_index(const std::unordered_set& gl_index_ids, - rocksdb::WriteBatch *batch); - void add_create_index(const std::unordered_set& gl_index_ids, - rocksdb::WriteBatch *batch); - void finish_indexes_operation( - const std::unordered_set& gl_index_ids, - Rdb_key_def::DATA_DICT_TYPE dd_type); - void rollback_ongoing_index_creation(); + void + get_ongoing_index_operation(std::unordered_set *gl_index_ids, + Rdb_key_def::DATA_DICT_TYPE dd_type) const; + bool is_index_operation_ongoing(const GL_INDEX_ID &gl_index_id, + Rdb_key_def::DATA_DICT_TYPE dd_type) const; + void start_ongoing_index_operation(rocksdb::WriteBatch *batch, + const GL_INDEX_ID &gl_index_id, + Rdb_key_def::DATA_DICT_TYPE dd_type) const; + void end_ongoing_index_operation(rocksdb::WriteBatch *const batch, + const GL_INDEX_ID &gl_index_id, + Rdb_key_def::DATA_DICT_TYPE dd_type) const; + bool is_drop_index_empty() const; + void add_drop_table(std::shared_ptr *const key_descr, + const uint32 &n_keys, + rocksdb::WriteBatch *const batch) const; + void add_drop_index(const std::unordered_set &gl_index_ids, + rocksdb::WriteBatch *const batch) const; + void add_create_index(const std::unordered_set &gl_index_ids, + rocksdb::WriteBatch *const batch) const; + void + finish_indexes_operation(const std::unordered_set &gl_index_ids, + Rdb_key_def::DATA_DICT_TYPE dd_type) const; + void rollback_ongoing_index_creation() const; - inline void get_ongoing_drop_indexes(std::vector* gl_index_ids) - { + inline void get_ongoing_drop_indexes( + std::unordered_set *gl_index_ids) const { get_ongoing_index_operation(gl_index_ids, Rdb_key_def::DDL_DROP_INDEX_ONGOING); } - inline void get_ongoing_create_indexes(std::vector* gl_index_ids) - { + inline void get_ongoing_create_indexes( + std::unordered_set *gl_index_ids) const { get_ongoing_index_operation(gl_index_ids, Rdb_key_def::DDL_CREATE_INDEX_ONGOING); } inline void start_drop_index(rocksdb::WriteBatch *wb, - const GL_INDEX_ID& gl_index_id) - { + const GL_INDEX_ID &gl_index_id) const { start_ongoing_index_operation(wb, gl_index_id, Rdb_key_def::DDL_DROP_INDEX_ONGOING); } inline void start_create_index(rocksdb::WriteBatch *wb, - const GL_INDEX_ID& gl_index_id) - { + const GL_INDEX_ID &gl_index_id) const { start_ongoing_index_operation(wb, gl_index_id, Rdb_key_def::DDL_CREATE_INDEX_ONGOING); } inline void finish_drop_indexes( - const std::unordered_set& gl_index_ids) - { - finish_indexes_operation(gl_index_ids, - Rdb_key_def::DDL_DROP_INDEX_ONGOING); + const std::unordered_set &gl_index_ids) const { + finish_indexes_operation(gl_index_ids, Rdb_key_def::DDL_DROP_INDEX_ONGOING); } inline void finish_create_indexes( - const std::unordered_set& gl_index_ids) - { + const std::unordered_set &gl_index_ids) const { finish_indexes_operation(gl_index_ids, Rdb_key_def::DDL_CREATE_INDEX_ONGOING); } - inline bool is_drop_index_ongoing(const GL_INDEX_ID& gl_index_id) - { + inline bool is_drop_index_ongoing(const GL_INDEX_ID &gl_index_id) const { return is_index_operation_ongoing(gl_index_id, Rdb_key_def::DDL_DROP_INDEX_ONGOING); } - inline bool is_create_index_ongoing(const GL_INDEX_ID& gl_index_id) - { + inline bool is_create_index_ongoing(const GL_INDEX_ID &gl_index_id) const { return is_index_operation_ongoing(gl_index_id, Rdb_key_def::DDL_CREATE_INDEX_ONGOING); } - bool get_max_index_id(uint32_t *index_id); - bool update_max_index_id(rocksdb::WriteBatch* batch, - const uint32_t index_id); - void add_stats(rocksdb::WriteBatch* batch, - const std::vector& stats); - Rdb_index_stats get_stats(GL_INDEX_ID gl_index_id); + bool get_max_index_id(uint32_t *const index_id) const; + bool update_max_index_id(rocksdb::WriteBatch *const batch, + const uint32_t &index_id) const; + void add_stats(rocksdb::WriteBatch *const batch, + const std::vector &stats) const; + Rdb_index_stats get_stats(GL_INDEX_ID gl_index_id) const; }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_index_merge.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_index_merge.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_index_merge.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_index_merge.cc 2017-10-19 04:25:29.000000000 +0000 @@ -23,39 +23,28 @@ namespace myrocks { -Rdb_index_merge::Rdb_index_merge(const ulonglong merge_buf_size, - const ulonglong merge_combine_read_size, - const rocksdb::Comparator* comparator) : - m_merge_buf_size(merge_buf_size), - m_merge_combine_read_size(merge_combine_read_size), - m_comparator(comparator), - m_rec_buf_unsorted(nullptr), - m_output_buf(nullptr) -{ -} +Rdb_index_merge::Rdb_index_merge(const char *const tmpfile_path, + const ulonglong &merge_buf_size, + const ulonglong &merge_combine_read_size, + const rocksdb::Comparator *const comparator) + : m_tmpfile_path(tmpfile_path), m_merge_buf_size(merge_buf_size), + m_merge_combine_read_size(merge_combine_read_size), + m_comparator(comparator), m_rec_buf_unsorted(nullptr), + m_output_buf(nullptr) {} -Rdb_index_merge::~Rdb_index_merge() -{ +Rdb_index_merge::~Rdb_index_merge() { /* Close tmp file, we don't need to worry about deletion, mysql handles it. */ my_close(m_merge_file.fd, MYF(MY_WME)); - - /* There should be no records left in the offset tree */ - DBUG_ASSERT(m_offset_tree.empty()); - - /* There should be no pointers left on the merge heap */ - DBUG_ASSERT(m_merge_min_heap.empty()); } -int Rdb_index_merge::init() -{ +int Rdb_index_merge::init() { /* Create a temporary merge file on disk to store sorted chunks during inplace index creation. */ - if (merge_file_create()) - { + if (merge_file_create()) { return HA_ERR_INTERNAL_ERROR; } @@ -64,35 +53,53 @@ to disk. They will be written to disk sorted. A sorted tree is used to keep track of the offset of each record within the unsorted buffer. */ - m_rec_buf_unsorted= std::make_shared(m_merge_buf_size); + m_rec_buf_unsorted = + std::shared_ptr(new merge_buf_info(m_merge_buf_size)); /* Allocate output buffer that will contain sorted block that is written to disk. */ - m_output_buf= std::make_shared(m_merge_buf_size); + m_output_buf = + std::shared_ptr(new merge_buf_info(m_merge_buf_size)); - return 0; + return HA_EXIT_SUCCESS; } /** Create a merge file in the given location. */ -int Rdb_index_merge::merge_file_create() -{ +int Rdb_index_merge::merge_file_create() { DBUG_ASSERT(m_merge_file.fd == -1); - int fd = mysql_tmpfile("myrocks"); + int fd; + /* If no path set for tmpfile, use mysql_tmpdir by default */ + if (m_tmpfile_path == nullptr) { + fd = mysql_tmpfile("myrocks"); + } else { + char filename[FN_REFLEN]; + fd = create_temp_file(filename, m_tmpfile_path, "myrocks", + O_CREAT | O_EXCL | O_RDWR | O_TEMPORARY, + MYF(MY_WME)); + if (fd >= 0) { +#ifndef __WIN__ + /* + This can be removed once the following bug is fixed: + Bug #28903 create_temp_file() doesn't honor O_TEMPORARY option + (file not removed) (Unix) + */ + unlink(filename); +#endif /* !__WIN__ */ + } + } - if (fd < 0) - { + if (fd < 0) { return HA_ERR_INTERNAL_ERROR; } - - m_merge_file.fd = fd; + m_merge_file.fd = fd; m_merge_file.num_sort_buffers = 0; - return 0; + return HA_EXIT_SUCCESS; } /** @@ -102,9 +109,7 @@ If buffer in memory is full, write the buffer out to disk sorted using the offset tree, and clear the tree. (Happens in merge_buf_write) */ -int Rdb_index_merge::add(const rocksdb::Slice& key, - const rocksdb::Slice& val) -{ +int Rdb_index_merge::add(const rocksdb::Slice &key, const rocksdb::Slice &val) { /* Adding a record after heap is already created results in error */ DBUG_ASSERT(m_merge_min_heap.empty()); @@ -112,20 +117,30 @@ Check if sort buffer is going to be out of space, if so write it out to disk in sorted order using offset tree. */ - uint total_offset= RDB_MERGE_CHUNK_LEN + m_rec_buf_unsorted->curr_offset + - RDB_MERGE_KEY_DELIMITER + RDB_MERGE_VAL_DELIMITER + - key.size() + val.size(); - if (total_offset >= m_rec_buf_unsorted->total_size) - { - if (merge_buf_write()) - { + const uint total_offset = RDB_MERGE_CHUNK_LEN + + m_rec_buf_unsorted->curr_offset + + RDB_MERGE_KEY_DELIMITER + RDB_MERGE_VAL_DELIMITER + + key.size() + val.size(); + if (total_offset >= m_rec_buf_unsorted->total_size) { + /* + If the offset tree is empty here, that means that the proposed key to + add is too large for the buffer. + */ + if (m_offset_tree.empty()) { + // NO_LINT_DEBUG + sql_print_error("Sort buffer size is too small to process merge. " + "Please set merge buffer size to a higher value."); + return HA_ERR_INTERNAL_ERROR; + } + + if (merge_buf_write()) { // NO_LINT_DEBUG sql_print_error("Error writing sort buffer to disk."); return HA_ERR_INTERNAL_ERROR; } } - ulonglong rec_offset= m_rec_buf_unsorted->curr_offset; + const ulonglong rec_offset = m_rec_buf_unsorted->curr_offset; /* Store key and value in temporary unsorted in memory buffer pointed to by @@ -137,14 +152,13 @@ m_offset_tree.emplace(m_rec_buf_unsorted->block.get() + rec_offset, m_comparator); - return 0; + return HA_EXIT_SUCCESS; } /** Sort + write merge buffer chunk out to disk. */ -int Rdb_index_merge::merge_buf_write() -{ +int Rdb_index_merge::merge_buf_write() { DBUG_ASSERT(m_merge_file.fd != -1); DBUG_ASSERT(m_rec_buf_unsorted != nullptr); DBUG_ASSERT(m_output_buf != nullptr); @@ -159,8 +173,7 @@ Iterate through the offset tree. Should be ordered by the secondary key at this point. */ - for (auto& rec : m_offset_tree) - { + for (const auto &rec : m_offset_tree) { DBUG_ASSERT(m_output_buf->curr_offset <= m_merge_buf_size); /* Read record from offset (should never fail) */ @@ -181,16 +194,20 @@ then write into the respective merge buffer. */ if (my_seek(m_merge_file.fd, m_merge_file.num_sort_buffers * m_merge_buf_size, - SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) - { + SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { // NO_LINT_DEBUG sql_print_error("Error seeking to location in merge file on disk."); return HA_ERR_INTERNAL_ERROR; } + /* + Add a file sync call here to flush the data out. Otherwise, the filesystem + cache can flush out all of the files at the same time, causing a write + burst. + */ if (my_write(m_merge_file.fd, m_output_buf->block.get(), - m_output_buf->total_size, MYF(MY_WME | MY_NABP))) - { + m_output_buf->total_size, MYF(MY_WME | MY_NABP)) || + mysql_file_sync(m_merge_file.fd, MYF(MY_WME))) { // NO_LINT_DEBUG sql_print_error("Error writing sorted merge buffer to disk."); return HA_ERR_INTERNAL_ERROR; @@ -202,23 +219,21 @@ /* Reset everything for next run */ merge_reset(); - return 0; + return HA_EXIT_SUCCESS; } /** Prepare n-way merge of n sorted buffers on disk, using a heap sorted by secondary key records. */ -int Rdb_index_merge::merge_heap_prepare() -{ +int Rdb_index_merge::merge_heap_prepare() { DBUG_ASSERT(m_merge_min_heap.empty()); /* If the offset tree is not empty, there are still some records that need to be written to disk. Write them out now. */ - if (!m_offset_tree.empty() && merge_buf_write()) - { + if (!m_offset_tree.empty() && merge_buf_write()) { return HA_ERR_INTERNAL_ERROR; } @@ -228,39 +243,34 @@ For an n-way merge, we need to read chunks of each merge file simultaneously. */ - ulonglong chunk_size= m_merge_combine_read_size/ - m_merge_file.num_sort_buffers; - if (chunk_size >= m_merge_buf_size) - { - chunk_size= m_merge_buf_size; + ulonglong chunk_size = + m_merge_combine_read_size / m_merge_file.num_sort_buffers; + if (chunk_size >= m_merge_buf_size) { + chunk_size = m_merge_buf_size; } /* Allocate buffers for each chunk */ - for (ulonglong i = 0; i < m_merge_file.num_sort_buffers; i++) - { - auto entry= std::make_shared(m_comparator); + for (ulonglong i = 0; i < m_merge_file.num_sort_buffers; i++) { + const auto entry = std::make_shared(m_comparator); /* Read chunk_size bytes from each chunk on disk, and place inside respective chunk buffer. */ - size_t total_size= - entry->prepare(m_merge_file.fd, i * m_merge_buf_size, chunk_size); + const size_t total_size = + entry->prepare(m_merge_file.fd, i * m_merge_buf_size, chunk_size); - if (total_size == (size_t) - 1) - { + if (total_size == (size_t)-1) { return HA_ERR_INTERNAL_ERROR; } /* Can reach this condition if an index was added on table w/ no rows */ - if (total_size - RDB_MERGE_CHUNK_LEN == 0) - { + if (total_size - RDB_MERGE_CHUNK_LEN == 0) { break; } /* Read the first record from each buffer to initially populate the heap */ - if (entry->read_rec(&entry->key, &entry->val)) - { + if (entry->read_rec(&entry->key, &entry->val)) { // NO_LINT_DEBUG sql_print_error("Chunk size is too small to process merge."); return HA_ERR_INTERNAL_ERROR; @@ -269,14 +279,14 @@ m_merge_min_heap.push(std::move(entry)); } - return 0; + return HA_EXIT_SUCCESS; } /** Create and/or iterate through keys in the merge heap. */ -int Rdb_index_merge::next(rocksdb::Slice* key, rocksdb::Slice* val) -{ +int Rdb_index_merge::next(rocksdb::Slice *const key, + rocksdb::Slice *const val) { /* If table fits in one sort buffer, we can optimize by writing the sort buffer directly through to the sstfilewriter instead of @@ -285,20 +295,18 @@ If there are no sort buffer records (alters on empty tables), also exit here. */ - if (m_merge_file.num_sort_buffers == 0) - { - if (m_offset_tree.empty()) - { + if (m_merge_file.num_sort_buffers == 0) { + if (m_offset_tree.empty()) { return -1; } - auto rec= m_offset_tree.begin(); + const auto rec = m_offset_tree.begin(); /* Read record from offset */ merge_read_rec(rec->block, key, val); m_offset_tree.erase(rec); - return 0; + return HA_EXIT_SUCCESS; } int res; @@ -308,10 +316,8 @@ of the external sort. Populate the heap with initial values from each disk chunk. */ - if (m_merge_min_heap.empty()) - { - if ((res= merge_heap_prepare())) - { + if (m_merge_min_heap.empty()) { + if ((res = merge_heap_prepare())) { // NO_LINT_DEBUG sql_print_error("Error during preparation of heap."); return res; @@ -322,7 +328,7 @@ inside the SST file yet. */ merge_heap_top(key, val); - return 0; + return HA_EXIT_SUCCESS; } DBUG_ASSERT(!m_merge_min_heap.empty()); @@ -332,14 +338,13 @@ /** Get current top record from the heap. */ -void Rdb_index_merge::merge_heap_top(rocksdb::Slice* key, - rocksdb::Slice* val) -{ +void Rdb_index_merge::merge_heap_top(rocksdb::Slice *const key, + rocksdb::Slice *const val) { DBUG_ASSERT(!m_merge_min_heap.empty()); - const std::shared_ptr& entry= m_merge_min_heap.top(); - *key= entry->key; - *val= entry->val; + const std::shared_ptr &entry = m_merge_min_heap.top(); + *key = entry->key; + *val = entry->val; } /** @@ -348,14 +353,13 @@ Returns -1 when there are no more records in the heap. */ -int Rdb_index_merge::merge_heap_pop_and_get_next(rocksdb::Slice* key, - rocksdb::Slice* val) -{ +int Rdb_index_merge::merge_heap_pop_and_get_next(rocksdb::Slice *const key, + rocksdb::Slice *const val) { /* Make a new reference to shared ptr so it doesn't get destroyed during pop(). We are going to push this entry back onto the heap. */ - const std::shared_ptr entry= m_merge_min_heap.top(); + const std::shared_ptr entry = m_merge_min_heap.top(); m_merge_min_heap.pop(); /* @@ -365,15 +369,13 @@ Return without adding entry back onto heap. If heap is also empty, we must be finished with merge. */ - if (entry->chunk_info->is_chunk_finished()) - { - if (m_merge_min_heap.empty()) - { + if (entry->chunk_info->is_chunk_finished()) { + if (m_merge_min_heap.empty()) { return -1; } merge_heap_top(key, val); - return 0; + return HA_EXIT_SUCCESS; } /* @@ -385,16 +387,13 @@ If merge_read_rec fails, it means the either the chunk was cut off or we've reached the end of the respective chunk. */ - if (entry->read_rec(&entry->key, &entry->val)) - { - if (entry->read_next_chunk_from_disk(m_merge_file.fd)) - { + if (entry->read_rec(&entry->key, &entry->val)) { + if (entry->read_next_chunk_from_disk(m_merge_file.fd)) { return HA_ERR_INTERNAL_ERROR; } /* Try reading record again, should never fail. */ - if (entry->read_rec(&entry->key, &entry->val)) - { + if (entry->read_rec(&entry->key, &entry->val)) { return HA_ERR_INTERNAL_ERROR; } } @@ -404,52 +403,46 @@ /* Return the current top record on heap */ merge_heap_top(key, val); - return 0; + return HA_EXIT_SUCCESS; } -int Rdb_index_merge::merge_heap_entry::read_next_chunk_from_disk(File fd) -{ - if (chunk_info->read_next_chunk_from_disk(fd)) - { - return 1; +int Rdb_index_merge::merge_heap_entry::read_next_chunk_from_disk(File fd) { + if (chunk_info->read_next_chunk_from_disk(fd)) { + return HA_EXIT_FAILURE; } - block= chunk_info->block.get(); - return 0; + block = chunk_info->block.get(); + return HA_EXIT_SUCCESS; } -int Rdb_index_merge::merge_buf_info::read_next_chunk_from_disk(File fd) -{ +int Rdb_index_merge::merge_buf_info::read_next_chunk_from_disk(File fd) { disk_curr_offset += curr_offset; - if (my_seek(fd, disk_curr_offset, SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) - { + if (my_seek(fd, disk_curr_offset, SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { // NO_LINT_DEBUG sql_print_error("Error seeking to location in merge file on disk."); - return 1; + return HA_EXIT_FAILURE; } /* Overwrite the old block */ - size_t bytes_read= my_read(fd, block.get(), block_len, MYF(MY_WME)); - if (bytes_read == (size_t) -1) - { + const size_t bytes_read = my_read(fd, block.get(), block_len, MYF(MY_WME)); + if (bytes_read == (size_t)-1) { // NO_LINT_DEBUG sql_print_error("Error reading merge file from disk."); - return 1; + return HA_EXIT_FAILURE; } - curr_offset= 0; - return 0; + curr_offset = 0; + return HA_EXIT_SUCCESS; } /** Get records from offset within sort buffer and compare them. Sort by least to greatest. */ -int Rdb_index_merge::merge_record_compare(const uchar* a_block, - const uchar* b_block, - const rocksdb::Comparator* const comparator) -{ +int Rdb_index_merge::merge_record_compare( + const uchar *const a_block, const uchar *const b_block, + const rocksdb::Comparator *const comparator) { return comparator->Compare(as_slice(a_block), as_slice(b_block)); } @@ -457,102 +450,103 @@ Given an offset in a merge sort buffer, read out the keys + values. After this, block will point to the next record in the buffer. **/ -void Rdb_index_merge::merge_read_rec(const uchar* block, - rocksdb::Slice* key, - rocksdb::Slice* val) -{ +void Rdb_index_merge::merge_read_rec(const uchar *const block, + rocksdb::Slice *const key, + rocksdb::Slice *const val) { /* Read key at block offset into key slice and the value into value slice*/ read_slice(key, block); read_slice(val, block + RDB_MERGE_REC_DELIMITER + key->size()); } -void Rdb_index_merge::read_slice(rocksdb::Slice* slice, const uchar* block_ptr) -{ +void Rdb_index_merge::read_slice(rocksdb::Slice *slice, + const uchar *block_ptr) { uint64 slice_len; merge_read_uint64(&block_ptr, &slice_len); - *slice= rocksdb::Slice(reinterpret_cast(block_ptr), slice_len); + *slice = rocksdb::Slice(reinterpret_cast(block_ptr), slice_len); } -int Rdb_index_merge::merge_heap_entry::read_rec(rocksdb::Slice *key, - rocksdb::Slice *val) -{ - const uchar* block_ptr= block; +int Rdb_index_merge::merge_heap_entry::read_rec(rocksdb::Slice *const key, + rocksdb::Slice *const val) { + const uchar *block_ptr = block; + const auto orig_offset = chunk_info->curr_offset; + const auto orig_block = block; /* Read key at block offset into key slice and the value into value slice*/ - if (read_slice(key, &block_ptr) != 0 || read_slice(val, &block_ptr) != 0) - { - return 1; + if (read_slice(key, &block_ptr) != 0) { + return HA_EXIT_FAILURE; } - chunk_info->curr_offset += (uintptr_t) block_ptr - (uintptr_t) block; - block += (uintptr_t) block_ptr - (uintptr_t) block; + chunk_info->curr_offset += (uintptr_t)block_ptr - (uintptr_t)block; + block += (uintptr_t)block_ptr - (uintptr_t)block; - return 0; + if (read_slice(val, &block_ptr) != 0) { + chunk_info->curr_offset = orig_offset; + block = orig_block; + return HA_EXIT_FAILURE; + } + + chunk_info->curr_offset += (uintptr_t)block_ptr - (uintptr_t)block; + block += (uintptr_t)block_ptr - (uintptr_t)block; + + return HA_EXIT_SUCCESS; } -int Rdb_index_merge::merge_heap_entry::read_slice(rocksdb::Slice* slice, - const uchar** block_ptr) -{ - if (!chunk_info->has_space(RDB_MERGE_REC_DELIMITER)) - { - return 1; +int Rdb_index_merge::merge_heap_entry::read_slice(rocksdb::Slice *const slice, + const uchar **block_ptr) { + if (!chunk_info->has_space(RDB_MERGE_REC_DELIMITER)) { + return HA_EXIT_FAILURE; } uint64 slice_len; merge_read_uint64(block_ptr, &slice_len); - if (!chunk_info->has_space(RDB_MERGE_REC_DELIMITER + slice_len)) - { - return 1; + if (!chunk_info->has_space(RDB_MERGE_REC_DELIMITER + slice_len)) { + return HA_EXIT_FAILURE; } - *slice= rocksdb::Slice(reinterpret_cast(*block_ptr), slice_len); + *slice = + rocksdb::Slice(reinterpret_cast(*block_ptr), slice_len); *block_ptr += slice_len; - return 0; + return HA_EXIT_SUCCESS; } size_t Rdb_index_merge::merge_heap_entry::prepare(File fd, ulonglong f_offset, - ulonglong chunk_size) -{ - chunk_info= std::make_shared(chunk_size); - size_t res = chunk_info->prepare(fd, f_offset); - if (res != (size_t) - 1) - { - block= chunk_info->block.get() + RDB_MERGE_CHUNK_LEN; + ulonglong chunk_size) { + chunk_info = std::make_shared(chunk_size); + const size_t res = chunk_info->prepare(fd, f_offset); + if (res != (size_t)-1) { + block = chunk_info->block.get() + RDB_MERGE_CHUNK_LEN; } return res; } -size_t Rdb_index_merge::merge_buf_info::prepare(File fd, ulonglong f_offset) -{ - disk_start_offset= f_offset; - disk_curr_offset= f_offset; +size_t Rdb_index_merge::merge_buf_info::prepare(File fd, ulonglong f_offset) { + disk_start_offset = f_offset; + disk_curr_offset = f_offset; /* Need to position cursor to the chunk it needs to be at on filesystem then read 'chunk_size' bytes into the respective chunk buffer. */ - if (my_seek(fd, f_offset, SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) - { + if (my_seek(fd, f_offset, SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { // NO_LINT_DEBUG sql_print_error("Error seeking to location in merge file on disk."); - return (size_t) - 1; + return (size_t)-1; } - size_t bytes_read= my_read(fd, block.get(), total_size, MYF(MY_WME)); - if (bytes_read == (size_t) - 1) - { + const size_t bytes_read = my_read(fd, block.get(), total_size, MYF(MY_WME)); + if (bytes_read == (size_t)-1) { // NO_LINT_DEBUG sql_print_error("Error reading merge file from disk."); - return (size_t) - 1; + return (size_t)-1; } /* Read the first 8 bytes of each chunk, this gives us the actual size of each chunk. */ - const uchar *block_ptr= block.get(); + const uchar *block_ptr = block.get(); merge_read_uint64(&block_ptr, &total_size); curr_offset += RDB_MERGE_CHUNK_LEN; return total_size; @@ -560,27 +554,23 @@ /* Store key and value w/ their respective delimiters at the given offset */ void Rdb_index_merge::merge_buf_info::store_key_value( - const rocksdb::Slice& key, const rocksdb::Slice& val) -{ + const rocksdb::Slice &key, const rocksdb::Slice &val) { store_slice(key); store_slice(val); } -void Rdb_index_merge::merge_buf_info::store_slice(const rocksdb::Slice& slice) -{ +void Rdb_index_merge::merge_buf_info::store_slice(const rocksdb::Slice &slice) { /* Store length delimiter */ merge_store_uint64(&block[curr_offset], slice.size()); /* Store slice data */ memcpy(&block[curr_offset + RDB_MERGE_REC_DELIMITER], slice.data(), - slice.size()); + slice.size()); curr_offset += slice.size() + RDB_MERGE_REC_DELIMITER; } - -void Rdb_index_merge::merge_reset() -{ +void Rdb_index_merge::merge_reset() { /* Either error, or all values in the sort buffer have been written to disk, so we need to clear the offset tree. @@ -588,17 +578,14 @@ m_offset_tree.clear(); /* Reset sort buffer block */ - if (m_rec_buf_unsorted && m_rec_buf_unsorted->block) - { - m_rec_buf_unsorted->curr_offset= 0; + if (m_rec_buf_unsorted && m_rec_buf_unsorted->block) { + m_rec_buf_unsorted->curr_offset = 0; } /* Reset output buf */ - if (m_output_buf && m_output_buf->block) - { - m_output_buf->curr_offset= 0; + if (m_output_buf && m_output_buf->block) { + m_output_buf->curr_offset = 0; } } -} // namespace myrocks - +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_index_merge.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_index_merge.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_index_merge.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_index_merge.h 2017-10-19 04:25:29.000000000 +0000 @@ -18,13 +18,13 @@ /* MySQL header files */ #include "../sql/log.h" -#include "./handler.h" /* handler */ -#include "./my_global.h" /* ulonglong */ +#include "./handler.h" /* handler */ +#include "./my_global.h" /* ulonglong */ /* C++ standard header files */ +#include #include #include -#include /* RocksDB header files */ #include "rocksdb/db.h" @@ -46,13 +46,13 @@ class Rdb_tbl_def; class Rdb_index_merge { - Rdb_index_merge(const Rdb_index_merge& p)= delete; - Rdb_index_merge& operator=(const Rdb_index_merge& p)= delete; + Rdb_index_merge(const Rdb_index_merge &p) = delete; + Rdb_index_merge &operator=(const Rdb_index_merge &p) = delete; - public: +public: /* Information about temporary files used in external merge sort */ struct merge_file_info { - File fd= -1; /* file descriptor */ + File fd = -1; /* file descriptor */ ulong num_sort_buffers; /* number of sort buffers in temp file */ }; @@ -60,40 +60,37 @@ struct merge_buf_info { /* heap memory allocated for main memory sort/merge */ std::unique_ptr block; - ulonglong block_len; /* amount of data bytes allocated for block above */ + const ulonglong + block_len; /* amount of data bytes allocated for block above */ ulonglong curr_offset; /* offset of the record pointer for the block */ ulonglong disk_start_offset; /* where the chunk starts on disk */ - ulonglong disk_curr_offset; /* current offset on disk */ - ulonglong total_size; /* total # of data bytes in chunk */ + ulonglong disk_curr_offset; /* current offset on disk */ + ulonglong total_size; /* total # of data bytes in chunk */ - void store_key_value(const rocksdb::Slice& key, const rocksdb::Slice& val) - __attribute__((__nonnull__)); + void store_key_value(const rocksdb::Slice &key, const rocksdb::Slice &val) + __attribute__((__nonnull__)); - void store_slice(const rocksdb::Slice& slice) - __attribute__((__nonnull__)); + void store_slice(const rocksdb::Slice &slice) __attribute__((__nonnull__)); - size_t prepare(File fd, ulonglong f_offset) - __attribute__((__nonnull__)); + size_t prepare(File fd, ulonglong f_offset) __attribute__((__nonnull__)); int read_next_chunk_from_disk(File fd) - __attribute__((__nonnull__, __warn_unused_result__)); + __attribute__((__nonnull__, __warn_unused_result__)); - inline bool is_chunk_finished() - { + inline bool is_chunk_finished() const { return curr_offset + disk_curr_offset - disk_start_offset == total_size; } - inline bool has_space(uint64 needed) - { + inline bool has_space(uint64 needed) const { return curr_offset + needed <= block_len; } - explicit merge_buf_info(const ulonglong merge_block_size) : - block(nullptr), block_len(merge_block_size), curr_offset(0), - disk_start_offset(0), disk_curr_offset(0), total_size(merge_block_size) - { + explicit merge_buf_info(const ulonglong merge_block_size) + : block(nullptr), block_len(merge_block_size), curr_offset(0), + disk_start_offset(0), disk_curr_offset(0), + total_size(merge_block_size) { /* Will throw an exception if it runs out of memory here */ - block= std::unique_ptr(new uchar[merge_block_size]); + block = std::unique_ptr(new uchar[merge_block_size]); /* Initialize entire buffer to 0 to avoid valgrind errors */ memset(block.get(), 0, merge_block_size); @@ -101,129 +98,121 @@ }; /* Represents an entry in the heap during merge phase of external sort */ - struct merge_heap_entry - { + struct merge_heap_entry { std::shared_ptr chunk_info; /* pointer to buffer info */ - uchar* block; /* pointer to heap memory where record is stored */ - const rocksdb::Comparator* const comparator; + uchar *block; /* pointer to heap memory where record is stored */ + const rocksdb::Comparator *const comparator; rocksdb::Slice key; /* current key pointed to by block ptr */ rocksdb::Slice val; size_t prepare(File fd, ulonglong f_offset, ulonglong chunk_size) - __attribute__((__nonnull__)); + __attribute__((__nonnull__)); int read_next_chunk_from_disk(File fd) - __attribute__((__nonnull__, __warn_unused_result__)); + __attribute__((__nonnull__, __warn_unused_result__)); - int read_rec(rocksdb::Slice *key, rocksdb::Slice *val) - __attribute__((__nonnull__, __warn_unused_result__)); + int read_rec(rocksdb::Slice *const key, rocksdb::Slice *const val) + __attribute__((__nonnull__, __warn_unused_result__)); - int read_slice(rocksdb::Slice* slice, const uchar** block_ptr) - __attribute__((__nonnull__, __warn_unused_result__)); + int read_slice(rocksdb::Slice *const slice, const uchar **block_ptr) + __attribute__((__nonnull__, __warn_unused_result__)); - explicit merge_heap_entry(const rocksdb::Comparator* const comparator) : - chunk_info(nullptr), block(nullptr), comparator(comparator) {} + explicit merge_heap_entry(const rocksdb::Comparator *const comparator) + : chunk_info(nullptr), block(nullptr), comparator(comparator) {} }; - struct merge_heap_comparator - { - bool operator() (const std::shared_ptr& lhs, - const std::shared_ptr& rhs) - { + struct merge_heap_comparator { + bool operator()(const std::shared_ptr &lhs, + const std::shared_ptr &rhs) { return lhs->comparator->Compare(rhs->key, lhs->key) < 0; } }; /* Represents a record in unsorted buffer */ - struct merge_record - { - uchar* block; /* points to offset of key in sort buffer */ - const rocksdb::Comparator* const comparator; + struct merge_record { + uchar *block; /* points to offset of key in sort buffer */ + const rocksdb::Comparator *const comparator; - bool operator< (const merge_record &record) const - { + bool operator<(const merge_record &record) const { return merge_record_compare(this->block, record.block, comparator) < 0; } - merge_record(uchar* block, const rocksdb::Comparator* const comparator) : - block(block), comparator(comparator) {} + merge_record(uchar *const block, + const rocksdb::Comparator *const comparator) + : block(block), comparator(comparator) {} }; - private: - const ulonglong m_merge_buf_size; - const ulonglong m_merge_combine_read_size; - const rocksdb::Comparator* m_comparator; - struct merge_file_info m_merge_file; - std::shared_ptr m_rec_buf_unsorted; - std::shared_ptr m_output_buf; - std::set m_offset_tree; +private: + const char *m_tmpfile_path; + const ulonglong m_merge_buf_size; + const ulonglong m_merge_combine_read_size; + const rocksdb::Comparator *m_comparator; + struct merge_file_info m_merge_file; + std::shared_ptr m_rec_buf_unsorted; + std::shared_ptr m_output_buf; + std::set m_offset_tree; std::priority_queue, std::vector>, - merge_heap_comparator> m_merge_min_heap; + merge_heap_comparator> + m_merge_min_heap; - static inline void merge_store_uint64(uchar *dst, uint64 n) - { + static inline void merge_store_uint64(uchar *const dst, uint64 n) { memcpy(dst, &n, sizeof(n)); } - static inline void merge_read_uint64(const uchar **buf_ptr, uint64 *dst) - { + static inline void merge_read_uint64(const uchar **buf_ptr, + uint64 *const dst) { DBUG_ASSERT(buf_ptr != nullptr); memcpy(dst, *buf_ptr, sizeof(uint64)); *buf_ptr += sizeof(uint64); } - static inline rocksdb::Slice as_slice(const uchar* block) - { + static inline rocksdb::Slice as_slice(const uchar *block) { uint64 len; merge_read_uint64(&block, &len); - return rocksdb::Slice(reinterpret_cast(block), len); + return rocksdb::Slice(reinterpret_cast(block), len); } - static int merge_record_compare(const uchar* a_block, const uchar* b_block, - const rocksdb::Comparator* const comparator) - __attribute__((__nonnull__, __warn_unused_result__)); - - void merge_read_rec(const uchar* block, rocksdb::Slice* key, - rocksdb::Slice* val) - __attribute__((__nonnull__)); - - void read_slice(rocksdb::Slice* slice, const uchar* block_ptr) - __attribute__((__nonnull__)); - - public: - Rdb_index_merge(const ulonglong merge_buf_size, - const ulonglong merge_combine_read_size, - const rocksdb::Comparator* comparator); + static int merge_record_compare(const uchar *a_block, const uchar *b_block, + const rocksdb::Comparator *const comparator) + __attribute__((__nonnull__, __warn_unused_result__)); + + void merge_read_rec(const uchar *const block, rocksdb::Slice *const key, + rocksdb::Slice *const val) __attribute__((__nonnull__)); + + void read_slice(rocksdb::Slice *slice, const uchar *block_ptr) + __attribute__((__nonnull__)); + +public: + Rdb_index_merge(const char *const tmpfile_path, + const ulonglong &merge_buf_size, + const ulonglong &merge_combine_read_size, + const rocksdb::Comparator *const comparator); ~Rdb_index_merge(); - int init() - __attribute__((__nonnull__, __warn_unused_result__)); + int init() __attribute__((__nonnull__, __warn_unused_result__)); - int merge_file_create() - __attribute__((__nonnull__, __warn_unused_result__)); + int merge_file_create() __attribute__((__nonnull__, __warn_unused_result__)); - int add(const rocksdb::Slice& key, const rocksdb::Slice& val) - __attribute__((__nonnull__, __warn_unused_result__)); + int add(const rocksdb::Slice &key, const rocksdb::Slice &val) + __attribute__((__nonnull__, __warn_unused_result__)); - int merge_buf_write() - __attribute__((__nonnull__, __warn_unused_result__)); + int merge_buf_write() __attribute__((__nonnull__, __warn_unused_result__)); - int next(rocksdb::Slice* key, rocksdb::Slice* val) - __attribute__((__nonnull__, __warn_unused_result__)); + int next(rocksdb::Slice *const key, rocksdb::Slice *const val) + __attribute__((__nonnull__, __warn_unused_result__)); - int merge_heap_prepare() - __attribute__((__nonnull__, __warn_unused_result__)); + int merge_heap_prepare() __attribute__((__nonnull__, __warn_unused_result__)); - void merge_heap_top(rocksdb::Slice* key, rocksdb::Slice* val) - __attribute__((__nonnull__)); + void merge_heap_top(rocksdb::Slice *key, rocksdb::Slice *val) + __attribute__((__nonnull__)); - int merge_heap_pop_and_get_next(rocksdb::Slice* key, rocksdb::Slice* val) - __attribute__((__nonnull__, __warn_unused_result__)); + int merge_heap_pop_and_get_next(rocksdb::Slice *const key, + rocksdb::Slice *const val) + __attribute__((__nonnull__, __warn_unused_result__)); void merge_reset(); }; -} // namespace myrocks - +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_i_s.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_i_s.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_i_s.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_i_s.cc 2017-10-19 04:25:29.000000000 +0000 @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* C++ standard header files */ +#include #include #include @@ -22,93 +23,103 @@ #include /* RocksDB header files */ -#include "rocksdb/convenience.h" #include "rocksdb/compaction_filter.h" +#include "rocksdb/convenience.h" #include "rocksdb/filter_policy.h" #include "rocksdb/memtablerep.h" #include "rocksdb/merge_operator.h" #include "rocksdb/slice_transform.h" +#include "rocksdb/utilities/transaction_db.h" /* MyRocks header files */ #include "./ha_rocksdb.h" #include "./ha_rocksdb_proto.h" #include "./rdb_cf_manager.h" #include "./rdb_datadic.h" +#include "./rdb_utils.h" namespace myrocks { /** - Define the INFORMATION_SCHEMA (I_S) structures needed by MyRocks storage engine. + Define the INFORMATION_SCHEMA (I_S) structures needed by MyRocks storage + engine. */ -#define ROCKSDB_FIELD_INFO(_name_, _len_, _type_, _flag_) \ - { _name_, _len_, _type_, 0, _flag_, nullptr, 0 } +#define ROCKSDB_FIELD_INFO(_name_, _len_, _type_, _flag_) \ + { _name_, _len_, _type_, 0, _flag_, nullptr, 0 } -#define ROCKSDB_FIELD_INFO_END ROCKSDB_FIELD_INFO(nullptr, \ - 0, MYSQL_TYPE_NULL, 0) +#define ROCKSDB_FIELD_INFO_END \ + ROCKSDB_FIELD_INFO(nullptr, 0, MYSQL_TYPE_NULL, 0) /* Support for INFORMATION_SCHEMA.ROCKSDB_CFSTATS dynamic table */ -static int rdb_i_s_cfstats_fill_table( - my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond __attribute__((__unused__))) -{ +namespace RDB_CFSTATS_FIELD { +enum { CF_NAME = 0, STAT_TYPE, VALUE }; +} // namespace RDB_CFSTATS_FIELD + +static ST_FIELD_INFO rdb_i_s_cfstats_fields_info[] = { + ROCKSDB_FIELD_INFO("CF_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO_END}; + +static int rdb_i_s_cfstats_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + bool ret; uint64_t val; - DBUG_ENTER("rdb_i_s_cfstats_fill_table"); + const std::vector> cf_properties = { + {rocksdb::DB::Properties::kNumImmutableMemTable, + "NUM_IMMUTABLE_MEM_TABLE"}, + {rocksdb::DB::Properties::kMemTableFlushPending, + "MEM_TABLE_FLUSH_PENDING"}, + {rocksdb::DB::Properties::kCompactionPending, "COMPACTION_PENDING"}, + {rocksdb::DB::Properties::kCurSizeActiveMemTable, + "CUR_SIZE_ACTIVE_MEM_TABLE"}, + {rocksdb::DB::Properties::kCurSizeAllMemTables, + "CUR_SIZE_ALL_MEM_TABLES"}, + {rocksdb::DB::Properties::kNumEntriesActiveMemTable, + "NUM_ENTRIES_ACTIVE_MEM_TABLE"}, + {rocksdb::DB::Properties::kNumEntriesImmMemTables, + "NUM_ENTRIES_IMM_MEM_TABLES"}, + {rocksdb::DB::Properties::kEstimateTableReadersMem, + "NON_BLOCK_CACHE_SST_MEM_USAGE"}, + {rocksdb::DB::Properties::kNumLiveVersions, "NUM_LIVE_VERSIONS"}}; - std::vector> cf_properties = { - {rocksdb::DB::Properties::kNumImmutableMemTable, "NUM_IMMUTABLE_MEM_TABLE"}, - {rocksdb::DB::Properties::kMemTableFlushPending, - "MEM_TABLE_FLUSH_PENDING"}, - {rocksdb::DB::Properties::kCompactionPending, "COMPACTION_PENDING"}, - {rocksdb::DB::Properties::kCurSizeActiveMemTable, - "CUR_SIZE_ACTIVE_MEM_TABLE"}, - {rocksdb::DB::Properties::kCurSizeAllMemTables, "CUR_SIZE_ALL_MEM_TABLES"}, - {rocksdb::DB::Properties::kNumEntriesActiveMemTable, - "NUM_ENTRIES_ACTIVE_MEM_TABLE"}, - {rocksdb::DB::Properties::kNumEntriesImmMemTables, - "NUM_ENTRIES_IMM_MEM_TABLES"}, - {rocksdb::DB::Properties::kEstimateTableReadersMem, - "NON_BLOCK_CACHE_SST_MEM_USAGE"}, - {rocksdb::DB::Properties::kNumLiveVersions, "NUM_LIVE_VERSIONS"} - }; - - rocksdb::DB *rdb= rdb_get_rocksdb_db(); - Rdb_cf_manager& cf_manager= rdb_get_cf_manager(); + rocksdb::DB *const rdb = rdb_get_rocksdb_db(); + const Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); DBUG_ASSERT(rdb != nullptr); - for (auto cf_name : cf_manager.get_cf_names()) - { - rocksdb::ColumnFamilyHandle* cfh; + for (const auto &cf_name : cf_manager.get_cf_names()) { + rocksdb::ColumnFamilyHandle *cfh; bool is_automatic; /* Only the cf name is important. Whether it was generated automatically does not matter, so is_automatic is ignored. */ - cfh= cf_manager.get_cf(cf_name.c_str(), "", nullptr, &is_automatic); + cfh = cf_manager.get_cf(cf_name.c_str(), "", nullptr, &is_automatic); if (cfh == nullptr) continue; - for (auto property : cf_properties) - { + for (const auto &property : cf_properties) { if (!rdb->GetIntProperty(cfh, property.first, &val)) continue; DBUG_ASSERT(tables != nullptr); - tables->table->field[0]->store(cf_name.c_str(), cf_name.size(), - system_charset_info); - tables->table->field[1]->store(property.second.c_str(), - property.second.size(), - system_charset_info); - tables->table->field[2]->store(val, true); + tables->table->field[RDB_CFSTATS_FIELD::CF_NAME]->store( + cf_name.c_str(), cf_name.size(), system_charset_info); + tables->table->field[RDB_CFSTATS_FIELD::STAT_TYPE]->store( + property.second.c_str(), property.second.size(), system_charset_info); + tables->table->field[RDB_CFSTATS_FIELD::VALUE]->store(val, true); - ret= my_core::schema_table_store_record(thd, tables->table); + ret = my_core::schema_table_store_record(thd, tables->table); if (ret) DBUG_RETURN(ret); @@ -117,25 +128,17 @@ DBUG_RETURN(0); } -static ST_FIELD_INFO rdb_i_s_cfstats_fields_info[]= -{ - ROCKSDB_FIELD_INFO("CF_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO_END -}; +static int rdb_i_s_cfstats_init(void *p) { + DBUG_ENTER_FUNC(); -static int rdb_i_s_cfstats_init(void *p) -{ - my_core::ST_SCHEMA_TABLE *schema; - - DBUG_ENTER("rdb_i_s_cfstats_init"); DBUG_ASSERT(p != nullptr); - schema= (my_core::ST_SCHEMA_TABLE*) p; + my_core::ST_SCHEMA_TABLE *schema; - schema->fields_info= rdb_i_s_cfstats_fields_info; - schema->fill_table= rdb_i_s_cfstats_fill_table; + schema = (my_core::ST_SCHEMA_TABLE *)p; + + schema->fields_info = rdb_i_s_cfstats_fields_info; + schema->fill_table = rdb_i_s_cfstats_fill_table; DBUG_RETURN(0); } @@ -143,39 +146,45 @@ /* Support for INFORMATION_SCHEMA.ROCKSDB_DBSTATS dynamic table */ -static int rdb_i_s_dbstats_fill_table( - my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond __attribute__((__unused__))) -{ +namespace RDB_DBSTATS_FIELD { +enum { STAT_TYPE = 0, VALUE }; +} // namespace RDB_DBSTATS_FIELD + +static ST_FIELD_INFO rdb_i_s_dbstats_fields_info[] = { + ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO_END}; + +static int rdb_i_s_dbstats_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + bool ret; uint64_t val; - DBUG_ENTER("rdb_i_s_dbstats_fill_table"); + const std::vector> db_properties = { + {rocksdb::DB::Properties::kBackgroundErrors, "DB_BACKGROUND_ERRORS"}, + {rocksdb::DB::Properties::kNumSnapshots, "DB_NUM_SNAPSHOTS"}, + {rocksdb::DB::Properties::kOldestSnapshotTime, + "DB_OLDEST_SNAPSHOT_TIME"}}; - std::vector> db_properties = { - {rocksdb::DB::Properties::kBackgroundErrors, "DB_BACKGROUND_ERRORS"}, - {rocksdb::DB::Properties::kNumSnapshots, "DB_NUM_SNAPSHOTS"}, - {rocksdb::DB::Properties::kOldestSnapshotTime, "DB_OLDEST_SNAPSHOT_TIME"} - }; - - rocksdb::DB *rdb= rdb_get_rocksdb_db(); - const rocksdb::BlockBasedTableOptions& table_options= - rdb_get_table_options(); + rocksdb::DB *const rdb = rdb_get_rocksdb_db(); + const rocksdb::BlockBasedTableOptions &table_options = + rdb_get_table_options(); - for (auto property : db_properties) - { + for (const auto &property : db_properties) { if (!rdb->GetIntProperty(property.first, &val)) continue; DBUG_ASSERT(tables != nullptr); - tables->table->field[0]->store(property.second.c_str(), - property.second.size(), - system_charset_info); - tables->table->field[1]->store(val, true); + tables->table->field[RDB_DBSTATS_FIELD::STAT_TYPE]->store( + property.second.c_str(), property.second.size(), system_charset_info); + tables->table->field[RDB_DBSTATS_FIELD::VALUE]->store(val, true); - ret= my_core::schema_table_store_record(thd, tables->table); + ret = my_core::schema_table_store_record(thd, tables->table); if (ret) DBUG_RETURN(ret); @@ -191,35 +200,27 @@ There is no interface to retrieve this block cache, nor fetch the usage information from the column family. */ - val= (table_options.block_cache ? table_options.block_cache->GetUsage() : 0); - tables->table->field[0]->store(STRING_WITH_LEN("DB_BLOCK_CACHE_USAGE"), - system_charset_info); - tables->table->field[1]->store(val, true); + val = (table_options.block_cache ? table_options.block_cache->GetUsage() : 0); + tables->table->field[RDB_DBSTATS_FIELD::STAT_TYPE]->store( + STRING_WITH_LEN("DB_BLOCK_CACHE_USAGE"), system_charset_info); + tables->table->field[RDB_DBSTATS_FIELD::VALUE]->store(val, true); - ret= my_core::schema_table_store_record(thd, tables->table); + ret = my_core::schema_table_store_record(thd, tables->table); DBUG_RETURN(ret); } -static ST_FIELD_INFO rdb_i_s_dbstats_fields_info[]= -{ - ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO_END -}; +static int rdb_i_s_dbstats_init(void *const p) { + DBUG_ENTER_FUNC(); -static int rdb_i_s_dbstats_init(void *p) -{ DBUG_ASSERT(p != nullptr); my_core::ST_SCHEMA_TABLE *schema; - DBUG_ENTER("rdb_i_s_dbstats_init"); + schema = (my_core::ST_SCHEMA_TABLE *)p; - schema= (my_core::ST_SCHEMA_TABLE*) p; - - schema->fields_info= rdb_i_s_dbstats_fields_info; - schema->fill_table= rdb_i_s_dbstats_fill_table; + schema->fields_info = rdb_i_s_dbstats_fields_info; + schema->fill_table = rdb_i_s_dbstats_fill_table; DBUG_RETURN(0); } @@ -227,23 +228,33 @@ /* Support for INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT dynamic table */ +namespace RDB_PERF_CONTEXT_FIELD { +enum { TABLE_SCHEMA = 0, TABLE_NAME, PARTITION_NAME, STAT_TYPE, VALUE }; +} // namespace RDB_PERF_CONTEXT_FIELD + +static ST_FIELD_INFO rdb_i_s_perf_context_fields_info[] = { + ROCKSDB_FIELD_INFO("TABLE_SCHEMA", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("TABLE_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("PARTITION_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, + MY_I_S_MAYBE_NULL), + ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO_END}; + +static int rdb_i_s_perf_context_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); -static int rdb_i_s_perf_context_fill_table( - my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond __attribute__((__unused__))) -{ DBUG_ASSERT(thd != nullptr); DBUG_ASSERT(tables != nullptr); - int ret= 0; - Field** field= tables->table->field; - - DBUG_ENTER("rdb_i_s_perf_context_fill_table"); + int ret = 0; + Field **field = tables->table->field; - std::vector tablenames= rdb_get_open_table_names(); - for (const auto& it : tablenames) - { + const std::vector tablenames = rdb_get_open_table_names(); + for (const auto &it : tablenames) { std::string str, dbname, tablename, partname; Rdb_perf_counters counters; @@ -251,37 +262,35 @@ return HA_ERR_INTERNAL_ERROR; } - if (rdb_split_normalized_tablename(str, &dbname, &tablename, &partname)) - { + if (rdb_split_normalized_tablename(str, &dbname, &tablename, &partname)) { continue; } - if (rdb_get_table_perf_counters(it.c_str(), &counters)) - { + if (rdb_get_table_perf_counters(it.c_str(), &counters)) { continue; } DBUG_ASSERT(field != nullptr); - field[0]->store(dbname.c_str(), dbname.size(), system_charset_info); - field[1]->store(tablename.c_str(), tablename.size(), system_charset_info); - if (partname.size() == 0) - { - field[2]->set_null(); - } - else - { - field[2]->set_notnull(); - field[2]->store(partname.c_str(), partname.size(), system_charset_info); - } - - for (int i= 0; i < PC_MAX_IDX; i++) - { - field[3]->store(rdb_pc_stat_types[i].c_str(), rdb_pc_stat_types[i].size(), - system_charset_info); - field[4]->store(counters.m_value[i], true); + field[RDB_PERF_CONTEXT_FIELD::TABLE_SCHEMA]->store( + dbname.c_str(), dbname.size(), system_charset_info); + field[RDB_PERF_CONTEXT_FIELD::TABLE_NAME]->store( + tablename.c_str(), tablename.size(), system_charset_info); + if (partname.size() == 0) { + field[RDB_PERF_CONTEXT_FIELD::PARTITION_NAME]->set_null(); + } else { + field[RDB_PERF_CONTEXT_FIELD::PARTITION_NAME]->set_notnull(); + field[RDB_PERF_CONTEXT_FIELD::PARTITION_NAME]->store( + partname.c_str(), partname.size(), system_charset_info); + } + + for (int i = 0; i < PC_MAX_IDX; i++) { + field[RDB_PERF_CONTEXT_FIELD::STAT_TYPE]->store( + rdb_pc_stat_types[i].c_str(), rdb_pc_stat_types[i].size(), + system_charset_info); + field[RDB_PERF_CONTEXT_FIELD::VALUE]->store(counters.m_value[i], true); - ret= my_core::schema_table_store_record(thd, tables->table); + ret = my_core::schema_table_store_record(thd, tables->table); if (ret) DBUG_RETURN(ret); } @@ -290,59 +299,58 @@ DBUG_RETURN(0); } -static ST_FIELD_INFO rdb_i_s_perf_context_fields_info[]= -{ - ROCKSDB_FIELD_INFO("TABLE_SCHEMA", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("TABLE_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("PARTITION_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, - MY_I_S_MAYBE_NULL), - ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, - 0), - ROCKSDB_FIELD_INFO_END -}; +static int rdb_i_s_perf_context_init(void *const p) { + DBUG_ENTER_FUNC(); -static int rdb_i_s_perf_context_init(void *p) -{ DBUG_ASSERT(p != nullptr); my_core::ST_SCHEMA_TABLE *schema; - DBUG_ENTER("rdb_i_s_perf_context_init"); + schema = (my_core::ST_SCHEMA_TABLE *)p; - schema= (my_core::ST_SCHEMA_TABLE*) p; - - schema->fields_info= rdb_i_s_perf_context_fields_info; - schema->fill_table= rdb_i_s_perf_context_fill_table; + schema->fields_info = rdb_i_s_perf_context_fields_info; + schema->fill_table = rdb_i_s_perf_context_fill_table; DBUG_RETURN(0); } +/* + Support for INFORMATION_SCHEMA.ROCKSDB_PERF_CONTEXT_GLOBAL dynamic table + */ +namespace RDB_PERF_CONTEXT_GLOBAL_FIELD { +enum { STAT_TYPE = 0, VALUE }; +} // namespace RDB_PERF_CONTEXT_GLOBAL_FIELD + +static ST_FIELD_INFO rdb_i_s_perf_context_global_fields_info[] = { + ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO_END}; + static int rdb_i_s_perf_context_global_fill_table( - my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond __attribute__((__unused__))) -{ + my_core::THD *const thd, my_core::TABLE_LIST *const tables, + my_core::Item *const cond __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(thd != nullptr); DBUG_ASSERT(tables != nullptr); - int ret= 0; - DBUG_ENTER("rdb_i_s_perf_context_global_fill_table"); + int ret = 0; // Get a copy of the global perf counters. Rdb_perf_counters global_counters; rdb_get_global_perf_counters(&global_counters); - for (int i= 0; i < PC_MAX_IDX; i++) { + for (int i = 0; i < PC_MAX_IDX; i++) { DBUG_ASSERT(tables->table != nullptr); DBUG_ASSERT(tables->table->field != nullptr); - tables->table->field[0]->store(rdb_pc_stat_types[i].c_str(), - rdb_pc_stat_types[i].size(), - system_charset_info); - tables->table->field[1]->store(global_counters.m_value[i], true); + tables->table->field[RDB_PERF_CONTEXT_GLOBAL_FIELD::STAT_TYPE]->store( + rdb_pc_stat_types[i].c_str(), rdb_pc_stat_types[i].size(), + system_charset_info); + tables->table->field[RDB_PERF_CONTEXT_GLOBAL_FIELD::VALUE]->store( + global_counters.m_value[i], true); - ret= my_core::schema_table_store_record(thd, tables->table); + ret = my_core::schema_table_store_record(thd, tables->table); if (ret) DBUG_RETURN(ret); } @@ -350,25 +358,17 @@ DBUG_RETURN(0); } -static ST_FIELD_INFO rdb_i_s_perf_context_global_fields_info[]= -{ - ROCKSDB_FIELD_INFO("STAT_TYPE", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("VALUE", sizeof(uint64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO_END -}; +static int rdb_i_s_perf_context_global_init(void *const p) { + DBUG_ENTER_FUNC(); -static int rdb_i_s_perf_context_global_init(void *p) -{ DBUG_ASSERT(p != nullptr); my_core::ST_SCHEMA_TABLE *schema; - DBUG_ENTER("rdb_i_s_perf_context_global_init"); + schema = (my_core::ST_SCHEMA_TABLE *)p; - schema= (my_core::ST_SCHEMA_TABLE*) p; - - schema->fields_info= rdb_i_s_perf_context_global_fields_info; - schema->fill_table= rdb_i_s_perf_context_global_fill_table; + schema->fields_info = rdb_i_s_perf_context_global_fields_info; + schema->fill_table = rdb_i_s_perf_context_global_fill_table; DBUG_RETURN(0); } @@ -376,113 +376,125 @@ /* Support for INFORMATION_SCHEMA.ROCKSDB_CFOPTIONS dynamic table */ -static int rdb_i_s_cfoptions_fill_table( - my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond __attribute__((__unused__))) -{ +namespace RDB_CFOPTIONS_FIELD { +enum { CF_NAME = 0, OPTION_TYPE, VALUE }; +} // namespace RDB_CFOPTIONS_FIELD + +static ST_FIELD_INFO rdb_i_s_cfoptions_fields_info[] = { + ROCKSDB_FIELD_INFO("CF_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("OPTION_TYPE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("VALUE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO_END}; + +static int rdb_i_s_cfoptions_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(thd != nullptr); DBUG_ASSERT(tables != nullptr); bool ret; - DBUG_ENTER("rdb_i_s_cfoptions_fill_table"); - - Rdb_cf_manager& cf_manager= rdb_get_cf_manager(); + Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); - for (auto cf_name : cf_manager.get_cf_names()) - { + for (const auto &cf_name : cf_manager.get_cf_names()) { std::string val; rocksdb::ColumnFamilyOptions opts; cf_manager.get_cf_options(cf_name, &opts); std::vector> cf_option_types = { - {"COMPARATOR", opts.comparator == nullptr ? "NULL" : - std::string(opts.comparator->Name())}, - {"MERGE_OPERATOR", opts.merge_operator == nullptr ? "NULL" : - std::string(opts.merge_operator->Name())}, - {"COMPACTION_FILTER", opts.compaction_filter == nullptr ? "NULL" : - std::string(opts.compaction_filter->Name())}, - {"COMPACTION_FILTER_FACTORY", - opts.compaction_filter_factory == nullptr ? "NULL" : - std::string(opts.compaction_filter_factory->Name())}, - {"WRITE_BUFFER_SIZE", std::to_string(opts.write_buffer_size)}, - {"MAX_WRITE_BUFFER_NUMBER", std::to_string(opts.max_write_buffer_number)}, - {"MIN_WRITE_BUFFER_NUMBER_TO_MERGE", - std::to_string(opts.min_write_buffer_number_to_merge)}, - {"NUM_LEVELS", std::to_string(opts.num_levels)}, - {"LEVEL0_FILE_NUM_COMPACTION_TRIGGER", - std::to_string(opts.level0_file_num_compaction_trigger)}, - {"LEVEL0_SLOWDOWN_WRITES_TRIGGER", - std::to_string(opts.level0_slowdown_writes_trigger)}, - {"LEVEL0_STOP_WRITES_TRIGGER", - std::to_string(opts.level0_stop_writes_trigger)}, - {"MAX_MEM_COMPACTION_LEVEL", std::to_string(opts.max_mem_compaction_level)}, - {"TARGET_FILE_SIZE_BASE", std::to_string(opts.target_file_size_base)}, - {"TARGET_FILE_SIZE_MULTIPLIER", std::to_string(opts.target_file_size_multiplier)}, - {"MAX_BYTES_FOR_LEVEL_BASE", std::to_string(opts.max_bytes_for_level_base)}, - {"LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES", - opts.level_compaction_dynamic_level_bytes ? "ON" : "OFF"}, - {"MAX_BYTES_FOR_LEVEL_MULTIPLIER", - std::to_string(opts.max_bytes_for_level_multiplier)}, - {"SOFT_RATE_LIMIT", std::to_string(opts.soft_rate_limit)}, - {"HARD_RATE_LIMIT", std::to_string(opts.hard_rate_limit)}, - {"RATE_LIMIT_DELAY_MAX_MILLISECONDS", - std::to_string(opts.rate_limit_delay_max_milliseconds)}, - {"ARENA_BLOCK_SIZE", std::to_string(opts.arena_block_size)}, - {"DISABLE_AUTO_COMPACTIONS", - opts.disable_auto_compactions ? "ON" : "OFF"}, - {"PURGE_REDUNDANT_KVS_WHILE_FLUSH", - opts.purge_redundant_kvs_while_flush ? "ON" : "OFF"}, - {"VERIFY_CHECKSUM_IN_COMPACTION", - opts.verify_checksums_in_compaction ? "ON" : "OFF"}, - {"MAX_SEQUENTIAL_SKIP_IN_ITERATIONS", - std::to_string(opts.max_sequential_skip_in_iterations)}, - {"MEMTABLE_FACTORY", - opts.memtable_factory == nullptr ? "NULL" : - opts.memtable_factory->Name()}, - {"INPLACE_UPDATE_SUPPORT", - opts.inplace_update_support ? "ON" : "OFF"}, - {"INPLACE_UPDATE_NUM_LOCKS", - opts.inplace_update_num_locks ? "ON" : "OFF"}, - {"MEMTABLE_PREFIX_BLOOM_BITS_RATIO", - std::to_string(opts.memtable_prefix_bloom_size_ratio)}, - {"MEMTABLE_PREFIX_BLOOM_HUGE_PAGE_TLB_SIZE", - std::to_string(opts.memtable_huge_page_size)}, - {"BLOOM_LOCALITY", std::to_string(opts.bloom_locality)}, - {"MAX_SUCCESSIVE_MERGES", - std::to_string(opts.max_successive_merges)}, - {"MIN_PARTIAL_MERGE_OPERANDS", - std::to_string(opts.min_partial_merge_operands)}, - {"OPTIMIZE_FILTERS_FOR_HITS", - (opts.optimize_filters_for_hits ? "ON" : "OFF")}, + {"COMPARATOR", opts.comparator == nullptr + ? "NULL" + : std::string(opts.comparator->Name())}, + {"MERGE_OPERATOR", opts.merge_operator == nullptr + ? "NULL" + : std::string(opts.merge_operator->Name())}, + {"COMPACTION_FILTER", + opts.compaction_filter == nullptr + ? "NULL" + : std::string(opts.compaction_filter->Name())}, + {"COMPACTION_FILTER_FACTORY", + opts.compaction_filter_factory == nullptr + ? "NULL" + : std::string(opts.compaction_filter_factory->Name())}, + {"WRITE_BUFFER_SIZE", std::to_string(opts.write_buffer_size)}, + {"MAX_WRITE_BUFFER_NUMBER", + std::to_string(opts.max_write_buffer_number)}, + {"MIN_WRITE_BUFFER_NUMBER_TO_MERGE", + std::to_string(opts.min_write_buffer_number_to_merge)}, + {"NUM_LEVELS", std::to_string(opts.num_levels)}, + {"LEVEL0_FILE_NUM_COMPACTION_TRIGGER", + std::to_string(opts.level0_file_num_compaction_trigger)}, + {"LEVEL0_SLOWDOWN_WRITES_TRIGGER", + std::to_string(opts.level0_slowdown_writes_trigger)}, + {"LEVEL0_STOP_WRITES_TRIGGER", + std::to_string(opts.level0_stop_writes_trigger)}, + {"MAX_MEM_COMPACTION_LEVEL", + std::to_string(opts.max_mem_compaction_level)}, + {"TARGET_FILE_SIZE_BASE", std::to_string(opts.target_file_size_base)}, + {"TARGET_FILE_SIZE_MULTIPLIER", + std::to_string(opts.target_file_size_multiplier)}, + {"MAX_BYTES_FOR_LEVEL_BASE", + std::to_string(opts.max_bytes_for_level_base)}, + {"LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES", + opts.level_compaction_dynamic_level_bytes ? "ON" : "OFF"}, + {"MAX_BYTES_FOR_LEVEL_MULTIPLIER", + std::to_string(opts.max_bytes_for_level_multiplier)}, + {"SOFT_RATE_LIMIT", std::to_string(opts.soft_rate_limit)}, + {"HARD_RATE_LIMIT", std::to_string(opts.hard_rate_limit)}, + {"RATE_LIMIT_DELAY_MAX_MILLISECONDS", + std::to_string(opts.rate_limit_delay_max_milliseconds)}, + {"ARENA_BLOCK_SIZE", std::to_string(opts.arena_block_size)}, + {"DISABLE_AUTO_COMPACTIONS", + opts.disable_auto_compactions ? "ON" : "OFF"}, + {"PURGE_REDUNDANT_KVS_WHILE_FLUSH", + opts.purge_redundant_kvs_while_flush ? "ON" : "OFF"}, + {"VERIFY_CHECKSUM_IN_COMPACTION", + opts.verify_checksums_in_compaction ? "ON" : "OFF"}, + {"MAX_SEQUENTIAL_SKIP_IN_ITERATIONS", + std::to_string(opts.max_sequential_skip_in_iterations)}, + {"MEMTABLE_FACTORY", opts.memtable_factory == nullptr + ? "NULL" + : opts.memtable_factory->Name()}, + {"INPLACE_UPDATE_SUPPORT", opts.inplace_update_support ? "ON" : "OFF"}, + {"INPLACE_UPDATE_NUM_LOCKS", + opts.inplace_update_num_locks ? "ON" : "OFF"}, + {"MEMTABLE_PREFIX_BLOOM_BITS_RATIO", + std::to_string(opts.memtable_prefix_bloom_size_ratio)}, + {"MEMTABLE_PREFIX_BLOOM_HUGE_PAGE_TLB_SIZE", + std::to_string(opts.memtable_huge_page_size)}, + {"BLOOM_LOCALITY", std::to_string(opts.bloom_locality)}, + {"MAX_SUCCESSIVE_MERGES", std::to_string(opts.max_successive_merges)}, + {"MIN_PARTIAL_MERGE_OPERANDS", + std::to_string(opts.min_partial_merge_operands)}, + {"OPTIMIZE_FILTERS_FOR_HITS", + (opts.optimize_filters_for_hits ? "ON" : "OFF")}, }; // get MAX_BYTES_FOR_LEVEL_MULTIPLIER_ADDITIONAL option value val = opts.max_bytes_for_level_multiplier_additional.empty() ? "NULL" : ""; - for (auto level : opts.max_bytes_for_level_multiplier_additional) - { + for (const auto &level : opts.max_bytes_for_level_multiplier_additional) { val.append(std::to_string(level) + ":"); } val.pop_back(); - cf_option_types.push_back({"MAX_BYTES_FOR_LEVEL_MULTIPLIER_ADDITIONAL", val}); + cf_option_types.push_back( + {"MAX_BYTES_FOR_LEVEL_MULTIPLIER_ADDITIONAL", val}); // get COMPRESSION_TYPE option value GetStringFromCompressionType(&val, opts.compression); - if (val.empty()) - { + if (val.empty()) { val = "NULL"; } cf_option_types.push_back({"COMPRESSION_TYPE", val}); // get COMPRESSION_PER_LEVEL option value val = opts.compression_per_level.empty() ? "NULL" : ""; - for (auto compression_type : opts.compression_per_level) - { + for (const auto &compression_type : opts.compression_per_level) { std::string res; GetStringFromCompressionType(&res, compression_type); - if (!res.empty()) - { + if (!res.empty()) { val.append(res + ":"); } } @@ -496,34 +508,42 @@ cf_option_types.push_back({"COMPRESSION_OPTS", val}); // bottommost_compression - if (opts.bottommost_compression) - { + if (opts.bottommost_compression) { std::string res; GetStringFromCompressionType(&res, opts.bottommost_compression); - if (!res.empty()) - { + if (!res.empty()) { cf_option_types.push_back({"BOTTOMMOST_COMPRESSION", res}); } } // get PREFIX_EXTRACTOR option - cf_option_types.push_back({"PREFIX_EXTRACTOR", - opts.prefix_extractor == nullptr ? "NULL" : - std::string(opts.prefix_extractor->Name())}); + cf_option_types.push_back( + {"PREFIX_EXTRACTOR", opts.prefix_extractor == nullptr + ? "NULL" + : std::string(opts.prefix_extractor->Name())}); // get COMPACTION_STYLE option - switch (opts.compaction_style) - { - case rocksdb::kCompactionStyleLevel: val = "kCompactionStyleLevel"; break; - case rocksdb::kCompactionStyleUniversal: val = "kCompactionStyleUniversal"; break; - case rocksdb:: kCompactionStyleFIFO: val = "kCompactionStyleFIFO"; break; - case rocksdb:: kCompactionStyleNone: val = "kCompactionStyleNone"; break; - default: val = "NULL"; + switch (opts.compaction_style) { + case rocksdb::kCompactionStyleLevel: + val = "kCompactionStyleLevel"; + break; + case rocksdb::kCompactionStyleUniversal: + val = "kCompactionStyleUniversal"; + break; + case rocksdb::kCompactionStyleFIFO: + val = "kCompactionStyleFIFO"; + break; + case rocksdb::kCompactionStyleNone: + val = "kCompactionStyleNone"; + break; + default: + val = "NULL"; } cf_option_types.push_back({"COMPACTION_STYLE", val}); // get COMPACTION_OPTIONS_UNIVERSAL related options - rocksdb::CompactionOptionsUniversal compac_opts = opts.compaction_options_universal; + const rocksdb::CompactionOptionsUniversal compac_opts = + opts.compaction_options_universal; val = "{SIZE_RATIO="; val.append(std::to_string(compac_opts.size_ratio)); val.append("; MIN_MERGE_WIDTH="); @@ -535,104 +555,126 @@ val.append("; COMPRESSION_SIZE_PERCENT="); val.append(std::to_string(compac_opts.compression_size_percent)); val.append("; STOP_STYLE="); - switch (compac_opts.stop_style) - { - case rocksdb::kCompactionStopStyleSimilarSize: - val.append("kCompactionStopStyleSimilarSize}"); break; - case rocksdb::kCompactionStopStyleTotalSize: - val.append("kCompactionStopStyleTotalSize}"); break; - default: val.append("}"); + switch (compac_opts.stop_style) { + case rocksdb::kCompactionStopStyleSimilarSize: + val.append("kCompactionStopStyleSimilarSize}"); + break; + case rocksdb::kCompactionStopStyleTotalSize: + val.append("kCompactionStopStyleTotalSize}"); + break; + default: + val.append("}"); } cf_option_types.push_back({"COMPACTION_OPTIONS_UNIVERSAL", val}); // get COMPACTION_OPTION_FIFO option - cf_option_types.push_back({"COMPACTION_OPTION_FIFO::MAX_TABLE_FILES_SIZE", - std::to_string(opts.compaction_options_fifo.max_table_files_size)}); + cf_option_types.push_back( + {"COMPACTION_OPTION_FIFO::MAX_TABLE_FILES_SIZE", + std::to_string(opts.compaction_options_fifo.max_table_files_size)}); // get block-based table related options - const rocksdb::BlockBasedTableOptions& table_options= - rdb_get_table_options(); + const rocksdb::BlockBasedTableOptions &table_options = + rdb_get_table_options(); // get BLOCK_BASED_TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS option cf_option_types.push_back( {"BLOCK_BASED_TABLE_FACTORY::CACHE_INDEX_AND_FILTER_BLOCKS", - table_options.cache_index_and_filter_blocks ? "1" : "0"}); + table_options.cache_index_and_filter_blocks ? "1" : "0"}); // get BLOCK_BASED_TABLE_FACTORY::INDEX_TYPE option value - switch (table_options.index_type) - { - case rocksdb::BlockBasedTableOptions::kBinarySearch: val = "kBinarySearch"; break; - case rocksdb::BlockBasedTableOptions::kHashSearch: val = "kHashSearch"; break; - default: val = "NULL"; + switch (table_options.index_type) { + case rocksdb::BlockBasedTableOptions::kBinarySearch: + val = "kBinarySearch"; + break; + case rocksdb::BlockBasedTableOptions::kHashSearch: + val = "kHashSearch"; + break; + default: + val = "NULL"; } cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::INDEX_TYPE", val}); // get BLOCK_BASED_TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION option value - cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION", - table_options.hash_index_allow_collision ? "ON" : "OFF"}); + cf_option_types.push_back( + {"BLOCK_BASED_TABLE_FACTORY::HASH_INDEX_ALLOW_COLLISION", + table_options.hash_index_allow_collision ? "ON" : "OFF"}); // get BLOCK_BASED_TABLE_FACTORY::CHECKSUM option value - switch (table_options.checksum) - { - case rocksdb::kNoChecksum: val = "kNoChecksum"; break; - case rocksdb::kCRC32c: val = "kCRC32c"; break; - case rocksdb::kxxHash: val = "kxxHash"; break; - default: val = "NULL"; + switch (table_options.checksum) { + case rocksdb::kNoChecksum: + val = "kNoChecksum"; + break; + case rocksdb::kCRC32c: + val = "kCRC32c"; + break; + case rocksdb::kxxHash: + val = "kxxHash"; + break; + default: + val = "NULL"; } cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::CHECKSUM", val}); // get BLOCK_BASED_TABLE_FACTORY::NO_BLOCK_CACHE option value cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::NO_BLOCK_CACHE", - table_options.no_block_cache ? "ON" : "OFF"}); + table_options.no_block_cache ? "ON" : "OFF"}); // get BLOCK_BASED_TABLE_FACTORY::FILTER_POLICY option - cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::FILTER_POLICY", - table_options.filter_policy == nullptr ? "NULL" : - std::string(table_options.filter_policy->Name())}); + cf_option_types.push_back( + {"BLOCK_BASED_TABLE_FACTORY::FILTER_POLICY", + table_options.filter_policy == nullptr + ? "NULL" + : std::string(table_options.filter_policy->Name())}); // get BLOCK_BASED_TABLE_FACTORY::WHOLE_KEY_FILTERING option cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::WHOLE_KEY_FILTERING", - table_options.whole_key_filtering ? "1" : "0"}); + table_options.whole_key_filtering ? "1" : "0"}); // get BLOCK_BASED_TABLE_FACTORY::BLOCK_CACHE option - cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::BLOCK_CACHE", - table_options.block_cache == nullptr ? "NULL" : - std::to_string(table_options.block_cache->GetUsage())}); + cf_option_types.push_back( + {"BLOCK_BASED_TABLE_FACTORY::BLOCK_CACHE", + table_options.block_cache == nullptr + ? "NULL" + : std::to_string(table_options.block_cache->GetUsage())}); // get BLOCK_BASED_TABLE_FACTORY::BLOCK_CACHE_COMPRESSED option - cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::BLOCK_CACHE_COMPRESSED", - table_options.block_cache_compressed == nullptr ? "NULL" : - std::to_string(table_options.block_cache_compressed->GetUsage())}); + cf_option_types.push_back( + {"BLOCK_BASED_TABLE_FACTORY::BLOCK_CACHE_COMPRESSED", + table_options.block_cache_compressed == nullptr + ? "NULL" + : std::to_string( + table_options.block_cache_compressed->GetUsage())}); // get BLOCK_BASED_TABLE_FACTORY::BLOCK_SIZE option cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::BLOCK_SIZE", - std::to_string(table_options.block_size)}); + std::to_string(table_options.block_size)}); // get BLOCK_BASED_TABLE_FACTORY::BLOCK_SIZE_DEVIATION option - cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::BLOCK_SIZE_DEVIATION", - std::to_string(table_options.block_size_deviation)}); + cf_option_types.push_back( + {"BLOCK_BASED_TABLE_FACTORY::BLOCK_SIZE_DEVIATION", + std::to_string(table_options.block_size_deviation)}); // get BLOCK_BASED_TABLE_FACTORY::BLOCK_RESTART_INTERVAL option - cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::BLOCK_RESTART_INTERVAL", - std::to_string(table_options.block_restart_interval)}); + cf_option_types.push_back( + {"BLOCK_BASED_TABLE_FACTORY::BLOCK_RESTART_INTERVAL", + std::to_string(table_options.block_restart_interval)}); // get BLOCK_BASED_TABLE_FACTORY::FORMAT_VERSION option cf_option_types.push_back({"BLOCK_BASED_TABLE_FACTORY::FORMAT_VERSION", - std::to_string(table_options.format_version)}); + std::to_string(table_options.format_version)}); - for (auto cf_option_type : cf_option_types) - { + for (const auto &cf_option_type : cf_option_types) { DBUG_ASSERT(tables->table != nullptr); DBUG_ASSERT(tables->table->field != nullptr); - tables->table->field[0]->store(cf_name.c_str(), cf_name.size(), - system_charset_info); - tables->table->field[1]->store(cf_option_type.first.c_str(), - cf_option_type.first.size(), - system_charset_info); - tables->table->field[2]->store(cf_option_type.second.c_str(), - cf_option_type.second.size(), - system_charset_info); + tables->table->field[RDB_CFOPTIONS_FIELD::CF_NAME]->store( + cf_name.c_str(), cf_name.size(), system_charset_info); + tables->table->field[RDB_CFOPTIONS_FIELD::OPTION_TYPE]->store( + cf_option_type.first.c_str(), cf_option_type.first.size(), + system_charset_info); + tables->table->field[RDB_CFOPTIONS_FIELD::VALUE]->store( + cf_option_type.second.c_str(), cf_option_type.second.size(), + system_charset_info); ret = my_core::schema_table_store_record(thd, tables->table); @@ -643,25 +685,29 @@ DBUG_RETURN(0); } -static ST_FIELD_INFO rdb_i_s_cfoptions_fields_info[] = -{ - ROCKSDB_FIELD_INFO("CF_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("OPTION_TYPE", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("VALUE", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO_END -}; +/* + Support for INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO dynamic table + */ +namespace RDB_GLOBAL_INFO_FIELD { +enum { TYPE = 0, NAME, VALUE }; +} + +static ST_FIELD_INFO rdb_i_s_global_info_fields_info[] = { + ROCKSDB_FIELD_INFO("TYPE", FN_REFLEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("NAME", FN_REFLEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("VALUE", FN_REFLEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO_END}; /* * helper function for rdb_i_s_global_info_fill_table * to insert (TYPE, KEY, VALUE) rows into * information_schema.rocksdb_global_info */ -static int rdb_global_info_fill_row(my_core::THD *thd, - my_core::TABLE_LIST *tables, - const char *type, - const char *name, - const char *value) -{ +static int rdb_global_info_fill_row(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + const char *const type, + const char *const name, + const char *const value) { DBUG_ASSERT(thd != nullptr); DBUG_ASSERT(tables != nullptr); DBUG_ASSERT(tables->table != nullptr); @@ -669,56 +715,39 @@ DBUG_ASSERT(name != nullptr); DBUG_ASSERT(value != nullptr); - Field **field= tables->table->field; + Field **field = tables->table->field; DBUG_ASSERT(field != nullptr); - field[0]->store(type, strlen(type), system_charset_info); - field[1]->store(name, strlen(name), system_charset_info); - field[2]->store(value, strlen(value), system_charset_info); + field[RDB_GLOBAL_INFO_FIELD::TYPE]->store(type, strlen(type), + system_charset_info); + field[RDB_GLOBAL_INFO_FIELD::NAME]->store(name, strlen(name), + system_charset_info); + field[RDB_GLOBAL_INFO_FIELD::VALUE]->store(value, strlen(value), + system_charset_info); return my_core::schema_table_store_record(thd, tables->table); } -/* - Support for INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO dynamic table - */ -static int rdb_i_s_global_info_fill_table( - my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond __attribute__((__unused__))) -{ +static int rdb_i_s_global_info_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(thd != nullptr); DBUG_ASSERT(tables != nullptr); - DBUG_ENTER("rdb_i_s_global_info_fill_table"); static const uint32_t INT_BUF_LEN = 21; - static const uint32_t GTID_BUF_LEN = 60; static const uint32_t CF_ID_INDEX_BUF_LEN = 60; - int ret= 0; - - /* binlog info */ - Rdb_binlog_manager *blm= rdb_get_binlog_manager(); - DBUG_ASSERT(blm != nullptr); - - char file_buf[FN_REFLEN+1]= {0}; - my_off_t pos = 0; - char pos_buf[INT_BUF_LEN]= {0}; - char gtid_buf[GTID_BUF_LEN]= {0}; - - if (blm->read(file_buf, &pos, gtid_buf)) { - snprintf(pos_buf, INT_BUF_LEN, "%lu", (uint64_t) pos); - ret |= rdb_global_info_fill_row(thd, tables, "BINLOG", "FILE", file_buf); - ret |= rdb_global_info_fill_row(thd, tables, "BINLOG", "POS", pos_buf); - ret |= rdb_global_info_fill_row(thd, tables, "BINLOG", "GTID", gtid_buf); - } + int ret = 0; /* max index info */ - Rdb_dict_manager *dict_manager= rdb_get_dict_manager(); + const Rdb_dict_manager *const dict_manager = rdb_get_dict_manager(); DBUG_ASSERT(dict_manager != nullptr); uint32_t max_index_id; - char max_index_id_buf[INT_BUF_LEN]= {0}; + char max_index_id_buf[INT_BUF_LEN] = {0}; if (dict_manager->get_max_index_id(&max_index_id)) { snprintf(max_index_id_buf, INT_BUF_LEN, "%u", max_index_id); @@ -727,32 +756,46 @@ } /* cf_id -> cf_flags */ - char cf_id_buf[INT_BUF_LEN]= {0}; - char cf_value_buf[FN_REFLEN+1] = {0}; - Rdb_cf_manager& cf_manager= rdb_get_cf_manager(); - for (auto cf_handle : cf_manager.get_all_cf()) { + char cf_id_buf[INT_BUF_LEN] = {0}; + char cf_value_buf[FN_REFLEN + 1] = {0}; + const Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); + + for (const auto &cf_handle : cf_manager.get_all_cf()) { + DBUG_ASSERT(cf_handle != nullptr); + uint flags; - dict_manager->get_cf_flags(cf_handle->GetID(), &flags); + + if (!dict_manager->get_cf_flags(cf_handle->GetID(), &flags)) { + // NO_LINT_DEBUG + sql_print_error("RocksDB: Failed to get column family flags " + "from CF with id = %u. MyRocks data dictionary may " + "be corrupted.", + cf_handle->GetID()); + abort_with_stack_traces(); + } + snprintf(cf_id_buf, INT_BUF_LEN, "%u", cf_handle->GetID()); snprintf(cf_value_buf, FN_REFLEN, "%s [%u]", cf_handle->GetName().c_str(), - flags); + flags); + ret |= rdb_global_info_fill_row(thd, tables, "CF_FLAGS", cf_id_buf, - cf_value_buf); + cf_value_buf); - if (ret) + if (ret) { break; + } } /* DDL_DROP_INDEX_ONGOING */ - std::vector gl_index_ids; - dict_manager->get_ongoing_index_operation(&gl_index_ids, - Rdb_key_def::DDL_DROP_INDEX_ONGOING); - char cf_id_index_buf[CF_ID_INDEX_BUF_LEN]= {0}; + std::unordered_set gl_index_ids; + dict_manager->get_ongoing_index_operation( + &gl_index_ids, Rdb_key_def::DDL_DROP_INDEX_ONGOING); + char cf_id_index_buf[CF_ID_INDEX_BUF_LEN] = {0}; for (auto gl_index_id : gl_index_ids) { snprintf(cf_id_index_buf, CF_ID_INDEX_BUF_LEN, "cf_id:%u,index_id:%u", - gl_index_id.cf_id, gl_index_id.index_id); + gl_index_id.cf_id, gl_index_id.index_id); ret |= rdb_global_info_fill_row(thd, tables, "DDL_DROP_INDEX_ONGOING", - cf_id_index_buf, ""); + cf_id_index_buf, ""); if (ret) break; @@ -761,164 +804,245 @@ DBUG_RETURN(ret); } -static ST_FIELD_INFO rdb_i_s_global_info_fields_info[] = -{ - ROCKSDB_FIELD_INFO("TYPE", FN_REFLEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("NAME", FN_REFLEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("VALUE", FN_REFLEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO_END -}; +/* + Support for INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS dynamic table + */ +static int rdb_i_s_compact_stats_fill_table(my_core::THD *thd, + my_core::TABLE_LIST *tables, + my_core::Item *cond + __attribute__((__unused__))) { + DBUG_ASSERT(thd != nullptr); + DBUG_ASSERT(tables != nullptr); + DBUG_ENTER("rdb_i_s_global_compact_stats_table"); -namespace // anonymous namespace = not visible outside this source file -{ -struct Rdb_ddl_scanner : public Rdb_tables_scanner + int ret = 0; + + rocksdb::DB *rdb = rdb_get_rocksdb_db(); + Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); + DBUG_ASSERT(rdb != nullptr); + + for (auto cf_name : cf_manager.get_cf_names()) { + rocksdb::ColumnFamilyHandle *cfh; + bool is_automatic; + /* + Only the cf name is important. Whether it was generated automatically + does not matter, so is_automatic is ignored. + */ + cfh = cf_manager.get_cf(cf_name.c_str(), "", nullptr, &is_automatic); + if (cfh == nullptr) { + continue; + } + std::map props; + bool bool_ret __attribute__((__unused__)); + bool_ret = rdb->GetMapProperty(cfh, "rocksdb.cfstats", &props); + DBUG_ASSERT(bool_ret); + + for (auto const &prop_ent : props) { + std::string prop_name = prop_ent.first; + double value = prop_ent.second; + std::size_t del_pos = prop_name.find('.'); + DBUG_ASSERT(del_pos != std::string::npos); + std::string level_str = prop_name.substr(0, del_pos); + std::string type_str = prop_name.substr(del_pos + 1); + + Field **field = tables->table->field; + DBUG_ASSERT(field != nullptr); + field[0]->store(cf_name.c_str(), cf_name.size(), system_charset_info); + field[1]->store(level_str.c_str(), level_str.size(), system_charset_info); + field[2]->store(type_str.c_str(), type_str.size(), system_charset_info); + field[3]->store(value, true); + + ret |= my_core::schema_table_store_record(thd, tables->table); + if (ret != 0) { + DBUG_RETURN(ret); + } + } + } + + DBUG_RETURN(ret); +} + +static ST_FIELD_INFO rdb_i_s_compact_stats_fields_info[] = { + ROCKSDB_FIELD_INFO("CF_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("LEVEL", FN_REFLEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("TYPE", FN_REFLEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("VALUE", sizeof(double), MYSQL_TYPE_DOUBLE, 0), + ROCKSDB_FIELD_INFO_END}; + +namespace // anonymous namespace = not visible outside this source file { - my_core::THD *m_thd; +struct Rdb_ddl_scanner : public Rdb_tables_scanner { + my_core::THD *m_thd; my_core::TABLE *m_table; - int add_table(Rdb_tbl_def* tdef) override; + int add_table(Rdb_tbl_def *tdef) override; +}; +} // anonymous namespace + +/* + Support for INFORMATION_SCHEMA.ROCKSDB_DDL dynamic table + */ +namespace RDB_DDL_FIELD { +enum { + TABLE_SCHEMA = 0, + TABLE_NAME, + PARTITION_NAME, + INDEX_NAME, + COLUMN_FAMILY, + INDEX_NUMBER, + INDEX_TYPE, + KV_FORMAT_VERSION, + CF }; -} // anonymous namespace +} // namespace RDB_DDL_FIELD +static ST_FIELD_INFO rdb_i_s_ddl_fields_info[] = { + ROCKSDB_FIELD_INFO("TABLE_SCHEMA", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("TABLE_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("PARTITION_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, + MY_I_S_MAYBE_NULL), + ROCKSDB_FIELD_INFO("INDEX_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("COLUMN_FAMILY", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("INDEX_NUMBER", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("INDEX_TYPE", sizeof(uint16_t), MYSQL_TYPE_SHORT, 0), + ROCKSDB_FIELD_INFO("KV_FORMAT_VERSION", sizeof(uint16_t), MYSQL_TYPE_SHORT, + 0), + ROCKSDB_FIELD_INFO("CF", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO_END}; -int Rdb_ddl_scanner::add_table(Rdb_tbl_def *tdef) -{ +int Rdb_ddl_scanner::add_table(Rdb_tbl_def *tdef) { DBUG_ASSERT(tdef != nullptr); - int ret= 0; + int ret = 0; DBUG_ASSERT(m_table != nullptr); - Field** field= m_table->field; + Field **field = m_table->field; DBUG_ASSERT(field != nullptr); - const std::string& dbname= tdef->base_dbname(); - field[0]->store(dbname.c_str(), dbname.size(), system_charset_info); - - const std::string& tablename= tdef->base_tablename(); - field[1]->store(tablename.c_str(), tablename.size(), system_charset_info); - - const std::string& partname= tdef->base_partition(); - if (partname.length() == 0) - { - field[2]->set_null(); - } - else - { - field[2]->set_notnull(); - field[2]->store(partname.c_str(), partname.size(), system_charset_info); + const std::string &dbname = tdef->base_dbname(); + field[RDB_DDL_FIELD::TABLE_SCHEMA]->store(dbname.c_str(), dbname.size(), + system_charset_info); + + const std::string &tablename = tdef->base_tablename(); + field[RDB_DDL_FIELD::TABLE_NAME]->store(tablename.c_str(), tablename.size(), + system_charset_info); + + const std::string &partname = tdef->base_partition(); + if (partname.length() == 0) { + field[RDB_DDL_FIELD::PARTITION_NAME]->set_null(); + } else { + field[RDB_DDL_FIELD::PARTITION_NAME]->set_notnull(); + field[RDB_DDL_FIELD::PARTITION_NAME]->store( + partname.c_str(), partname.size(), system_charset_info); } - for (uint i= 0; i < tdef->m_key_count; i++) - { - const std::shared_ptr& kd= tdef->m_key_descr_arr[i]; - DBUG_ASSERT(kd != nullptr); - - field[3]->store(kd->m_name.c_str(), kd->m_name.size(), system_charset_info); - - GL_INDEX_ID gl_index_id = kd->get_gl_index_id(); - field[4]->store(gl_index_id.cf_id, true); - field[5]->store(gl_index_id.index_id, true); - field[6]->store(kd->m_index_type, true); - field[7]->store(kd->m_kv_format_version, true); + for (uint i = 0; i < tdef->m_key_count; i++) { + const Rdb_key_def &kd = *tdef->m_key_descr_arr[i]; - std::string cf_name= kd->get_cf()->GetName(); - field[8]->store(cf_name.c_str(), cf_name.size(), system_charset_info); + field[RDB_DDL_FIELD::INDEX_NAME]->store(kd.m_name.c_str(), kd.m_name.size(), + system_charset_info); - ret= my_core::schema_table_store_record(m_thd, m_table); + GL_INDEX_ID gl_index_id = kd.get_gl_index_id(); + field[RDB_DDL_FIELD::COLUMN_FAMILY]->store(gl_index_id.cf_id, true); + field[RDB_DDL_FIELD::INDEX_NUMBER]->store(gl_index_id.index_id, true); + field[RDB_DDL_FIELD::INDEX_TYPE]->store(kd.m_index_type, true); + field[RDB_DDL_FIELD::KV_FORMAT_VERSION]->store(kd.m_kv_format_version, + true); + + std::string cf_name = kd.get_cf()->GetName(); + field[RDB_DDL_FIELD::CF]->store(cf_name.c_str(), cf_name.size(), + system_charset_info); + + ret = my_core::schema_table_store_record(m_thd, m_table); if (ret) return ret; } - return 0; + return HA_EXIT_SUCCESS; } -static int rdb_i_s_ddl_fill_table(my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond) -{ - DBUG_ENTER("rdb_i_s_ddl_fill_table"); +static int rdb_i_s_ddl_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond) { + DBUG_ENTER_FUNC(); DBUG_ASSERT(thd != nullptr); DBUG_ASSERT(tables != nullptr); Rdb_ddl_scanner ddl_arg; - ddl_arg.m_thd= thd; - ddl_arg.m_table= tables->table; + ddl_arg.m_thd = thd; + ddl_arg.m_table = tables->table; - Rdb_ddl_manager *ddl_manager= rdb_get_ddl_manager(); + Rdb_ddl_manager *ddl_manager = rdb_get_ddl_manager(); DBUG_ASSERT(ddl_manager != nullptr); - int ret= ddl_manager->scan_for_tables(&ddl_arg); + int ret = ddl_manager->scan_for_tables(&ddl_arg); DBUG_RETURN(ret); } -static ST_FIELD_INFO rdb_i_s_ddl_fields_info[] = -{ - ROCKSDB_FIELD_INFO("TABLE_SCHEMA", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("TABLE_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("PARTITION_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, - MY_I_S_MAYBE_NULL), - ROCKSDB_FIELD_INFO("INDEX_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("COLUMN_FAMILY", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), - ROCKSDB_FIELD_INFO("INDEX_NUMBER", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), - ROCKSDB_FIELD_INFO("INDEX_TYPE", sizeof(uint16_t), MYSQL_TYPE_SHORT, 0), - ROCKSDB_FIELD_INFO("KV_FORMAT_VERSION", sizeof(uint16_t), - MYSQL_TYPE_SHORT, 0), - ROCKSDB_FIELD_INFO("CF", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO_END -}; +static int rdb_i_s_ddl_init(void *const p) { + DBUG_ENTER_FUNC(); -static int rdb_i_s_ddl_init(void *p) -{ my_core::ST_SCHEMA_TABLE *schema; - DBUG_ENTER("rdb_i_s_ddl_init"); DBUG_ASSERT(p != nullptr); - schema= (my_core::ST_SCHEMA_TABLE*) p; + schema = (my_core::ST_SCHEMA_TABLE *)p; - schema->fields_info= rdb_i_s_ddl_fields_info; - schema->fill_table= rdb_i_s_ddl_fill_table; + schema->fields_info = rdb_i_s_ddl_fields_info; + schema->fill_table = rdb_i_s_ddl_fill_table; DBUG_RETURN(0); } -static int rdb_i_s_cfoptions_init(void *p) -{ +static int rdb_i_s_cfoptions_init(void *const p) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(p != nullptr); + my_core::ST_SCHEMA_TABLE *schema; - DBUG_ENTER("rdb_i_s_cfoptions_init"); + schema = (my_core::ST_SCHEMA_TABLE *)p; + + schema->fields_info = rdb_i_s_cfoptions_fields_info; + schema->fill_table = rdb_i_s_cfoptions_fill_table; + + DBUG_RETURN(0); +} + +static int rdb_i_s_global_info_init(void *const p) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(p != nullptr); - schema= (my_core::ST_SCHEMA_TABLE*) p; + my_core::ST_SCHEMA_TABLE *schema; - schema->fields_info= rdb_i_s_cfoptions_fields_info; - schema->fill_table= rdb_i_s_cfoptions_fill_table; + schema = reinterpret_cast(p); + + schema->fields_info = rdb_i_s_global_info_fields_info; + schema->fill_table = rdb_i_s_global_info_fill_table; DBUG_RETURN(0); } -static int rdb_i_s_global_info_init(void *p) -{ +static int rdb_i_s_compact_stats_init(void *p) { my_core::ST_SCHEMA_TABLE *schema; - DBUG_ENTER("rdb_i_s_global_info_init"); + DBUG_ENTER("rdb_i_s_compact_stats_init"); DBUG_ASSERT(p != nullptr); - schema= reinterpret_cast(p); + schema = reinterpret_cast(p); - schema->fields_info= rdb_i_s_global_info_fields_info; - schema->fill_table= rdb_i_s_global_info_fill_table; + schema->fields_info = rdb_i_s_compact_stats_fields_info; + schema->fill_table = rdb_i_s_compact_stats_fill_table; DBUG_RETURN(0); } /* Given a path to a file return just the filename portion. */ -static std::string rdb_filename_without_path( - const std::string& path) -{ +static std::string rdb_filename_without_path(const std::string &path) { /* Find last slash in path */ - size_t pos = path.rfind('/'); + const size_t pos = path.rfind('/'); /* None found? Just return the original string */ if (pos == std::string::npos) { @@ -929,70 +1053,115 @@ return path.substr(pos + 1); } +/* + Support for INFORMATION_SCHEMA.ROCKSDB_INDEX_FILE_MAP dynamic table + */ +namespace RDB_INDEX_FILE_MAP_FIELD { +enum { + COLUMN_FAMILY = 0, + INDEX_NUMBER, + SST_NAME, + NUM_ROWS, + DATA_SIZE, + ENTRY_DELETES, + ENTRY_SINGLEDELETES, + ENTRY_MERGES, + ENTRY_OTHERS +}; +} // namespace RDB_INDEX_FILE_MAP_FIELD + +static ST_FIELD_INFO rdb_i_s_index_file_map_fields_info[] = { + /* The information_schema.rocksdb_index_file_map virtual table has four + * fields: + * COLUMN_FAMILY => the index's column family contained in the SST file + * INDEX_NUMBER => the index id contained in the SST file + * SST_NAME => the name of the SST file containing some indexes + * NUM_ROWS => the number of entries of this index id in this SST file + * DATA_SIZE => the data size stored in this SST file for this index id */ + ROCKSDB_FIELD_INFO("COLUMN_FAMILY", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("INDEX_NUMBER", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("SST_NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("NUM_ROWS", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("DATA_SIZE", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("ENTRY_DELETES", sizeof(int64_t), MYSQL_TYPE_LONGLONG, + 0), + ROCKSDB_FIELD_INFO("ENTRY_SINGLEDELETES", sizeof(int64_t), + MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("ENTRY_MERGES", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("ENTRY_OTHERS", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO_END}; + /* Fill the information_schema.rocksdb_index_file_map virtual table */ -static int rdb_i_s_index_file_map_fill_table( - my_core::THD *thd, - my_core::TABLE_LIST *tables, - my_core::Item *cond __attribute__((__unused__))) -{ +static int rdb_i_s_index_file_map_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(thd != nullptr); DBUG_ASSERT(tables != nullptr); DBUG_ASSERT(tables->table != nullptr); - int ret = 0; + int ret = 0; Field **field = tables->table->field; DBUG_ASSERT(field != nullptr); - DBUG_ENTER("rdb_i_s_index_file_map_fill_table"); - /* Iterate over all the column families */ - rocksdb::DB *rdb= rdb_get_rocksdb_db(); + rocksdb::DB *const rdb = rdb_get_rocksdb_db(); DBUG_ASSERT(rdb != nullptr); - Rdb_cf_manager& cf_manager= rdb_get_cf_manager(); - for (auto cf_handle : cf_manager.get_all_cf()) { + const Rdb_cf_manager &cf_manager = rdb_get_cf_manager(); + for (const auto &cf_handle : cf_manager.get_all_cf()) { /* Grab the the properties of all the tables in the column family */ rocksdb::TablePropertiesCollection table_props_collection; - rocksdb::Status s = rdb->GetPropertiesOfAllTables(cf_handle, - &table_props_collection); + const rocksdb::Status s = + rdb->GetPropertiesOfAllTables(cf_handle, &table_props_collection); if (!s.ok()) { continue; } /* Iterate over all the items in the collection, each of which contains a * name and the actual properties */ - for (auto props : table_props_collection) { + for (const auto &props : table_props_collection) { /* Add the SST name into the output */ - std::string sst_name = rdb_filename_without_path(props.first); - field[2]->store(sst_name.data(), sst_name.size(), system_charset_info); + const std::string sst_name = rdb_filename_without_path(props.first); + field[RDB_INDEX_FILE_MAP_FIELD::SST_NAME]->store( + sst_name.data(), sst_name.size(), system_charset_info); /* Get the __indexstats__ data out of the table property */ std::vector stats; Rdb_tbl_prop_coll::read_stats_from_tbl_props(props.second, &stats); if (stats.empty()) { - field[0]->store(-1, true); - field[1]->store(-1, true); - field[3]->store(-1, true); - field[4]->store(-1, true); - field[5]->store(-1, true); - field[6]->store(-1, true); - field[7]->store(-1, true); - field[8]->store(-1, true); - } - else { + field[RDB_INDEX_FILE_MAP_FIELD::COLUMN_FAMILY]->store(-1, true); + field[RDB_INDEX_FILE_MAP_FIELD::INDEX_NUMBER]->store(-1, true); + field[RDB_INDEX_FILE_MAP_FIELD::NUM_ROWS]->store(-1, true); + field[RDB_INDEX_FILE_MAP_FIELD::DATA_SIZE]->store(-1, true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_DELETES]->store(-1, true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_SINGLEDELETES]->store(-1, true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_MERGES]->store(-1, true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_OTHERS]->store(-1, true); + } else { for (auto it : stats) { - /* Add the index number, the number of rows, and data size to the output */ - field[0]->store(it.m_gl_index_id.cf_id, true); - field[1]->store(it.m_gl_index_id.index_id, true); - field[3]->store(it.m_rows, true); - field[4]->store(it.m_data_size, true); - field[5]->store(it.m_entry_deletes, true); - field[6]->store(it.m_entry_single_deletes, true); - field[7]->store(it.m_entry_merges, true); - field[8]->store(it.m_entry_others, true); + /* Add the index number, the number of rows, and data size to the + * output */ + field[RDB_INDEX_FILE_MAP_FIELD::COLUMN_FAMILY]->store( + it.m_gl_index_id.cf_id, true); + field[RDB_INDEX_FILE_MAP_FIELD::INDEX_NUMBER]->store( + it.m_gl_index_id.index_id, true); + field[RDB_INDEX_FILE_MAP_FIELD::NUM_ROWS]->store(it.m_rows, true); + field[RDB_INDEX_FILE_MAP_FIELD::DATA_SIZE]->store(it.m_data_size, + true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_DELETES]->store( + it.m_entry_deletes, true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_SINGLEDELETES]->store( + it.m_entry_single_deletes, true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_MERGES]->store( + it.m_entry_merges, true); + field[RDB_INDEX_FILE_MAP_FIELD::ENTRY_OTHERS]->store( + it.m_entry_others, true); /* Tell MySQL about this row in the virtual table */ - ret= my_core::schema_table_store_record(thd, tables->table); + ret = my_core::schema_table_store_record(thd, tables->table); if (ret != 0) { break; } @@ -1004,186 +1173,402 @@ DBUG_RETURN(ret); } -static ST_FIELD_INFO rdb_i_s_index_file_map_fields_info[] = -{ - /* The information_schema.rocksdb_index_file_map virtual table has four fields: - * COLUMN_FAMILY => the index's column family contained in the SST file - * INDEX_NUMBER => the index id contained in the SST file - * SST_NAME => the name of the SST file containing some indexes - * NUM_ROWS => the number of entries of this index id in this SST file - * DATA_SIZE => the data size stored in this SST file for this index id */ - ROCKSDB_FIELD_INFO("COLUMN_FAMILY", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), - ROCKSDB_FIELD_INFO("INDEX_NUMBER", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), - ROCKSDB_FIELD_INFO("SST_NAME", NAME_LEN+1, MYSQL_TYPE_STRING, 0), - ROCKSDB_FIELD_INFO("NUM_ROWS", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO("DATA_SIZE", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO("ENTRY_DELETES", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO("ENTRY_SINGLEDELETES", sizeof(int64_t), - MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO("ENTRY_MERGES", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO("ENTRY_OTHERS", sizeof(int64_t), MYSQL_TYPE_LONGLONG, 0), - ROCKSDB_FIELD_INFO_END -}; - /* Initialize the information_schema.rocksdb_index_file_map virtual table */ -static int rdb_i_s_index_file_map_init(void *p) -{ +static int rdb_i_s_index_file_map_init(void *const p) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(p != nullptr); + my_core::ST_SCHEMA_TABLE *schema; - DBUG_ENTER("rdb_i_s_index_file_map_init"); + schema = (my_core::ST_SCHEMA_TABLE *)p; + + schema->fields_info = rdb_i_s_index_file_map_fields_info; + schema->fill_table = rdb_i_s_index_file_map_fill_table; + + DBUG_RETURN(0); +} + +/* + Support for INFORMATION_SCHEMA.ROCKSDB_LOCKS dynamic table + */ +namespace RDB_LOCKS_FIELD { +enum { COLUMN_FAMILY_ID = 0, TRANSACTION_ID, KEY, MODE }; +} // namespace RDB_LOCKS_FIELD + +static ST_FIELD_INFO rdb_i_s_lock_info_fields_info[] = { + ROCKSDB_FIELD_INFO("COLUMN_FAMILY_ID", sizeof(uint32_t), MYSQL_TYPE_LONG, + 0), + ROCKSDB_FIELD_INFO("TRANSACTION_ID", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("KEY", FN_REFLEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("MODE", 32, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO_END}; + +/* Fill the information_schema.rocksdb_locks virtual table */ +static int rdb_i_s_lock_info_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(thd != nullptr); + DBUG_ASSERT(tables != nullptr); + DBUG_ASSERT(tables->table != nullptr); + + int ret = 0; + + rocksdb::TransactionDB *const rdb = rdb_get_rocksdb_db(); + DBUG_ASSERT(rdb != nullptr); + + /* cf id -> rocksdb::KeyLockInfo */ + std::unordered_multimap lock_info = + rdb->GetLockStatusData(); + + for (const auto &lock : lock_info) { + const uint32_t cf_id = lock.first; + const auto &key_lock_info = lock.second; + const auto key_hexstr = rdb_hexdump(key_lock_info.key.c_str(), + key_lock_info.key.length(), FN_REFLEN); + + for (const auto &id : key_lock_info.ids) { + tables->table->field[RDB_LOCKS_FIELD::COLUMN_FAMILY_ID]->store(cf_id, + true); + tables->table->field[RDB_LOCKS_FIELD::TRANSACTION_ID]->store(id, true); + + tables->table->field[RDB_LOCKS_FIELD::KEY]->store( + key_hexstr.c_str(), key_hexstr.size(), system_charset_info); + tables->table->field[RDB_LOCKS_FIELD::MODE]->store( + key_lock_info.exclusive ? "X" : "S", 1, system_charset_info); + + /* Tell MySQL about this row in the virtual table */ + ret = my_core::schema_table_store_record(thd, tables->table); + if (ret != 0) { + break; + } + } + } + DBUG_RETURN(ret); +} + +/* Initialize the information_schema.rocksdb_lock_info virtual table */ +static int rdb_i_s_lock_info_init(void *const p) { + DBUG_ENTER_FUNC(); + DBUG_ASSERT(p != nullptr); - schema= (my_core::ST_SCHEMA_TABLE*) p; + my_core::ST_SCHEMA_TABLE *schema; + + schema = (my_core::ST_SCHEMA_TABLE *)p; - schema->fields_info= rdb_i_s_index_file_map_fields_info; - schema->fill_table= rdb_i_s_index_file_map_fill_table; + schema->fields_info = rdb_i_s_lock_info_fields_info; + schema->fill_table = rdb_i_s_lock_info_fill_table; DBUG_RETURN(0); } -static int rdb_i_s_deinit(void *p __attribute__((__unused__))) -{ - DBUG_ENTER("rdb_i_s_deinit"); +/* + Support for INFORMATION_SCHEMA.ROCKSDB_TRX dynamic table + */ +namespace RDB_TRX_FIELD { +enum { + TRANSACTION_ID = 0, + STATE, + NAME, + WRITE_COUNT, + LOCK_COUNT, + TIMEOUT_SEC, + WAITING_KEY, + WAITING_COLUMN_FAMILY_ID, + IS_REPLICATION, + SKIP_TRX_API, + READ_ONLY, + HAS_DEADLOCK_DETECTION, + NUM_ONGOING_BULKLOAD, + THREAD_ID, + QUERY +}; +} // namespace RDB_TRX_FIELD + +static ST_FIELD_INFO rdb_i_s_trx_info_fields_info[] = { + ROCKSDB_FIELD_INFO("TRANSACTION_ID", sizeof(ulonglong), MYSQL_TYPE_LONGLONG, + 0), + ROCKSDB_FIELD_INFO("STATE", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("NAME", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("WRITE_COUNT", sizeof(ulonglong), MYSQL_TYPE_LONGLONG, + 0), + ROCKSDB_FIELD_INFO("LOCK_COUNT", sizeof(ulonglong), MYSQL_TYPE_LONGLONG, 0), + ROCKSDB_FIELD_INFO("TIMEOUT_SEC", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("WAITING_KEY", FN_REFLEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO("WAITING_COLUMN_FAMILY_ID", sizeof(uint32_t), + MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("IS_REPLICATION", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("SKIP_TRX_API", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("READ_ONLY", sizeof(uint32_t), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("HAS_DEADLOCK_DETECTION", sizeof(uint32_t), + MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("NUM_ONGOING_BULKLOAD", sizeof(uint32_t), + MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("THREAD_ID", sizeof(ulong), MYSQL_TYPE_LONG, 0), + ROCKSDB_FIELD_INFO("QUERY", NAME_LEN + 1, MYSQL_TYPE_STRING, 0), + ROCKSDB_FIELD_INFO_END}; + +/* Fill the information_schema.rocksdb_trx virtual table */ +static int rdb_i_s_trx_info_fill_table(my_core::THD *const thd, + my_core::TABLE_LIST *const tables, + my_core::Item *const cond + __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(thd != nullptr); + DBUG_ASSERT(tables != nullptr); + DBUG_ASSERT(tables->table != nullptr); + + int ret = 0; + + const std::vector &all_trx_info = rdb_get_all_trx_info(); + + for (const auto &info : all_trx_info) { + auto name_hexstr = + rdb_hexdump(info.name.c_str(), info.name.length(), NAME_LEN); + auto key_hexstr = rdb_hexdump(info.waiting_key.c_str(), + info.waiting_key.length(), FN_REFLEN); + tables->table->field[RDB_TRX_FIELD::TRANSACTION_ID]->store(info.trx_id, + true); + tables->table->field[RDB_TRX_FIELD::STATE]->store( + info.state.c_str(), info.state.length(), system_charset_info); + tables->table->field[RDB_TRX_FIELD::NAME]->store( + name_hexstr.c_str(), name_hexstr.length(), system_charset_info); + tables->table->field[RDB_TRX_FIELD::WRITE_COUNT]->store(info.write_count, + true); + tables->table->field[RDB_TRX_FIELD::LOCK_COUNT]->store(info.lock_count, + true); + tables->table->field[RDB_TRX_FIELD::TIMEOUT_SEC]->store(info.timeout_sec, + false); + tables->table->field[RDB_TRX_FIELD::WAITING_KEY]->store( + key_hexstr.c_str(), key_hexstr.length(), system_charset_info); + tables->table->field[RDB_TRX_FIELD::WAITING_COLUMN_FAMILY_ID]->store( + info.waiting_cf_id, true); + tables->table->field[RDB_TRX_FIELD::IS_REPLICATION]->store( + info.is_replication, false); + tables->table->field[RDB_TRX_FIELD::SKIP_TRX_API]->store(info.skip_trx_api, + false); + tables->table->field[RDB_TRX_FIELD::READ_ONLY]->store(info.read_only, + false); + tables->table->field[RDB_TRX_FIELD::HAS_DEADLOCK_DETECTION]->store( + info.deadlock_detect, false); + tables->table->field[RDB_TRX_FIELD::NUM_ONGOING_BULKLOAD]->store( + info.num_ongoing_bulk_load, false); + tables->table->field[RDB_TRX_FIELD::THREAD_ID]->store(info.thread_id, true); + tables->table->field[RDB_TRX_FIELD::QUERY]->store( + info.query_str.c_str(), info.query_str.length(), system_charset_info); + + /* Tell MySQL about this row in the virtual table */ + ret = my_core::schema_table_store_record(thd, tables->table); + if (ret != 0) { + break; + } + } + + DBUG_RETURN(ret); +} + +/* Initialize the information_schema.rocksdb_trx_info virtual table */ +static int rdb_i_s_trx_info_init(void *const p) { + DBUG_ENTER_FUNC(); + + DBUG_ASSERT(p != nullptr); + + my_core::ST_SCHEMA_TABLE *schema; + + schema = (my_core::ST_SCHEMA_TABLE *)p; + + schema->fields_info = rdb_i_s_trx_info_fields_info; + schema->fill_table = rdb_i_s_trx_info_fill_table; + + DBUG_RETURN(0); +} + +static int rdb_i_s_deinit(void *p __attribute__((__unused__))) { + DBUG_ENTER_FUNC(); DBUG_RETURN(0); } -static struct st_mysql_information_schema rdb_i_s_info= -{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; +static struct st_mysql_information_schema rdb_i_s_info = { + MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION}; -struct st_mysql_plugin rdb_i_s_cfstats= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_CFSTATS", - "Facebook", - "RocksDB column family stats", - PLUGIN_LICENSE_GPL, - rdb_i_s_cfstats_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_cfstats = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_CFSTATS", + "Facebook", + "RocksDB column family stats", + PLUGIN_LICENSE_GPL, + rdb_i_s_cfstats_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -struct st_mysql_plugin rdb_i_s_dbstats= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_DBSTATS", - "Facebook", - "RocksDB database stats", - PLUGIN_LICENSE_GPL, - rdb_i_s_dbstats_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_dbstats = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_DBSTATS", + "Facebook", + "RocksDB database stats", + PLUGIN_LICENSE_GPL, + rdb_i_s_dbstats_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -struct st_mysql_plugin rdb_i_s_perf_context= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_PERF_CONTEXT", - "Facebook", - "RocksDB perf context stats", - PLUGIN_LICENSE_GPL, - rdb_i_s_perf_context_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_perf_context = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_PERF_CONTEXT", + "Facebook", + "RocksDB perf context stats", + PLUGIN_LICENSE_GPL, + rdb_i_s_perf_context_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -struct st_mysql_plugin rdb_i_s_perf_context_global= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_PERF_CONTEXT_GLOBAL", - "Facebook", - "RocksDB perf context stats (all)", - PLUGIN_LICENSE_GPL, - rdb_i_s_perf_context_global_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_perf_context_global = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_PERF_CONTEXT_GLOBAL", + "Facebook", + "RocksDB perf context stats (all)", + PLUGIN_LICENSE_GPL, + rdb_i_s_perf_context_global_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -struct st_mysql_plugin rdb_i_s_cfoptions= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_CF_OPTIONS", - "Facebook", - "RocksDB column family options", - PLUGIN_LICENSE_GPL, - rdb_i_s_cfoptions_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_cfoptions = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_CF_OPTIONS", + "Facebook", + "RocksDB column family options", + PLUGIN_LICENSE_GPL, + rdb_i_s_cfoptions_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -struct st_mysql_plugin rdb_i_s_global_info= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_GLOBAL_INFO", - "Facebook", - "RocksDB global info", - PLUGIN_LICENSE_GPL, - rdb_i_s_global_info_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_global_info = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_GLOBAL_INFO", + "Facebook", + "RocksDB global info", + PLUGIN_LICENSE_GPL, + rdb_i_s_global_info_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -struct st_mysql_plugin rdb_i_s_ddl= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_DDL", - "Facebook", - "RocksDB Data Dictionary", - PLUGIN_LICENSE_GPL, - rdb_i_s_ddl_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_compact_stats = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_COMPACTION_STATS", + "Facebook", + "RocksDB compaction stats", + PLUGIN_LICENSE_GPL, + rdb_i_s_compact_stats_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -struct st_mysql_plugin rdb_i_s_index_file_map= -{ - MYSQL_INFORMATION_SCHEMA_PLUGIN, - &rdb_i_s_info, - "ROCKSDB_INDEX_FILE_MAP", - "Facebook", - "RocksDB index file map", - PLUGIN_LICENSE_GPL, - rdb_i_s_index_file_map_init, - rdb_i_s_deinit, - 0x0001, /* version number (0.1) */ - nullptr, /* status variables */ - nullptr, /* system variables */ - nullptr, /* config options */ - 0, /* flags */ +struct st_mysql_plugin rdb_i_s_ddl = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_DDL", + "Facebook", + "RocksDB Data Dictionary", + PLUGIN_LICENSE_GPL, + rdb_i_s_ddl_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ +}; + +struct st_mysql_plugin rdb_i_s_index_file_map = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_INDEX_FILE_MAP", + "Facebook", + "RocksDB index file map", + PLUGIN_LICENSE_GPL, + rdb_i_s_index_file_map_init, + rdb_i_s_deinit, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ }; -} // namespace myrocks +struct st_mysql_plugin rdb_i_s_lock_info = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_LOCKS", + "Facebook", + "RocksDB lock information", + PLUGIN_LICENSE_GPL, + rdb_i_s_lock_info_init, + nullptr, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ +}; + +struct st_mysql_plugin rdb_i_s_trx_info = { + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &rdb_i_s_info, + "ROCKSDB_TRX", + "Facebook", + "RocksDB transaction information", + PLUGIN_LICENSE_GPL, + rdb_i_s_trx_info_init, + nullptr, + 0x0001, /* version number (0.1) */ + nullptr, /* status variables */ + nullptr, /* system variables */ + nullptr, /* config options */ + 0, /* flags */ +}; +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_i_s.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_i_s.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_i_s.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_i_s.h 2017-10-19 04:25:29.000000000 +0000 @@ -26,9 +26,10 @@ extern struct st_mysql_plugin rdb_i_s_perf_context; extern struct st_mysql_plugin rdb_i_s_perf_context_global; extern struct st_mysql_plugin rdb_i_s_cfoptions; +extern struct st_mysql_plugin rdb_i_s_compact_stats; extern struct st_mysql_plugin rdb_i_s_global_info; extern struct st_mysql_plugin rdb_i_s_ddl; extern struct st_mysql_plugin rdb_i_s_index_file_map; - -} // namespace myrocks - +extern struct st_mysql_plugin rdb_i_s_lock_info; +extern struct st_mysql_plugin rdb_i_s_trx_info; +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_mutex_wrapper.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_mutex_wrapper.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_mutex_wrapper.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_mutex_wrapper.cc 2017-10-19 04:25:29.000000000 +0000 @@ -22,8 +22,7 @@ #include "./rdb_utils.h" // Internal MySQL APIs not exposed in any header. -extern "C" -{ +extern "C" { void thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, mysql_mutex_t *mutex, const PSI_stage_info *stage, PSI_stage_info *old_stage); void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage); @@ -33,27 +32,23 @@ namespace myrocks { -static -PSI_stage_info stage_waiting_on_row_lock2= { 0, "Waiting for row lock", 0}; +static PSI_stage_info stage_waiting_on_row_lock2 = {0, "Waiting for row lock", + 0}; -static const int64_t MICROSECS= 1000*1000; +static const int64_t ONE_SECOND_IN_MICROSECS = 1000 * 1000; // A timeout as long as one full non-leap year worth of microseconds is as // good as infinite timeout. -static const int64_t BIG_TIMEOUT= MICROSECS * 60 * 60 * 24 * 7 * 365; +static const int64_t ONE_YEAR_IN_MICROSECS = + ONE_SECOND_IN_MICROSECS * 60 * 60 * 24 * 365; -Rdb_cond_var::Rdb_cond_var() { - mysql_cond_init(0, &m_cond, nullptr); -} +Rdb_cond_var::Rdb_cond_var() { mysql_cond_init(0, &m_cond, nullptr); } -Rdb_cond_var::~Rdb_cond_var() { - mysql_cond_destroy(&m_cond); -} +Rdb_cond_var::~Rdb_cond_var() { mysql_cond_destroy(&m_cond); } -Status Rdb_cond_var::Wait(std::shared_ptr mutex_arg) { - return WaitFor(mutex_arg, BIG_TIMEOUT); +Status Rdb_cond_var::Wait(const std::shared_ptr mutex_arg) { + return WaitFor(mutex_arg, ONE_YEAR_IN_MICROSECS); } - /* @brief Wait on condition variable. The caller must make sure that we own @@ -69,27 +64,25 @@ */ Status -Rdb_cond_var::WaitFor(std::shared_ptr mutex_arg, - int64_t timeout_micros) -{ - auto *mutex_obj= reinterpret_cast(mutex_arg.get()); +Rdb_cond_var::WaitFor(const std::shared_ptr mutex_arg, + int64_t timeout_micros) { + auto *mutex_obj = reinterpret_cast(mutex_arg.get()); DBUG_ASSERT(mutex_obj != nullptr); - mysql_mutex_t * const mutex_ptr= &mutex_obj->m_mutex; + mysql_mutex_t *const mutex_ptr = &mutex_obj->m_mutex; - int res= 0; + int res = 0; struct timespec wait_timeout; if (timeout_micros < 0) - timeout_micros= BIG_TIMEOUT; - set_timespec_nsec(wait_timeout, timeout_micros*1000); + timeout_micros = ONE_YEAR_IN_MICROSECS; + set_timespec_nsec(wait_timeout, timeout_micros * 1000); #ifndef STANDALONE_UNITTEST PSI_stage_info old_stage; mysql_mutex_assert_owner(mutex_ptr); - if (current_thd && mutex_obj->m_old_stage_info.count(current_thd) == 0) - { + if (current_thd && mutex_obj->m_old_stage_info.count(current_thd) == 0) { my_core::thd_enter_cond(current_thd, &m_cond, mutex_ptr, &stage_waiting_on_row_lock2, &old_stage); /* @@ -105,15 +98,14 @@ } #endif - bool killed= false; + bool killed = false; - do - { - res= mysql_cond_timedwait(&m_cond, mutex_ptr, &wait_timeout); + do { + res = mysql_cond_timedwait(&m_cond, mutex_ptr, &wait_timeout); #ifndef STANDALONE_UNITTEST if (current_thd) - killed= my_core::thd_killed(current_thd); + killed = my_core::thd_killed(current_thd); #endif } while (!killed && res == EINTR); @@ -123,7 +115,6 @@ return Status::OK(); } - /* @note @@ -154,32 +145,21 @@ None of this looks like a problem for our use case. */ -void Rdb_cond_var::Notify() -{ - mysql_cond_signal(&m_cond); -} - +void Rdb_cond_var::Notify() { mysql_cond_signal(&m_cond); } /* @note This is called without holding the mutex that's used for waiting on the condition. See ::Notify(). */ -void Rdb_cond_var::NotifyAll() -{ - mysql_cond_broadcast(&m_cond); -} - +void Rdb_cond_var::NotifyAll() { mysql_cond_broadcast(&m_cond); } -Rdb_mutex::Rdb_mutex() -{ +Rdb_mutex::Rdb_mutex() { mysql_mutex_init(0 /* Don't register in P_S. */, &m_mutex, MY_MUTEX_INIT_FAST); } -Rdb_mutex::~Rdb_mutex() { - mysql_mutex_destroy(&m_mutex); -} +Rdb_mutex::~Rdb_mutex() { mysql_mutex_destroy(&m_mutex); } Status Rdb_mutex::Lock() { mysql_mutex_lock(&m_mutex); @@ -192,8 +172,7 @@ // If implementing a custom version of this class, the implementation may // choose to ignore the timeout. // Return OK on success, or other Status on failure. -Status Rdb_mutex::TryLockFor(int64_t timeout_time __attribute__((__unused__))) -{ +Status Rdb_mutex::TryLockFor(int64_t timeout_time __attribute__((__unused__))) { /* Note: PThreads API has pthread_mutex_timedlock(), but mysql's mysql_mutex_* wrappers do not wrap that function. @@ -202,10 +181,8 @@ return Status::OK(); } - #ifndef STANDALONE_UNITTEST -void Rdb_mutex::set_unlock_action(PSI_stage_info *old_stage_arg) -{ +void Rdb_mutex::set_unlock_action(const PSI_stage_info *const old_stage_arg) { DBUG_ASSERT(old_stage_arg != nullptr); mysql_mutex_assert_owner(&m_mutex); @@ -219,9 +196,9 @@ // Unlock Mutex that was successfully locked by Lock() or TryLockUntil() void Rdb_mutex::UnLock() { #ifndef STANDALONE_UNITTEST - if (m_old_stage_info.count(current_thd) > 0) - { - std::shared_ptr old_stage = m_old_stage_info[current_thd]; + if (m_old_stage_info.count(current_thd) > 0) { + const std::shared_ptr old_stage = + m_old_stage_info[current_thd]; m_old_stage_info.erase(current_thd); /* The following will call mysql_mutex_unlock */ my_core::thd_exit_cond(current_thd, old_stage.get()); @@ -231,4 +208,4 @@ mysql_mutex_unlock(&m_mutex); } -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_mutex_wrapper.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_mutex_wrapper.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_mutex_wrapper.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_mutex_wrapper.h 2017-10-19 04:25:29.000000000 +0000 @@ -32,10 +32,11 @@ namespace myrocks { -class Rdb_mutex: public rocksdb::TransactionDBMutex { - Rdb_mutex(const Rdb_mutex& p) = delete; - Rdb_mutex& operator = (const Rdb_mutex& p)=delete; - public: +class Rdb_mutex : public rocksdb::TransactionDBMutex { + Rdb_mutex(const Rdb_mutex &p) = delete; + Rdb_mutex &operator=(const Rdb_mutex &p) = delete; + +public: Rdb_mutex(); virtual ~Rdb_mutex(); @@ -53,25 +54,27 @@ // TimedOut if timed out, // or other Status on failure. // If returned status is OK, TransactionDB will eventually call UnLock(). - virtual rocksdb::Status TryLockFor( - int64_t timeout_time __attribute__((__unused__))) override; + virtual rocksdb::Status TryLockFor(int64_t timeout_time + __attribute__((__unused__))) override; // Unlock Mutex that was successfully locked by Lock() or TryLockUntil() virtual void UnLock() override; - private: +private: mysql_mutex_t m_mutex; friend class Rdb_cond_var; #ifndef STANDALONE_UNITTEST - void set_unlock_action(PSI_stage_info *old_stage_arg); - std::unordered_map> m_old_stage_info; + void set_unlock_action(const PSI_stage_info *const old_stage_arg); + std::unordered_map> m_old_stage_info; #endif }; +class Rdb_cond_var : public rocksdb::TransactionDBCondVar { + Rdb_cond_var(const Rdb_cond_var &) = delete; + Rdb_cond_var &operator=(const Rdb_cond_var &) = delete; -class Rdb_cond_var: public rocksdb::TransactionDBCondVar { - public: +public: Rdb_cond_var(); virtual ~Rdb_cond_var(); @@ -85,7 +88,7 @@ // Returns non-OK if TransactionDB should stop waiting and fail the operation. // May return OK spuriously even if not notified. virtual rocksdb::Status - Wait(std::shared_ptr mutex) override; + Wait(const std::shared_ptr mutex) override; // Block current thread until condition variable is notifiesd by a call to // Notify() or NotifyAll(), or if the timeout is reached. @@ -100,7 +103,7 @@ // fail the operation. // May return OK spuriously even if not notified. virtual rocksdb::Status - WaitFor(std::shared_ptr mutex, + WaitFor(const std::shared_ptr mutex, int64_t timeout_time) override; // If any threads are waiting on *this, unblock at least one of the @@ -110,30 +113,30 @@ // Unblocks all threads waiting on *this. virtual void NotifyAll() override; - private: +private: mysql_cond_t m_cond; }; - class Rdb_mutex_factory : public rocksdb::TransactionDBMutexFactory { - public: - /* - Override parent class's virtual methods of interrest. - */ +public: + Rdb_mutex_factory(const Rdb_mutex_factory &) = delete; + Rdb_mutex_factory &operator=(const Rdb_mutex_factory &) = delete; + Rdb_mutex_factory() {} + /* + Override parent class's virtual methods of interrest. + */ virtual std::shared_ptr AllocateMutex() override { - return - std::make_shared(); + return std::make_shared(); } virtual std::shared_ptr AllocateCondVar() override { - return - std::make_shared(); + return std::make_shared(); } virtual ~Rdb_mutex_factory() {} }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_perf_context.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_perf_context.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_perf_context.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_perf_context.cc 2017-10-19 04:25:29.000000000 +0000 @@ -35,71 +35,68 @@ // 2. Update sections (A), (B), and (C) below // 3. Update perf_context.test and show_engine.test -std::string rdb_pc_stat_types[]= -{ - // (A) These should be in the same order as the PC enum - "USER_KEY_COMPARISON_COUNT", - "BLOCK_CACHE_HIT_COUNT", - "BLOCK_READ_COUNT", - "BLOCK_READ_BYTE", - "BLOCK_READ_TIME", - "BLOCK_CHECKSUM_TIME", - "BLOCK_DECOMPRESS_TIME", - "INTERNAL_KEY_SKIPPED_COUNT", - "INTERNAL_DELETE_SKIPPED_COUNT", - "GET_SNAPSHOT_TIME", - "GET_FROM_MEMTABLE_TIME", - "GET_FROM_MEMTABLE_COUNT", - "GET_POST_PROCESS_TIME", - "GET_FROM_OUTPUT_FILES_TIME", - "SEEK_ON_MEMTABLE_TIME", - "SEEK_ON_MEMTABLE_COUNT", - "SEEK_CHILD_SEEK_TIME", - "SEEK_CHILD_SEEK_COUNT", - "SEEK_IN_HEAP_TIME", - "SEEK_INTERNAL_SEEK_TIME", - "FIND_NEXT_USER_ENTRY_TIME", - "WRITE_WAL_TIME", - "WRITE_MEMTABLE_TIME", - "WRITE_DELAY_TIME", - "WRITE_PRE_AND_POST_PROCESS_TIME", - "DB_MUTEX_LOCK_NANOS", - "DB_CONDITION_WAIT_NANOS", - "MERGE_OPERATOR_TIME_NANOS", - "READ_INDEX_BLOCK_NANOS", - "READ_FILTER_BLOCK_NANOS", - "NEW_TABLE_BLOCK_ITER_NANOS", - "NEW_TABLE_ITERATOR_NANOS", - "BLOCK_SEEK_NANOS", - "FIND_TABLE_NANOS", - "IO_THREAD_POOL_ID", - "IO_BYTES_WRITTEN", - "IO_BYTES_READ", - "IO_OPEN_NANOS", - "IO_ALLOCATE_NANOS", - "IO_WRITE_NANOS", - "IO_READ_NANOS", - "IO_RANGE_SYNC_NANOS", - "IO_LOGGER_NANOS" -}; - -#define IO_PERF_RECORD(_field_) \ - do { \ - if (rocksdb::perf_context._field_ > 0) \ - counters->m_value[idx] += rocksdb::perf_context._field_; \ - idx++; \ +std::string rdb_pc_stat_types[] = { + // (A) These should be in the same order as the PC enum + "USER_KEY_COMPARISON_COUNT", + "BLOCK_CACHE_HIT_COUNT", + "BLOCK_READ_COUNT", + "BLOCK_READ_BYTE", + "BLOCK_READ_TIME", + "BLOCK_CHECKSUM_TIME", + "BLOCK_DECOMPRESS_TIME", + "INTERNAL_KEY_SKIPPED_COUNT", + "INTERNAL_DELETE_SKIPPED_COUNT", + "GET_SNAPSHOT_TIME", + "GET_FROM_MEMTABLE_TIME", + "GET_FROM_MEMTABLE_COUNT", + "GET_POST_PROCESS_TIME", + "GET_FROM_OUTPUT_FILES_TIME", + "SEEK_ON_MEMTABLE_TIME", + "SEEK_ON_MEMTABLE_COUNT", + "SEEK_CHILD_SEEK_TIME", + "SEEK_CHILD_SEEK_COUNT", + "SEEK_IN_HEAP_TIME", + "SEEK_INTERNAL_SEEK_TIME", + "FIND_NEXT_USER_ENTRY_TIME", + "WRITE_WAL_TIME", + "WRITE_MEMTABLE_TIME", + "WRITE_DELAY_TIME", + "WRITE_PRE_AND_POST_PROCESS_TIME", + "DB_MUTEX_LOCK_NANOS", + "DB_CONDITION_WAIT_NANOS", + "MERGE_OPERATOR_TIME_NANOS", + "READ_INDEX_BLOCK_NANOS", + "READ_FILTER_BLOCK_NANOS", + "NEW_TABLE_BLOCK_ITER_NANOS", + "NEW_TABLE_ITERATOR_NANOS", + "BLOCK_SEEK_NANOS", + "FIND_TABLE_NANOS", + "IO_THREAD_POOL_ID", + "IO_BYTES_WRITTEN", + "IO_BYTES_READ", + "IO_OPEN_NANOS", + "IO_ALLOCATE_NANOS", + "IO_WRITE_NANOS", + "IO_READ_NANOS", + "IO_RANGE_SYNC_NANOS", + "IO_LOGGER_NANOS"}; + +#define IO_PERF_RECORD(_field_) \ + do { \ + if (rocksdb::perf_context._field_ > 0) \ + counters->m_value[idx] += rocksdb::perf_context._field_; \ + idx++; \ } while (0) -#define IO_STAT_RECORD(_field_) \ - do { \ - if (rocksdb::iostats_context._field_ > 0) \ - counters->m_value[idx] += rocksdb::iostats_context._field_; \ - idx++; \ +#define IO_STAT_RECORD(_field_) \ + do { \ + if (rocksdb::iostats_context._field_ > 0) \ + counters->m_value[idx] += rocksdb::iostats_context._field_; \ + idx++; \ } while (0) -static void harvest_diffs(Rdb_atomic_perf_counters *counters) -{ +static void harvest_diffs(Rdb_atomic_perf_counters *const counters) { // (C) These should be in the same order as the PC enum - size_t idx= 0; + size_t idx = 0; IO_PERF_RECORD(user_key_comparison_count); IO_PERF_RECORD(block_cache_hit_count); IO_PERF_RECORD(block_read_count); @@ -148,35 +145,29 @@ #undef IO_PERF_DIFF #undef IO_STAT_DIFF - static Rdb_atomic_perf_counters rdb_global_perf_counters; -void rdb_get_global_perf_counters(Rdb_perf_counters *counters) -{ +void rdb_get_global_perf_counters(Rdb_perf_counters *const counters) { DBUG_ASSERT(counters != nullptr); counters->load(rdb_global_perf_counters); } -void Rdb_perf_counters::load(const Rdb_atomic_perf_counters &atomic_counters) -{ - for (int i= 0; i < PC_MAX_IDX; i++) { - m_value[i]= atomic_counters.m_value[i].load(std::memory_order_relaxed); +void Rdb_perf_counters::load(const Rdb_atomic_perf_counters &atomic_counters) { + for (int i = 0; i < PC_MAX_IDX; i++) { + m_value[i] = atomic_counters.m_value[i].load(std::memory_order_relaxed); } } -bool Rdb_io_perf::start(uint32_t perf_context_level) -{ - rocksdb::PerfLevel perf_level= - static_cast(perf_context_level); +bool Rdb_io_perf::start(const uint32_t perf_context_level) { + const rocksdb::PerfLevel perf_level = + static_cast(perf_context_level); - if (rocksdb::GetPerfLevel() != perf_level) - { + if (rocksdb::GetPerfLevel() != perf_level) { rocksdb::SetPerfLevel(perf_level); } - if (perf_level == rocksdb::kDisable) - { + if (perf_level == rocksdb::kDisable) { return false; } @@ -185,55 +176,36 @@ return true; } -void Rdb_io_perf::end_and_record(uint32_t perf_context_level) -{ - rocksdb::PerfLevel perf_level= - static_cast(perf_context_level); +void Rdb_io_perf::end_and_record(const uint32_t perf_context_level) { + const rocksdb::PerfLevel perf_level = + static_cast(perf_context_level); - if (perf_level == rocksdb::kDisable) - { + if (perf_level == rocksdb::kDisable) { return; } - if (m_atomic_counters) - { + if (m_atomic_counters) { harvest_diffs(m_atomic_counters); } harvest_diffs(&rdb_global_perf_counters); - if (m_shared_io_perf_read && - (rocksdb::perf_context.block_read_byte != 0 || - rocksdb::perf_context.block_read_count != 0 || - rocksdb::perf_context.block_read_time != 0)) - { + if (m_shared_io_perf_read && (rocksdb::perf_context.block_read_byte != 0 || + rocksdb::perf_context.block_read_count != 0 || + rocksdb::perf_context.block_read_time != 0)) { my_io_perf_t io_perf_read; - my_io_perf_init(&io_perf_read); - io_perf_read.bytes= rocksdb::perf_context.block_read_byte; - io_perf_read.requests= rocksdb::perf_context.block_read_count; + io_perf_read.init(); + io_perf_read.bytes = rocksdb::perf_context.block_read_byte; + io_perf_read.requests = rocksdb::perf_context.block_read_count; /* Rocksdb does not distinguish between I/O service and wait time, so just use svc time. */ - io_perf_read.svc_time_max= io_perf_read.svc_time= + io_perf_read.svc_time_max = io_perf_read.svc_time = rocksdb::perf_context.block_read_time; - my_io_perf_sum_atomic_helper(m_shared_io_perf_read, &io_perf_read); - my_io_perf_sum(&m_stats->table_io_perf_read, &io_perf_read); - } - - if (m_stats) { - if (rocksdb::perf_context.internal_key_skipped_count != 0) - { - m_stats->key_skipped += rocksdb::perf_context.internal_key_skipped_count; - } - - if (rocksdb::perf_context.internal_delete_skipped_count != 0) - { - m_stats->delete_skipped += - rocksdb::perf_context.internal_delete_skipped_count; - } + m_shared_io_perf_read->sum(io_perf_read); } } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_perf_context.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_perf_context.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_perf_context.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_perf_context.h 2017-10-19 04:25:29.000000000 +0000 @@ -24,6 +24,7 @@ /* MySQL header files */ #include "./handler.h" #include +#include namespace myrocks { @@ -80,8 +81,7 @@ A collection of performance counters that can be safely incremented by multiple threads since it stores atomic datapoints. */ -struct Rdb_atomic_perf_counters -{ +struct Rdb_atomic_perf_counters { std::atomic_ullong m_value[PC_MAX_IDX]; }; @@ -89,9 +89,12 @@ A collection of performance counters that is meant to be incremented by a single thread. */ -class Rdb_perf_counters -{ - public: +class Rdb_perf_counters { + Rdb_perf_counters(const Rdb_perf_counters &) = delete; + Rdb_perf_counters &operator=(const Rdb_perf_counters &) = delete; + +public: + Rdb_perf_counters() = default; uint64_t m_value[PC_MAX_IDX]; void load(const Rdb_atomic_perf_counters &atomic_counters); @@ -102,33 +105,34 @@ /* Perf timers for data reads */ -class Rdb_io_perf -{ +class Rdb_io_perf { // Context management - Rdb_atomic_perf_counters *m_atomic_counters= nullptr; - my_io_perf_atomic_t *m_shared_io_perf_read= nullptr; - ha_statistics *m_stats= nullptr; - - public: - void init(Rdb_atomic_perf_counters *atomic_counters, - my_io_perf_atomic_t *shared_io_perf_read, - ha_statistics *stats) - { + Rdb_atomic_perf_counters *m_atomic_counters = nullptr; + my_io_perf_atomic_t *m_shared_io_perf_read = nullptr; + ha_statistics *m_stats = nullptr; + +public: + Rdb_io_perf(const Rdb_io_perf &) = delete; + Rdb_io_perf &operator=(const Rdb_io_perf &) = delete; + + void init(Rdb_atomic_perf_counters *const atomic_counters, + my_io_perf_atomic_t *const shared_io_perf_read, + ha_statistics *const stats) { DBUG_ASSERT(atomic_counters != nullptr); DBUG_ASSERT(shared_io_perf_read != nullptr); DBUG_ASSERT(stats != nullptr); - m_atomic_counters= atomic_counters; - m_shared_io_perf_read= shared_io_perf_read; - m_stats= stats; + m_atomic_counters = atomic_counters; + m_shared_io_perf_read = shared_io_perf_read; + m_stats = stats; } - bool start(uint32_t perf_context_level); - void end_and_record(uint32_t perf_context_level); + bool start(const uint32_t perf_context_level); + void end_and_record(const uint32_t perf_context_level); - explicit Rdb_io_perf() : m_atomic_counters(nullptr), - m_shared_io_perf_read(nullptr), - m_stats(nullptr) {} + explicit Rdb_io_perf() + : m_atomic_counters(nullptr), m_shared_io_perf_read(nullptr), + m_stats(nullptr) {} }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_sst_info.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_sst_info.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_sst_info.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_sst_info.cc 2017-10-19 04:25:29.000000000 +0000 @@ -28,6 +28,7 @@ /* RocksDB header files */ #include "rocksdb/db.h" +#include "rocksdb/options.h" /* MyRocks header files */ #include "./ha_rocksdb.h" @@ -36,24 +37,20 @@ namespace myrocks { -Rdb_sst_file::Rdb_sst_file(rocksdb::DB* db, rocksdb::ColumnFamilyHandle* cf, - const rocksdb::DBOptions& db_options, - const std::string& name) : - m_db(db), - m_cf(cf), - m_db_options(db_options), - m_sst_file_writer(nullptr), - m_name(name) -{ +Rdb_sst_file::Rdb_sst_file(rocksdb::DB *const db, + rocksdb::ColumnFamilyHandle *const cf, + const rocksdb::DBOptions &db_options, + const std::string &name, const bool tracing) + : m_db(db), m_cf(cf), m_db_options(db_options), m_sst_file_writer(nullptr), + m_name(name), m_tracing(tracing) { DBUG_ASSERT(db != nullptr); DBUG_ASSERT(cf != nullptr); } -Rdb_sst_file::~Rdb_sst_file() -{ +Rdb_sst_file::~Rdb_sst_file() { // Make sure we clean up delete m_sst_file_writer; - m_sst_file_writer= nullptr; + m_sst_file_writer = nullptr; // In case something went wrong attempt to delete the temporary file. // If everything went fine that file will have been renamed and this @@ -61,179 +58,203 @@ std::remove(m_name.c_str()); } -rocksdb::Status Rdb_sst_file::open() -{ +rocksdb::Status Rdb_sst_file::open() { DBUG_ASSERT(m_sst_file_writer == nullptr); rocksdb::ColumnFamilyDescriptor cf_descr; - rocksdb::Status s= m_cf->GetDescriptor(&cf_descr); - if (!s.ok()) - { + rocksdb::Status s = m_cf->GetDescriptor(&cf_descr); + if (!s.ok()) { return s; } // Create an sst file writer with the current options and comparator - const rocksdb::Comparator* comparator= m_cf->GetComparator(); + const rocksdb::Comparator *comparator = m_cf->GetComparator(); - rocksdb::EnvOptions env_options(m_db_options); - rocksdb::Options options(m_db_options, cf_descr.options); + const rocksdb::EnvOptions env_options(m_db_options); + const rocksdb::Options options(m_db_options, cf_descr.options); - m_sst_file_writer= - new rocksdb::SstFileWriter(env_options, options, comparator); + m_sst_file_writer = + new rocksdb::SstFileWriter(env_options, options, comparator, m_cf); - s= m_sst_file_writer->Open(m_name); - if (!s.ok()) - { + s = m_sst_file_writer->Open(m_name); + if (m_tracing) { + // NO_LINT_DEBUG + sql_print_information("SST Tracing: Open(%s) returned %s", m_name.c_str(), + s.ok() ? "ok" : "not ok"); + } + + if (!s.ok()) { delete m_sst_file_writer; - m_sst_file_writer= nullptr; + m_sst_file_writer = nullptr; } return s; } -rocksdb::Status Rdb_sst_file::put(const rocksdb::Slice& key, - const rocksdb::Slice& value) -{ +rocksdb::Status Rdb_sst_file::put(const rocksdb::Slice &key, + const rocksdb::Slice &value) { DBUG_ASSERT(m_sst_file_writer != nullptr); // Add the specified key/value to the sst file writer return m_sst_file_writer->Add(key, value); } +std::string Rdb_sst_file::generateKey(const std::string &key) { + static char const hexdigit[] = {'0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + + std::string res; + + res.reserve(key.size() * 2); + + for (auto ch : key) { + res += hexdigit[((uint8_t)ch) >> 4]; + res += hexdigit[((uint8_t)ch) & 0x0F]; + } + + return res; +} + // This function is run by the background thread -rocksdb::Status Rdb_sst_file::commit() -{ +rocksdb::Status Rdb_sst_file::commit() { DBUG_ASSERT(m_sst_file_writer != nullptr); rocksdb::Status s; + rocksdb::ExternalSstFileInfo fileinfo; /// Finish may should be modified // Close out the sst file - s= m_sst_file_writer->Finish(); - if (s.ok()) - { - std::vector files = { m_name }; + s = m_sst_file_writer->Finish(&fileinfo); + if (m_tracing) { + // NO_LINT_DEBUG + sql_print_information("SST Tracing: Finish returned %s", + s.ok() ? "ok" : "not ok"); + } + + if (s.ok()) { + if (m_tracing) { + // NO_LINT_DEBUG + sql_print_information("SST Tracing: Adding file %s, smallest key: %s, " + "largest key: %s, file size: %lu, " + "num_entries: %lu", + fileinfo.file_path.c_str(), + generateKey(fileinfo.smallest_key).c_str(), + generateKey(fileinfo.largest_key).c_str(), + fileinfo.file_size, fileinfo.num_entries); + } + // Add the file to the database - // Set the skip_snapshot_check parameter to true since no one + // Set the snapshot_consistency parameter to false since no one // should be accessing the table we are bulk loading - s= m_db->AddFile(m_cf, files, true, true); + rocksdb::IngestExternalFileOptions opts; + opts.move_files = true; + opts.snapshot_consistency = false; + opts.allow_global_seqno = false; + opts.allow_blocking_flush = false; + s = m_db->IngestExternalFile(m_cf, {m_name}, opts); + + if (m_tracing) { + // NO_LINT_DEBUG + sql_print_information("SST Tracing: AddFile(%s) returned %s", + fileinfo.file_path.c_str(), + s.ok() ? "ok" : "not ok"); + } } delete m_sst_file_writer; - m_sst_file_writer= nullptr; + m_sst_file_writer = nullptr; return s; } -Rdb_sst_info::Rdb_sst_info(rocksdb::DB* db, const std::string& tablename, - const std::string& indexname, - rocksdb::ColumnFamilyHandle* cf, - const rocksdb::DBOptions& db_options) : - m_db(db), - m_cf(cf), - m_db_options(db_options), - m_curr_size(0), - m_sst_count(0), - m_error_msg(""), +Rdb_sst_info::Rdb_sst_info(rocksdb::DB *const db, const std::string &tablename, + const std::string &indexname, + rocksdb::ColumnFamilyHandle *const cf, + const rocksdb::DBOptions &db_options, + const bool &tracing) + : m_db(db), m_cf(cf), m_db_options(db_options), m_curr_size(0), + m_sst_count(0), m_error_msg(""), #if defined(RDB_SST_INFO_USE_THREAD) - m_queue(), - m_mutex(), - m_cond(), - m_thread(nullptr), - m_finished(false), + m_queue(), m_mutex(), m_cond(), m_thread(nullptr), m_finished(false), #endif - m_sst_file(nullptr) -{ - m_prefix= db->GetName() + "/"; + m_sst_file(nullptr), m_tracing(tracing) { + m_prefix = db->GetName() + "/"; std::string normalized_table; - if (rdb_normalize_tablename(tablename.c_str(), &normalized_table)) - { + if (rdb_normalize_tablename(tablename.c_str(), &normalized_table)) { // We failed to get a normalized table name. This should never happen, // but handle it anyway. - m_prefix += "fallback_" + - std::to_string( - reinterpret_cast(reinterpret_cast(this))) + "_" + - indexname + "_"; - } - else - { + m_prefix += "fallback_" + std::to_string(reinterpret_cast( + reinterpret_cast(this))) + + "_" + indexname + "_"; + } else { m_prefix += normalized_table + "_" + indexname + "_"; } rocksdb::ColumnFamilyDescriptor cf_descr; - rocksdb::Status s= m_cf->GetDescriptor(&cf_descr); - if (!s.ok()) - { + const rocksdb::Status s = m_cf->GetDescriptor(&cf_descr); + if (!s.ok()) { // Default size if we can't get the cf's target size - m_max_size= 64*1024*1024; - } - else - { + m_max_size = 64 * 1024 * 1024; + } else { // Set the maximum size to 3 times the cf's target size - m_max_size= cf_descr.options.target_file_size_base * 3; + m_max_size = cf_descr.options.target_file_size_base * 3; } } -Rdb_sst_info::~Rdb_sst_info() -{ +Rdb_sst_info::~Rdb_sst_info() { DBUG_ASSERT(m_sst_file == nullptr); #if defined(RDB_SST_INFO_USE_THREAD) DBUG_ASSERT(m_thread == nullptr); #endif } -int Rdb_sst_info::open_new_sst_file() -{ +int Rdb_sst_info::open_new_sst_file() { DBUG_ASSERT(m_sst_file == nullptr); // Create the new sst file's name - std::string name= m_prefix + std::to_string(m_sst_count++) + m_suffix; + const std::string name = m_prefix + std::to_string(m_sst_count++) + m_suffix; // Create the new sst file object - m_sst_file= new Rdb_sst_file(m_db, m_cf, m_db_options, name); + m_sst_file = new Rdb_sst_file(m_db, m_cf, m_db_options, name, m_tracing); // Open the sst file - rocksdb::Status s= m_sst_file->open(); - if (!s.ok()) - { + const rocksdb::Status s = m_sst_file->open(); + if (!s.ok()) { set_error_msg(s.ToString()); delete m_sst_file; - m_sst_file= nullptr; - return 1; + m_sst_file = nullptr; + return HA_EXIT_FAILURE; } - m_curr_size= 0; + m_curr_size = 0; - return 0; + return HA_EXIT_SUCCESS; } -void Rdb_sst_info::close_curr_sst_file() -{ +void Rdb_sst_info::close_curr_sst_file() { DBUG_ASSERT(m_sst_file != nullptr); DBUG_ASSERT(m_curr_size > 0); #if defined(RDB_SST_INFO_USE_THREAD) - if (m_thread == nullptr) - { + if (m_thread == nullptr) { // We haven't already started a background thread, so start one - m_thread= new std::thread(thread_fcn, this); + m_thread = new std::thread(thread_fcn, this); } DBUG_ASSERT(m_thread != nullptr); { // Add this finished sst file to the queue (while holding mutex) - std::lock_guard guard(m_mutex); + const std::lock_guard guard(m_mutex); m_queue.push(m_sst_file); } // Notify the background thread that there is a new entry in the queue m_cond.notify_one(); #else - rocksdb::Status s= m_sst_file->commit(); - if (!s.ok()) - { + const rocksdb::Status s = m_sst_file->commit(); + if (!s.ok()) { set_error_msg(s.ToString()); } @@ -241,34 +262,28 @@ #endif // Reset for next sst file - m_sst_file= nullptr; - m_curr_size= 0; + m_sst_file = nullptr; + m_curr_size = 0; } -int Rdb_sst_info::put(const rocksdb::Slice& key, - const rocksdb::Slice& value) -{ +int Rdb_sst_info::put(const rocksdb::Slice &key, const rocksdb::Slice &value) { int rc; - if (m_curr_size >= m_max_size) - { + if (m_curr_size >= m_max_size) { // The current sst file has reached its maximum, close it out close_curr_sst_file(); // While we are here, check to see if we have had any errors from the // background thread - we don't want to wait for the end to report them - if (!m_error_msg.empty()) - { - return 1; + if (!m_error_msg.empty()) { + return HA_EXIT_FAILURE; } } - if (m_curr_size == 0) - { + if (m_curr_size == 0) { // We don't have an sst file open - open one - rc= open_new_sst_file(); - if (rc != 0) - { + rc = open_new_sst_file(); + if (rc != 0) { return rc; } } @@ -276,93 +291,81 @@ DBUG_ASSERT(m_sst_file != nullptr); // Add the key/value to the current sst file - rocksdb::Status s= m_sst_file->put(key, value); - if (!s.ok()) - { + const rocksdb::Status s = m_sst_file->put(key, value); + if (!s.ok()) { set_error_msg(s.ToString()); - return 1; + return HA_EXIT_FAILURE; } m_curr_size += key.size() + value.size(); - return 0; + return HA_EXIT_SUCCESS; } -int Rdb_sst_info::commit() -{ - if (m_curr_size > 0) - { +int Rdb_sst_info::commit() { + if (m_curr_size > 0) { // Close out any existing files close_curr_sst_file(); } #if defined(RDB_SST_INFO_USE_THREAD) - if (m_thread != nullptr) - { + if (m_thread != nullptr) { // Tell the background thread we are done - m_finished= true; + m_finished = true; m_cond.notify_one(); // Wait for the background thread to finish m_thread->join(); delete m_thread; - m_thread= nullptr; + m_thread = nullptr; } #endif // Did we get any errors? - if (!m_error_msg.empty()) - { - return 1; + if (!m_error_msg.empty()) { + return HA_EXIT_FAILURE; } - return 0; + return HA_EXIT_SUCCESS; } -void Rdb_sst_info::set_error_msg(const std::string& msg) -{ +void Rdb_sst_info::set_error_msg(const std::string &msg) { #if defined(RDB_SST_INFO_USE_THREAD) // Both the foreground and background threads can set the error message // so lock the mutex to protect it. We only want the first error that // we encounter. - std::lock_guard guard(m_mutex); + const std::lock_guard guard(m_mutex); #endif my_printf_error(ER_UNKNOWN_ERROR, "bulk load error: %s", MYF(0), msg.c_str()); - if (m_error_msg.empty()) - { - m_error_msg= msg; + if (m_error_msg.empty()) { + m_error_msg = msg; } } #if defined(RDB_SST_INFO_USE_THREAD) // Static thread function - the Rdb_sst_info object is in 'object' -void Rdb_sst_info::thread_fcn(void* object) -{ - reinterpret_cast(object)->run_thread(); +void Rdb_sst_info::thread_fcn(void *object) { + reinterpret_cast(object)->run_thread(); } -void Rdb_sst_info::run_thread() -{ - std::unique_lock lk(m_mutex); +void Rdb_sst_info::run_thread() { + const std::unique_lock lk(m_mutex); - do - { + do { // Wait for notification or 1 second to pass m_cond.wait_for(lk, std::chrono::seconds(1)); // Inner loop pulls off all Rdb_sst_file entries and processes them - while (!m_queue.empty()) - { - Rdb_sst_file* sst_file= m_queue.front(); + while (!m_queue.empty()) { + const Rdb_sst_file *const sst_file = m_queue.front(); m_queue.pop(); // Release the lock - we don't want to hold it while committing the file lk.unlock(); // Close out the sst file and add it to the database - rocksdb::Status s= sst_file->commit(); - if (!s.ok()) - { + const rocksdb::Status s = sst_file->commit(); + if (!s.ok()) { set_error_msg(s.ToString()); } @@ -380,14 +383,12 @@ } #endif -void Rdb_sst_info::init(rocksdb::DB* db) -{ - std::string path= db->GetName() + FN_DIRSEP; - struct st_my_dir* dir_info= my_dir(path.c_str(), MYF(MY_DONT_SORT)); +void Rdb_sst_info::init(const rocksdb::DB *const db) { + const std::string path = db->GetName() + FN_DIRSEP; + struct st_my_dir *const dir_info = my_dir(path.c_str(), MYF(MY_DONT_SORT)); // Access the directory - if (dir_info == nullptr) - { + if (dir_info == nullptr) { // NO_LINT_DEBUG sql_print_warning("RocksDB: Could not access database directory: %s", path.c_str()); @@ -395,16 +396,14 @@ } // Scan through the files in the directory - struct fileinfo* file_info= dir_info->dir_entry; - for (uint ii= 0; ii < dir_info->number_off_files; ii++, file_info++) - { + const struct fileinfo *file_info = dir_info->dir_entry; + for (uint ii = 0; ii < dir_info->number_off_files; ii++, file_info++) { // find any files ending with m_suffix ... - std::string name= file_info->name; - size_t pos= name.find(m_suffix); - if (pos != std::string::npos && name.size() - pos == m_suffix.size()) - { + const std::string name = file_info->name; + const size_t pos = name.find(m_suffix); + if (pos != std::string::npos && name.size() - pos == m_suffix.size()) { // ... and remove them - std::string fullname= path + name; + const std::string fullname = path + name; my_delete(fullname.c_str(), MYF(0)); } } @@ -413,5 +412,5 @@ my_dirend(dir_info); } -std::string Rdb_sst_info::m_suffix= ".bulk_load.tmp"; -} // namespace myrocks +std::string Rdb_sst_info::m_suffix = ".bulk_load.tmp"; +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_sst_info.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_sst_info.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_sst_info.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_sst_info.h 2017-10-19 04:25:29.000000000 +0000 @@ -33,69 +33,77 @@ namespace myrocks { class Rdb_sst_file { - Rdb_sst_file(const Rdb_sst_file& p)= delete; - Rdb_sst_file& operator=(const Rdb_sst_file& p)= delete; - - rocksdb::DB* m_db; - rocksdb::ColumnFamilyHandle* m_cf; - const rocksdb::DBOptions& m_db_options; - rocksdb::SstFileWriter* m_sst_file_writer; - std::string m_name; - - public: - Rdb_sst_file(rocksdb::DB* db, rocksdb::ColumnFamilyHandle* cf, - const rocksdb::DBOptions& db_options, const std::string& name); +private: + Rdb_sst_file(const Rdb_sst_file &p) = delete; + Rdb_sst_file &operator=(const Rdb_sst_file &p) = delete; + + rocksdb::DB *const m_db; + rocksdb::ColumnFamilyHandle *const m_cf; + const rocksdb::DBOptions &m_db_options; + rocksdb::SstFileWriter *m_sst_file_writer; + const std::string m_name; + const bool m_tracing; + + std::string generateKey(const std::string &key); + +public: + Rdb_sst_file(rocksdb::DB *const db, rocksdb::ColumnFamilyHandle *const cf, + const rocksdb::DBOptions &db_options, const std::string &name, + const bool tracing); ~Rdb_sst_file(); rocksdb::Status open(); - rocksdb::Status put(const rocksdb::Slice& key, const rocksdb::Slice& value); + rocksdb::Status put(const rocksdb::Slice &key, const rocksdb::Slice &value); rocksdb::Status commit(); }; class Rdb_sst_info { - Rdb_sst_info(const Rdb_sst_info& p)= delete; - Rdb_sst_info& operator=(const Rdb_sst_info& p)= delete; - - rocksdb::DB* m_db; - rocksdb::ColumnFamilyHandle* m_cf; - const rocksdb::DBOptions& m_db_options; - uint64_t m_curr_size; - uint64_t m_max_size; - uint m_sst_count; - std::string m_error_msg; - std::string m_prefix; - static std::string m_suffix; +private: + Rdb_sst_info(const Rdb_sst_info &p) = delete; + Rdb_sst_info &operator=(const Rdb_sst_info &p) = delete; + + rocksdb::DB *const m_db; + rocksdb::ColumnFamilyHandle *const m_cf; + const rocksdb::DBOptions &m_db_options; + uint64_t m_curr_size; + uint64_t m_max_size; + uint m_sst_count; + std::string m_error_msg; + std::string m_prefix; + static std::string m_suffix; #if defined(RDB_SST_INFO_USE_THREAD) - std::queue m_queue; - std::mutex m_mutex; - std::condition_variable m_cond; - std::thread* m_thread; - bool m_finished; + std::queue m_queue; + std::mutex m_mutex; + std::condition_variable m_cond; + std::thread *m_thread; + bool m_finished; #endif - Rdb_sst_file* m_sst_file; + Rdb_sst_file *m_sst_file; + const bool m_tracing; int open_new_sst_file(); void close_curr_sst_file(); - void set_error_msg(const std::string& msg); + void set_error_msg(const std::string &msg); #if defined(RDB_SST_INFO_USE_THREAD) void run_thread(); - static void thread_fcn(void* object); + static void thread_fcn(void *object); #endif - public: - Rdb_sst_info(rocksdb::DB* db, const std::string& tablename, - const std::string& indexname, rocksdb::ColumnFamilyHandle* cf, - const rocksdb::DBOptions& db_options); +public: + Rdb_sst_info(rocksdb::DB *const db, const std::string &tablename, + const std::string &indexname, + rocksdb::ColumnFamilyHandle *const cf, + const rocksdb::DBOptions &db_options, const bool &tracing); ~Rdb_sst_info(); - int put(const rocksdb::Slice& key, const rocksdb::Slice& value); + int put(const rocksdb::Slice &key, const rocksdb::Slice &value); int commit(); - const std::string& error_message() const { return m_error_msg; } + const std::string &error_message() const { return m_error_msg; } - static void init(rocksdb::DB* db); + static void init(const rocksdb::DB *const db); }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_threads.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_threads.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_threads.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_threads.cc 2017-10-19 04:25:29.000000000 +0000 @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef USE_PRAGMA_IMPLEMENTATION -#pragma implementation // gcc: Class implementation +#pragma implementation // gcc: Class implementation #endif /* The C++ file's header */ @@ -24,58 +24,64 @@ namespace myrocks { -void* Rdb_thread::thread_func(void* thread_ptr) -{ +void *Rdb_thread::thread_func(void *const thread_ptr) { DBUG_ASSERT(thread_ptr != nullptr); - Rdb_thread* thread= static_cast(thread_ptr); - if (!thread->m_run_once.exchange(true)) - { + Rdb_thread *const thread = static_cast(thread_ptr); + if (!thread->m_run_once.exchange(true)) { thread->run(); thread->uninit(); } return nullptr; } - void Rdb_thread::init( #ifdef HAVE_PSI_INTERFACE - my_core::PSI_mutex_key stop_bg_psi_mutex_key, - my_core::PSI_cond_key stop_bg_psi_cond_key + my_core::PSI_mutex_key stop_bg_psi_mutex_key, + my_core::PSI_cond_key stop_bg_psi_cond_key #endif - ) -{ + ) { DBUG_ASSERT(!m_run_once); mysql_mutex_init(stop_bg_psi_mutex_key, &m_signal_mutex, MY_MUTEX_INIT_FAST); mysql_cond_init(stop_bg_psi_cond_key, &m_signal_cond, nullptr); } - -void Rdb_thread::uninit() -{ +void Rdb_thread::uninit() { mysql_mutex_destroy(&m_signal_mutex); mysql_cond_destroy(&m_signal_cond); } - -int Rdb_thread::create_thread( +int Rdb_thread::create_thread(const std::string &thread_name #ifdef HAVE_PSI_INTERFACE - PSI_thread_key background_psi_thread_key + , + PSI_thread_key background_psi_thread_key #endif - ) -{ - return mysql_thread_create(background_psi_thread_key, - &m_handle, nullptr, thread_func, this); -} + ) { + DBUG_ASSERT(!thread_name.empty()); + int err = mysql_thread_create(background_psi_thread_key, &m_handle, nullptr, + thread_func, this); + + if (!err) { + /* + mysql_thread_create() ends up doing some work underneath and setting the + thread name as "my-func". This isn't what we want. Our intent is to name + the threads according to their purpose so that when displayed under the + debugger then they'll be more easily identifiable. Therefore we'll reset + the name if thread was successfully created. + */ + err = pthread_setname_np(m_handle, thread_name.c_str()); + } + + return err; +} -void Rdb_thread::signal(bool stop_thread) -{ +void Rdb_thread::signal(const bool &stop_thread) { mysql_mutex_lock(&m_signal_mutex); if (stop_thread) { - m_stop= true; + m_stop = true; } mysql_cond_signal(&m_signal_cond); mysql_mutex_unlock(&m_signal_mutex); } -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_threads.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_threads.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_threads.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_threads.h 2017-10-19 04:25:29.000000000 +0000 @@ -18,6 +18,7 @@ /* C++ standard header files */ #include +#include /* MySQL includes */ #include "./my_global.h" @@ -29,91 +30,81 @@ namespace myrocks { -class Rdb_thread -{ - private: +class Rdb_thread { +private: // Disable Copying - Rdb_thread(const Rdb_thread&); - Rdb_thread& operator=(const Rdb_thread&); + Rdb_thread(const Rdb_thread &); + Rdb_thread &operator=(const Rdb_thread &); // Make sure we run only once std::atomic_bool m_run_once; - pthread_t m_handle; + pthread_t m_handle; - protected: - mysql_mutex_t m_signal_mutex; - mysql_cond_t m_signal_cond; - bool m_stop= false; +protected: + mysql_mutex_t m_signal_mutex; + mysql_cond_t m_signal_cond; + bool m_stop = false; - public: +public: Rdb_thread() : m_run_once(false) {} #ifdef HAVE_PSI_INTERFACE - void init(my_core::PSI_mutex_key stop_bg_psi_mutex_key, - my_core::PSI_cond_key stop_bg_psi_cond_key); - int create_thread( - my_core::PSI_thread_key background_psi_thread_key); + void init(my_core::PSI_mutex_key stop_bg_psi_mutex_key, + my_core::PSI_cond_key stop_bg_psi_cond_key); + int create_thread(const std::string &thread_name, + my_core::PSI_thread_key background_psi_thread_key); #else void init(); - int create_thread(); + int create_thread(const std::string &thread_name); #endif virtual void run(void) = 0; - void signal(bool stop_thread= false); + void signal(const bool &stop_thread = false); - int join() - { - return pthread_join(m_handle, nullptr); - } + int join() { return pthread_join(m_handle, nullptr); } void uninit(); virtual ~Rdb_thread() {} - private: - static void* thread_func(void* thread_ptr); +private: + static void *thread_func(void *const thread_ptr); }; - /** MyRocks background thread control N.B. This is on top of RocksDB's own background threads (@see rocksdb::CancelAllBackgroundWork()) */ -class Rdb_background_thread : public Rdb_thread -{ - private: - bool m_save_stats= false; +class Rdb_background_thread : public Rdb_thread { +private: + bool m_save_stats = false; - void reset() - { + void reset() { mysql_mutex_assert_owner(&m_signal_mutex); - m_stop= false; - m_save_stats= false; + m_stop = false; + m_save_stats = false; } - public: +public: virtual void run() override; - void request_save_stats() - { + void request_save_stats() { mysql_mutex_lock(&m_signal_mutex); - m_save_stats= true; + m_save_stats = true; mysql_mutex_unlock(&m_signal_mutex); } }; - /* Drop index thread control */ -struct Rdb_drop_index_thread : public Rdb_thread -{ +struct Rdb_drop_index_thread : public Rdb_thread { virtual void run() override; }; -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_utils.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_utils.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_utils.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_utils.cc 2017-10-19 04:25:29.000000000 +0000 @@ -32,13 +32,12 @@ /* Skip past any spaces in the input */ -const char* rdb_skip_spaces(struct charset_info_st* cs, const char *str) -{ +const char *rdb_skip_spaces(const struct charset_info_st *const cs, + const char *str) { DBUG_ASSERT(cs != nullptr); DBUG_ASSERT(str != nullptr); - while (my_isspace(cs, *str)) - { + while (my_isspace(cs, *str)) { str++; } @@ -50,18 +49,15 @@ Note that str1 can be longer but we only compare up to the number of characters in str2. */ -bool rdb_compare_strings_ic(const char *str1, const char *str2) -{ +bool rdb_compare_strings_ic(const char *const str1, const char *const str2) { DBUG_ASSERT(str1 != nullptr); DBUG_ASSERT(str2 != nullptr); // Scan through the strings size_t ii; - for (ii = 0; str2[ii]; ii++) - { + for (ii = 0; str2[ii]; ii++) { if (toupper(static_cast(str1[ii])) != - toupper(static_cast(str2[ii]))) - { + toupper(static_cast(str2[ii]))) { return false; } } @@ -73,11 +69,10 @@ Scan through an input string looking for pattern, ignoring case and skipping all data enclosed in quotes. */ -const char* rdb_find_in_string(const char *str, const char *pattern, - bool *succeeded) -{ - char quote = '\0'; - bool escape = false; +const char *rdb_find_in_string(const char *str, const char *pattern, + bool *const succeeded) { + char quote = '\0'; + bool escape = false; DBUG_ASSERT(str != nullptr); DBUG_ASSERT(pattern != nullptr); @@ -85,38 +80,30 @@ *succeeded = false; - for ( ; *str; str++) - { + for (; *str; str++) { /* If we found a our starting quote character */ - if (*str == quote) - { + if (*str == quote) { /* If it was escaped ignore it */ - if (escape) - { + if (escape) { escape = false; } /* Otherwise we are now outside of the quoted string */ - else - { + else { quote = '\0'; } } /* Else if we are currently inside a quoted string? */ - else if (quote != '\0') - { + else if (quote != '\0') { /* If so, check for the escape character */ escape = !escape && *str == '\\'; } /* Else if we found a quote we are starting a quoted string */ - else if (*str == '"' || *str == '\'' || *str == '`') - { + else if (*str == '"' || *str == '\'' || *str == '`') { quote = *str; } /* Else we are outside of a quoted string - look for our pattern */ - else - { - if (rdb_compare_strings_ic(str, pattern)) - { + else { + if (rdb_compare_strings_ic(str, pattern)) { *succeeded = true; return str; } @@ -131,9 +118,9 @@ /* See if the next valid token matches the specified string */ -const char* rdb_check_next_token(struct charset_info_st* cs, const char *str, - const char *pattern, bool *succeeded) -{ +const char *rdb_check_next_token(const struct charset_info_st *const cs, + const char *str, const char *const pattern, + bool *const succeeded) { DBUG_ASSERT(cs != nullptr); DBUG_ASSERT(str != nullptr); DBUG_ASSERT(pattern != nullptr); @@ -143,8 +130,7 @@ str = rdb_skip_spaces(cs, str); // See if the next characters match the pattern - if (rdb_compare_strings_ic(str, pattern)) - { + if (rdb_compare_strings_ic(str, pattern)) { *succeeded = true; return str + strlen(pattern); } @@ -156,43 +142,35 @@ /* Parse id */ -const char* rdb_parse_id(struct charset_info_st* cs, const char *str, - std::string *id) -{ +const char *rdb_parse_id(const struct charset_info_st *const cs, + const char *str, std::string *const id) { DBUG_ASSERT(cs != nullptr); DBUG_ASSERT(str != nullptr); // Move past any spaces str = rdb_skip_spaces(cs, str); - if (*str == '\0') - { + if (*str == '\0') { return str; } char quote = '\0'; - if (*str == '`' || *str == '"') - { + if (*str == '`' || *str == '"') { quote = *str++; } - size_t len = 0; - const char* start = str; + size_t len = 0; + const char *start = str; - if (quote != '\0') - { - for ( ; ; ) - { - if (*str == '\0') - { + if (quote != '\0') { + for (;;) { + if (*str == '\0') { return str; } - if (*str == quote) - { + if (*str == quote) { str++; - if (*str != quote) - { + if (*str != quote) { break; } } @@ -200,27 +178,21 @@ str++; len++; } - } - else - { - while (!my_isspace(cs, *str) && *str != '(' && *str != ')' && - *str != '.' && *str != ',' && *str != '\0') - { + } else { + while (!my_isspace(cs, *str) && *str != '(' && *str != ')' && *str != '.' && + *str != ',' && *str != '\0') { str++; len++; } } // If the user requested the id create it and return it - if (id != nullptr) - { + if (id != nullptr) { *id = std::string(""); id->reserve(len); - while (len--) - { + while (len--) { *id += *start; - if (*start++ == quote) - { + if (*start++ == quote) { start++; } } @@ -232,8 +204,8 @@ /* Skip id */ -const char* rdb_skip_id(struct charset_info_st* cs, const char *str) -{ +const char *rdb_skip_id(const struct charset_info_st *const cs, + const char *str) { DBUG_ASSERT(cs != nullptr); DBUG_ASSERT(str != nullptr); @@ -241,19 +213,16 @@ } static const std::size_t rdb_hex_bytes_per_char = 2; -static const std::array rdb_hexdigit = -{ - { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' } -}; +static const std::array rdb_hexdigit = {{'0', '1', '2', '3', '4', '5', + '6', '7', '8', '9', 'a', 'b', + 'c', 'd', 'e', 'f'}}; /* Convert data into a hex string with optional maximum length. If the data is larger than the maximum length trancate it and append "..". */ -std::string rdb_hexdump(const char *data, std::size_t data_len, - std::size_t maxsize) -{ +std::string rdb_hexdump(const char *data, const std::size_t data_len, + const std::size_t maxsize) { DBUG_ASSERT(data != nullptr); // Count the elements in the string @@ -262,8 +231,7 @@ std::size_t len = elems * rdb_hex_bytes_per_char; std::string str; - if (maxsize != 0 && len > maxsize) - { + if (maxsize != 0 && len > maxsize) { // If the amount of output is too large adjust the settings // and leave room for the ".." at the end elems = (maxsize - 2) / rdb_hex_bytes_per_char; @@ -274,33 +242,29 @@ str.reserve(len); // Loop through the input data and build the output string - for (std::size_t ii = 0; ii < elems; ii++, data++) - { - uint8_t ch = (uint8_t) *data; + for (std::size_t ii = 0; ii < elems; ii++, data++) { + uint8_t ch = (uint8_t)*data; str += rdb_hexdigit[ch >> 4]; str += rdb_hexdigit[ch & 0x0F]; } // If we can't fit it all add the ".." - if (elems != data_len) - { + if (elems != data_len) { str += ".."; } return str; } - /* Attempt to access the database subdirectory to see if it exists */ -bool rdb_database_exists(const std::string& db_name) -{ - std::string dir = std::string(mysql_real_data_home) + FN_DIRSEP + db_name; - struct st_my_dir* dir_info = my_dir(dir.c_str(), - MYF(MY_DONT_SORT | MY_WANT_STAT)); - if (dir_info == nullptr) - { +bool rdb_database_exists(const std::string &db_name) { + const std::string dir = + std::string(mysql_real_data_home) + FN_DIRSEP + db_name; + struct st_my_dir *const dir_info = + my_dir(dir.c_str(), MYF(MY_DONT_SORT | MY_WANT_STAT)); + if (dir_info == nullptr) { return false; } @@ -308,73 +272,14 @@ return true; } -/* - Set the patterns string. If there are invalid regex patterns they will - be stored in m_bad_patterns and the result will be false, otherwise the - result will be true. -*/ -bool Regex_list_handler::set_patterns(const std::string& pattern_str) -{ - bool pattern_valid= true; - - // Create a normalized version of the pattern string with all delimiters - // replaced by the '|' character - std::string norm_pattern= pattern_str; - std::replace(norm_pattern.begin(), norm_pattern.end(), m_delimiter, '|'); - - // Make sure no one else is accessing the list while we are changing it. - mysql_rwlock_wrlock(&m_rwlock); - - // Clear out any old error information - m_bad_pattern_str.clear(); - - try - { - // Replace all delimiters with the '|' operator and create the regex - // Note that this means the delimiter can not be part of a regular - // expression. This is currently not a problem as we are using the comma - // character as a delimiter and commas are not valid in table names. - m_pattern.reset(new std::regex(norm_pattern)); - } - catch (const std::regex_error& e) - { - // This pattern is invalid. - pattern_valid= false; - - // Put the bad pattern into a member variable so it can be retrieved later. - m_bad_pattern_str= pattern_str; - } - - // Release the lock - mysql_rwlock_unlock(&m_rwlock); - - return pattern_valid; -} - -bool Regex_list_handler::matches(const std::string& str) const -{ - DBUG_ASSERT(m_pattern != nullptr); - - // Make sure no one else changes the list while we are accessing it. - mysql_rwlock_rdlock(&m_rwlock); - - // See if the table name matches the regex we have created - bool found= std::regex_match(str, *m_pattern); - - // Release the lock - mysql_rwlock_unlock(&m_rwlock); - - return found; -} - -void warn_about_bad_patterns(const Regex_list_handler* regex_list_handler, - const char *name) +void warn_about_bad_patterns(const Regex ®ex, const char *name) { // There was some invalid regular expression data in the patterns supplied // NO_LINT_DEBUG - sql_print_warning("Invalid pattern in %s: %s", name, - regex_list_handler->bad_pattern().c_str()); + sql_print_warning("RocksDB: Invalid pattern in %s: %s", + name, + regex.pattern().c_str()); } -} // namespace myrocks +} // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_utils.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_utils.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/rdb_utils.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/rdb_utils.h 2017-10-19 04:25:29.000000000 +0000 @@ -16,17 +16,19 @@ #pragma once /* C++ standard header files */ +#include #include #include /* MySQL header files */ #include "./sql_string.h" +#include "./sql_regex.h" /* RocksDB header files */ #include "rocksdb/slice.h" #ifdef HAVE_JEMALLOC - #include +#include #endif namespace myrocks { @@ -38,7 +40,7 @@ #ifndef interface #define interface struct -#endif // interface +#endif // interface /* Introduce C-style pseudo-namespaces, a handy way to make code more readble @@ -56,7 +58,7 @@ // to non-obvious MySQL functions, like the ones that do not start with well // known prefixes: "my_", "sql_", and "mysql_". #define my_core -#endif // my_core +#endif // my_core /* The intent behind a SHIP_ASSERT() macro is to have a mechanism for validating @@ -100,18 +102,50 @@ a and b must be both true or both false. */ #ifndef DBUG_ASSERT_IFF -#define DBUG_ASSERT_IFF(a, b) \ +#define DBUG_ASSERT_IFF(a, b) \ DBUG_ASSERT(static_cast(a) == static_cast(b)) #endif /* + Intent behind this macro is to avoid manually typing the function name every + time we want to add the debugging statement and use the compiler for this + work. This avoids typical refactoring problems when one renames a function, + but the tracing message doesn't get updated. + + We could use __func__ or __FUNCTION__ macros, but __PRETTY_FUNCTION__ + contains the signature of the function as well as its bare name and provides + therefore more context when interpreting the logs. +*/ +#define DBUG_ENTER_FUNC() DBUG_ENTER(__PRETTY_FUNCTION__) + +/* + Error handling pattern used across MySQL abides by the following rules: "All + functions that can report an error (usually an allocation error), should + return 0/FALSE/false on success, 1/TRUE/true on failure." + + https://dev.mysql.com/doc/internals/en/additional-suggestions.html has more + details. + + To increase the comprehension and readability of MyRocks codebase we'll use + constants similar to ones from C standard (EXIT_SUCCESS and EXIT_FAILURE) to + make sure that both failure and success paths are clearly identifiable. The + definitions of FALSE and TRUE come from . +*/ +#define HA_EXIT_SUCCESS FALSE +#define HA_EXIT_FAILURE TRUE + +/* + Generic constant. +*/ +const size_t RDB_MAX_HEXDUMP_LEN = 1000; + +/* Helper function to get an NULL terminated uchar* out of a given MySQL String. */ -inline uchar* rdb_mysql_str_to_uchar_str(my_core::String *str) -{ +inline uchar *rdb_mysql_str_to_uchar_str(my_core::String *str) { DBUG_ASSERT(str != nullptr); - return reinterpret_cast(str->c_ptr()); + return reinterpret_cast(str->c_ptr()); } /* @@ -119,9 +153,16 @@ given STL string. */ -inline const uchar* rdb_std_str_to_uchar_ptr(const std::string &str) -{ - return reinterpret_cast(str.data()); +inline const uchar *rdb_std_str_to_uchar_ptr(const std::string &str) { + return reinterpret_cast(str.data()); +} + +/* + Helper function to convert seconds to milliseconds. +*/ + +constexpr int rdb_convert_sec_to_ms(int sec) { + return std::chrono::milliseconds(std::chrono::seconds(sec)).count(); } /* @@ -129,10 +170,9 @@ given RocksDB item. */ -inline const uchar* rdb_slice_to_uchar_ptr(const rocksdb::Slice *item) -{ +inline const uchar *rdb_slice_to_uchar_ptr(const rocksdb::Slice *item) { DBUG_ASSERT(item != nullptr); - return reinterpret_cast(item->data()); + return reinterpret_cast(item->data()); } /* @@ -141,12 +181,11 @@ scenario for cases where it has been verified that this intervention has noticeable benefits. */ -inline int purge_all_jemalloc_arenas() -{ +inline int purge_all_jemalloc_arenas() { #ifdef HAVE_JEMALLOC unsigned narenas = 0; size_t sz = sizeof(unsigned); - char name[25] = { 0 }; + char name[25] = {0}; // Get the number of arenas first. Please see `jemalloc` documentation for // all the various options. @@ -173,94 +212,42 @@ Helper functions to parse strings. */ -const char* rdb_skip_spaces(struct charset_info_st* cs, const char *str) - __attribute__((__nonnull__, __warn_unused_result__)); +const char *rdb_skip_spaces(const struct charset_info_st *const cs, + const char *str) + __attribute__((__nonnull__, __warn_unused_result__)); + +bool rdb_compare_strings_ic(const char *const str1, const char *const str2) + __attribute__((__nonnull__, __warn_unused_result__)); + +const char *rdb_find_in_string(const char *str, const char *pattern, + bool *const succeeded) + __attribute__((__nonnull__, __warn_unused_result__)); + +const char *rdb_check_next_token(const struct charset_info_st *const cs, + const char *str, const char *const pattern, + bool *const succeeded) + __attribute__((__nonnull__, __warn_unused_result__)); + +const char *rdb_parse_id(const struct charset_info_st *const cs, + const char *str, std::string *const id) + __attribute__((__nonnull__(1, 2), __warn_unused_result__)); -bool rdb_compare_strings_ic(const char *str1, const char *str2) - __attribute__((__nonnull__, __warn_unused_result__)); - -const char* rdb_find_in_string(const char *str, const char *pattern, - bool *succeeded) - __attribute__((__nonnull__, __warn_unused_result__)); - -const char* rdb_check_next_token(struct charset_info_st* cs, const char *str, - const char *pattern, bool *succeeded) - __attribute__((__nonnull__, __warn_unused_result__)); - -const char* rdb_parse_id(struct charset_info_st* cs, const char *str, - std::string *id) - __attribute__((__nonnull__(1, 2), __warn_unused_result__)); - -const char* rdb_skip_id(struct charset_info_st* cs, const char *str) - __attribute__((__nonnull__, __warn_unused_result__)); +const char *rdb_skip_id(const struct charset_info_st *const cs, const char *str) + __attribute__((__nonnull__, __warn_unused_result__)); /* Helper functions to populate strings. */ -std::string rdb_hexdump(const char *data, std::size_t data_len, - std::size_t maxsize = 0) - __attribute__((__nonnull__)); +std::string rdb_hexdump(const char *data, const std::size_t data_len, + const std::size_t maxsize = 0) + __attribute__((__nonnull__)); /* Helper function to see if a database exists */ -bool rdb_database_exists(const std::string& db_name); - - -/* - Helper class imported from webscale and needed by MyRocks. - Used to handle system options that are lists of regex expressions. -*/ -class Regex_list_handler -{ - private: -#if defined(HAVE_PSI_INTERFACE) - const PSI_rwlock_key& m_key; -#endif - - char m_delimiter; - std::string m_bad_pattern_str; - std::unique_ptr m_pattern; - - mutable mysql_rwlock_t m_rwlock; - - Regex_list_handler(const Regex_list_handler& other)= delete; - Regex_list_handler& operator=(const Regex_list_handler& other)= delete; - - public: -#if defined(HAVE_PSI_INTERFACE) - Regex_list_handler(const PSI_rwlock_key& key, - char delimiter= ',') : - m_key(key), -#else - Regex_list_handler(char delimiter= ',') : -#endif - m_delimiter(delimiter), - m_bad_pattern_str("") - { - mysql_rwlock_init(key, &m_rwlock); - } - - ~Regex_list_handler() - { - mysql_rwlock_destroy(&m_rwlock); - } - - // Set the list of patterns - bool set_patterns(const std::string& patterns); - - // See if a string matches at least one pattern - bool matches(const std::string& str) const; - - // See the list of bad patterns - const std::string& bad_pattern() const - { - return m_bad_pattern_str; - } -}; +bool rdb_database_exists(const std::string &db_name); -void warn_about_bad_patterns(const Regex_list_handler* regex_list_handler, - const char *name); +void warn_about_bad_patterns(const Regex ®ex, const char *name); } // namespace myrocks diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/tools/mysql_ldb.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/tools/mysql_ldb.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/tools/mysql_ldb.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/tools/mysql_ldb.cc 2017-10-19 04:25:29.000000000 +0000 @@ -3,13 +3,13 @@ // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // -#include "rocksdb/ldb_tool.h" #include "../rdb_comparator.h" +#include "rocksdb/ldb_tool.h" -int main(int argc, char** argv) { +int main(int argc, char **argv) { rocksdb::Options db_options; - myrocks::Rdb_pk_comparator pk_comparator; - db_options.comparator= &pk_comparator; + const myrocks::Rdb_pk_comparator pk_comparator; + db_options.comparator = &pk_comparator; rocksdb::LDBTool tool; tool.Run(argc, argv, db_options); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/unittest/test_properties_collector.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/unittest/test_properties_collector.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/rocksdb/unittest/test_properties_collector.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/rocksdb/unittest/test_properties_collector.cc 2017-10-19 04:25:29.000000000 +0000 @@ -18,43 +18,37 @@ #include "../ha_rocksdb.h" #include "../rdb_datadic.h" -void putKeys(myrocks::Rdb_tbl_prop_coll* coll, - int num, - bool is_delete, - uint64_t expected_deleted) -{ +void putKeys(myrocks::Rdb_tbl_prop_coll *coll, int num, bool is_delete, + uint64_t expected_deleted) { std::string str("aaaaaaaaaaaaaa"); rocksdb::Slice sl(str.data(), str.size()); - for (int i=0; i < num; i++) { + for (int i = 0; i < num; i++) { coll->AddUserKey( - sl, sl, - is_delete ? rocksdb::kEntryDelete : rocksdb::kEntryPut, - 0, 100); + sl, sl, is_delete ? rocksdb::kEntryDelete : rocksdb::kEntryPut, 0, 100); } - DBUG_ASSERT(coll->GetMaxDeletedRows() == expected_deleted); + DBUG_ASSERT(coll->GetMaxDeletedRows() == expected_deleted); } -int main(int argc, char** argv) -{ +int main(int argc, char **argv) { // test the circular buffer for delete flags myrocks::Rdb_compact_params params; - params.m_file_size= 333; - params.m_deletes= 333; // irrelevant - params.m_window= 10; + params.m_file_size = 333; + params.m_deletes = 333; // irrelevant + params.m_window = 10; myrocks::Rdb_tbl_prop_coll coll(nullptr, params, 0, - RDB_DEFAULT_TBL_STATS_SAMPLE_PCT); + RDB_DEFAULT_TBL_STATS_SAMPLE_PCT); - putKeys(&coll, 2, true, 2); // [xx] - putKeys(&coll, 3, false, 2); // [xxo] - putKeys(&coll, 1, true, 3); // [xxox] - putKeys(&coll, 6, false, 3); // [xxoxoooooo] - putKeys(&coll, 3, true, 4); // xxo[xooooooxxx] - putKeys(&coll, 1, false, 4); // xxox[ooooooxxxo] - putKeys(&coll, 100, false, 4); // ....[oooooooooo] - putKeys(&coll, 100, true, 10); // ....[xxxxxxxxxx] - putKeys(&coll, 100, true, 10); // ....[oooooooooo] + putKeys(&coll, 2, true, 2); // [xx] + putKeys(&coll, 3, false, 2); // [xxo] + putKeys(&coll, 1, true, 3); // [xxox] + putKeys(&coll, 6, false, 3); // [xxoxoooooo] + putKeys(&coll, 3, true, 4); // xxo[xooooooxxx] + putKeys(&coll, 1, false, 4); // xxox[ooooooxxxo] + putKeys(&coll, 100, false, 4); // ....[oooooooooo] + putKeys(&coll, 100, true, 10); // ....[xxxxxxxxxx] + putKeys(&coll, 100, true, 10); // ....[oooooooooo] return 0; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -110,7 +110,8 @@ tokudb_background.cc tokudb_information_schema.cc tokudb_sysvars.cc - tokudb_thread.cc) + tokudb_thread.cc + tokudb_dir_cmd.cc) MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES tokufractaltree_static tokuportability_static ${ZLIB_LIBRARY} stdc++) SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin") diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/ha_tokudb.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/ha_tokudb.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/ha_tokudb.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/ha_tokudb.cc 2017-10-19 04:25:29.000000000 +0000 @@ -29,6 +29,7 @@ #include "tokudb_status.h" #include "tokudb_card.h" #include "ha_tokudb.h" +#include "sql_db.h" HASH TOKUDB_SHARE::_open_tables; @@ -531,51 +532,6 @@ DBT* orig_key; } *INDEX_READ_INFO; -static int ai_poll_fun(void *extra, float progress) { - LOADER_CONTEXT context = (LOADER_CONTEXT)extra; - if (thd_killed(context->thd)) { - sprintf(context->write_status_msg, "The process has been killed, aborting add index."); - return ER_ABORTING_CONNECTION; - } - float percentage = progress * 100; - sprintf(context->write_status_msg, "Adding of indexes about %.1f%% done", percentage); - thd_proc_info(context->thd, context->write_status_msg); -#ifdef HA_TOKUDB_HAS_THD_PROGRESS - thd_progress_report(context->thd, (unsigned long long) percentage, 100); -#endif - return 0; -} - -static int loader_poll_fun(void *extra, float progress) { - LOADER_CONTEXT context = (LOADER_CONTEXT)extra; - if (thd_killed(context->thd)) { - sprintf(context->write_status_msg, "The process has been killed, aborting bulk load."); - return ER_ABORTING_CONNECTION; - } - float percentage = progress * 100; - sprintf(context->write_status_msg, "Loading of data about %.1f%% done", percentage); - thd_proc_info(context->thd, context->write_status_msg); -#ifdef HA_TOKUDB_HAS_THD_PROGRESS - thd_progress_report(context->thd, (unsigned long long) percentage, 100); -#endif - return 0; -} - -static void loader_ai_err_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) { - LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; - assert_always(context->ha); - context->ha->set_loader_error(err); -} - -static void loader_dup_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) { - LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; - assert_always(context->ha); - context->ha->set_loader_error(err); - if (err == DB_KEYEXIST) { - context->ha->set_dup_value_for_pk(key); - } -} - // // smart DBT callback function for optimize // in optimize, we want to flatten DB by doing @@ -3395,11 +3351,13 @@ lc.thd = thd; lc.ha = this; - - error = loader->set_poll_function(loader, loader_poll_fun, &lc); + + error = loader->set_poll_function( + loader, ha_tokudb::bulk_insert_poll, &lc); assert_always(!error); - error = loader->set_error_callback(loader, loader_dup_fun, &lc); + error = loader->set_error_callback( + loader, ha_tokudb::loader_dup, &lc); assert_always(!error); trx->stmt_progress.using_loader = true; @@ -3412,6 +3370,47 @@ } TOKUDB_HANDLER_DBUG_VOID_RETURN; } +int ha_tokudb::bulk_insert_poll(void* extra, float progress) { + LOADER_CONTEXT context = (LOADER_CONTEXT)extra; + if (thd_killed(context->thd)) { + sprintf(context->write_status_msg, + "The process has been killed, aborting bulk load."); + return ER_ABORTING_CONNECTION; + } + float percentage = progress * 100; + sprintf(context->write_status_msg, + "Loading of data t %s about %.1f%% done", + context->ha->share->full_table_name(), + percentage); + thd_proc_info(context->thd, context->write_status_msg); +#ifdef HA_TOKUDB_HAS_THD_PROGRESS + thd_progress_report(context->thd, (unsigned long long)percentage, 100); +#endif + return 0; +} +void ha_tokudb::loader_add_index_err(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra) { + LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; + assert_always(context->ha); + context->ha->set_loader_error(err); +} +void ha_tokudb::loader_dup(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra) { + LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra; + assert_always(context->ha); + context->ha->set_loader_error(err); + if (err == DB_KEYEXIST) { + context->ha->set_dup_value_for_pk(key); + } +} // // Method that is called at the end of many calls to insert rows @@ -5253,17 +5252,17 @@ DEBUG_SYNC(ha_thd(), "tokudb_icp_asc_scan_out_of_range"); goto cleanup; } else if (result == ICP_NO_MATCH) { - // if we are performing a DESC ICP scan and have no end_range - // to compare to stop using ICP filtering as there isn't much more - // that we can do without going through contortions with remembering - // and comparing key parts. + // Optimizer change for MyRocks also benefits us here in TokuDB as + // opt_range.cc QUICK_SELECT::get_next now sets end_range during + // descending scan. We should not ever hit this condition, but + // leaving this code in to prevent any possibility of a descending + // scan to the beginning of an index and catch any possibility + // in debug builds with an assertion + assert_debug(!(!end_range && direction < 0)); if (!end_range && direction < 0) { - cancel_pushed_idx_cond(); - DEBUG_SYNC(ha_thd(), "tokudb_icp_desc_scan_invalidate"); } - error = TOKUDB_CURSOR_CONTINUE; goto cleanup; } @@ -6121,9 +6120,6 @@ stats.records = share->row_count() + share->rows_from_locked_table; stats.deleted = 0; if (!(flag & HA_STATUS_NO_LOCK)) { - uint64_t num_rows = 0; - TOKU_DB_FRAGMENTATION_S frag_info; - memset(&frag_info, 0, sizeof frag_info); error = txn_begin(db_env, NULL, &txn, DB_READ_UNCOMMITTED, ha_thd()); if (error) { @@ -6133,29 +6129,18 @@ // we should always have a primary key assert_always(share->file != NULL); - error = estimate_num_rows(share->file, &num_rows, txn); - if (error == 0) { - share->set_row_count(num_rows, false); - stats.records = num_rows; - } else { - goto cleanup; - } - error = share->file->get_fragmentation(share->file, &frag_info); - if (error) { - goto cleanup; - } - stats.delete_length = frag_info.unused_bytes; - DB_BTREE_STAT64 dict_stats; error = share->file->stat64(share->file, txn, &dict_stats); if (error) { goto cleanup; } - + share->set_row_count(dict_stats.bt_ndata, false); + stats.records = dict_stats.bt_ndata; stats.create_time = dict_stats.bt_create_time_sec; stats.update_time = dict_stats.bt_modify_time_sec; stats.check_time = dict_stats.bt_verify_time_sec; stats.data_file_length = dict_stats.bt_dsize; + stats.delete_length = dict_stats.bt_fsize - dict_stats.bt_dsize; if (hidden_primary_key) { // // in this case, we have a hidden primary key, do not @@ -6191,30 +6176,21 @@ // // this solution is much simpler than trying to maintain an // accurate number of valid keys at the handlerton layer. - uint curr_num_DBs = table->s->keys + tokudb_test(hidden_primary_key); + uint curr_num_DBs = + table->s->keys + tokudb_test(hidden_primary_key); for (uint i = 0; i < curr_num_DBs; i++) { // skip the primary key, skip dropped indexes if (i == primary_key || share->key_file[i] == NULL) { continue; } - error = - share->key_file[i]->stat64( - share->key_file[i], - txn, - &dict_stats); + error = share->key_file[i]->stat64( + share->key_file[i], txn, &dict_stats); if (error) { goto cleanup; } stats.index_file_length += dict_stats.bt_dsize; - - error = - share->file->get_fragmentation( - share->file, - &frag_info); - if (error) { - goto cleanup; - } - stats.delete_length += frag_info.unused_bytes; + stats.delete_length += + dict_stats.bt_fsize - dict_stats.bt_dsize; } } @@ -7651,6 +7627,33 @@ TOKUDB_HANDLER_DBUG_RETURN(error); } +static bool tokudb_check_db_dir_exist_from_table_name(const char *table_name) { + DBUG_ASSERT(table_name); + bool mysql_dir_exists; + char db_name[FN_REFLEN]; + const char *db_name_begin = strchr(table_name, FN_LIBCHAR); + const char *db_name_end = strrchr(table_name, FN_LIBCHAR); + DBUG_ASSERT(db_name_begin); + DBUG_ASSERT(db_name_end); + DBUG_ASSERT(db_name_begin != db_name_end); + + ++db_name_begin; + size_t db_name_size = db_name_end - db_name_begin; + + DBUG_ASSERT(db_name_size < FN_REFLEN); + + memcpy(db_name, db_name_begin, db_name_size); + db_name[db_name_size] = '\0'; + + // At this point, db_name contains the MySQL formatted database name. + // This is exactly the same format that would come into us through a + // CREATE TABLE. Some charaters (like ':' for example) might be expanded + // into hex (':' would papear as "@003a"). + // We need to check that the MySQL destination database directory exists. + mysql_dir_exists = (my_access(db_name, F_OK) == 0); + + return mysql_dir_exists; +} // // renames table from "from" to "to" @@ -7673,15 +7676,26 @@ TOKUDB_SHARE::drop_share(share); } int error; - error = delete_or_rename_table(from, to, false); - if (TOKUDB_LIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0) && - error == DB_LOCK_NOTGRANTED) { + bool to_db_dir_exist = tokudb_check_db_dir_exist_from_table_name(to); + if (!to_db_dir_exist) { sql_print_error( - "Could not rename table from %s to %s because another transaction " - "has accessed the table. To rename the table, make sure no " - "transactions touch the table.", + "Could not rename table from %s to %s because " + "destination db does not exist", from, to); + error = HA_ERR_DEST_SCHEMA_NOT_EXIST; + } + else { + error = delete_or_rename_table(from, to, false); + if (TOKUDB_LIKELY(TOKUDB_DEBUG_FLAGS(TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0) && + error == DB_LOCK_NOTGRANTED) { + sql_print_error( + "Could not rename table from %s to %s because another transaction " + "has accessed the table. To rename the table, make sure no " + "transactions touch the table.", + from, + to); + } } TOKUDB_HANDLER_DBUG_RETURN(error); } @@ -7823,7 +7837,7 @@ // As a result, equal may be 0 and greater may actually be equal+greater // So, we call key_range64 on the key, and the key that is after it. if (!start_key && !end_key) { - error = estimate_num_rows(kfile, &rows, transaction); + error = estimate_num_rows(share->file, &rows, transaction); if (error) { ret_val = HA_TOKUDB_RANGE_COUNT; goto cleanup; @@ -8169,12 +8183,14 @@ goto cleanup; } - error = indexer->set_poll_function(indexer, ai_poll_fun, &lc); + error = indexer->set_poll_function( + indexer, ha_tokudb::tokudb_add_index_poll, &lc); if (error) { goto cleanup; } - error = indexer->set_error_callback(indexer, loader_ai_err_fun, &lc); + error = indexer->set_error_callback( + indexer, ha_tokudb::loader_add_index_err, &lc); if (error) { goto cleanup; } @@ -8229,12 +8245,14 @@ goto cleanup; } - error = loader->set_poll_function(loader, loader_poll_fun, &lc); + error = + loader->set_poll_function(loader, ha_tokudb::bulk_insert_poll, &lc); if (error) { goto cleanup; } - error = loader->set_error_callback(loader, loader_ai_err_fun, &lc); + error = loader->set_error_callback( + loader, ha_tokudb::loader_add_index_err, &lc); if (error) { goto cleanup; } @@ -8441,6 +8459,24 @@ thd_proc_info(thd, orig_proc_info); TOKUDB_HANDLER_DBUG_RETURN(error ? error : loader_error); } +int ha_tokudb::tokudb_add_index_poll(void* extra, float progress) { + LOADER_CONTEXT context = (LOADER_CONTEXT)extra; + if (thd_killed(context->thd)) { + sprintf(context->write_status_msg, + "The process has been killed, aborting add index."); + return ER_ABORTING_CONNECTION; + } + float percentage = progress * 100; + sprintf(context->write_status_msg, + "Adding of indexes to %s about %.1f%% done", + context->ha->share->full_table_name(), + percentage); + thd_proc_info(context->thd, context->write_status_msg); +#ifdef HA_TOKUDB_HAS_THD_PROGRESS + thd_progress_report(context->thd, (unsigned long long)percentage, 100); +#endif + return 0; +} // // Internal function called by ha_tokudb::add_index and ha_tokudb::alter_table_phase2 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/ha_tokudb.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/ha_tokudb.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/ha_tokudb.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/ha_tokudb.h 2017-10-19 04:25:29.000000000 +0000 @@ -799,6 +799,19 @@ #else void start_bulk_insert(ha_rows rows); #endif + static int bulk_insert_poll(void* extra, float progress); + static void loader_add_index_err(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra); + static void loader_dup(DB* db, + int i, + int err, + DBT* key, + DBT* val, + void* error_extra); int end_bulk_insert(); int end_bulk_insert(bool abort); @@ -816,6 +829,8 @@ int index_first(uchar * buf); int index_last(uchar * buf); + bool has_gap_locks() const { return true; } + int rnd_init(bool scan); int rnd_end(); int rnd_next(uchar * buf); @@ -936,17 +951,23 @@ #endif private: - int tokudb_add_index( - TABLE *table_arg, - KEY *key_info, - uint num_of_keys, - DB_TXN* txn, - bool* inc_num_DBs, - bool* modified_DB - ); - void restore_add_index(TABLE* table_arg, uint num_of_keys, bool incremented_numDBs, bool modified_DBs); - int drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys, KEY *key_info, DB_TXN* txn); - void restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys); + int tokudb_add_index(TABLE* table_arg, + KEY* key_info, + uint num_of_keys, + DB_TXN* txn, + bool* inc_num_DBs, + bool* modified_DB); + static int tokudb_add_index_poll(void *extra, float progress); + void restore_add_index(TABLE* table_arg, + uint num_of_keys, + bool incremented_numDBs, + bool modified_DBs); + int drop_indexes(TABLE* table_arg, + uint* key_num, + uint num_of_keys, + KEY* key_info, + DB_TXN* txn); + void restore_drop_indexes(TABLE* table_arg, uint* key_num, uint num_of_keys); public: // delete all rows from the table diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/hatoku_hton.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/hatoku_hton.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/hatoku_hton.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/hatoku_hton.cc 2017-10-19 04:25:29.000000000 +0000 @@ -67,6 +67,7 @@ static void tokudb_handle_fatal_signal(handlerton* hton, THD* thd, int sig); #endif static int tokudb_close_connection(handlerton* hton, THD* thd); +static void tokudb_kill_connection(handlerton *hton, THD *thd); static int tokudb_commit(handlerton* hton, THD* thd, bool all); static int tokudb_rollback(handlerton* hton, THD* thd, bool all); #if TOKU_INCLUDE_XA @@ -343,6 +344,7 @@ tokudb_hton->create = tokudb_create_handler; tokudb_hton->close_connection = tokudb_close_connection; + tokudb_hton->kill_connection = tokudb_kill_connection; tokudb_hton->savepoint_offset = sizeof(SP_INFO_T); tokudb_hton->savepoint_set = tokudb_savepoint; @@ -766,6 +768,12 @@ return error; } +void tokudb_kill_connection(handlerton *hton, THD *thd) { + TOKUDB_DBUG_ENTER(""); + db_env->kill_waiter(db_env, thd); + DBUG_VOID_RETURN; +} + bool tokudb_flush_logs(handlerton * hton) { TOKUDB_DBUG_ENTER(""); int error; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_dir_cmd.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_dir_cmd.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_dir_cmd.cc 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_dir_cmd.cc 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,331 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +/* -*- mode: C; c-basic-offset: 4 -*- */ +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB 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 TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#include "hatoku_hton.h" +#include "tokudb_dir_cmd.h" +#include "my_dbug.h" +#include "sql_base.h" + +#include +#include + +namespace tokudb { + +const char tokens_delimiter = ' '; +const char tokens_escape_delimiter_char = '\\'; + +static int MDL_and_TDC(THD *thd, + const char *db, + const char *table, + const dir_cmd_callbacks &cb) { + int error; + LEX_STRING db_arg; + LEX_STRING table_arg; + + db_arg.str = const_cast(db); + db_arg.length = strlen(db);; + table_arg.str = const_cast(table); + table_arg.length = strlen(table); + Table_ident table_ident(thd, db_arg, table_arg, true);; + thd->lex->select_lex.add_table_to_list( + thd, &table_ident, NULL, 1, TL_UNLOCK, MDL_EXCLUSIVE, 0, 0, 0); + /* The lock will be released at the end of mysq_execute_command() */ + error = lock_table_names(thd, + thd->lex->select_lex.table_list.first, + NULL, + thd->variables.lock_wait_timeout, + 0); + if (error) { + if (cb.set_error) + cb.set_error(thd, + error, + "Can't lock table '%s.%s'", + db, + table); + return error; + } + tdc_remove_table(thd, TDC_RT_REMOVE_ALL, db, table, false); + return error; +} + +static bool parse_db_and_table(const char *dname, + std::string /*out*/ &db_name, + std::string /*out*/ &table_name) { + const char *begin; + const char *end; + const char *db_name_begin; + const char *db_name_end; + + begin = strchr(dname, '/'); + if (!begin) + return false; + ++begin; + end = strchr(begin, '/'); + if (!end) + return false; + + db_name_begin = begin; + db_name_end = end; + + begin = end + 1; + + end = strchr(begin, '-'); + if (!end) + return false; + + if (strncmp(end, "-main", strlen("-main")) && + strncmp(end, "-status", strlen("-status")) && + strncmp(end, "-key", strlen("-key"))) + return false; + + db_name.assign(db_name_begin, db_name_end); + table_name.assign(begin, end); + + return true; +} + +static int attach(THD *thd, + const std::string &dname, + const std::string &iname, + const dir_cmd_callbacks &cb) { + int error; + DB_TXN* txn = NULL; + DB_TXN *parent_txn = NULL; + tokudb_trx_data *trx = NULL; + + std::string db_name; + std::string table_name; + + if (parse_db_and_table(dname.c_str(), db_name, table_name)) { + error = MDL_and_TDC(thd, db_name.c_str(), table_name.c_str(), cb); + if (error) + goto cleanup; + } + + trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + if (trx && trx->sub_sp_level) + parent_txn = trx->sub_sp_level; + error = txn_begin(db_env, parent_txn, &txn, 0, thd); + if (error) + goto cleanup; + + error = db_env->dirtool_attach(db_env, + txn, + dname.c_str(), + iname.c_str()); +cleanup: + if (txn) { + if (error) { + abort_txn(txn); + } + else { + commit_txn(txn, 0); + } + } + return error; +} + +static int detach(THD *thd, + const std::string &dname, + const dir_cmd_callbacks &cb) { + int error; + DB_TXN* txn = NULL; + DB_TXN *parent_txn = NULL; + tokudb_trx_data *trx = NULL; + + std::string db_name; + std::string table_name; + + if (parse_db_and_table(dname.c_str(), db_name, table_name)) { + error = MDL_and_TDC(thd, db_name.c_str(), table_name.c_str(), cb); + if (error) + goto cleanup; + } + + trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + if (trx && trx->sub_sp_level) + parent_txn = trx->sub_sp_level; + error = txn_begin(db_env, parent_txn, &txn, 0, thd); + if (error) + goto cleanup; + + error = db_env->dirtool_detach(db_env, + txn, + dname.c_str()); +cleanup: + if (txn) { + if (error) { + abort_txn(txn); + } + else { + commit_txn(txn, 0); + } + } + return error; +} + +static int move(THD *thd, + const std::string &old_dname, + const std::string &new_dname, + const dir_cmd_callbacks &cb) { + int error; + DB_TXN* txn = NULL; + DB_TXN *parent_txn = NULL; + tokudb_trx_data *trx = NULL; + + std::string db_name; + std::string table_name; + + if (parse_db_and_table(old_dname.c_str(), db_name, table_name)) { + error = MDL_and_TDC(thd, db_name.c_str(), table_name.c_str(), cb); + if (error) + goto cleanup; + } + + trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); + if (trx && trx->sub_sp_level) + parent_txn = trx->sub_sp_level; + error = txn_begin(db_env, parent_txn, &txn, 0, thd); + if (error) + goto cleanup; + + error = db_env->dirtool_move(db_env, + txn, + old_dname.c_str(), + new_dname.c_str()); +cleanup: + if (txn) { + if (error) { + abort_txn(txn); + } + else { + commit_txn(txn, 0); + } + } + return error; +} + +static void tokenize(const char *cmd_str, + std::vector /*out*/ &tokens) { + DBUG_ASSERT(cmd_str); + + bool was_escape = false; + const char *token_begin = cmd_str; + const char *token_end = token_begin; + + while (*token_end) { + if (*token_end == tokens_escape_delimiter_char) { + was_escape = true; + } + else if (*token_end == tokens_delimiter) { + if (was_escape) + was_escape = false; + else { + if (token_begin == token_end) + ++token_begin; + else { + tokens.push_back(std::string(token_begin, token_end)); + token_begin = token_end + 1; + } + } + } + else { + was_escape = false; + } + ++token_end; + } + + if (token_begin != token_end) + tokens.push_back(std::string(token_begin, token_end)); +} + +void process_dir_cmd(THD *thd, + const char *cmd_str, + const dir_cmd_callbacks &cb) { + + DBUG_ASSERT(thd); + DBUG_ASSERT(cmd_str); + + std::vector tokens; + tokenize(cmd_str, tokens); + + if (tokens.empty()) + return; + + const std::string &cmd = tokens[0]; + + if (!cmd.compare("attach")) { + if (tokens.size() != 3) { + if (cb.set_error) + cb.set_error(thd, + EINVAL, + "attach command requires two arguments"); + } + else { + int r = attach(thd, tokens[1], tokens[2], cb); + if (r && cb.set_error) + cb.set_error(thd, r, "Attach command error"); + } + } + else if (!cmd.compare("detach")) { + if (tokens.size() != 2) { + if (cb.set_error) + cb.set_error(thd, + EINVAL, + "detach command requires one argument"); + } + else { + int r = detach(thd, tokens[1], cb); + if (r && cb.set_error) + cb.set_error(thd, r, "detach command error"); + } + } + else if (!cmd.compare("move")) { + if (tokens.size() != 3) { + if (cb.set_error) + cb.set_error(thd, + EINVAL, + "move command requires two arguments"); + } + else { + int r = move(thd, tokens[1], tokens[2], cb); + if (r && cb.set_error) + cb.set_error(thd, r, "move command error"); + } + } + else { + if (cb.set_error) + cb.set_error(thd, + ENOENT, + "Unknown command '%s'", + cmd.c_str()); + } + + return; +}; + + +} // namespace tokudb diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_dir_cmd.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_dir_cmd.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_dir_cmd.h 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_dir_cmd.h 2017-10-19 04:25:29.000000000 +0000 @@ -0,0 +1,46 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/*====== +This file is part of TokuDB + + +Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. + + TokuDBis is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, + as published by the Free Software Foundation. + + TokuDB 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 TokuDB. If not, see . + +======= */ + +#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." + +#ifndef _TOKUDB_DIR_CMD_H +#define _TOKUDB_DIR_CMD_H + +#include + +namespace tokudb { + +struct dir_cmd_callbacks { + void (*set_error)(THD *thd, + int error, + const char *error_fmt, + ...); +}; + +void process_dir_cmd(THD *thd, + const char *cmd_str, + const dir_cmd_callbacks &cb); + +}; + +#endif // _TOKUDB_DIR_CMD_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_information_schema.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_information_schema.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_information_schema.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_information_schema.cc 2017-10-19 04:25:29.000000000 +0000 @@ -73,7 +73,8 @@ void *extra) { uint64_t txn_id = txn->id64(txn); - uint64_t client_id = txn->get_client_id(txn); + uint64_t client_id; + txn->get_client_id(txn, &client_id, NULL); uint64_t start_time = txn->get_start_time(txn); trx_extra_t* e = reinterpret_cast(extra); THD* thd = e->thd; @@ -312,7 +313,8 @@ void* extra) { uint64_t txn_id = txn->id64(txn); - uint64_t client_id = txn->get_client_id(txn); + uint64_t client_id; + txn->get_client_id(txn, &client_id, NULL); locks_extra_t* e = reinterpret_cast(extra); THD* thd = e->thd; TABLE* table = e->table; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_sysvars.cc percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_sysvars.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_sysvars.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_sysvars.cc 2017-10-19 04:25:29.000000000 +0000 @@ -25,6 +25,9 @@ #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." #include "hatoku_hton.h" +#include "sql_acl.h" +#include "tokudb_dir_cmd.h" +#include "sql_parse.h" namespace tokudb { namespace sysvars { @@ -40,6 +43,8 @@ #define TOKUDB_VERSION_STR NULL #endif +const size_t error_buffer_max_size = 1024; + ulonglong cache_size = 0; uint cachetable_pool_threads = 0; int cardinality_scale_percent = 0; @@ -918,7 +923,70 @@ true); #endif +static int dir_cmd_check(THD* thd, struct st_mysql_sys_var* var, + void* save, struct st_mysql_value* value) ; + +static MYSQL_THDVAR_INT(dir_cmd_last_error, + PLUGIN_VAR_THDLOCAL, + "error from the last dir command. 0 is success", + NULL, NULL, 0, 0, 0, 1); + +static MYSQL_THDVAR_STR(dir_cmd_last_error_string, + PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC, + "error string from the last dir command", + NULL, NULL, NULL); +static MYSQL_THDVAR_STR(dir_cmd, + PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC, + "name of the directory where the backup is stored", + dir_cmd_check, NULL, NULL); + +static void dir_cmd_set_error(THD *thd, + int error, + const char *error_fmt, + ...) { + char buff[error_buffer_max_size]; + va_list varargs; + + assert(thd); + assert(error_fmt); + + va_start(varargs, error_fmt); + vsnprintf(buff, sizeof(buff), error_fmt, varargs); + va_end(varargs); + + THDVAR_SET(thd, dir_cmd_last_error, &error); + THDVAR_SET(thd, dir_cmd_last_error_string, buff); +} + +static int dir_cmd_check(THD* thd, struct st_mysql_sys_var* var, + void* save, struct st_mysql_value* value) { + int error = 0; + dir_cmd_set_error(thd, error, ""); + + if (check_global_access(thd, SUPER_ACL)) { + return 1; + } + + char buff[STRING_BUFFER_USUAL_SIZE]; + int length = sizeof(buff); + const char *str = value->val_str(value, buff, &length); + if (str) { + str = thd->strmake(str, length); + *(const char**)save = str; + } + + if (str) { + dir_cmd_callbacks callbacks { .set_error = dir_cmd_set_error }; + process_dir_cmd(thd, str, callbacks); + + error = THDVAR(thd, dir_cmd_last_error); + } else { + error = EINVAL; + } + + return error; +} //****************************************************************************** // all system variables @@ -949,7 +1017,6 @@ MYSQL_SYSVAR(version), MYSQL_SYSVAR(write_status_frequency), MYSQL_SYSVAR(dir_per_db), - #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL MYSQL_SYSVAR(gdb_path), MYSQL_SYSVAR(gdb_on_fatal), @@ -1008,6 +1075,9 @@ #if TOKUDB_DEBUG MYSQL_SYSVAR(debug_pause_background_job_manager), #endif // TOKUDB_DEBUG + MYSQL_SYSVAR(dir_cmd_last_error), + MYSQL_SYSVAR(dir_cmd_last_error_string), + MYSQL_SYSVAR(dir_cmd), NULL }; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_txn.h percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_txn.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/storage/tokudb/tokudb_txn.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/storage/tokudb/tokudb_txn.h 2017-10-19 04:25:29.000000000 +0000 @@ -116,7 +116,7 @@ int r = env->txn_begin(env, parent, txn, flags); if (r == 0 && thd) { DB_TXN* this_txn = *txn; - this_txn->set_client_id(this_txn, thd_get_thread_id(thd)); + this_txn->set_client_id(this_txn, thd_get_thread_id(thd), thd); } TOKUDB_TRACE_FOR_FLAGS( TOKUDB_DEBUG_TXN, diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/strings/ctype-utf8.c percona-xtradb-cluster-5.6-5.6.37-26.21/strings/ctype-utf8.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/strings/ctype-utf8.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/strings/ctype-utf8.c 2017-10-19 04:25:29.000000000 +0000 @@ -5083,15 +5083,30 @@ */ static size_t -my_strxfrm_pad_nweights_unicode(uchar *str, uchar *strend, size_t nweights) +my_strxfrm_pad_nweights_unicode(uchar *str, + const uchar *const strend, + size_t nweights) { - uchar *str0; - DBUG_ASSERT(str && str <= strend); - for (str0= str; str < strend && nweights; nweights--) + const uchar *const str0 = str; + const uchar *const weightend = str + (nweights*2); + const uchar *const end = (weightend < strend) ? weightend : strend; + DBUG_ASSERT(str && str <= strend); + + while (str < end-3) + { + *str++= 0x00; + *str++= 0x20; + *str++= 0x00; + *str++= 0x20; + } + if (str < end-1) + { + *str++= 0x00; + *str++= 0x20; + } + if (str < end) { *str++= 0x00; - if (str < strend) - *str++= 0x20; } return str - str0; } @@ -5112,15 +5127,26 @@ */ static size_t -my_strxfrm_pad_unicode(uchar *str, uchar *strend) +my_strxfrm_pad_unicode(uchar *str, const uchar *const strend) { - uchar *str0= str; + const uchar *const str0 = str; DBUG_ASSERT(str && str <= strend); - for ( ; str < strend ; ) + + while (str < strend-3) + { + *str++= 0x00; + *str++= 0x20; + *str++= 0x00; + *str++= 0x20; + } + if (str < strend-1) + { + *str++= 0x00; + *str++= 0x20; + } + if (str < strend) { *str++= 0x00; - if (str < strend) - *str++= 0x20; } return str - str0; } @@ -5142,13 +5168,13 @@ { my_wc_t wc; int res; - uchar *dst0= dst; - uchar *de= dst + dstlen; - const uchar *se= src + srclen; + uchar *const dst0= dst; + const uchar *const de= dst + dstlen; + const uchar *const se= src + srclen; MY_UNICASE_INFO *uni_plane= (cs->state & MY_CS_BINSORT) ? NULL : cs->caseinfo; LINT_INIT(wc); - DBUG_ASSERT(src); + DBUG_ASSERT(src || srclen == 0); for (; dst < de && nweights; nweights--) { @@ -5185,12 +5211,12 @@ const uchar *src, size_t srclen, uint flags) { my_wc_t wc; - uchar *dst0= dst; - uchar *de= dst + dstlen; - const uchar *se = src + srclen; + uchar *const dst0= dst; + const uchar *const de= dst + dstlen; + const uchar *const se= src + srclen; LINT_INIT(wc); - DBUG_ASSERT(src); + DBUG_ASSERT(src || srclen == 0); DBUG_ASSERT(cs->state & MY_CS_BINSORT); for ( ; dst < de && nweights; nweights--) @@ -5210,7 +5236,17 @@ if (flags & MY_STRXFRM_PAD_WITH_SPACE) { - for ( ; dst < de && nweights; nweights--) + const uchar *const weightend = dst + (nweights*3); + const uchar *const end = (weightend < de) ? weightend : de; + + while (dst < end-2) + { + *dst++= 0x00; + *dst++= 0x00; + *dst++= 0x20; + nweights--; + } + if (dst < de && nweights > 0) { *dst++= 0x00; if (dst < de) @@ -5226,7 +5262,13 @@ if (flags & MY_STRXFRM_PAD_TO_MAXLEN) { - while (dst < de) + while (dst < de-2) + { + *dst++= 0x00; + *dst++= 0x00; + *dst++= 0x20; + } + if (dst < de) { *dst++= 0x00; if (dst < de) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/support-files/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/support-files/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/support-files/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/support-files/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# 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 @@ -51,6 +51,11 @@ DESTINATION ${inst_location} COMPONENT IniFiles) IF(UNIX) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET (PIDOF "pidof") + ELSE() + SET (PIDOF "pgrep -d' ' -f") + ENDIF() SET(prefix ${CMAKE_INSTALL_PREFIX}) FOREACH(script mysqld_multi.server mysql-log-rotate binary-configure) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/support-files/mysql.5.6.34-79.1.spec percona-xtradb-cluster-5.6-5.6.37-26.21/support-files/mysql.5.6.34-79.1.spec --- percona-xtradb-cluster-5.6-5.6.34-26.19/support-files/mysql.5.6.34-79.1.spec 2016-12-13 08:49:19.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/support-files/mysql.5.6.34-79.1.spec 1970-01-01 00:00:00.000000000 +0000 @@ -1,2410 +0,0 @@ -# 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 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; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston -# MA 02110-1301 USA. - -############################################################################## -# Some common macro definitions -############################################################################## - -# NOTE: "vendor" is used in upgrade/downgrade check, so you can't -# change these, has to be exactly as is. -%global mysql_old_vendor MySQL AB -%global mysql_vendor_2 Sun Microsystems, Inc. -%global mysql_vendor Oracle and/or its affiliates - -%global mysql_version 5.6.34-79.1 -%global wsrep_version 26.19 -%global wsrep_revision XXXX - -%global mysqld_user mysql -%global mysqld_group mysql -%global mysqldatadir /var/lib/mysql - -%global release %{wsrep_version} -%global short_product_tag 5.6 -%global previous_tag 5.5 - -# -# Macros we use which are not available in all supported versions of RPM -# -# - defined/undefined are missing on RHEL4 -# -%if %{expand:%{?defined:0}%{!?defined:1}} -%define defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}} -%endif -%if %{expand:%{?undefined:0}%{!?undefined:1}} -%define undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}} -%endif - -# ---------------------------------------------------------------------------- -# RPM build tools now automatically detect Perl module dependencies. This -# detection causes problems as it is broken in some versions, and it also -# provides unwanted dependencies from mandatory scripts in our package. -# It might not be possible to disable this in all versions of RPM, but here we -# try anyway. We keep the "AutoReqProv: no" for the "test" sub package, as -# disabling here might fail, and that package has the most problems. -# See: -# http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides -# http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html -# ---------------------------------------------------------------------------- -%undefine __perl_provides -%undefine __perl_requires - -############################################################################## -# Command line handling -############################################################################## -# -# To set options: -# -# $ rpmbuild --define="option " ... -# - -# ---------------------------------------------------------------------------- -# Commercial builds -# ---------------------------------------------------------------------------- -%if %{undefined commercial} -%define commercial 0 -%endif - -# ---------------------------------------------------------------------------- -# Source name -# ---------------------------------------------------------------------------- -%if %{undefined src_base} -%define src_base mysql-wsrep -%endif -%define src_dir %{src_base}-%{mysql_version}-%{wsrep_version} - -# ---------------------------------------------------------------------------- -# Feature set (storage engines, options). Default to community (everything) -# ---------------------------------------------------------------------------- -%if %{undefined feature_set} -%define feature_set community -%endif - -# ---------------------------------------------------------------------------- -# Server comment strings -# ---------------------------------------------------------------------------- -%if %{undefined compilation_comment_debug} -%define compilation_comment_debug MySQL Community Server - Debug (GPL) -%endif -%if %{undefined compilation_comment_release} -%define compilation_comment_release MySQL Community Server (GPL) -%endif - -# ---------------------------------------------------------------------------- -# Product and server suffixes -# ---------------------------------------------------------------------------- -%if %{undefined product_suffix} - %if %{defined short_product_tag} - %define product_suffix -%{short_product_tag} - %define previous_suffix -%{previous_tag} - %else - %define product_suffix %{nil} - %endif -%endif - -%if %{undefined server_suffix} -%define server_suffix %{nil} -%endif - -# ---------------------------------------------------------------------------- -# Distribution support -# ---------------------------------------------------------------------------- - -# Disable post build checks for time being. -BuildConflicts: post-build-checks - -BuildRequires: gcc-c++ ncurses-devel perl zlib-devel cmake libaio-devel bison flex - -%if 0%{?rhel} == 6 || 0%{?rhel} == 7 || 0%{?fedora} == 20 || 0%{?fedora} == 21 -BuildRequires: time openssl-devel -%endif -%if 0%{?rhel} == 7 -BuildRequires: perl(Time::HiRes) perl(Env) -%endif - -%if 0%{?suse_version} -%if 0%{?suse_version} == 1110 -BuildRequires: gdbm-devel gperf openldap2-client procps pwdutils libopenssl-devel -%else -BuildRequires: libopenssl-devel -%endif -%if 0%{?suse_version} == 1310 || 0%{?suse_version} == 1315 || 0%{?suse_version} == 1320 -BuildRequires: gperf procps time - %endif - %endif - -# Define dist tag if not given by platform -# In case of problems, check "/etc/rpm/macros.dist" -%if %{undefined dist} - # For suse versions see: - # https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto - %if 0%{?suse_version} == 1110 - %define dist .sle11 - %endif - %if 0%{?suse_version} == 1310 - %define dist .suse13.1 - %endif - %if 0%{?suse_version} == 1315 - %define dist .sle12 - %endif - %if 0%{?suse_version} == 1320 - %define dist .suse13.2 - %endif - # Still missing? - %if %{undefined dist} - %define dist .DIST - %endif -%endif -# CentOS 7 would force ".el7.centos", we want to avoid that. -%if 0%{?rhel} == 7 - %define dist .el7 -%endif - -# Avoid debuginfo RPMs, leaves binaries unstripped -%define debug_package %{nil} - -# ---------------------------------------------------------------------------- -# Support optional "tcmalloc" library (experimental) -# ---------------------------------------------------------------------------- -%if %{defined malloc_lib_target} -%define WITH_TCMALLOC 1 -%else -%define WITH_TCMALLOC 0 -%endif - -############################################################################## -# Settings for the "compatibility libs", the version depends on the target platform -############################################################################## - -# To differ between current main version and libs-compat: -%global currentlib 18 - -%if 0%{?rhel} == 6 -%global compatver 5.1.73 -%global compatlib 16 -%global compatsrc https://cdn.mysql.com/Downloads/MySQL-5.1/mysql-%{compatver}.tar.gz -%global compatch mysql-5173-charset-dir.patch -%endif - -# 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.7 (or higher) that has a libmysqlclient.so.20 or higher. -# -# %%if 0%%{?rhel} == 7 -# %%global compatver 5.5.45 -# %%global compatlib 18 -# %%global compatsrc https://cdn.mysql.com/Downloads/MySQL-5.5/mysql-%%{compatver}.tar.gz -# %%global compatch mysql-5545-charset-dir.patch -# # By default, a build will include the bundeled "yaSSL" library for SSL. -# %%{?with_ssl: %%global ssl_option -DWITH_SSL=%%{with_ssl}} -# %%endif - -%if 0%{?compatlib} -# Attention: "compat_src_dir" is the old version (e.g. 5.1.73), depends on platform -%global compat_src_dir mysql-%{compatver} -%endif - -############################################################################## -# Configuration based upon above user input, not to be set directly -############################################################################## - -%if 0%{?commercial} -%define license_files_server %{src_dir}/LICENSE.mysql -%define license_type Commercial -%else -%define license_files_server %{src_dir}/COPYING %{src_dir}/README -%define license_type GPL -%define compat_license_files_server %{compat_src_dir}/COPYING %{compat_src_dir}/README -%endif - -############################################################################## -# Main spec file section -############################################################################## - -Name: mysql-wsrep%{product_suffix} -Summary: MySQL: a very fast and reliable SQL database server -Group: Applications/Databases -Version: 5.6.34_79.1 -Release: %{release}%{dist} -# Distribution: %{distro_description} -License: Copyright (c) 2000, 2016, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field. -Source: %{src_dir}.tar.gz -%if 0%{?compatlib} -Source7: %{compatsrc} -%endif -Source99: mysql-rpmlintrc -Patch0: cmake-no-wix.patch -%if 0%{?compatlib} -Patch7: %{compatch} -%if 0%{?compatlib} == 18 -Patch8: mysql-5.5-libmysqlclient-symbols.patch -%endif -%endif -URL: http://www.mysql.com/ -Packager: Codership Oy -Vendor: %{mysql_vendor} -# BuildRequires: %{distro_buildreq} -#wsrep_patch_tag - -Requires: mysql-wsrep-server%{product_suffix} -Requires: mysql-wsrep-client%{product_suffix} - -%if %{defined previous_suffix} -Obsoletes: mysql-wsrep%{previous_suffix} -%endif - -# Regression tests may take a long time, override the default to skip them -%{!?runselftest:%global runselftest 0} - -# Think about what you use here since the first step is to -# run a rm -rf -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -# From the manual -%description -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 -%{mysql_vendor} - -The MySQL software has Dual Licensing, which means you can use the MySQL -software free of charge under the GNU General Public License -(http://www.gnu.org/licenses/). You can also purchase commercial MySQL -licenses from %{mysql_vendor} if you do not wish to be bound by the terms of -the GPL. See the chapter "Licensing and Support" in the manual for -further info. - -The MySQL web site (http://www.mysql.com/) provides the latest -news and information about the MySQL software. Also please see the -documentation and the manual for more information. - -This is a meta package of the MySQL software combined with the "wsrep plugin" -aka "Galera Cluster", all governed by the GPL. -It causes the installation of both the server and the client subpackages -so that the machine can be used both as a local database server and as a node -in a MySQL Galera Cluster. - -############################################################################## -# Sub package definition -############################################################################## - -%package -n mysql-wsrep-server%{product_suffix} -Summary: MySQL: a very fast and reliable SQL database server -Group: Applications/Databases -# Distro requirements -# RedHat -%if 0%{?fedora} || 0%{?rhel} -Requires: chkconfig coreutils grep procps shadow-utils net-tools rsync lsof -%if 0%{?rhel} == 7 || 0%{?fedora} >= 20 -Requires: perl-Data-Dumper -%endif -%endif -# SUSE -%if 0%{?suse_version} -Requires: aaa_base coreutils grep procps rsync lsof -%if 0%{suse_version} == 1110 -Requires: pwdutils -%endif -%endif - -%if %{defined previous_suffix} -Obsoletes: mysql-wsrep-server%{previous_suffix} -%endif -%if 0%{?commercial} -Obsoletes: MySQL-server -%else -Obsoletes: MySQL-server-advanced -%endif -Obsoletes: mysql-server < %{version}-%{release} -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 mysql-community-common -%endif -Provides: mysql-server = %{version}-%{release} -Provides: mysql-server%{?_isa} = %{version}-%{release} - -%description -n mysql-wsrep-server%{product_suffix} -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 -%{mysql_vendor} - -The MySQL software has Dual Licensing, which means you can use the MySQL -software free of charge under the GNU General Public License -(http://www.gnu.org/licenses/). You can also purchase commercial MySQL -licenses from %{mysql_vendor} if you do not wish to be bound by the terms of -the GPL. See the chapter "Licensing and Support" in the manual for -further info. - -The MySQL web site (http://www.mysql.com/) provides the latest news and -information about the MySQL software. Also please see the documentation -and the manual for more information. - -This package includes the MySQL server binary as well as related utilities -to run and administer a MySQL server. - -Built with wsrep patch %{wsrep_version}, to be a node in a Galera cluster. - -If you want to access and work with the database locally, you have to install -package "mysql-wsrep-client%{product_suffix}" as well! - -# ---------------------------------------------------------------------------- -%package -n mysql-wsrep-client%{product_suffix} -Summary: MySQL - Client -Group: Applications/Databases - -%if %{defined previous_suffix} -Obsoletes: mysql-wsrep-client%{previous_suffix} -%endif -%if 0%{?commercial} -Obsoletes: MySQL-client -%else -Obsoletes: MySQL-client-advanced -%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} -Provides: mysql%{?_isa} = %{version}-%{release} -Provides: mysql-client = %{version} -Provides: MySQL-client = %{version} - -%description -n mysql-wsrep-client%{product_suffix} -This package contains the standard MySQL clients and administration tools. - -For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ - -# ---------------------------------------------------------------------------- -%package -n mysql-wsrep-test%{product_suffix} -Summary: MySQL - Test suite -Group: Applications/Databases - -%if %{defined previous_suffix} -Obsoletes: mysql-wsrep-test%{previous_suffix} -%endif -%if 0%{?commercial} -Requires: MySQL-client-advanced perl -Obsoletes: MySQL-test -%else -Requires: MySQL-client perl -Obsoletes: MySQL-test-advanced -%endif -Obsoletes: mysql-test < %{version}-%{release} -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 mysql-community-bench -Obsoletes: MySQL-bench -Provides: mysql-test = %{version}-%{release} -Provides: mysql-test%{?_isa} = %{version}-%{release} -AutoReqProv: no - -%description -n mysql-wsrep-test%{product_suffix} -This package contains the MySQL regression test suite. - -For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ - -# ---------------------------------------------------------------------------- -%package -n mysql-wsrep-devel%{product_suffix} -Summary: MySQL - Development header files and libraries -Group: Applications/Databases - -%if %{defined previous_suffix} -Obsoletes: mysql-wsrep-devel%{previous_suffix} -%endif -%if 0%{?commercial} -Obsoletes: MySQL-devel -%else -Obsoletes: MySQL-devel-advanced -%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} -Provides: mysql-devel%{?_isa} = %{version}-%{release} - -%description -n mysql-wsrep-devel%{product_suffix} -This package contains the development header files and libraries necessary -to develop MySQL client applications. - -For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ - -# ---------------------------------------------------------------------------- -%package -n mysql-wsrep-shared%{product_suffix} -Summary: MySQL - Shared libraries -Group: Applications/Databases - -%if %{defined previous_suffix} -Obsoletes: mysql-wsrep-shared%{previous_suffix} -%endif -%if 0%{?commercial} -Obsoletes: MySQL-shared -%else -Obsoletes: MySQL-shared-advanced -%endif -Obsoletes: MySQL-shared-standard MySQL-shared-pro -Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl -Obsoletes: MySQL-shared-pro-gpl-cert -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 mysql-community-libs -# Necessary on RHEL 7, no harm on other platforms: -Obsoletes: mariadb-libs - -%description -n mysql-wsrep-shared%{product_suffix} -This package contains the shared libraries (*.so*) which certain languages -and applications need to dynamically load and use MySQL. - -# ---------------------------------------------------------------------------- -%if 0%{?compatlib} -%package -n mysql-wsrep-libs-compat%{product_suffix} -Summary: Shared libraries for MySQL %{compatver} database client applications -Group: Applications/Databases - -%if %{defined previous_suffix} -Obsoletes: mysql-wsrep-libs-compat%{previous_suffix} -%endif -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} - -# Dealing with RHEL 6 and upwards (and compatible ...) -# 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 ...) -# Above general section for RHEL also applies, it deals with "mysql" packages. -# But with RHEL 7, we also get "mariadb" ... -Obsoletes: mariadb-libs -%endif - -%description -n mysql-wsrep-libs-compat%{product_suffix} -The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, -and robust SQL (Structured Query Language) database server. -See the MySQL web site (http://www.mysql.com/) for further information, -including its dual licensing (GNU GPL or commercial licenses). - -This package contains the shared libraries for (old) MySQL %{compatver} client -applications. -It is intended for RHEL %{?rhel} and compatible distributions, -to satisfy the dependencies of several applications shipping with that distro -while the MySQL software on the machine is updated to a newer release series. - -%endif - -# ---------------------------------------------------------------------------- -%package -n MySQL-embedded%{product_suffix} -Summary: MySQL - Embedded library -Group: Applications/Databases -%if 0%{?commercial} -Requires: MySQL-devel-advanced -Obsoletes: MySQL-embedded -%else -Requires: MySQL-devel -Obsoletes: MySQL-embedded-advanced -%endif -Obsoletes: mysql-embedded < %{version}-%{release} -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 -Provides: mysql-embedded = %{version}-%{release} -Provides: mysql-embedded%{?_isa} = %{version}-%{release} - -%description -n MySQL-embedded%{product_suffix} -This package contains the MySQL server as an embedded library. - -The embedded MySQL server library makes it possible to run a full-featured -MySQL server inside the client application. The main benefits are increased -speed and more simple management for embedded applications. - -The API is identical for the embedded MySQL version and the -client/server version. - -For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ - -############################################################################## -%prep -%if 0%{?compatlib} -%setup -q -T -a 0 -a 7 -c -n %{name} -# -q = quiet, -T = no default unpack, -n = source dir name, -c = create, -a = unpack after cd -# https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04.html -# http://rpm.org/max-rpm-snapshot/s1-rpm-inside-macros.html -pushd %{compat_src_dir} -%patch7 -p 1 -%if 0%{?compatlib} == 18 -%patch8 -p 1 -%endif -popd -%else -%setup -q -T -a 0 -c -n %{name} -%endif # 0%{?compatlib} - -# That patch is needed with old cmake only, on SLES 11, but it won't do any harm -# outside Windows, so it may be used in all RPM builds. -pushd %{src_dir} -%patch0 -p1 -#wsrep_apply_patch_tag -popd - -############################################################################## -%build - -# Build compat libs -%if 0%{?compatlib} -( -%if 0%{?compatlib} == 16 -# RHEL 6: MySQL 5.1, using traditional "configure ; make" -export CC="gcc" CXX="g++" -export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv" -export CXXFLAGS="$CFLAGS %{?el6:-felide-constructors} -fno-rtti -fno-exceptions" -pushd %{compat_src_dir} -%configure \ - --with-readline \ - --without-debug \ - --enable-shared \ - --localstatedir=/var/lib/mysql \ - --with-unix-socket-path=/var/lib/mysql/mysql.sock \ - --with-mysqld-user="mysql" \ - --with-extra-charsets=all \ - --enable-local-infile \ - --enable-largefile \ - --enable-thread-safe-client \ - --with-ssl=%{_prefix} \ - --with-embedded-server \ - --with-big-tables \ - --with-pic \ - --with-plugin-innobase \ - --with-plugin-innodb_plugin \ - --with-plugin-partition \ - --disable-dependency-tracking -make %{?_smp_mflags} -popd -%endif -##### -%if 0%{?compatlib} == 18 -# RHEL 7: MySQL 5.5, using "cmake ; make" -mkdir release -cd release -cmake ../%{compat_src_dir} \ - -DBUILD_CONFIG=mysql_release \ - -DINSTALL_LAYOUT=RPM \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DENABLE_DTRACE=OFF \ - -DCMAKE_C_FLAGS="%{optflags}" \ - -DCMAKE_CXX_FLAGS="%{optflags}" \ - -DINSTALL_LIBDIR="%{_lib}/mysql" \ - -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ - -DINSTALL_SQLBENCHDIR=share \ - -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ - -DFEATURE_SET="%{feature_set}" \ - -DWITH_EMBEDDED_SERVER=1 \ - -DWITH_EMBEDDED_SHARED_LIBRARY=1 \ - %{?ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ - -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" -echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG -make %{?_smp_mflags} VERBOSE=1 -cd .. -%endif -) -%endif - -pushd %{src_dir} - -# Fail quickly and obviously if user tries to build as root -%if %runselftest - if [ x"`id -u`" = x0 ]; then - echo "The MySQL regression tests may fail if run as root." - echo "If you really need to build the RPM as root, use" - echo "--define='runselftest 0' to skip the regression tests." - exit 1 - fi -%endif - -# Be strict about variables, bail at earliest opportunity, etc. -set -eu - -# Optional package files -touch optional-files-devel - -# -# Set environment in order of preference, MYSQL_BUILD_* first, then variable -# name, finally a default. RPM_OPT_FLAGS is assumed to be a part of the -# default RPM build environment. -# - -# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break -# the compile in cmd-line-utils/libedit - needs investigation, but for now -# we simply unset it and use those specified directly in cmake. -%if "%{_arch}" == "ia64" -RPM_OPT_FLAGS= -%endif - -export PATH=${MYSQL_BUILD_PATH:-$PATH} -export CC=${MYSQL_BUILD_CC:-${CC:-gcc}} -export CXX=${MYSQL_BUILD_CXX:-${CXX:-g++}} -export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}} -export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors}} -export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}} -export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}} -export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:--j$(ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) && echo $(($ncpu > 4 ? 4 : $ncpu)))} - -# By default, a build will use the system library for SSL. -# However, there may be a need to override. -# Protect against undefined variables if there is no override option. -%if %{undefined with_ssl} -%define ssl_option -DWITH_SSL=system -%else -%define ssl_option -DWITH_SSL=%{with_ssl} -%endif - -# Build debug mysqld and libmysqld.a -mkdir debug -( - cd debug - # Attempt to remove any optimisation flags from the debug build - CFLAGS=`echo " ${CFLAGS} " | \ - sed -e 's/ -O[0-9]* / /' \ - -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ - -e 's/-D_FORTIFY_SOURCE=2/ /' \ - -e 's/ -unroll2 / /' \ - -e 's/ -ip / /' \ - -e 's/^ //' \ - -e 's/ $//'` - CXXFLAGS=`echo " ${CXXFLAGS} " | \ - sed -e 's/ -O[0-9]* / /' \ - -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ - -e 's/-D_FORTIFY_SOURCE=2/ /' \ - -e 's/ -unroll2 / /' \ - -e 's/ -ip / /' \ - -e 's/^ //' \ - -e 's/ $//'` - # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before - # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM - ${CMAKE} ../ -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ - -DCMAKE_BUILD_TYPE=Debug \ - -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ - -DFEATURE_SET="%{feature_set}" \ - %{ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ - -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ - -DWITH_WSREP=1 \ - -DWSREP_VERSION="%{wsrep_version}" \ - -DWSREP_REVISION="%{wsrep_revision}" - echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG - make ${MAKE_JFLAG} VERBOSE=1 -) -# Build full release -mkdir release -( - cd release - # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before - # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM - ${CMAKE} ../ -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ - -DFEATURE_SET="%{feature_set}" \ - %{ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ - -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ - -DWITH_WSREP=1 \ - -DWSREP_VERSION="%{wsrep_version}" \ - -DWSREP_REVISION="%{wsrep_revision}" - echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG - make ${MAKE_JFLAG} VERBOSE=1 -) - -%if %runselftest - MTR_BUILD_THREAD=auto - export MTR_BUILD_THREAD - - (cd release && make test-bt-fast || true) -%endif -popd - -############################################################################## -%install -%if 0%{?compatlib} -( -cd $RPM_BUILD_DIR/%{name} - -# Install compat libs -# This must be done *before* the current libs are installed, for the "rm *.{a,la,so}" -%if 0%{?compatlib} == 16 -for dir in mysql-%{compatver}/libmysql mysql-%{compatver}/libmysql_r ; do -%else -for dir in release/libmysql ; do -%endif - pushd $dir - make DESTDIR=%{buildroot} install - popd -done -rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient{,_r}.{a,la,so} - -# "charsets/" -install -d -m 0755 %{buildroot}/usr/share/mysql/charsets-%{compatver}/ -install -m 644 mysql-%{compatver}/sql/share/charsets/* %{buildroot}/usr/share/mysql/charsets-%{compatver}/ - -# Add libdir to linker -install -d -m 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d -echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf -) -%endif - -RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/%{name}/%{src_dir} -cd $MBD - -# Ensure that needed directories exists -install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} -install -d $RBR%{mysqldatadir}/mysql -install -d $RBR%{_datadir}/mysql-test -install -d $RBR%{_datadir}/mysql/SELinux/RHEL4 -install -d $RBR%{_includedir} -install -d $RBR%{_libdir} -install -d $RBR%{_mandir} -install -d $RBR%{_sbindir} -install -d $RBR/var/lib/mysql-files - -mkdir -p $RBR%{_sysconfdir}/my.cnf.d - -# Install all binaries -( - cd $MBD/release - make DESTDIR=$RBR install -) - -# FIXME: at some point we should stop doing this and just install everything -# FIXME: directly into %%{_libdir}/mysql - perhaps at the same time as renaming -# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax -mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/ - -# Install logrotate and autostart -install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql -install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql - -# Create a symlink "rcmysql", pointing to the init.script. SuSE users -# will appreciate that, as all services usually offer this. -ln -sf %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql - -# Create a wsrep_sst_rsync_wan symlink. -install -d $RBR%{_bindir} -ln -sf wsrep_sst_rsync $RBR%{_bindir}/wsrep_sst_rsync_wan - -# Touch the place where the my.cnf config file might be located -# Just to make sure it's in the file list and marked as a config file -touch $RBR%{_sysconfdir}/my.cnf -touch $RBR%{_sysconfdir}/wsrep.cnf - - -# Install SELinux files in datadir -install -m 600 $MBD/support-files/RHEL4-SElinux/mysql.{fc,te} \ - $RBR%{_datadir}/mysql/SELinux/RHEL4 - -# Get the list of "_datadir" files, remove those that go into "libs-compat" -find $RBR%{_datadir}/mysql -type f -print | sed -e "s=$RBR==" \ - | fgrep -v "charsets-%{compatver}" | sort >> $MBD/release/support-files/plugins.files - -%if %{WITH_TCMALLOC} -# Even though this is a shared library, put it under /usr/lib*/mysql, so it -# doesn't conflict with possible shared lib by the same name in /usr/lib*. See -# `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used. -install -m 644 "%{malloc_lib_source}" \ - "$RBR%{_libdir}/mysql/%{malloc_lib_target}" -%endif - -# Remove man pages we explicitly do not want to package, avoids 'unpackaged -# files' warning. -# This has become obsolete: rm -f $RBR%%{_mandir}/man1/make_win_bin_dist.1* - -%check - -############################################################################## -# Post processing actions, i.e. when installed -############################################################################## - -%pre -n mysql-wsrep-server%{product_suffix} -# This is the code running at the beginning of a RPM upgrade action, -# before replacing the old files with the new ones. - -# ATTENTION: Parts of this are duplicated in the "triggerpostun" ! - -# There are users who deviate from the default file system layout. -# Check local settings to support them. -if [ -x %{_bindir}/my_print_defaults ] -then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` - PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'` -fi -if [ -z "$mysql_datadir" ] -then - mysql_datadir=%{mysqldatadir} -fi -if [ -z "$PID_FILE_PATT" ] -then - PID_FILE_PATT="$mysql_datadir/*.pid" -fi - -# Check if we can safely upgrade. An upgrade is only safe if it's from one -# of our RPMs in the same version family. - -# Handle both ways of spelling the capability. -installed=`rpm -q --whatprovides mysql-server 2> /dev/null` -if [ $? -ne 0 -o -z "$installed" ]; then - installed=`rpm -q --whatprovides MySQL-server 2> /dev/null` -fi -if [ $? -eq 0 -a -n "$installed" ]; then - installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names - vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1` - version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1` - myoldvendor='%{mysql_old_vendor}' - myvendor_2='%{mysql_vendor_2}' - myvendor='%{mysql_vendor}' - myversion='%{mysql_version}' - - old_family=`echo $version \ - | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'` - new_family=`echo $myversion \ - | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'` - - [ -z "$vendor" ] && vendor='' - [ -z "$old_family" ] && old_family="" - [ -z "$new_family" ] && new_family="" - - error_text= - if [ "$vendor" != "$myoldvendor" \ - -a "$vendor" != "$myvendor_2" \ - -a "$vendor" != "$myvendor" ]; then - error_text="$error_text -The current MySQL server package is provided by a different -vendor ($vendor) than $myoldvendor, $myvendor_2, or $myvendor. -Some files may be installed to different locations, including log -files and the service startup script in %{_sysconfdir}/init.d/. -" - fi - - if [ "$old_family" != "$new_family" ]; then - error_text="$error_text -Upgrading directly from MySQL $old_family to MySQL $new_family may not -be safe in all cases. A manual dump and restore using mysqldump is -recommended. It is important to review the MySQL manual's Upgrading -section for version-specific incompatibilities. -" - fi - - if [ -n "$error_text" ]; then - cat <&2 - -****************************************************************** -A MySQL server package ($installed) is installed. -$error_text -A manual upgrade is required. - -- Ensure that you have a complete, working backup of your data and my.cnf - files -- Shut down the MySQL server cleanly -- Remove the existing MySQL packages. Usually this command will - list the packages you should remove: - rpm -qa | grep -i '^mysql-' - - You may choose to use 'rpm --nodeps -ev ' to remove - the package which contains the perconaserverclient shared library. The - library will be reinstalled by the MySQL-shared-compat package. -- Install the new MySQL packages supplied by $myvendor -- Ensure that the MySQL server is started -- Run the 'mysql_upgrade' program - -This is a brief description of the upgrade process. Important details -can be found in the MySQL manual, in the Upgrading section. -****************************************************************** -HERE - exit 1 - fi -fi - -# We assume that if there is exactly one ".pid" file, -# it contains the valid PID of a running MySQL server. -NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l` -case $NR_PID_FILES in - 0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server - 1 ) SERVER_TO_START='true' ;; - * ) SERVER_TO_START='' # Situation not clear - SEVERAL_PID_FILES=true ;; -esac -# That logic may be debated: We might check whether it is non-empty, -# contains exactly one number (possibly a PID), and whether "ps" finds it. -# OTOH, if there is no such process, it means a crash without a cleanup - -# is that a reason not to start a new server after upgrade? - -STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER - -if [ -f "$STATUS_FILE" ]; then - echo "Some previous upgrade was not finished:" - ls -ld $STATUS_FILE - echo "Please check its status, then do" - echo " rm $STATUS_FILE" - echo "before repeating the MySQL upgrade." - exit 1 -elif [ -n "$SEVERAL_PID_FILES" ] ; then - echo "You have more than one PID file:" - ls -ld $PID_FILE_PATT - echo "Please check which one (if any) corresponds to a running server" - echo "and delete all others before repeating the MySQL upgrade." - exit 1 -fi - -NEW_VERSION=%{mysql_version}-%{release} - -# The "pre" section code is also run on a first installation, -# when there is no data directory yet. Protect against error messages. -# Check for the existence of subdirectory "mysql/", the database of system -# tables like "mysql.user". -if [ -d $mysql_datadir/mysql ] ; then - echo "MySQL RPM upgrade to version $NEW_VERSION" > $STATUS_FILE - echo "'pre' step running at `date`" >> $STATUS_FILE - echo >> $STATUS_FILE - fcount=`ls -ltr $mysql_datadir/*.err 2>/dev/null | wc -l` - if [ $fcount -gt 0 ] ; then - echo "ERR file(s):" >> $STATUS_FILE - ls -ltr $mysql_datadir/*.err >> $STATUS_FILE - echo >> $STATUS_FILE - echo "Latest 'Version' line in latest file:" >> $STATUS_FILE - grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \ - tail -1 >> $STATUS_FILE - echo >> $STATUS_FILE - fi - - if [ -n "$SERVER_TO_START" ] ; then - # There is only one PID file, race possibility ignored - echo "PID file:" >> $STATUS_FILE - ls -l $PID_FILE_PATT >> $STATUS_FILE - cat $PID_FILE_PATT >> $STATUS_FILE - echo >> $STATUS_FILE - echo "Server process:" >> $STATUS_FILE - ps -fp `cat $PID_FILE_PATT` >> $STATUS_FILE - echo >> $STATUS_FILE - echo "SERVER_TO_START=$SERVER_TO_START" >> $STATUS_FILE - else - # Take a note we checked it ... - echo "PID file:" >> $STATUS_FILE - ls -l $PID_FILE_PATT >> $STATUS_FILE 2>&1 - fi -fi - -# Shut down a previously installed server first -# Note we *could* make that depend on $SERVER_TO_START, but we rather don't, -# so a "stop" is attempted even if there is no PID file. -# (Maybe the "stop" doesn't work then, but we might fix that in itself.) -if [ -x %{_sysconfdir}/init.d/mysql ] ; then - %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1 - echo "Giving mysqld 5 seconds to exit nicely" - sleep 5 -fi - -%post -n mysql-wsrep-server%{product_suffix} -# This is the code running at the end of a RPM install or upgrade action, -# after the (new) files have been written. - -# ATTENTION: Parts of this are duplicated in the "triggerpostun" ! - -# There are users who deviate from the default file system layout. -# Check local settings to support them. -if [ -x %{_bindir}/my_print_defaults ] -then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` -fi -if [ -z "$mysql_datadir" ] -then - mysql_datadir=%{mysqldatadir} -fi - -NEW_VERSION=%{mysql_version}-%{release} -STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER - -# ---------------------------------------------------------------------- -# Create data directory if needed, check whether upgrade or install -# ---------------------------------------------------------------------- -if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi -if [ -f "$STATUS_FILE" ] ; then - SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` -else - SERVER_TO_START='' -fi -# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START" -if [ ! -d $mysql_datadir/mysql ] ; then - mkdir $mysql_datadir/mysql $mysql_datadir/test - echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE -else - # If the directory exists, we may assume it is an upgrade. - echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE -fi - -# ---------------------------------------------------------------------- -# Make MySQL start/shutdown automatically when the machine does it. -# ---------------------------------------------------------------------- -# NOTE: This still needs to be debated. Should we check whether these links -# for the other run levels exist(ed) before the upgrade? -# use chkconfig on Enterprise Linux and newer SuSE releases -if [ -x /sbin/chkconfig ] ; then - /sbin/chkconfig --add mysql -# use insserv for older SuSE Linux versions -elif [ -x /sbin/insserv ] ; then - /sbin/insserv %{_sysconfdir}/init.d/mysql -fi - -# ---------------------------------------------------------------------- -# Create a MySQL user and group. Do not report any problems if it already -# exists. -# ---------------------------------------------------------------------- -groupadd -r %{mysqld_group} 2> /dev/null || true -useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" \ - -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true -# The user may already exist, make sure it has the proper group nevertheless -# (BUG#12823) -usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true - -# ---------------------------------------------------------------------- -# Change permissions so that the user that will run the MySQL daemon -# owns all database files. -# ---------------------------------------------------------------------- -chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir - -# ---------------------------------------------------------------------- -# Initiate databases if needed -# ---------------------------------------------------------------------- -if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then - # Fix bug#45415: no "mysql_install_db" on an upgrade - # Do this as a negative to err towards more "install" runs - # rather than to miss one. - %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} --random-passwords - - # Attention: Now 'root' is the only database user, - # its password is a random value found in ~/.mysql_secret, - # and the "password expired" flag is set: - # Any client needs that password, and the first command - # executed must be a new "set password"! -fi - -# ---------------------------------------------------------------------- -# Upgrade databases if needed would go here - but it cannot be automated yet -# ---------------------------------------------------------------------- - -# ---------------------------------------------------------------------- -# Change permissions again to fix any new files. -# ---------------------------------------------------------------------- -chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir - -# ---------------------------------------------------------------------- -# Fix permissions for the permission database so that only the user -# can read them. -# ---------------------------------------------------------------------- -chmod -R og-rw $mysql_datadir/mysql - -# ---------------------------------------------------------------------- -# install SELinux files - but don't override existing ones -# ---------------------------------------------------------------------- -SETARGETDIR=/etc/selinux/targeted/src/policy -SEDOMPROG=$SETARGETDIR/domains/program -SECONPROG=$SETARGETDIR/file_contexts/program -if [ -f /etc/redhat-release ] \ - && (grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \ - || grep -q "CentOS release 4" /etc/redhat-release) ; then - echo - echo - echo 'Notes regarding SELinux on this platform:' - echo '=========================================' - echo - echo 'The default policy might cause server startup to fail because it is' - echo 'not allowed to access critical files. In this case, please update' - echo 'your installation.' - echo - echo 'The default policy might also cause inavailability of SSL related' - echo 'features because the server is not allowed to access /dev/random' - echo 'and /dev/urandom. If this is a problem, please do the following:' - echo - echo ' 1) install selinux-policy-targeted-sources from your OS vendor' - echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':' - echo ' allow mysqld_t random_device_t:chr_file read;' - echo ' allow mysqld_t urandom_device_t:chr_file read;' - echo ' 3) cd to '$SETARGETDIR' and issue the following command:' - echo ' make load' - echo - echo -fi - -if [ -x sbin/restorecon ] ; then - sbin/restorecon -R var/lib/mysql -fi - -# Was the server running before the upgrade? If so, restart the new one. -if [ "$SERVER_TO_START" = "true" ] ; then - # Restart in the same way that mysqld will be started normally. - if [ -x %{_sysconfdir}/init.d/mysql ] ; then - %{_sysconfdir}/init.d/mysql start - echo "Giving mysqld 5 seconds to start" - sleep 5 - fi -fi - -# Collect an upgrade history ... -echo "Upgrade/install finished at `date`" >> $STATUS_FILE -echo >> $STATUS_FILE -echo "=====" >> $STATUS_FILE -STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY -cat $STATUS_FILE >> $STATUS_HISTORY -mv -f $STATUS_FILE ${STATUS_FILE}-LAST # for "triggerpostun" - - -#echo "Thank you for installing the MySQL Community Server! For Production -#systems, we recommend MySQL Enterprise, which contains enterprise-ready -#software, intelligent advisory services, and full production support with -#scheduled service packs and more. Visit www.mysql.com/enterprise for more -#information." - -%preun -n mysql-wsrep-server%{product_suffix} - -# Which '$1' does this refer to? Fedora docs have info: -# " ... a count of the number of versions of the package that are installed. -# Action Count -# Install the first time 1 -# Upgrade 2 or higher (depending on the number of versions installed) -# Remove last version of package 0 " -# -# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html - -if [ $1 = 0 ] ; then - # Stop MySQL before uninstalling it - if [ -x %{_sysconfdir}/init.d/mysql ] ; then - %{_sysconfdir}/init.d/mysql stop > /dev/null - # Remove autostart of MySQL - # use chkconfig on Enterprise Linux and newer SuSE releases - if [ -x /sbin/chkconfig ] ; then - /sbin/chkconfig --del mysql - # For older SuSE Linux versions - elif [ -x /sbin/insserv ] ; then - /sbin/insserv -r %{_sysconfdir}/init.d/mysql - fi - fi -fi - -# We do not remove the mysql user since it may still own a lot of -# database files. - -%triggerpostun -n mysql-wsrep-server%{product_suffix} --MySQL-server-community - -# Setup: We renamed this package, so any existing "server-community" -# package will be removed when this "server" is installed. -# Problem: RPM will first run the "pre" and "post" sections of this script, -# and only then the "preun" of that old community server. -# But this "preun" includes stopping the server and uninstalling the service, -# "chkconfig --del mysql" which removes the symlinks to the start script. -# Solution: *After* the community server got removed, restart this server -# and re-install the service. -# -# For information about triggers in spec files, see the Fedora docs: -# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html -# For all details of this code, see the "pre" and "post" sections. - -# There are users who deviate from the default file system layout. -# Check local settings to support them. -if [ -x %{_bindir}/my_print_defaults ] -then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` -fi -if [ -z "$mysql_datadir" ] -then - mysql_datadir=%{mysqldatadir} -fi - -NEW_VERSION=%{mysql_version}-%{release} -STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference! -STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY - -if [ -f "$STATUS_FILE" ] ; then - SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` -else - # This should never happen, but let's be prepared - SERVER_TO_START='' -fi -echo "Analyzed: SERVER_TO_START=$SERVER_TO_START" - -if [ -x /sbin/chkconfig ] ; then - /sbin/chkconfig --add mysql -# use insserv for older SuSE Linux versions -elif [ -x /sbin/insserv ] ; then - /sbin/insserv %{_sysconfdir}/init.d/mysql -fi - -# Was the server running before the upgrade? If so, restart the new one. -if [ "$SERVER_TO_START" = "true" ] ; then - # Restart in the same way that mysqld will be started normally. - if [ -x %{_sysconfdir}/init.d/mysql ] ; then - %{_sysconfdir}/init.d/mysql start - echo "Giving mysqld 5 seconds to start" - sleep 5 - fi -fi - -echo "Trigger 'postun --community' finished at `date`" >> $STATUS_HISTORY -echo >> $STATUS_HISTORY -echo "=====" >> $STATUS_HISTORY - - -# ---------------------------------------------------------------------- -# Clean up the BuildRoot after build is done -# ---------------------------------------------------------------------- -%clean -[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \ - && rm -rf $RPM_BUILD_ROOT; - -############################################################################## -# Files section -############################################################################## - -%files -n mysql-wsrep%{product_suffix} -# Intentionally empty - this is a pure meta package. - -# ---------------------------------------------------------------------------- -%files -n mysql-wsrep-server%{product_suffix} -f %{src_dir}/release/support-files/plugins.files -%defattr(-,root,root,0755) -%if %{defined license_files_server} -%doc %{license_files_server} -%endif -%doc %{src_dir}/Docs/ChangeLog -%doc %{src_dir}/release/Docs/INFO_SRC* -%doc %{src_dir}/release/Docs/INFO_BIN* -%doc %{src_dir}/release/support-files/my-default.cnf -%doc %{src_dir}/Docs/README-wsrep -%doc %{src_dir}/release/support-files/wsrep.cnf -%doc %{src_dir}/release/support-files/wsrep_notify - -%if 0%{?commercial} -%doc %attr(644, root, root) %{_infodir}/mysql.info* -%endif - -%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1* -%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1* -%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1* -%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1* -%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1* -%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_convert_table_format.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_extensions.1* -%doc %attr(644, root, man) %{_mandir}/man8/mysqld.8* -%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1* -%doc %attr(644, root, man) %{_mandir}/man1/perror.1* -%doc %attr(644, root, man) %{_mandir}/man1/replace.1* -%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1* -%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1* - -%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf -%ghost %config(noreplace,missingok) %{_sysconfdir}/wsrep.cnf -%dir %{_sysconfdir}/my.cnf.d - -%attr(755, root, root) %{_bindir}/innochecksum -%attr(755, root, root) %{_bindir}/my_print_defaults -%attr(755, root, root) %{_bindir}/myisam_ftdump -%attr(755, root, root) %{_bindir}/myisamchk -%attr(755, root, root) %{_bindir}/myisamlog -%attr(755, root, root) %{_bindir}/myisampack -%attr(755, root, root) %{_bindir}/mysql_convert_table_format -%attr(755, root, root) %{_bindir}/mysql_fix_extensions -%attr(755, root, root) %{_bindir}/mysql_install_db -%attr(755, root, root) %{_bindir}/mysql_plugin -%attr(755, root, root) %{_bindir}/mysql_secure_installation -%attr(755, root, root) %{_bindir}/mysql_setpermission -%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql -%attr(755, root, root) %{_bindir}/mysql_upgrade -%attr(755, root, root) %{_bindir}/mysql_zap -%attr(755, root, root) %{_bindir}/mysqlbug -%attr(755, root, root) %{_bindir}/mysqld_multi -%attr(755, root, root) %{_bindir}/mysqld_safe -%attr(755, root, root) %{_bindir}/mysqldumpslow -%attr(755, root, root) %{_bindir}/mysqlhotcopy -%attr(755, root, root) %{_bindir}/mysqltest -%attr(755, root, root) %{_bindir}/perror -%attr(755, root, root) %{_bindir}/replace -%attr(755, root, root) %{_bindir}/resolve_stack_dump -%attr(755, root, root) %{_bindir}/resolveip -%attr(755, root, root) %{_bindir}/wsrep_sst_common -%attr(755, root, root) %{_bindir}/wsrep_sst_mysqldump -%attr(755, root, root) %{_bindir}/wsrep_sst_rsync -%attr(755, root, root) %{_bindir}/wsrep_sst_rsync_wan -%attr(755, root, root) %{_bindir}/wsrep_sst_xtrabackup -%attr(755, root, root) %{_bindir}/wsrep_sst_xtrabackup-v2 - -%attr(755, root, root) %{_sbindir}/mysqld -%attr(755, root, root) %{_sbindir}/mysqld-debug -%attr(755, root, root) %{_sbindir}/rcmysql -%dir %{_libdir}/mysql/plugin -%dir %{_libdir}/mysql/plugin/debug -%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini - -%if %{WITH_TCMALLOC} -%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target} -%endif - -%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql -%attr(755, root, root) %{_sysconfdir}/init.d/mysql -# %%attr(755, root, root) %%{_datadir}/mysql/ ## Contained in "plugins.files", see "%%install" code -%dir %attr(755, mysql, mysql) /var/lib/mysql -%dir %attr(750, mysql, mysql) /var/lib/mysql-files - -# ---------------------------------------------------------------------------- -%files -n mysql-wsrep-client%{product_suffix} - -%defattr(-, root, root, 0755) -%if %{defined license_files_server} -%doc %{license_files_server} -%endif -%attr(755, root, root) %{_bindir}/msql2mysql -%attr(755, root, root) %{_bindir}/mysql -%attr(755, root, root) %{_bindir}/mysql_find_rows -%attr(755, root, root) %{_bindir}/mysql_waitpid -%attr(755, root, root) %{_bindir}/mysqlaccess -# XXX: This should be moved to %%{_sysconfdir} -%attr(644, root, root) %{_bindir}/mysqlaccess.conf -%attr(755, root, root) %{_bindir}/mysqladmin -%attr(755, root, root) %{_bindir}/mysqlbinlog -%attr(755, root, root) %{_bindir}/mysqlcheck -%attr(755, root, root) %{_bindir}/mysqldump -%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_editor - -%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_waitpid.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlcheck.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_config_editor.1* - -# ---------------------------------------------------------------------------- -%files -n mysql-wsrep-devel%{product_suffix} -f %{src_dir}/optional-files-devel -%defattr(-, root, root, 0755) -%if %{defined license_files_server} -%doc %{license_files_server} -%endif -%doc %attr(644, root, man) %{_mandir}/man1/comp_err.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1* -%attr(755, root, root) %{_bindir}/mysql_config -%dir %attr(755, root, root) %{_includedir}/mysql -%dir %attr(755, root, root) %{_libdir}/mysql -%{_includedir}/mysql/* -%{_datadir}/aclocal/mysql.m4 -%{_libdir}/mysql/libperconaserverclient.a -%{_libdir}/mysql/libperconaserverclient_r.a -%{_libdir}/mysql/libmysqlservices.a - -# ---------------------------------------------------------------------------- -%files -n mysql-wsrep-shared%{product_suffix} -%defattr(-, root, root, 0755) -%if %{defined license_files_server} -%doc %{license_files_server} -%endif -# Shared libraries (omit for architectures that don't support them) -%{_libdir}/libmysql*.so -%{_libdir}/libmysql*.so.%{currentlib}* - -%post -n mysql-wsrep-shared%{product_suffix} -/sbin/ldconfig - -%postun -n mysql-wsrep-shared%{product_suffix} -/sbin/ldconfig - -# ---------------------------------------------------------------------------- -%if 0%{?compatlib} -%files -n mysql-wsrep-libs-compat%{product_suffix} -%defattr(-, root, root, -) -%doc %{?compat_license_files_server} -%dir %attr(755, root, root) %{_libdir}/mysql -%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf -%{_libdir}/mysql/libmysqlclient.so.%{compatlib} -%{_libdir}/mysql/libmysqlclient.so.%{compatlib}.0.0 -%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib} -%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib}.0.0 -%dir %attr(755, root, root) %{_datadir}/mysql/ -%dir %attr(755, root, root) %{_datadir}/mysql/charsets-%{compatver}/ -%attr(644, root, root) %{_datadir}/mysql/charsets-%{compatver}/* - -%post -n mysql-wsrep-libs-compat%{product_suffix} -/sbin/ldconfig - -%postun -n mysql-wsrep-libs-compat%{product_suffix} -/sbin/ldconfig -%endif - -# ---------------------------------------------------------------------------- -%files -n mysql-wsrep-test%{product_suffix} -%defattr(-, root, root, 0755) -%if %{defined license_files_server} -%doc %{license_files_server} -%endif -%attr(-, root, root) %{_datadir}/mysql-test -%attr(755, root, root) %{_bindir}/mysql_client_test -%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql-stress-test.pl.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test_embedded.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1* - -############################################################################## -# The spec file changelog only includes changes made to the spec file -# itself - note that they must be ordered by date (important when -# merging BK trees) -############################################################################## -%changelog -* Fri Jun 10 2016 Joerg Bruehe -- 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 -- 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. - This solves issue Github-223. -- Introduce a macro "previous_suffix" and set it to "-5.5", so that installing a - "mysql-wsrep-*-5.6" package will "obsolete" the corresponding "mysql-wsrep-*-5.5" - package. This solves issue Github-224. -- Fix dependency: There is no "libopenssl1-devel", just "libopenssl-devel". - -* Tue Oct 27 2015 Joerg Bruehe -- Add the spec file changes coded in mysql-wsrep 5.5 to create "libs-compat", - visible and documented (Sep 11 - 17) in the 5.5 spec file. - -* Thu Jan 29 2015 Joerg Bruehe -- Add a meta-package "mysql-wsrep" that requires both "server" and "client". -- Fix the fall-back definition of "dist", it must start with a period. - -* Mon Jan 26 2015 Joerg Bruehe -- Allow "rpmlint", but suppress "post-build-checks" (fail on SuSE 12 + 13). -- Improve handling of undefined "%%{dist}". -- Fix wrong changelog dates, to get rid of warnings about "bogus date". -- Escape percent signs in changelog, to get rid of "rpmlint" warnings. - -* Tue Jan 20 2015 Teemu Ollakka - -- Reworked to build wsrep patched packages exclusively -- OBS compatible - -* Mon Oct 06 2014 Balasubramanian Kandasamy -- Add license info in each subpackage - -* Wed May 28 2014 Balasubramanian Kandasamy -- Updated usergroup to mysql on datadir - -* Wed Oct 30 2013 Balasubramanian Kandasamy -- Removed non gpl file docs/mysql.info from community packages - -* Mon Sep 09 2013 Balasubramanian Kandasamy -- Updated logic to get the correct count of PID files - -* Fri Aug 16 2013 Balasubramanian Kandasamy -- Added provides lowercase mysql tags - -* Wed Jun 26 2013 Balasubramanian Kandasamy -- Cleaned up spec file to resolve rpm dependencies. - -* Mon Nov 05 2012 Joerg Bruehe - -- Allow to override the default to use the bundled yaSSL by an option like - --define="with_ssl /path/to/ssl" - -* Wed Oct 10 2012 Bjorn Munch - -- Replace old my-*.cnf config file examples with template my-default.cnf - -* Fri Oct 05 2012 Joerg Bruehe - -- Let the installation use the new option "--random-passwords" of "mysql_install_db". - (Bug# 12794345 Ensure root password) -- Fix an inconsistency: "new install" vs "upgrade" are told from the (non)existence - of "$mysql_datadir/mysql" (holding table "mysql.user" and other system stuff). - -* Tue Jul 24 2012 Joerg Bruehe - -- Add a macro "runselftest": - if set to 1 (default), the test suite will be run during the RPM build; - this can be oveeridden via the command line by adding - --define "runselftest 0" - Failures of the test suite will NOT make the RPM build fail! - -* Mon Jul 16 2012 Joerg Bruehe - -- Add the man page for the "mysql_config_editor". - -* Mon Jun 11 2012 Joerg Bruehe - -- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging. - -* Wed Feb 29 2012 Brajmohan Saxena - -- Removal all traces of the readline library from mysql (BUG 13738013) - -* Wed Sep 28 2011 Joerg Bruehe - -- Fix duplicate mentioning of "mysql_plugin" and its manual page, - it is better to keep alphabetic order in the files list (merging!). - -* Wed Sep 14 2011 Joerg Bruehe - -- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace - the RPMs of any configuration (of the current or the preceding release series) - by the new ones. This is done by not using the implicitly generated capabilities - (which include the configuration name) and relying on more generic ones which - just list the function ("server", "client", ...). - The implicit generation cannot be prevented, so all these capabilities must be - explicitly listed in "Obsoletes:" - -* Tue Sep 13 2011 Jonathan Perkin - -- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6. Due to - changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install) - this necessitated a move of the libmygcc.a installation to the install - phase, which is probably where it belonged in the first place. - -* Tue Sep 13 2011 Joerg Bruehe - -- "make_win_bin_dist" and its manual are dropped, cmake does it different. - -* Thu Sep 08 2011 Daniel Fischer - -- Add mysql_plugin man page. - -* Tue Aug 30 2011 Tor Didriksen - -- Set CXX=g++ by default to add a dependency on libgcc/libstdc++. - Also, remove the use of the -fno-exceptions and -fno-rtti flags. - TODO: update distro_buildreq/distro_requires - -* Tue Aug 30 2011 Joerg Bruehe - -- Add the manual page for "mysql_plugin" to the server package. - -* Fri Aug 19 2011 Joerg Bruehe - -- Null-upmerge the fix of bug#37165: This spec file is not affected. -- Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}". - -* Fri Aug 12 2011 Daniel Fischer - -- Source plugin library files list from cmake-generated file. - -* Mon Jul 25 2011 Chuck Bell - -- Added the mysql_plugin client - enables or disables plugins. - -* Thu Jul 21 2011 Sunanda Menon - -- Fix bug#12561297: Added the MySQL embedded binary - -* Thu Jul 07 2011 Joerg Bruehe - -- Fix bug#45415: "rpm upgrade recreates test database" - Let the creation of the "test" database happen only during a new installation, - not in an RPM upgrade. - This affects both the "mkdir" and the call of "mysql_install_db". - -* Wed Feb 09 2011 Joerg Bruehe - -- 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) - should still work, and use these locations. - The problem was that the fix for bug#27072 did not check for local settings. - -* Mon Jan 31 2011 Joerg Bruehe - -- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN". - -* Tue Nov 23 2010 Jonathan Perkin - -- EXCEPTIONS-CLIENT has been deleted, remove it from here too -- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing - a '-j' argument to make. - -* Mon Nov 1 2010 Georgi Kodinov - -- Added test authentication (WL#1054) plugin binaries - -* Wed Oct 6 2010 Georgi Kodinov - -- Added example external authentication (WL#1054) plugin binaries - -* Wed Aug 11 2010 Joerg Bruehe - -- With a recent spec file cleanup, names have changed: A "-community" part was dropped. - Reflect that in the "Obsoletes" specifications. -- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM. -- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade". - -* Tue Jun 15 2010 Joerg Bruehe - -- Change the behaviour on installation and upgrade: - On installation, do not autostart the server. - *Iff* the server was stopped before the upgrade is started, this is taken as a - sign the administrator is handling that manually, and so the new server will - not be started automatically at the end of the upgrade. - The start/stop scripts will still be installed, so the server will be started - on the next machine boot. - This is the 5.5 version of fixing bug#27072 (RPM autostarting the server). - -* Tue Jun 1 2010 Jonathan Perkin - -- Implement SELinux checks from distribution-specific spec file. - -* Wed May 12 2010 Jonathan Perkin - -- Large number of changes to build using CMake -- Introduce distribution-specific RPMs -- Drop debuginfo, build all binaries with debug/symbols -- Remove __os_install_post, use native macro -- Remove _unpackaged_files_terminate_build, make it an error to have - unpackaged files -- Remove cluster RPMs - -* Wed Mar 24 2010 Joerg Bruehe - -- Add "--with-perfschema" to the configure options. - -* Mon Mar 22 2010 Joerg Bruehe - -- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64", - mask "rmdir" return code 1. -- Remove "ha_example.*" files from the list, they aren't built. - -* Wed Mar 17 2010 Joerg Bruehe - -- Fix a wrong path name in handling the debug plugins. - -* Wed Mar 10 2010 Joerg Bruehe - -- Take the result of the debug plugin build and put it into the optimized tree, - so that it becomes part of the final installation; - include the files in the packlist. Part of the fixes for bug#49022. - -* Mon Mar 01 2010 Joerg Bruehe - -- Set "Oracle and/or its affiliates" as the vendor and copyright owner, - accept upgrading from packages showing MySQL or Sun as vendor. - -* Fri Feb 12 2010 Joerg Bruehe - -- Formatting changes: - Have a consistent structure of separator lines and of indentation - (8 leading blanks => tab). -- Introduce the variable "src_dir". -- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence - over "CC" ("CXX"). -- Drop the old "with_static" argument analysis, this is not supported - in 5.1 since ages. -- Introduce variables to control the handlers individually, as well - as other options. -- Use the new "--with-plugin" notation for the table handlers. -- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql" - was done back in 2002 already. -- Make "--with-zlib-dir=bundled" the default, add an option to disable it. -- Add missing manual pages to the file list. -- Improve the runtime check for "libgcc.a", protect it against being tried - with the Intel compiler "icc". - -* Mon Jan 11 2010 Joerg Bruehe - -- Change RPM file naming: - - Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc". - - Release counts from 1, not 0. - -* Wed Dec 23 2009 Joerg Bruehe - -- The "semisync" plugin file name has lost its introductory "lib", - adapt the file lists for the subpackages. - This is a part missing from the fix for bug#48351. -- Remove the "fix_privilege_tables" manual, it does not exist in 5.5 - (and likely, the whole script will go, too). - -* Mon Nov 16 2009 Joerg Bruehe - -- Fix some problems with the directives around "tcmalloc" (experimental), - remove erroneous traces of the InnoDB plugin (that is 5.1 only). - -* Tue Oct 06 2009 Magnus Blaudd - -- Removed mysql_fix_privilege_tables - -* Fri Oct 02 2009 Alexander Nozdrin - -- "mysqlmanager" got removed from version 5.4, all references deleted. - -* Fri Aug 28 2009 Joerg Bruehe - -- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin. - -* Thu Aug 27 2009 Joerg Bruehe - -- This version does not contain the "Instance manager", "mysqlmanager": - Remove it from the spec file so that packaging succeeds. - -* Mon Aug 24 2009 Jonathan Perkin - -- Add conditionals for bundled zlib and innodb plugin - -* Fri Aug 21 2009 Jonathan Perkin - -- Install plugin libraries in appropriate packages. -- Disable libdaemon_example and ftexample plugins. - -* Thu Aug 20 2009 Jonathan Perkin - -- Update variable used for mysql-test suite location to match source. - -* Fri Nov 07 2008 Joerg Bruehe - -- Correct yesterday's fix, so that it also works for the last flag, - and fix a wrong quoting: un-quoted quote marks must not be escaped. - -* Thu Nov 06 2008 Kent Boortz - -- Removed "mysql_upgrade_shell" -- Removed some copy/paste between debug and normal build - -* Thu Nov 06 2008 Joerg Bruehe - -- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized. - This should cover both gcc and icc flags. Fixes bug#40546. - -* Fri Aug 29 2008 Kent Boortz - -- Removed the "Federated" storage engine option, and enabled in all - -* Tue Aug 26 2008 Joerg Bruehe - -- Get rid of the "warning: Installed (but unpackaged) file(s) found:" - Some generated files aren't needed in RPMs: - - the "sql-bench/" subdirectory - Some files were missing: - - /usr/share/aclocal/mysql.m4 ("devel" subpackage) - - Manual "mysqlbug" ("server" subpackage) - - Program "innochecksum" and its manual ("server" subpackage) - - Manual "mysql_find_rows" ("client" subpackage) - - Script "mysql_upgrade_shell" ("client" subpackage) - - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage) - - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage) - -* Mon Mar 31 2008 Kent Boortz - -- Made the "Federated" storage engine an option -- Made the "Cluster" storage engine and sub packages an option - -* Wed Mar 19 2008 Joerg Bruehe - -- Add the man pages for "ndbd" and "ndb_mgmd". - -* Mon Feb 18 2008 Timothy Smith - -- Require a manual upgrade if the alread-installed mysql-server is - from another vendor, or is of a different major version. - -* Wed May 02 2007 Joerg Bruehe - -- "ndb_size.tmpl" is not needed any more, - "man1/mysql_install_db.1" lacked the trailing '*'. - -* Sat Apr 07 2007 Kent Boortz - -- Removed man page for "mysql_create_system_tables" - -* Wed Mar 21 2007 Daniel Fischer - -- Add debug server. - -* Mon Mar 19 2007 Daniel Fischer - -- Remove Max RPMs; the server RPMs contain a mysqld compiled with all - features that previously only were built into Max. - -* Fri Mar 02 2007 Joerg Bruehe - -- Add several man pages for NDB which are now created. - -* Fri Jan 05 2007 Kent Boortz - -- Put back "libmygcc.a", found no real reason it was removed. - -- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the - correct "libgcc.a" path is returned for the 32/64 bit architecture. - -* Mon Dec 18 2006 Joerg Bruehe - -- Fix the move of "mysqlmanager" to section 8: Directory name was wrong. - -* Thu Dec 14 2006 Joerg Bruehe - -- Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql" - in the server RPM. -- The "mysqlmanager" man page got moved from section 1 to 8. - -* Thu Nov 30 2006 Joerg Bruehe - -- Call "make install" using "benchdir_root=%%{_datadir}", - because that is affecting the regression test suite as well. - -* Thu Nov 16 2006 Joerg Bruehe - -- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) - replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading - (bug#22081). - -* Mon Nov 13 2006 Joerg Bruehe - -- Add "--with-partition" to all server builds. - -- Use "--report-features" in one test run per server build. - -* Tue Aug 15 2006 Joerg Bruehe - -- The "max" server is removed from packages, effective from 5.1.12-beta. - Delete all steps to build, package, or install it. - -* Mon Jul 10 2006 Joerg Bruehe - -- Fix a typing error in the "make" target for the Perl script to run the tests. - -* Tue Jul 04 2006 Joerg Bruehe - -- Use the Perl script to run the tests, because it will automatically check - whether the server is configured with SSL. - -* Tue Jun 27 2006 Joerg Bruehe - -- move "mysqldumpslow" from the client RPM to the server RPM (bug#20216) - -- Revert all previous attempts to call "mysql_upgrade" during RPM upgrade, - there are some more aspects which need to be solved before this is possible. - For now, just ensure the binary "mysql_upgrade" is delivered and installed. - -* Thu Jun 22 2006 Joerg Bruehe - -- Close a gap of the previous version by explicitly using - a newly created temporary directory for the socket to be used - in the "mysql_upgrade" operation, overriding any local setting. - -* Tue Jun 20 2006 Joerg Bruehe - -- To run "mysql_upgrade", we need a running server; - start it in isolation and skip password checks. - -* Sat May 20 2006 Kent Boortz - -- Always compile for PIC, position independent code. - -* Wed May 10 2006 Kent Boortz - -- Use character set "all" when compiling with Cluster, to make Cluster - nodes independent on the character set directory, and the problem - that two RPM sub packages both wants to install this directory. - -* Mon May 01 2006 Kent Boortz - -- Use "./libtool --mode=execute" instead of searching for the - executable in current directory and ".libs". - -* Fri Apr 28 2006 Kent Boortz - -- Install and run "mysql_upgrade" - -* Wed Apr 12 2006 Jim Winstead - -- Remove sql-bench, and MySQL-bench RPM (will be built as an independent - project from the mysql-bench repository) - -* Tue Apr 11 2006 Jim Winstead - -- Remove old mysqltestmanager and related programs -* Sat Apr 01 2006 Kent Boortz - -- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS - -* Tue Mar 07 2006 Kent Boortz - -- Changed product name from "Community Edition" to "Community Server" - -* Mon Mar 06 2006 Kent Boortz - -- Fast mutexes is now disabled by default, but should be - used in Linux builds. - -* Mon Feb 20 2006 Kent Boortz - -- Reintroduced a max build -- Limited testing of 'debug' and 'max' servers -- Berkeley DB only in 'max' - -* Mon Feb 13 2006 Joerg Bruehe - -- Use "-i" on "make test-force"; - this is essential for later evaluation of this log file. - -* Thu Feb 09 2006 Kent Boortz - -- Pass '-static' to libtool, link static with our own libraries, dynamic - with system libraries. Link with the bundled zlib. - -* Wed Feb 08 2006 Kristian Nielsen - -- Modified RPM spec to match new 5.1 debug+max combined community packaging. - -* Sun Dec 18 2005 Kent Boortz - -- Added "client/mysqlslap" - -* Mon Dec 12 2005 Rodrigo Novo - -- Added zlib to the list of (static) libraries installed -- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld) -- Compile MySQL with bundled zlib -- Fixed %%packager name to "MySQL Production Engineering Team" - -* Mon Dec 05 2005 Joerg Bruehe - -- Avoid using the "bundled" zlib on "shared" builds: - As it is not installed (on the build system), this gives dependency - problems with "libtool" causing the build to fail. - (Change was done on Nov 11, but left uncommented.) - -* Tue Nov 22 2005 Joerg Bruehe - -- Extend the file existence check for "init.d/mysql" on un-install - to also guard the call to "insserv"/"chkconfig". - -* Thu Oct 27 2005 Lenz Grimmer - -- added more man pages - -* Wed Oct 19 2005 Kent Boortz - -- Made yaSSL support an option (off by default) - -* Wed Oct 19 2005 Kent Boortz - -- Enabled yaSSL support - -* Sat Oct 15 2005 Kent Boortz - -- Give mode arguments the same way in all places -- Moved copy of mysqld.a to "standard" build, but - disabled it as we don't do embedded yet in 5.0 - -* Fri Oct 14 2005 Kent Boortz - -- For 5.x, always compile with --with-big-tables -- Copy the config.log file to location outside - the build tree - -* Fri Oct 14 2005 Kent Boortz - -- Removed unneeded/obsolete configure options -- Added archive engine to standard server -- Removed the embedded server from experimental server -- Changed suffix "-Max" => "-max" -- Changed comment string "Max" => "Experimental" - -* Thu Oct 13 2005 Lenz Grimmer - -- added a usermod call to assign a potential existing mysql user to the - correct user group (BUG#12823) -- Save the perror binary built during Max build so it supports the NDB - error codes (BUG#13740) -- added a separate macro "mysqld_group" to be able to define the - user group of the mysql user seperately, if desired. - -* Thu Sep 29 2005 Lenz Grimmer - -- fixed the removing of the RPM_BUILD_ROOT in the %%clean section (the - $RBR variable did not get expanded, thus leaving old build roots behind) - -* Thu Aug 04 2005 Lenz Grimmer - -- Fixed the creation of the mysql user group account in the postinstall - section (BUG 12348) -- Fixed enabling the Archive storage engine in the Max binary - -* Tue Aug 02 2005 Lenz Grimmer - -- Fixed the Requires: tag for the server RPM (BUG 12233) - -* Fri Jul 15 2005 Lenz Grimmer - -- create a "mysql" user group and assign the mysql user account to that group - in the server postinstall section. (BUG 10984) - -* Tue Jun 14 2005 Lenz Grimmer - -- Do not build statically on i386 by default, only when adding either "--with - static" or "--define '_with_static 1'" to the RPM build options. Static - linking really only makes sense when linking against the specially patched - glibc 2.2.5. - -* Mon Jun 06 2005 Lenz Grimmer - -- added mysql_client_test to the "bench" subpackage (BUG 10676) -- added the libndbclient static and shared libraries (BUG 10676) - -* Wed Jun 01 2005 Lenz Grimmer - -- use "mysqldatadir" variable instead of hard-coding the path multiple times -- use the "mysqld_user" variable on all occasions a user name is referenced -- removed (incomplete) Brazilian translations -- removed redundant release tags from the subpackage descriptions - -* Wed May 25 2005 Joerg Bruehe - -- Added a "make clean" between separate calls to "BuildMySQL". - -* Thu May 12 2005 Guilhem Bichot - -- Removed the mysql_tableinfo script made obsolete by the information schema - -* Wed Apr 20 2005 Lenz Grimmer - -- Enabled the "blackhole" storage engine for the Max RPM - -* Wed Apr 13 2005 Lenz Grimmer - -- removed the MySQL manual files (html/ps/texi) - they have been removed - from the MySQL sources and are now available seperately. - -* Mon Apr 4 2005 Petr Chardin - -- old mysqlmanager, mysqlmanagerc and mysqlmanager-pwger renamed into - mysqltestmanager, mysqltestmanager and mysqltestmanager-pwgen respectively - -* Fri Mar 18 2005 Lenz Grimmer - -- Disabled RAID in the Max binaries once and for all (it has finally been - removed from the source tree) - -* Sun Feb 20 2005 Petr Chardin - -- Install MySQL Instance Manager together with mysqld, touch mysqlmanager - password file - -* Mon Feb 14 2005 Lenz Grimmer - -- Fixed the compilation comments and moved them into the separate build sections - for Max and Standard - -* Mon Feb 7 2005 Tomas Ulin - -- enabled the "Ndbcluster" storage engine for the max binary -- added extra make install in ndb subdir after Max build to get ndb binaries -- added packages for ndbcluster storage engine - -* Fri Jan 14 2005 Lenz Grimmer - -- replaced obsoleted "BuildPrereq" with "BuildRequires" instead - -* Thu Jan 13 2005 Lenz Grimmer - -- enabled the "Federated" storage engine for the max binary - -* Tue Jan 04 2005 Petr Chardin - -- ISAM and merge storage engines were purged. As well as appropriate - tools and manpages (isamchk and isamlog) - -* Fri Dec 31 2004 Lenz Grimmer - -- enabled the "Archive" storage engine for the max binary -- enabled the "CSV" storage engine for the max binary -- enabled the "Example" storage engine for the max binary - -* Thu Aug 26 2004 Lenz Grimmer - -- MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860) - -* Fri Aug 20 2004 Lenz Grimmer - -- do not link statically on IA64/AMD64 as these systems do not have - a patched glibc installed - -* Tue Aug 10 2004 Lenz Grimmer - -- Added libmygcc.a to the devel subpackage (required to link applications - against the the embedded server libmysqld.a) (BUG 4921) - -* Mon Aug 09 2004 Lenz Grimmer - -- Added EXCEPTIONS-CLIENT to the "devel" package - -* Thu Jul 29 2004 Lenz Grimmer - -- disabled OpenSSL in the Max binaries again (the RPM packages were the - only exception to this anyway) (BUG 1043) - -* Wed Jun 30 2004 Lenz Grimmer - -- fixed server postinstall (mysql_install_db was called with the wrong - parameter) - -* Thu Jun 24 2004 Lenz Grimmer - -- added mysql_tzinfo_to_sql to the server subpackage -- run "make clean" instead of "make distclean" - -* Mon Apr 05 2004 Lenz Grimmer - -- added ncurses-devel to the build prerequisites (BUG 3377) - -* Thu Feb 12 2004 Lenz Grimmer - -- when using gcc, _always_ use CXX=gcc -- replaced Copyright with License field (Copyright is obsolete) - -* Tue Feb 03 2004 Lenz Grimmer - -- added myisam_ftdump to the Server package - -* Tue Jan 13 2004 Lenz Grimmer - -- link the mysql client against libreadline instead of libedit (BUG 2289) - -* Mon Dec 22 2003 Lenz Grimmer - -- marked /etc/logrotate.d/mysql as a config file (BUG 2156) - -* Sat Dec 13 2003 Lenz Grimmer - -- fixed file permissions (BUG 1672) - -* Thu Dec 11 2003 Lenz Grimmer - -- made testing for gcc3 a bit more robust - -* Fri Dec 05 2003 Lenz Grimmer - -- added missing file mysql_create_system_tables to the server subpackage - -* Fri Nov 21 2003 Lenz Grimmer - -- removed dependency on MySQL-client from the MySQL-devel subpackage - as it is not really required. (BUG 1610) - -* Fri Aug 29 2003 Lenz Grimmer - -- Fixed BUG 1162 (removed macro names from the changelog) -- Really fixed BUG 998 (disable the checking for installed but - unpackaged files) - -* Tue Aug 05 2003 Lenz Grimmer - -- Fixed BUG 959 (libmysqld not being compiled properly) -- Fixed BUG 998 (RPM build errors): added missing files to the - distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow, - mysql_fix_privilege_tables.1), removed "-n" from install section. - -* Wed Jul 09 2003 Lenz Grimmer - -- removed the GIF Icon (file was not included in the sources anyway) -- removed unused variable shared_lib_version -- do not run automake before building the standard binary - (should not be necessary) -- add server suffix '-standard' to standard binary (to be in line - with the binary tarball distributions) -- Use more RPM macros (_exec_prefix, _sbindir, _libdir, _sysconfdir, - _datadir, _includedir) throughout the spec file. -- allow overriding CC and CXX (required when building with other compilers) - -* Fri May 16 2003 Lenz Grimmer - -- re-enabled RAID again - -* Wed Apr 30 2003 Lenz Grimmer - -- disabled MyISAM RAID (--with-raid) - it throws an assertion which - needs to be investigated first. - -* Mon Mar 10 2003 Lenz Grimmer - -- added missing file mysql_secure_installation to server subpackage - (BUG 141) - -* Tue Feb 11 2003 Lenz Grimmer - -- re-added missing pre- and post(un)install scripts to server subpackage -- added config file /etc/my.cnf to the file list (just for completeness) -- make sure to create the datadir with 755 permissions - -* Mon Jan 27 2003 Lenz Grimmer - -- removed unused CC and CXX variables -- CFLAGS and CXXFLAGS should honor RPM_OPT_FLAGS - -* Fri Jan 24 2003 Lenz Grimmer - -- renamed package "MySQL" to "MySQL-server" -- fixed Copyright tag -- added mysql_waitpid to client subpackage (required for mysql-test-run) - -* Wed Nov 27 2002 Lenz Grimmer - -- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of - Linux distributions now support this scheme as proposed by the LSB either - directly or via a compatibility symlink) -- Use new "restart" init script action instead of starting and stopping - separately -- Be more flexible in activating the automatic bootup - use insserv (on - older SuSE versions) or chkconfig (Red Hat, newer SuSE versions and - others) to create the respective symlinks - -* Wed Sep 25 2002 Lenz Grimmer - -- MySQL-Max now requires MySQL >= 4.0 to avoid version mismatches - (mixing 3.23 and 4.0 packages) - -* Fri Aug 09 2002 Lenz Grimmer - -- Turn off OpenSSL in MySQL-Max for now until it works properly again -- enable RAID for the Max binary instead -- added compatibility link: safe_mysqld -> mysqld_safe to ease the - transition from 3.23 - -* Thu Jul 18 2002 Lenz Grimmer - -- Reworked the build steps a little bit: the Max binary is supposed - to include OpenSSL, which cannot be linked statically, thus trying - to statically link against a special glibc is futile anyway -- because of this, it is not required to make yet another build run - just to compile the shared libs (saves a lot of time) -- updated package description of the Max subpackage -- clean up the BuildRoot directory afterwards - -* Mon Jul 15 2002 Lenz Grimmer - -- Updated Packager information -- Fixed the build options: the regular package is supposed to - include InnoDB and linked statically, while the Max package - should include BDB and SSL support - -* Fri May 03 2002 Lenz Grimmer - -- Use more RPM macros (e.g. infodir, mandir) to make the spec - file more portable -- reorganized the installation of documentation files: let RPM - take care of this -- reorganized the file list: actually install man pages along - with the binaries of the respective subpackage -- do not include libmysqld.a in the devel subpackage as well, if we - have a special "embedded" subpackage -- reworked the package descriptions - -* Mon Oct 8 2001 Monty - -- Added embedded server as a separate RPM - -* Fri Apr 13 2001 Monty - -- Added mysqld-max to the distribution - -* Tue Jan 2 2001 Monty - -- Added mysql-test to the bench package - -* Fri Aug 18 2000 Tim Smith - -- Added separate libmysql_r directory; now both a threaded - and non-threaded library is shipped. - -* Tue Sep 28 1999 David Axmark - -- Added the support-files/my-example.cnf to the docs directory. - -- Removed devel dependency on base since it is about client - development. - -* Wed Sep 8 1999 David Axmark - -- Cleaned up some for 3.23. - -* Thu Jul 1 1999 David Axmark - -- Added support for shared libraries in a separate sub - package. Original fix by David Fox (dsfox@cogsci.ucsd.edu) - -- The --enable-assembler switch is now automatically disables on - platforms there assembler code is unavailable. This should allow - building this RPM on non i386 systems. - -* Mon Feb 22 1999 David Axmark - -- Removed unportable cc switches from the spec file. The defaults can - now be overridden with environment variables. This feature is used - to compile the official RPM with optimal (but compiler version - specific) switches. - -- Removed the repetitive description parts for the sub rpms. Maybe add - again if RPM gets a multiline macro capability. - -- Added support for a pt_BR translation. Translation contributed by - Jorge Godoy . - -* Wed Nov 4 1998 David Axmark - -- A lot of changes in all the rpm and install scripts. This may even - be a working RPM :-) - -* Sun Aug 16 1998 David Axmark - -- A developers changelog for MySQL is available in the source RPM. And - there is a history of major user visible changed in the Reference - Manual. Only RPM specific changes will be documented here. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/support-files/mysql.5.6.37-82.2.spec percona-xtradb-cluster-5.6-5.6.37-26.21/support-files/mysql.5.6.37-82.2.spec --- percona-xtradb-cluster-5.6-5.6.34-26.19/support-files/mysql.5.6.37-82.2.spec 1970-01-01 00:00:00.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/support-files/mysql.5.6.37-82.2.spec 2017-10-27 11:39:29.000000000 +0000 @@ -0,0 +1,2410 @@ +# 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 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; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston +# MA 02110-1301 USA. + +############################################################################## +# Some common macro definitions +############################################################################## + +# NOTE: "vendor" is used in upgrade/downgrade check, so you can't +# change these, has to be exactly as is. +%global mysql_old_vendor MySQL AB +%global mysql_vendor_2 Sun Microsystems, Inc. +%global mysql_vendor Oracle and/or its affiliates + +%global mysql_version 5.6.37-82.2 +%global wsrep_version 26.21 +%global wsrep_revision XXXX + +%global mysqld_user mysql +%global mysqld_group mysql +%global mysqldatadir /var/lib/mysql + +%global release %{wsrep_version} +%global short_product_tag 5.6 +%global previous_tag 5.5 + +# +# Macros we use which are not available in all supported versions of RPM +# +# - defined/undefined are missing on RHEL4 +# +%if %{expand:%{?defined:0}%{!?defined:1}} +%define defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}} +%endif +%if %{expand:%{?undefined:0}%{!?undefined:1}} +%define undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}} +%endif + +# ---------------------------------------------------------------------------- +# RPM build tools now automatically detect Perl module dependencies. This +# detection causes problems as it is broken in some versions, and it also +# provides unwanted dependencies from mandatory scripts in our package. +# It might not be possible to disable this in all versions of RPM, but here we +# try anyway. We keep the "AutoReqProv: no" for the "test" sub package, as +# disabling here might fail, and that package has the most problems. +# See: +# http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides +# http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html +# ---------------------------------------------------------------------------- +%undefine __perl_provides +%undefine __perl_requires + +############################################################################## +# Command line handling +############################################################################## +# +# To set options: +# +# $ rpmbuild --define="option " ... +# + +# ---------------------------------------------------------------------------- +# Commercial builds +# ---------------------------------------------------------------------------- +%if %{undefined commercial} +%define commercial 0 +%endif + +# ---------------------------------------------------------------------------- +# Source name +# ---------------------------------------------------------------------------- +%if %{undefined src_base} +%define src_base mysql-wsrep +%endif +%define src_dir %{src_base}-%{mysql_version}-%{wsrep_version} + +# ---------------------------------------------------------------------------- +# Feature set (storage engines, options). Default to community (everything) +# ---------------------------------------------------------------------------- +%if %{undefined feature_set} +%define feature_set community +%endif + +# ---------------------------------------------------------------------------- +# Server comment strings +# ---------------------------------------------------------------------------- +%if %{undefined compilation_comment_debug} +%define compilation_comment_debug MySQL Community Server - Debug (GPL) +%endif +%if %{undefined compilation_comment_release} +%define compilation_comment_release MySQL Community Server (GPL) +%endif + +# ---------------------------------------------------------------------------- +# Product and server suffixes +# ---------------------------------------------------------------------------- +%if %{undefined product_suffix} + %if %{defined short_product_tag} + %define product_suffix -%{short_product_tag} + %define previous_suffix -%{previous_tag} + %else + %define product_suffix %{nil} + %endif +%endif + +%if %{undefined server_suffix} +%define server_suffix %{nil} +%endif + +# ---------------------------------------------------------------------------- +# Distribution support +# ---------------------------------------------------------------------------- + +# Disable post build checks for time being. +BuildConflicts: post-build-checks + +BuildRequires: gcc-c++ ncurses-devel perl zlib-devel cmake libaio-devel bison flex + +%if 0%{?rhel} == 6 || 0%{?rhel} == 7 || 0%{?fedora} == 20 || 0%{?fedora} == 21 +BuildRequires: time openssl-devel +%endif +%if 0%{?rhel} == 7 +BuildRequires: perl(Time::HiRes) perl(Env) +%endif + +%if 0%{?suse_version} +%if 0%{?suse_version} == 1110 +BuildRequires: gdbm-devel gperf openldap2-client procps pwdutils libopenssl-devel +%else +BuildRequires: libopenssl-devel +%endif +%if 0%{?suse_version} == 1310 || 0%{?suse_version} == 1315 || 0%{?suse_version} == 1320 +BuildRequires: gperf procps time + %endif + %endif + +# Define dist tag if not given by platform +# In case of problems, check "/etc/rpm/macros.dist" +%if %{undefined dist} + # For suse versions see: + # https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto + %if 0%{?suse_version} == 1110 + %define dist .sle11 + %endif + %if 0%{?suse_version} == 1310 + %define dist .suse13.1 + %endif + %if 0%{?suse_version} == 1315 + %define dist .sle12 + %endif + %if 0%{?suse_version} == 1320 + %define dist .suse13.2 + %endif + # Still missing? + %if %{undefined dist} + %define dist .DIST + %endif +%endif +# CentOS 7 would force ".el7.centos", we want to avoid that. +%if 0%{?rhel} == 7 + %define dist .el7 +%endif + +# Avoid debuginfo RPMs, leaves binaries unstripped +%define debug_package %{nil} + +# ---------------------------------------------------------------------------- +# Support optional "tcmalloc" library (experimental) +# ---------------------------------------------------------------------------- +%if %{defined malloc_lib_target} +%define WITH_TCMALLOC 1 +%else +%define WITH_TCMALLOC 0 +%endif + +############################################################################## +# Settings for the "compatibility libs", the version depends on the target platform +############################################################################## + +# To differ between current main version and libs-compat: +%global currentlib 18 + +%if 0%{?rhel} == 6 +%global compatver 5.1.73 +%global compatlib 16 +%global compatsrc https://cdn.mysql.com/Downloads/MySQL-5.1/mysql-%{compatver}.tar.gz +%global compatch mysql-5173-charset-dir.patch +%endif + +# 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.7 (or higher) that has a libmysqlclient.so.20 or higher. +# +# %%if 0%%{?rhel} == 7 +# %%global compatver 5.5.45 +# %%global compatlib 18 +# %%global compatsrc https://cdn.mysql.com/Downloads/MySQL-5.5/mysql-%%{compatver}.tar.gz +# %%global compatch mysql-5545-charset-dir.patch +# # By default, a build will include the bundeled "yaSSL" library for SSL. +# %%{?with_ssl: %%global ssl_option -DWITH_SSL=%%{with_ssl}} +# %%endif + +%if 0%{?compatlib} +# Attention: "compat_src_dir" is the old version (e.g. 5.1.73), depends on platform +%global compat_src_dir mysql-%{compatver} +%endif + +############################################################################## +# Configuration based upon above user input, not to be set directly +############################################################################## + +%if 0%{?commercial} +%define license_files_server %{src_dir}/LICENSE.mysql +%define license_type Commercial +%else +%define license_files_server %{src_dir}/COPYING %{src_dir}/README +%define license_type GPL +%define compat_license_files_server %{compat_src_dir}/COPYING %{compat_src_dir}/README +%endif + +############################################################################## +# Main spec file section +############################################################################## + +Name: mysql-wsrep%{product_suffix} +Summary: MySQL: a very fast and reliable SQL database server +Group: Applications/Databases +Version: 5.6.37_82.2 +Release: %{release}%{dist} +# Distribution: %{distro_description} +License: Copyright (c) 2000, 2017, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field. +Source: %{src_dir}.tar.gz +%if 0%{?compatlib} +Source7: %{compatsrc} +%endif +Source99: mysql-rpmlintrc +Patch0: cmake-no-wix.patch +%if 0%{?compatlib} +Patch7: %{compatch} +%if 0%{?compatlib} == 18 +Patch8: mysql-5.5-libmysqlclient-symbols.patch +%endif +%endif +URL: http://www.mysql.com/ +Packager: Codership Oy +Vendor: %{mysql_vendor} +# BuildRequires: %{distro_buildreq} +#wsrep_patch_tag + +Requires: mysql-wsrep-server%{product_suffix} +Requires: mysql-wsrep-client%{product_suffix} + +%if %{defined previous_suffix} +Obsoletes: mysql-wsrep%{previous_suffix} +%endif + +# Regression tests may take a long time, override the default to skip them +%{!?runselftest:%global runselftest 0} + +# Think about what you use here since the first step is to +# run a rm -rf +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +# From the manual +%description +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 +%{mysql_vendor} + +The MySQL software has Dual Licensing, which means you can use the MySQL +software free of charge under the GNU General Public License +(http://www.gnu.org/licenses/). You can also purchase commercial MySQL +licenses from %{mysql_vendor} if you do not wish to be bound by the terms of +the GPL. See the chapter "Licensing and Support" in the manual for +further info. + +The MySQL web site (http://www.mysql.com/) provides the latest +news and information about the MySQL software. Also please see the +documentation and the manual for more information. + +This is a meta package of the MySQL software combined with the "wsrep plugin" +aka "Galera Cluster", all governed by the GPL. +It causes the installation of both the server and the client subpackages +so that the machine can be used both as a local database server and as a node +in a MySQL Galera Cluster. + +############################################################################## +# Sub package definition +############################################################################## + +%package -n mysql-wsrep-server%{product_suffix} +Summary: MySQL: a very fast and reliable SQL database server +Group: Applications/Databases +# Distro requirements +# RedHat +%if 0%{?fedora} || 0%{?rhel} +Requires: chkconfig coreutils grep procps shadow-utils net-tools rsync lsof +%if 0%{?rhel} == 7 || 0%{?fedora} >= 20 +Requires: perl-Data-Dumper +%endif +%endif +# SUSE +%if 0%{?suse_version} +Requires: aaa_base coreutils grep procps rsync lsof +%if 0%{suse_version} == 1110 +Requires: pwdutils +%endif +%endif + +%if %{defined previous_suffix} +Obsoletes: mysql-wsrep-server%{previous_suffix} +%endif +%if 0%{?commercial} +Obsoletes: MySQL-server +%else +Obsoletes: MySQL-server-advanced +%endif +Obsoletes: mysql-server < %{version}-%{release} +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 mysql-community-common +%endif +Provides: mysql-server = %{version}-%{release} +Provides: mysql-server%{?_isa} = %{version}-%{release} + +%description -n mysql-wsrep-server%{product_suffix} +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 +%{mysql_vendor} + +The MySQL software has Dual Licensing, which means you can use the MySQL +software free of charge under the GNU General Public License +(http://www.gnu.org/licenses/). You can also purchase commercial MySQL +licenses from %{mysql_vendor} if you do not wish to be bound by the terms of +the GPL. See the chapter "Licensing and Support" in the manual for +further info. + +The MySQL web site (http://www.mysql.com/) provides the latest news and +information about the MySQL software. Also please see the documentation +and the manual for more information. + +This package includes the MySQL server binary as well as related utilities +to run and administer a MySQL server. + +Built with wsrep patch %{wsrep_version}, to be a node in a Galera cluster. + +If you want to access and work with the database locally, you have to install +package "mysql-wsrep-client%{product_suffix}" as well! + +# ---------------------------------------------------------------------------- +%package -n mysql-wsrep-client%{product_suffix} +Summary: MySQL - Client +Group: Applications/Databases + +%if %{defined previous_suffix} +Obsoletes: mysql-wsrep-client%{previous_suffix} +%endif +%if 0%{?commercial} +Obsoletes: MySQL-client +%else +Obsoletes: MySQL-client-advanced +%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} +Provides: mysql%{?_isa} = %{version}-%{release} +Provides: mysql-client = %{version} +Provides: MySQL-client = %{version} + +%description -n mysql-wsrep-client%{product_suffix} +This package contains the standard MySQL clients and administration tools. + +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ + +# ---------------------------------------------------------------------------- +%package -n mysql-wsrep-test%{product_suffix} +Summary: MySQL - Test suite +Group: Applications/Databases + +%if %{defined previous_suffix} +Obsoletes: mysql-wsrep-test%{previous_suffix} +%endif +%if 0%{?commercial} +Requires: MySQL-client-advanced perl +Obsoletes: MySQL-test +%else +Requires: MySQL-client perl +Obsoletes: MySQL-test-advanced +%endif +Obsoletes: mysql-test < %{version}-%{release} +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 mysql-community-bench +Obsoletes: MySQL-bench +Provides: mysql-test = %{version}-%{release} +Provides: mysql-test%{?_isa} = %{version}-%{release} +AutoReqProv: no + +%description -n mysql-wsrep-test%{product_suffix} +This package contains the MySQL regression test suite. + +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ + +# ---------------------------------------------------------------------------- +%package -n mysql-wsrep-devel%{product_suffix} +Summary: MySQL - Development header files and libraries +Group: Applications/Databases + +%if %{defined previous_suffix} +Obsoletes: mysql-wsrep-devel%{previous_suffix} +%endif +%if 0%{?commercial} +Obsoletes: MySQL-devel +%else +Obsoletes: MySQL-devel-advanced +%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} +Provides: mysql-devel%{?_isa} = %{version}-%{release} + +%description -n mysql-wsrep-devel%{product_suffix} +This package contains the development header files and libraries necessary +to develop MySQL client applications. + +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ + +# ---------------------------------------------------------------------------- +%package -n mysql-wsrep-shared%{product_suffix} +Summary: MySQL - Shared libraries +Group: Applications/Databases + +%if %{defined previous_suffix} +Obsoletes: mysql-wsrep-shared%{previous_suffix} +%endif +%if 0%{?commercial} +Obsoletes: MySQL-shared +%else +Obsoletes: MySQL-shared-advanced +%endif +Obsoletes: MySQL-shared-standard MySQL-shared-pro +Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl +Obsoletes: MySQL-shared-pro-gpl-cert +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 mysql-community-libs +# Necessary on RHEL 7, no harm on other platforms: +Obsoletes: mariadb-libs + +%description -n mysql-wsrep-shared%{product_suffix} +This package contains the shared libraries (*.so*) which certain languages +and applications need to dynamically load and use MySQL. + +# ---------------------------------------------------------------------------- +%if 0%{?compatlib} +%package -n mysql-wsrep-libs-compat%{product_suffix} +Summary: Shared libraries for MySQL %{compatver} database client applications +Group: Applications/Databases + +%if %{defined previous_suffix} +Obsoletes: mysql-wsrep-libs-compat%{previous_suffix} +%endif +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} + +# Dealing with RHEL 6 and upwards (and compatible ...) +# 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 ...) +# Above general section for RHEL also applies, it deals with "mysql" packages. +# But with RHEL 7, we also get "mariadb" ... +Obsoletes: mariadb-libs +%endif + +%description -n mysql-wsrep-libs-compat%{product_suffix} +The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, +and robust SQL (Structured Query Language) database server. +See the MySQL web site (http://www.mysql.com/) for further information, +including its dual licensing (GNU GPL or commercial licenses). + +This package contains the shared libraries for (old) MySQL %{compatver} client +applications. +It is intended for RHEL %{?rhel} and compatible distributions, +to satisfy the dependencies of several applications shipping with that distro +while the MySQL software on the machine is updated to a newer release series. + +%endif + +# ---------------------------------------------------------------------------- +%package -n MySQL-embedded%{product_suffix} +Summary: MySQL - Embedded library +Group: Applications/Databases +%if 0%{?commercial} +Requires: MySQL-devel-advanced +Obsoletes: MySQL-embedded +%else +Requires: MySQL-devel +Obsoletes: MySQL-embedded-advanced +%endif +Obsoletes: mysql-embedded < %{version}-%{release} +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 +Provides: mysql-embedded = %{version}-%{release} +Provides: mysql-embedded%{?_isa} = %{version}-%{release} + +%description -n MySQL-embedded%{product_suffix} +This package contains the MySQL server as an embedded library. + +The embedded MySQL server library makes it possible to run a full-featured +MySQL server inside the client application. The main benefits are increased +speed and more simple management for embedded applications. + +The API is identical for the embedded MySQL version and the +client/server version. + +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ + +############################################################################## +%prep +%if 0%{?compatlib} +%setup -q -T -a 0 -a 7 -c -n %{name} +# -q = quiet, -T = no default unpack, -n = source dir name, -c = create, -a = unpack after cd +# https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04.html +# http://rpm.org/max-rpm-snapshot/s1-rpm-inside-macros.html +pushd %{compat_src_dir} +%patch7 -p 1 +%if 0%{?compatlib} == 18 +%patch8 -p 1 +%endif +popd +%else +%setup -q -T -a 0 -c -n %{name} +%endif # 0%{?compatlib} + +# That patch is needed with old cmake only, on SLES 11, but it won't do any harm +# outside Windows, so it may be used in all RPM builds. +pushd %{src_dir} +%patch0 -p1 +#wsrep_apply_patch_tag +popd + +############################################################################## +%build + +# Build compat libs +%if 0%{?compatlib} +( +%if 0%{?compatlib} == 16 +# RHEL 6: MySQL 5.1, using traditional "configure ; make" +export CC="gcc" CXX="g++" +export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv" +export CXXFLAGS="$CFLAGS %{?el6:-felide-constructors} -fno-rtti -fno-exceptions" +pushd %{compat_src_dir} +%configure \ + --with-readline \ + --without-debug \ + --enable-shared \ + --localstatedir=/var/lib/mysql \ + --with-unix-socket-path=/var/lib/mysql/mysql.sock \ + --with-mysqld-user="mysql" \ + --with-extra-charsets=all \ + --enable-local-infile \ + --enable-largefile \ + --enable-thread-safe-client \ + --with-ssl=%{_prefix} \ + --with-embedded-server \ + --with-big-tables \ + --with-pic \ + --with-plugin-innobase \ + --with-plugin-innodb_plugin \ + --with-plugin-partition \ + --disable-dependency-tracking +make %{?_smp_mflags} +popd +%endif +##### +%if 0%{?compatlib} == 18 +# RHEL 7: MySQL 5.5, using "cmake ; make" +mkdir release +cd release +cmake ../%{compat_src_dir} \ + -DBUILD_CONFIG=mysql_release \ + -DINSTALL_LAYOUT=RPM \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DENABLE_DTRACE=OFF \ + -DCMAKE_C_FLAGS="%{optflags}" \ + -DCMAKE_CXX_FLAGS="%{optflags}" \ + -DINSTALL_LIBDIR="%{_lib}/mysql" \ + -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ + -DINSTALL_SQLBENCHDIR=share \ + -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ + -DFEATURE_SET="%{feature_set}" \ + -DWITH_EMBEDDED_SERVER=1 \ + -DWITH_EMBEDDED_SHARED_LIBRARY=1 \ + %{?ssl_option} \ + -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ + -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" +echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG +make %{?_smp_mflags} VERBOSE=1 +cd .. +%endif +) +%endif + +pushd %{src_dir} + +# Fail quickly and obviously if user tries to build as root +%if %runselftest + if [ x"`id -u`" = x0 ]; then + echo "The MySQL regression tests may fail if run as root." + echo "If you really need to build the RPM as root, use" + echo "--define='runselftest 0' to skip the regression tests." + exit 1 + fi +%endif + +# Be strict about variables, bail at earliest opportunity, etc. +set -eu + +# Optional package files +touch optional-files-devel + +# +# Set environment in order of preference, MYSQL_BUILD_* first, then variable +# name, finally a default. RPM_OPT_FLAGS is assumed to be a part of the +# default RPM build environment. +# + +# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break +# the compile in cmd-line-utils/libedit - needs investigation, but for now +# we simply unset it and use those specified directly in cmake. +%if "%{_arch}" == "ia64" +RPM_OPT_FLAGS= +%endif + +export PATH=${MYSQL_BUILD_PATH:-$PATH} +export CC=${MYSQL_BUILD_CC:-${CC:-gcc}} +export CXX=${MYSQL_BUILD_CXX:-${CXX:-g++}} +export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}} +export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors}} +export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}} +export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}} +export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:--j$(ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) && echo $(($ncpu > 4 ? 4 : $ncpu)))} + +# By default, a build will use the system library for SSL. +# However, there may be a need to override. +# Protect against undefined variables if there is no override option. +%if %{undefined with_ssl} +%define ssl_option -DWITH_SSL=system +%else +%define ssl_option -DWITH_SSL=%{with_ssl} +%endif + +# Build debug mysqld and libmysqld.a +mkdir debug +( + cd debug + # Attempt to remove any optimisation flags from the debug build + CFLAGS=`echo " ${CFLAGS} " | \ + sed -e 's/ -O[0-9]* / /' \ + -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ + -e 's/-D_FORTIFY_SOURCE=2/ /' \ + -e 's/ -unroll2 / /' \ + -e 's/ -ip / /' \ + -e 's/^ //' \ + -e 's/ $//'` + CXXFLAGS=`echo " ${CXXFLAGS} " | \ + sed -e 's/ -O[0-9]* / /' \ + -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ + -e 's/-D_FORTIFY_SOURCE=2/ /' \ + -e 's/ -unroll2 / /' \ + -e 's/ -ip / /' \ + -e 's/^ //' \ + -e 's/ $//'` + # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before + # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM + ${CMAKE} ../ -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ + -DCMAKE_BUILD_TYPE=Debug \ + -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ + -DFEATURE_SET="%{feature_set}" \ + %{ssl_option} \ + -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ + -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ + -DWITH_WSREP=1 \ + -DWSREP_VERSION="%{wsrep_version}" \ + -DWSREP_REVISION="%{wsrep_revision}" + echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG + make ${MAKE_JFLAG} VERBOSE=1 +) +# Build full release +mkdir release +( + cd release + # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before + # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM + ${CMAKE} ../ -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ + -DFEATURE_SET="%{feature_set}" \ + %{ssl_option} \ + -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ + -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ + -DWITH_WSREP=1 \ + -DWSREP_VERSION="%{wsrep_version}" \ + -DWSREP_REVISION="%{wsrep_revision}" + echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG + make ${MAKE_JFLAG} VERBOSE=1 +) + +%if %runselftest + MTR_BUILD_THREAD=auto + export MTR_BUILD_THREAD + + (cd release && make test-bt-fast || true) +%endif +popd + +############################################################################## +%install +%if 0%{?compatlib} +( +cd $RPM_BUILD_DIR/%{name} + +# Install compat libs +# This must be done *before* the current libs are installed, for the "rm *.{a,la,so}" +%if 0%{?compatlib} == 16 +for dir in mysql-%{compatver}/libmysql mysql-%{compatver}/libmysql_r ; do +%else +for dir in release/libmysql ; do +%endif + pushd $dir + make DESTDIR=%{buildroot} install + popd +done +rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient{,_r}.{a,la,so} + +# "charsets/" +install -d -m 0755 %{buildroot}/usr/share/mysql/charsets-%{compatver}/ +install -m 644 mysql-%{compatver}/sql/share/charsets/* %{buildroot}/usr/share/mysql/charsets-%{compatver}/ + +# Add libdir to linker +install -d -m 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d +echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf +) +%endif + +RBR=$RPM_BUILD_ROOT +MBD=$RPM_BUILD_DIR/%{name}/%{src_dir} +cd $MBD + +# Ensure that needed directories exists +install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} +install -d $RBR%{mysqldatadir}/mysql +install -d $RBR%{_datadir}/mysql-test +install -d $RBR%{_datadir}/mysql/SELinux/RHEL4 +install -d $RBR%{_includedir} +install -d $RBR%{_libdir} +install -d $RBR%{_mandir} +install -d $RBR%{_sbindir} +install -d $RBR/var/lib/mysql-files + +mkdir -p $RBR%{_sysconfdir}/my.cnf.d + +# Install all binaries +( + cd $MBD/release + make DESTDIR=$RBR install +) + +# FIXME: at some point we should stop doing this and just install everything +# FIXME: directly into %%{_libdir}/mysql - perhaps at the same time as renaming +# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax +mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/ + +# Install logrotate and autostart +install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql +install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql + +# Create a symlink "rcmysql", pointing to the init.script. SuSE users +# will appreciate that, as all services usually offer this. +ln -sf %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql + +# Create a wsrep_sst_rsync_wan symlink. +install -d $RBR%{_bindir} +ln -sf wsrep_sst_rsync $RBR%{_bindir}/wsrep_sst_rsync_wan + +# Touch the place where the my.cnf config file might be located +# Just to make sure it's in the file list and marked as a config file +touch $RBR%{_sysconfdir}/my.cnf +touch $RBR%{_sysconfdir}/wsrep.cnf + + +# Install SELinux files in datadir +install -m 600 $MBD/support-files/RHEL4-SElinux/mysql.{fc,te} \ + $RBR%{_datadir}/mysql/SELinux/RHEL4 + +# Get the list of "_datadir" files, remove those that go into "libs-compat" +find $RBR%{_datadir}/mysql -type f -print | sed -e "s=$RBR==" \ + | fgrep -v "charsets-%{compatver}" | sort >> $MBD/release/support-files/plugins.files + +%if %{WITH_TCMALLOC} +# Even though this is a shared library, put it under /usr/lib*/mysql, so it +# doesn't conflict with possible shared lib by the same name in /usr/lib*. See +# `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used. +install -m 644 "%{malloc_lib_source}" \ + "$RBR%{_libdir}/mysql/%{malloc_lib_target}" +%endif + +# Remove man pages we explicitly do not want to package, avoids 'unpackaged +# files' warning. +# This has become obsolete: rm -f $RBR%%{_mandir}/man1/make_win_bin_dist.1* + +%check + +############################################################################## +# Post processing actions, i.e. when installed +############################################################################## + +%pre -n mysql-wsrep-server%{product_suffix} +# This is the code running at the beginning of a RPM upgrade action, +# before replacing the old files with the new ones. + +# ATTENTION: Parts of this are duplicated in the "triggerpostun" ! + +# There are users who deviate from the default file system layout. +# Check local settings to support them. +if [ -x %{_bindir}/my_print_defaults ] +then + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` + PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'` +fi +if [ -z "$mysql_datadir" ] +then + mysql_datadir=%{mysqldatadir} +fi +if [ -z "$PID_FILE_PATT" ] +then + PID_FILE_PATT="$mysql_datadir/*.pid" +fi + +# Check if we can safely upgrade. An upgrade is only safe if it's from one +# of our RPMs in the same version family. + +# Handle both ways of spelling the capability. +installed=`rpm -q --whatprovides mysql-server 2> /dev/null` +if [ $? -ne 0 -o -z "$installed" ]; then + installed=`rpm -q --whatprovides MySQL-server 2> /dev/null` +fi +if [ $? -eq 0 -a -n "$installed" ]; then + installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names + vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1` + version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1` + myoldvendor='%{mysql_old_vendor}' + myvendor_2='%{mysql_vendor_2}' + myvendor='%{mysql_vendor}' + myversion='%{mysql_version}' + + old_family=`echo $version \ + | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'` + new_family=`echo $myversion \ + | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'` + + [ -z "$vendor" ] && vendor='' + [ -z "$old_family" ] && old_family="" + [ -z "$new_family" ] && new_family="" + + error_text= + if [ "$vendor" != "$myoldvendor" \ + -a "$vendor" != "$myvendor_2" \ + -a "$vendor" != "$myvendor" ]; then + error_text="$error_text +The current MySQL server package is provided by a different +vendor ($vendor) than $myoldvendor, $myvendor_2, or $myvendor. +Some files may be installed to different locations, including log +files and the service startup script in %{_sysconfdir}/init.d/. +" + fi + + if [ "$old_family" != "$new_family" ]; then + error_text="$error_text +Upgrading directly from MySQL $old_family to MySQL $new_family may not +be safe in all cases. A manual dump and restore using mysqldump is +recommended. It is important to review the MySQL manual's Upgrading +section for version-specific incompatibilities. +" + fi + + if [ -n "$error_text" ]; then + cat <&2 + +****************************************************************** +A MySQL server package ($installed) is installed. +$error_text +A manual upgrade is required. + +- Ensure that you have a complete, working backup of your data and my.cnf + files +- Shut down the MySQL server cleanly +- Remove the existing MySQL packages. Usually this command will + list the packages you should remove: + rpm -qa | grep -i '^mysql-' + + You may choose to use 'rpm --nodeps -ev ' to remove + the package which contains the perconaserverclient shared library. The + library will be reinstalled by the MySQL-shared-compat package. +- Install the new MySQL packages supplied by $myvendor +- Ensure that the MySQL server is started +- Run the 'mysql_upgrade' program + +This is a brief description of the upgrade process. Important details +can be found in the MySQL manual, in the Upgrading section. +****************************************************************** +HERE + exit 1 + fi +fi + +# We assume that if there is exactly one ".pid" file, +# it contains the valid PID of a running MySQL server. +NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l` +case $NR_PID_FILES in + 0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server + 1 ) SERVER_TO_START='true' ;; + * ) SERVER_TO_START='' # Situation not clear + SEVERAL_PID_FILES=true ;; +esac +# That logic may be debated: We might check whether it is non-empty, +# contains exactly one number (possibly a PID), and whether "ps" finds it. +# OTOH, if there is no such process, it means a crash without a cleanup - +# is that a reason not to start a new server after upgrade? + +STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER + +if [ -f "$STATUS_FILE" ]; then + echo "Some previous upgrade was not finished:" + ls -ld $STATUS_FILE + echo "Please check its status, then do" + echo " rm $STATUS_FILE" + echo "before repeating the MySQL upgrade." + exit 1 +elif [ -n "$SEVERAL_PID_FILES" ] ; then + echo "You have more than one PID file:" + ls -ld $PID_FILE_PATT + echo "Please check which one (if any) corresponds to a running server" + echo "and delete all others before repeating the MySQL upgrade." + exit 1 +fi + +NEW_VERSION=%{mysql_version}-%{release} + +# The "pre" section code is also run on a first installation, +# when there is no data directory yet. Protect against error messages. +# Check for the existence of subdirectory "mysql/", the database of system +# tables like "mysql.user". +if [ -d $mysql_datadir/mysql ] ; then + echo "MySQL RPM upgrade to version $NEW_VERSION" > $STATUS_FILE + echo "'pre' step running at `date`" >> $STATUS_FILE + echo >> $STATUS_FILE + fcount=`ls -ltr $mysql_datadir/*.err 2>/dev/null | wc -l` + if [ $fcount -gt 0 ] ; then + echo "ERR file(s):" >> $STATUS_FILE + ls -ltr $mysql_datadir/*.err >> $STATUS_FILE + echo >> $STATUS_FILE + echo "Latest 'Version' line in latest file:" >> $STATUS_FILE + grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \ + tail -1 >> $STATUS_FILE + echo >> $STATUS_FILE + fi + + if [ -n "$SERVER_TO_START" ] ; then + # There is only one PID file, race possibility ignored + echo "PID file:" >> $STATUS_FILE + ls -l $PID_FILE_PATT >> $STATUS_FILE + cat $PID_FILE_PATT >> $STATUS_FILE + echo >> $STATUS_FILE + echo "Server process:" >> $STATUS_FILE + ps -fp `cat $PID_FILE_PATT` >> $STATUS_FILE + echo >> $STATUS_FILE + echo "SERVER_TO_START=$SERVER_TO_START" >> $STATUS_FILE + else + # Take a note we checked it ... + echo "PID file:" >> $STATUS_FILE + ls -l $PID_FILE_PATT >> $STATUS_FILE 2>&1 + fi +fi + +# Shut down a previously installed server first +# Note we *could* make that depend on $SERVER_TO_START, but we rather don't, +# so a "stop" is attempted even if there is no PID file. +# (Maybe the "stop" doesn't work then, but we might fix that in itself.) +if [ -x %{_sysconfdir}/init.d/mysql ] ; then + %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1 + echo "Giving mysqld 5 seconds to exit nicely" + sleep 5 +fi + +%post -n mysql-wsrep-server%{product_suffix} +# This is the code running at the end of a RPM install or upgrade action, +# after the (new) files have been written. + +# ATTENTION: Parts of this are duplicated in the "triggerpostun" ! + +# There are users who deviate from the default file system layout. +# Check local settings to support them. +if [ -x %{_bindir}/my_print_defaults ] +then + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` +fi +if [ -z "$mysql_datadir" ] +then + mysql_datadir=%{mysqldatadir} +fi + +NEW_VERSION=%{mysql_version}-%{release} +STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER + +# ---------------------------------------------------------------------- +# Create data directory if needed, check whether upgrade or install +# ---------------------------------------------------------------------- +if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi +if [ -f "$STATUS_FILE" ] ; then + SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` +else + SERVER_TO_START='' +fi +# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START" +if [ ! -d $mysql_datadir/mysql ] ; then + mkdir $mysql_datadir/mysql $mysql_datadir/test + echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE +else + # If the directory exists, we may assume it is an upgrade. + echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE +fi + +# ---------------------------------------------------------------------- +# Make MySQL start/shutdown automatically when the machine does it. +# ---------------------------------------------------------------------- +# NOTE: This still needs to be debated. Should we check whether these links +# for the other run levels exist(ed) before the upgrade? +# use chkconfig on Enterprise Linux and newer SuSE releases +if [ -x /sbin/chkconfig ] ; then + /sbin/chkconfig --add mysql +# use insserv for older SuSE Linux versions +elif [ -x /sbin/insserv ] ; then + /sbin/insserv %{_sysconfdir}/init.d/mysql +fi + +# ---------------------------------------------------------------------- +# Create a MySQL user and group. Do not report any problems if it already +# exists. +# ---------------------------------------------------------------------- +groupadd -r %{mysqld_group} 2> /dev/null || true +useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" \ + -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true +# The user may already exist, make sure it has the proper group nevertheless +# (BUG#12823) +usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true + +# ---------------------------------------------------------------------- +# Change permissions so that the user that will run the MySQL daemon +# owns all database files. +# ---------------------------------------------------------------------- +chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir + +# ---------------------------------------------------------------------- +# Initiate databases if needed +# ---------------------------------------------------------------------- +if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then + # Fix bug#45415: no "mysql_install_db" on an upgrade + # Do this as a negative to err towards more "install" runs + # rather than to miss one. + %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} --random-passwords + + # Attention: Now 'root' is the only database user, + # its password is a random value found in ~/.mysql_secret, + # and the "password expired" flag is set: + # Any client needs that password, and the first command + # executed must be a new "set password"! +fi + +# ---------------------------------------------------------------------- +# Upgrade databases if needed would go here - but it cannot be automated yet +# ---------------------------------------------------------------------- + +# ---------------------------------------------------------------------- +# Change permissions again to fix any new files. +# ---------------------------------------------------------------------- +chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir + +# ---------------------------------------------------------------------- +# Fix permissions for the permission database so that only the user +# can read them. +# ---------------------------------------------------------------------- +chmod -R og-rw $mysql_datadir/mysql + +# ---------------------------------------------------------------------- +# install SELinux files - but don't override existing ones +# ---------------------------------------------------------------------- +SETARGETDIR=/etc/selinux/targeted/src/policy +SEDOMPROG=$SETARGETDIR/domains/program +SECONPROG=$SETARGETDIR/file_contexts/program +if [ -f /etc/redhat-release ] \ + && (grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \ + || grep -q "CentOS release 4" /etc/redhat-release) ; then + echo + echo + echo 'Notes regarding SELinux on this platform:' + echo '=========================================' + echo + echo 'The default policy might cause server startup to fail because it is' + echo 'not allowed to access critical files. In this case, please update' + echo 'your installation.' + echo + echo 'The default policy might also cause inavailability of SSL related' + echo 'features because the server is not allowed to access /dev/random' + echo 'and /dev/urandom. If this is a problem, please do the following:' + echo + echo ' 1) install selinux-policy-targeted-sources from your OS vendor' + echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':' + echo ' allow mysqld_t random_device_t:chr_file read;' + echo ' allow mysqld_t urandom_device_t:chr_file read;' + echo ' 3) cd to '$SETARGETDIR' and issue the following command:' + echo ' make load' + echo + echo +fi + +if [ -x sbin/restorecon ] ; then + sbin/restorecon -R var/lib/mysql +fi + +# Was the server running before the upgrade? If so, restart the new one. +if [ "$SERVER_TO_START" = "true" ] ; then + # Restart in the same way that mysqld will be started normally. + if [ -x %{_sysconfdir}/init.d/mysql ] ; then + %{_sysconfdir}/init.d/mysql start + echo "Giving mysqld 5 seconds to start" + sleep 5 + fi +fi + +# Collect an upgrade history ... +echo "Upgrade/install finished at `date`" >> $STATUS_FILE +echo >> $STATUS_FILE +echo "=====" >> $STATUS_FILE +STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY +cat $STATUS_FILE >> $STATUS_HISTORY +mv -f $STATUS_FILE ${STATUS_FILE}-LAST # for "triggerpostun" + + +#echo "Thank you for installing the MySQL Community Server! For Production +#systems, we recommend MySQL Enterprise, which contains enterprise-ready +#software, intelligent advisory services, and full production support with +#scheduled service packs and more. Visit www.mysql.com/enterprise for more +#information." + +%preun -n mysql-wsrep-server%{product_suffix} + +# Which '$1' does this refer to? Fedora docs have info: +# " ... a count of the number of versions of the package that are installed. +# Action Count +# Install the first time 1 +# Upgrade 2 or higher (depending on the number of versions installed) +# Remove last version of package 0 " +# +# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html + +if [ $1 = 0 ] ; then + # Stop MySQL before uninstalling it + if [ -x %{_sysconfdir}/init.d/mysql ] ; then + %{_sysconfdir}/init.d/mysql stop > /dev/null + # Remove autostart of MySQL + # use chkconfig on Enterprise Linux and newer SuSE releases + if [ -x /sbin/chkconfig ] ; then + /sbin/chkconfig --del mysql + # For older SuSE Linux versions + elif [ -x /sbin/insserv ] ; then + /sbin/insserv -r %{_sysconfdir}/init.d/mysql + fi + fi +fi + +# We do not remove the mysql user since it may still own a lot of +# database files. + +%triggerpostun -n mysql-wsrep-server%{product_suffix} --MySQL-server-community + +# Setup: We renamed this package, so any existing "server-community" +# package will be removed when this "server" is installed. +# Problem: RPM will first run the "pre" and "post" sections of this script, +# and only then the "preun" of that old community server. +# But this "preun" includes stopping the server and uninstalling the service, +# "chkconfig --del mysql" which removes the symlinks to the start script. +# Solution: *After* the community server got removed, restart this server +# and re-install the service. +# +# For information about triggers in spec files, see the Fedora docs: +# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html +# For all details of this code, see the "pre" and "post" sections. + +# There are users who deviate from the default file system layout. +# Check local settings to support them. +if [ -x %{_bindir}/my_print_defaults ] +then + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` +fi +if [ -z "$mysql_datadir" ] +then + mysql_datadir=%{mysqldatadir} +fi + +NEW_VERSION=%{mysql_version}-%{release} +STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference! +STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY + +if [ -f "$STATUS_FILE" ] ; then + SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` +else + # This should never happen, but let's be prepared + SERVER_TO_START='' +fi +echo "Analyzed: SERVER_TO_START=$SERVER_TO_START" + +if [ -x /sbin/chkconfig ] ; then + /sbin/chkconfig --add mysql +# use insserv for older SuSE Linux versions +elif [ -x /sbin/insserv ] ; then + /sbin/insserv %{_sysconfdir}/init.d/mysql +fi + +# Was the server running before the upgrade? If so, restart the new one. +if [ "$SERVER_TO_START" = "true" ] ; then + # Restart in the same way that mysqld will be started normally. + if [ -x %{_sysconfdir}/init.d/mysql ] ; then + %{_sysconfdir}/init.d/mysql start + echo "Giving mysqld 5 seconds to start" + sleep 5 + fi +fi + +echo "Trigger 'postun --community' finished at `date`" >> $STATUS_HISTORY +echo >> $STATUS_HISTORY +echo "=====" >> $STATUS_HISTORY + + +# ---------------------------------------------------------------------- +# Clean up the BuildRoot after build is done +# ---------------------------------------------------------------------- +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \ + && rm -rf $RPM_BUILD_ROOT; + +############################################################################## +# Files section +############################################################################## + +%files -n mysql-wsrep%{product_suffix} +# Intentionally empty - this is a pure meta package. + +# ---------------------------------------------------------------------------- +%files -n mysql-wsrep-server%{product_suffix} -f %{src_dir}/release/support-files/plugins.files +%defattr(-,root,root,0755) +%if %{defined license_files_server} +%doc %{license_files_server} +%endif +%doc %{src_dir}/Docs/ChangeLog +%doc %{src_dir}/release/Docs/INFO_SRC* +%doc %{src_dir}/release/Docs/INFO_BIN* +%doc %{src_dir}/release/support-files/my-default.cnf +%doc %{src_dir}/Docs/README-wsrep +%doc %{src_dir}/release/support-files/wsrep.cnf +%doc %{src_dir}/release/support-files/wsrep_notify + +%if 0%{?commercial} +%doc %attr(644, root, root) %{_infodir}/mysql.info* +%endif + +%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1* +%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1* +%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1* +%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1* +%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1* +%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_convert_table_format.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_extensions.1* +%doc %attr(644, root, man) %{_mandir}/man8/mysqld.8* +%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1* +%doc %attr(644, root, man) %{_mandir}/man1/perror.1* +%doc %attr(644, root, man) %{_mandir}/man1/replace.1* +%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1* +%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1* + +%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf +%ghost %config(noreplace,missingok) %{_sysconfdir}/wsrep.cnf +%dir %{_sysconfdir}/my.cnf.d + +%attr(755, root, root) %{_bindir}/innochecksum +%attr(755, root, root) %{_bindir}/my_print_defaults +%attr(755, root, root) %{_bindir}/myisam_ftdump +%attr(755, root, root) %{_bindir}/myisamchk +%attr(755, root, root) %{_bindir}/myisamlog +%attr(755, root, root) %{_bindir}/myisampack +%attr(755, root, root) %{_bindir}/mysql_convert_table_format +%attr(755, root, root) %{_bindir}/mysql_fix_extensions +%attr(755, root, root) %{_bindir}/mysql_install_db +%attr(755, root, root) %{_bindir}/mysql_plugin +%attr(755, root, root) %{_bindir}/mysql_secure_installation +%attr(755, root, root) %{_bindir}/mysql_setpermission +%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql +%attr(755, root, root) %{_bindir}/mysql_upgrade +%attr(755, root, root) %{_bindir}/mysql_zap +%attr(755, root, root) %{_bindir}/mysqlbug +%attr(755, root, root) %{_bindir}/mysqld_multi +%attr(755, root, root) %{_bindir}/mysqld_safe +%attr(755, root, root) %{_bindir}/mysqldumpslow +%attr(755, root, root) %{_bindir}/mysqlhotcopy +%attr(755, root, root) %{_bindir}/mysqltest +%attr(755, root, root) %{_bindir}/perror +%attr(755, root, root) %{_bindir}/replace +%attr(755, root, root) %{_bindir}/resolve_stack_dump +%attr(755, root, root) %{_bindir}/resolveip +%attr(755, root, root) %{_bindir}/wsrep_sst_common +%attr(755, root, root) %{_bindir}/wsrep_sst_mysqldump +%attr(755, root, root) %{_bindir}/wsrep_sst_rsync +%attr(755, root, root) %{_bindir}/wsrep_sst_rsync_wan +%attr(755, root, root) %{_bindir}/wsrep_sst_xtrabackup +%attr(755, root, root) %{_bindir}/wsrep_sst_xtrabackup-v2 + +%attr(755, root, root) %{_sbindir}/mysqld +%attr(755, root, root) %{_sbindir}/mysqld-debug +%attr(755, root, root) %{_sbindir}/rcmysql +%dir %{_libdir}/mysql/plugin +%dir %{_libdir}/mysql/plugin/debug +%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini + +%if %{WITH_TCMALLOC} +%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target} +%endif + +%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql +%attr(755, root, root) %{_sysconfdir}/init.d/mysql +# %%attr(755, root, root) %%{_datadir}/mysql/ ## Contained in "plugins.files", see "%%install" code +%dir %attr(755, mysql, mysql) /var/lib/mysql +%dir %attr(750, mysql, mysql) /var/lib/mysql-files + +# ---------------------------------------------------------------------------- +%files -n mysql-wsrep-client%{product_suffix} + +%defattr(-, root, root, 0755) +%if %{defined license_files_server} +%doc %{license_files_server} +%endif +%attr(755, root, root) %{_bindir}/msql2mysql +%attr(755, root, root) %{_bindir}/mysql +%attr(755, root, root) %{_bindir}/mysql_find_rows +%attr(755, root, root) %{_bindir}/mysql_waitpid +%attr(755, root, root) %{_bindir}/mysqlaccess +# XXX: This should be moved to %%{_sysconfdir} +%attr(644, root, root) %{_bindir}/mysqlaccess.conf +%attr(755, root, root) %{_bindir}/mysqladmin +%attr(755, root, root) %{_bindir}/mysqlbinlog +%attr(755, root, root) %{_bindir}/mysqlcheck +%attr(755, root, root) %{_bindir}/mysqldump +%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_editor + +%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_waitpid.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlcheck.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_config_editor.1* + +# ---------------------------------------------------------------------------- +%files -n mysql-wsrep-devel%{product_suffix} -f %{src_dir}/optional-files-devel +%defattr(-, root, root, 0755) +%if %{defined license_files_server} +%doc %{license_files_server} +%endif +%doc %attr(644, root, man) %{_mandir}/man1/comp_err.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1* +%attr(755, root, root) %{_bindir}/mysql_config +%dir %attr(755, root, root) %{_includedir}/mysql +%dir %attr(755, root, root) %{_libdir}/mysql +%{_includedir}/mysql/* +%{_datadir}/aclocal/mysql.m4 +%{_libdir}/mysql/libperconaserverclient.a +%{_libdir}/mysql/libperconaserverclient_r.a +%{_libdir}/mysql/libmysqlservices.a + +# ---------------------------------------------------------------------------- +%files -n mysql-wsrep-shared%{product_suffix} +%defattr(-, root, root, 0755) +%if %{defined license_files_server} +%doc %{license_files_server} +%endif +# Shared libraries (omit for architectures that don't support them) +%{_libdir}/libmysql*.so +%{_libdir}/libmysql*.so.%{currentlib}* + +%post -n mysql-wsrep-shared%{product_suffix} +/sbin/ldconfig + +%postun -n mysql-wsrep-shared%{product_suffix} +/sbin/ldconfig + +# ---------------------------------------------------------------------------- +%if 0%{?compatlib} +%files -n mysql-wsrep-libs-compat%{product_suffix} +%defattr(-, root, root, -) +%doc %{?compat_license_files_server} +%dir %attr(755, root, root) %{_libdir}/mysql +%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf +%{_libdir}/mysql/libmysqlclient.so.%{compatlib} +%{_libdir}/mysql/libmysqlclient.so.%{compatlib}.0.0 +%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib} +%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib}.0.0 +%dir %attr(755, root, root) %{_datadir}/mysql/ +%dir %attr(755, root, root) %{_datadir}/mysql/charsets-%{compatver}/ +%attr(644, root, root) %{_datadir}/mysql/charsets-%{compatver}/* + +%post -n mysql-wsrep-libs-compat%{product_suffix} +/sbin/ldconfig + +%postun -n mysql-wsrep-libs-compat%{product_suffix} +/sbin/ldconfig +%endif + +# ---------------------------------------------------------------------------- +%files -n mysql-wsrep-test%{product_suffix} +%defattr(-, root, root, 0755) +%if %{defined license_files_server} +%doc %{license_files_server} +%endif +%attr(-, root, root) %{_datadir}/mysql-test +%attr(755, root, root) %{_bindir}/mysql_client_test +%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql-stress-test.pl.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test_embedded.1* +%doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1* + +############################################################################## +# The spec file changelog only includes changes made to the spec file +# itself - note that they must be ordered by date (important when +# merging BK trees) +############################################################################## +%changelog +* Fri Jun 10 2016 Joerg Bruehe +- 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 +- 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. + This solves issue Github-223. +- Introduce a macro "previous_suffix" and set it to "-5.5", so that installing a + "mysql-wsrep-*-5.6" package will "obsolete" the corresponding "mysql-wsrep-*-5.5" + package. This solves issue Github-224. +- Fix dependency: There is no "libopenssl1-devel", just "libopenssl-devel". + +* Tue Oct 27 2015 Joerg Bruehe +- Add the spec file changes coded in mysql-wsrep 5.5 to create "libs-compat", + visible and documented (Sep 11 - 17) in the 5.5 spec file. + +* Thu Jan 29 2015 Joerg Bruehe +- Add a meta-package "mysql-wsrep" that requires both "server" and "client". +- Fix the fall-back definition of "dist", it must start with a period. + +* Mon Jan 26 2015 Joerg Bruehe +- Allow "rpmlint", but suppress "post-build-checks" (fail on SuSE 12 + 13). +- Improve handling of undefined "%%{dist}". +- Fix wrong changelog dates, to get rid of warnings about "bogus date". +- Escape percent signs in changelog, to get rid of "rpmlint" warnings. + +* Tue Jan 20 2015 Teemu Ollakka + +- Reworked to build wsrep patched packages exclusively +- OBS compatible + +* Mon Oct 06 2014 Balasubramanian Kandasamy +- Add license info in each subpackage + +* Wed May 28 2014 Balasubramanian Kandasamy +- Updated usergroup to mysql on datadir + +* Wed Oct 30 2013 Balasubramanian Kandasamy +- Removed non gpl file docs/mysql.info from community packages + +* Mon Sep 09 2013 Balasubramanian Kandasamy +- Updated logic to get the correct count of PID files + +* Fri Aug 16 2013 Balasubramanian Kandasamy +- Added provides lowercase mysql tags + +* Wed Jun 26 2013 Balasubramanian Kandasamy +- Cleaned up spec file to resolve rpm dependencies. + +* Mon Nov 05 2012 Joerg Bruehe + +- Allow to override the default to use the bundled yaSSL by an option like + --define="with_ssl /path/to/ssl" + +* Wed Oct 10 2012 Bjorn Munch + +- Replace old my-*.cnf config file examples with template my-default.cnf + +* Fri Oct 05 2012 Joerg Bruehe + +- Let the installation use the new option "--random-passwords" of "mysql_install_db". + (Bug# 12794345 Ensure root password) +- Fix an inconsistency: "new install" vs "upgrade" are told from the (non)existence + of "$mysql_datadir/mysql" (holding table "mysql.user" and other system stuff). + +* Tue Jul 24 2012 Joerg Bruehe + +- Add a macro "runselftest": + if set to 1 (default), the test suite will be run during the RPM build; + this can be oveeridden via the command line by adding + --define "runselftest 0" + Failures of the test suite will NOT make the RPM build fail! + +* Mon Jul 16 2012 Joerg Bruehe + +- Add the man page for the "mysql_config_editor". + +* Mon Jun 11 2012 Joerg Bruehe + +- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging. + +* Wed Feb 29 2012 Brajmohan Saxena + +- Removal all traces of the readline library from mysql (BUG 13738013) + +* Wed Sep 28 2011 Joerg Bruehe + +- Fix duplicate mentioning of "mysql_plugin" and its manual page, + it is better to keep alphabetic order in the files list (merging!). + +* Wed Sep 14 2011 Joerg Bruehe + +- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace + the RPMs of any configuration (of the current or the preceding release series) + by the new ones. This is done by not using the implicitly generated capabilities + (which include the configuration name) and relying on more generic ones which + just list the function ("server", "client", ...). + The implicit generation cannot be prevented, so all these capabilities must be + explicitly listed in "Obsoletes:" + +* Tue Sep 13 2011 Jonathan Perkin + +- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6. Due to + changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install) + this necessitated a move of the libmygcc.a installation to the install + phase, which is probably where it belonged in the first place. + +* Tue Sep 13 2011 Joerg Bruehe + +- "make_win_bin_dist" and its manual are dropped, cmake does it different. + +* Thu Sep 08 2011 Daniel Fischer + +- Add mysql_plugin man page. + +* Tue Aug 30 2011 Tor Didriksen + +- Set CXX=g++ by default to add a dependency on libgcc/libstdc++. + Also, remove the use of the -fno-exceptions and -fno-rtti flags. + TODO: update distro_buildreq/distro_requires + +* Tue Aug 30 2011 Joerg Bruehe + +- Add the manual page for "mysql_plugin" to the server package. + +* Fri Aug 19 2011 Joerg Bruehe + +- Null-upmerge the fix of bug#37165: This spec file is not affected. +- Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}". + +* Fri Aug 12 2011 Daniel Fischer + +- Source plugin library files list from cmake-generated file. + +* Mon Jul 25 2011 Chuck Bell + +- Added the mysql_plugin client - enables or disables plugins. + +* Thu Jul 21 2011 Sunanda Menon + +- Fix bug#12561297: Added the MySQL embedded binary + +* Thu Jul 07 2011 Joerg Bruehe + +- Fix bug#45415: "rpm upgrade recreates test database" + Let the creation of the "test" database happen only during a new installation, + not in an RPM upgrade. + This affects both the "mkdir" and the call of "mysql_install_db". + +* Wed Feb 09 2011 Joerg Bruehe + +- 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) + should still work, and use these locations. + The problem was that the fix for bug#27072 did not check for local settings. + +* Mon Jan 31 2011 Joerg Bruehe + +- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN". + +* Tue Nov 23 2010 Jonathan Perkin + +- EXCEPTIONS-CLIENT has been deleted, remove it from here too +- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing + a '-j' argument to make. + +* Mon Nov 1 2010 Georgi Kodinov + +- Added test authentication (WL#1054) plugin binaries + +* Wed Oct 6 2010 Georgi Kodinov + +- Added example external authentication (WL#1054) plugin binaries + +* Wed Aug 11 2010 Joerg Bruehe + +- With a recent spec file cleanup, names have changed: A "-community" part was dropped. + Reflect that in the "Obsoletes" specifications. +- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM. +- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade". + +* Tue Jun 15 2010 Joerg Bruehe + +- Change the behaviour on installation and upgrade: + On installation, do not autostart the server. + *Iff* the server was stopped before the upgrade is started, this is taken as a + sign the administrator is handling that manually, and so the new server will + not be started automatically at the end of the upgrade. + The start/stop scripts will still be installed, so the server will be started + on the next machine boot. + This is the 5.5 version of fixing bug#27072 (RPM autostarting the server). + +* Tue Jun 1 2010 Jonathan Perkin + +- Implement SELinux checks from distribution-specific spec file. + +* Wed May 12 2010 Jonathan Perkin + +- Large number of changes to build using CMake +- Introduce distribution-specific RPMs +- Drop debuginfo, build all binaries with debug/symbols +- Remove __os_install_post, use native macro +- Remove _unpackaged_files_terminate_build, make it an error to have + unpackaged files +- Remove cluster RPMs + +* Wed Mar 24 2010 Joerg Bruehe + +- Add "--with-perfschema" to the configure options. + +* Mon Mar 22 2010 Joerg Bruehe + +- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64", + mask "rmdir" return code 1. +- Remove "ha_example.*" files from the list, they aren't built. + +* Wed Mar 17 2010 Joerg Bruehe + +- Fix a wrong path name in handling the debug plugins. + +* Wed Mar 10 2010 Joerg Bruehe + +- Take the result of the debug plugin build and put it into the optimized tree, + so that it becomes part of the final installation; + include the files in the packlist. Part of the fixes for bug#49022. + +* Mon Mar 01 2010 Joerg Bruehe + +- Set "Oracle and/or its affiliates" as the vendor and copyright owner, + accept upgrading from packages showing MySQL or Sun as vendor. + +* Fri Feb 12 2010 Joerg Bruehe + +- Formatting changes: + Have a consistent structure of separator lines and of indentation + (8 leading blanks => tab). +- Introduce the variable "src_dir". +- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence + over "CC" ("CXX"). +- Drop the old "with_static" argument analysis, this is not supported + in 5.1 since ages. +- Introduce variables to control the handlers individually, as well + as other options. +- Use the new "--with-plugin" notation for the table handlers. +- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql" + was done back in 2002 already. +- Make "--with-zlib-dir=bundled" the default, add an option to disable it. +- Add missing manual pages to the file list. +- Improve the runtime check for "libgcc.a", protect it against being tried + with the Intel compiler "icc". + +* Mon Jan 11 2010 Joerg Bruehe + +- Change RPM file naming: + - Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc". + - Release counts from 1, not 0. + +* Wed Dec 23 2009 Joerg Bruehe + +- The "semisync" plugin file name has lost its introductory "lib", + adapt the file lists for the subpackages. + This is a part missing from the fix for bug#48351. +- Remove the "fix_privilege_tables" manual, it does not exist in 5.5 + (and likely, the whole script will go, too). + +* Mon Nov 16 2009 Joerg Bruehe + +- Fix some problems with the directives around "tcmalloc" (experimental), + remove erroneous traces of the InnoDB plugin (that is 5.1 only). + +* Tue Oct 06 2009 Magnus Blaudd + +- Removed mysql_fix_privilege_tables + +* Fri Oct 02 2009 Alexander Nozdrin + +- "mysqlmanager" got removed from version 5.4, all references deleted. + +* Fri Aug 28 2009 Joerg Bruehe + +- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin. + +* Thu Aug 27 2009 Joerg Bruehe + +- This version does not contain the "Instance manager", "mysqlmanager": + Remove it from the spec file so that packaging succeeds. + +* Mon Aug 24 2009 Jonathan Perkin + +- Add conditionals for bundled zlib and innodb plugin + +* Fri Aug 21 2009 Jonathan Perkin + +- Install plugin libraries in appropriate packages. +- Disable libdaemon_example and ftexample plugins. + +* Thu Aug 20 2009 Jonathan Perkin + +- Update variable used for mysql-test suite location to match source. + +* Fri Nov 07 2008 Joerg Bruehe + +- Correct yesterday's fix, so that it also works for the last flag, + and fix a wrong quoting: un-quoted quote marks must not be escaped. + +* Thu Nov 06 2008 Kent Boortz + +- Removed "mysql_upgrade_shell" +- Removed some copy/paste between debug and normal build + +* Thu Nov 06 2008 Joerg Bruehe + +- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized. + This should cover both gcc and icc flags. Fixes bug#40546. + +* Fri Aug 29 2008 Kent Boortz + +- Removed the "Federated" storage engine option, and enabled in all + +* Tue Aug 26 2008 Joerg Bruehe + +- Get rid of the "warning: Installed (but unpackaged) file(s) found:" + Some generated files aren't needed in RPMs: + - the "sql-bench/" subdirectory + Some files were missing: + - /usr/share/aclocal/mysql.m4 ("devel" subpackage) + - Manual "mysqlbug" ("server" subpackage) + - Program "innochecksum" and its manual ("server" subpackage) + - Manual "mysql_find_rows" ("client" subpackage) + - Script "mysql_upgrade_shell" ("client" subpackage) + - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage) + - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage) + +* Mon Mar 31 2008 Kent Boortz + +- Made the "Federated" storage engine an option +- Made the "Cluster" storage engine and sub packages an option + +* Wed Mar 19 2008 Joerg Bruehe + +- Add the man pages for "ndbd" and "ndb_mgmd". + +* Mon Feb 18 2008 Timothy Smith + +- Require a manual upgrade if the alread-installed mysql-server is + from another vendor, or is of a different major version. + +* Wed May 02 2007 Joerg Bruehe + +- "ndb_size.tmpl" is not needed any more, + "man1/mysql_install_db.1" lacked the trailing '*'. + +* Sat Apr 07 2007 Kent Boortz + +- Removed man page for "mysql_create_system_tables" + +* Wed Mar 21 2007 Daniel Fischer + +- Add debug server. + +* Mon Mar 19 2007 Daniel Fischer + +- Remove Max RPMs; the server RPMs contain a mysqld compiled with all + features that previously only were built into Max. + +* Fri Mar 02 2007 Joerg Bruehe + +- Add several man pages for NDB which are now created. + +* Fri Jan 05 2007 Kent Boortz + +- Put back "libmygcc.a", found no real reason it was removed. + +- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the + correct "libgcc.a" path is returned for the 32/64 bit architecture. + +* Mon Dec 18 2006 Joerg Bruehe + +- Fix the move of "mysqlmanager" to section 8: Directory name was wrong. + +* Thu Dec 14 2006 Joerg Bruehe + +- Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql" + in the server RPM. +- The "mysqlmanager" man page got moved from section 1 to 8. + +* Thu Nov 30 2006 Joerg Bruehe + +- Call "make install" using "benchdir_root=%%{_datadir}", + because that is affecting the regression test suite as well. + +* Thu Nov 16 2006 Joerg Bruehe + +- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) + replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading + (bug#22081). + +* Mon Nov 13 2006 Joerg Bruehe + +- Add "--with-partition" to all server builds. + +- Use "--report-features" in one test run per server build. + +* Tue Aug 15 2006 Joerg Bruehe + +- The "max" server is removed from packages, effective from 5.1.12-beta. + Delete all steps to build, package, or install it. + +* Mon Jul 10 2006 Joerg Bruehe + +- Fix a typing error in the "make" target for the Perl script to run the tests. + +* Tue Jul 04 2006 Joerg Bruehe + +- Use the Perl script to run the tests, because it will automatically check + whether the server is configured with SSL. + +* Tue Jun 27 2006 Joerg Bruehe + +- move "mysqldumpslow" from the client RPM to the server RPM (bug#20216) + +- Revert all previous attempts to call "mysql_upgrade" during RPM upgrade, + there are some more aspects which need to be solved before this is possible. + For now, just ensure the binary "mysql_upgrade" is delivered and installed. + +* Thu Jun 22 2006 Joerg Bruehe + +- Close a gap of the previous version by explicitly using + a newly created temporary directory for the socket to be used + in the "mysql_upgrade" operation, overriding any local setting. + +* Tue Jun 20 2006 Joerg Bruehe + +- To run "mysql_upgrade", we need a running server; + start it in isolation and skip password checks. + +* Sat May 20 2006 Kent Boortz + +- Always compile for PIC, position independent code. + +* Wed May 10 2006 Kent Boortz + +- Use character set "all" when compiling with Cluster, to make Cluster + nodes independent on the character set directory, and the problem + that two RPM sub packages both wants to install this directory. + +* Mon May 01 2006 Kent Boortz + +- Use "./libtool --mode=execute" instead of searching for the + executable in current directory and ".libs". + +* Fri Apr 28 2006 Kent Boortz + +- Install and run "mysql_upgrade" + +* Wed Apr 12 2006 Jim Winstead + +- Remove sql-bench, and MySQL-bench RPM (will be built as an independent + project from the mysql-bench repository) + +* Tue Apr 11 2006 Jim Winstead + +- Remove old mysqltestmanager and related programs +* Sat Apr 01 2006 Kent Boortz + +- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS + +* Tue Mar 07 2006 Kent Boortz + +- Changed product name from "Community Edition" to "Community Server" + +* Mon Mar 06 2006 Kent Boortz + +- Fast mutexes is now disabled by default, but should be + used in Linux builds. + +* Mon Feb 20 2006 Kent Boortz + +- Reintroduced a max build +- Limited testing of 'debug' and 'max' servers +- Berkeley DB only in 'max' + +* Mon Feb 13 2006 Joerg Bruehe + +- Use "-i" on "make test-force"; + this is essential for later evaluation of this log file. + +* Thu Feb 09 2006 Kent Boortz + +- Pass '-static' to libtool, link static with our own libraries, dynamic + with system libraries. Link with the bundled zlib. + +* Wed Feb 08 2006 Kristian Nielsen + +- Modified RPM spec to match new 5.1 debug+max combined community packaging. + +* Sun Dec 18 2005 Kent Boortz + +- Added "client/mysqlslap" + +* Mon Dec 12 2005 Rodrigo Novo + +- Added zlib to the list of (static) libraries installed +- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld) +- Compile MySQL with bundled zlib +- Fixed %%packager name to "MySQL Production Engineering Team" + +* Mon Dec 05 2005 Joerg Bruehe + +- Avoid using the "bundled" zlib on "shared" builds: + As it is not installed (on the build system), this gives dependency + problems with "libtool" causing the build to fail. + (Change was done on Nov 11, but left uncommented.) + +* Tue Nov 22 2005 Joerg Bruehe + +- Extend the file existence check for "init.d/mysql" on un-install + to also guard the call to "insserv"/"chkconfig". + +* Thu Oct 27 2005 Lenz Grimmer + +- added more man pages + +* Wed Oct 19 2005 Kent Boortz + +- Made yaSSL support an option (off by default) + +* Wed Oct 19 2005 Kent Boortz + +- Enabled yaSSL support + +* Sat Oct 15 2005 Kent Boortz + +- Give mode arguments the same way in all places +- Moved copy of mysqld.a to "standard" build, but + disabled it as we don't do embedded yet in 5.0 + +* Fri Oct 14 2005 Kent Boortz + +- For 5.x, always compile with --with-big-tables +- Copy the config.log file to location outside + the build tree + +* Fri Oct 14 2005 Kent Boortz + +- Removed unneeded/obsolete configure options +- Added archive engine to standard server +- Removed the embedded server from experimental server +- Changed suffix "-Max" => "-max" +- Changed comment string "Max" => "Experimental" + +* Thu Oct 13 2005 Lenz Grimmer + +- added a usermod call to assign a potential existing mysql user to the + correct user group (BUG#12823) +- Save the perror binary built during Max build so it supports the NDB + error codes (BUG#13740) +- added a separate macro "mysqld_group" to be able to define the + user group of the mysql user seperately, if desired. + +* Thu Sep 29 2005 Lenz Grimmer + +- fixed the removing of the RPM_BUILD_ROOT in the %%clean section (the + $RBR variable did not get expanded, thus leaving old build roots behind) + +* Thu Aug 04 2005 Lenz Grimmer + +- Fixed the creation of the mysql user group account in the postinstall + section (BUG 12348) +- Fixed enabling the Archive storage engine in the Max binary + +* Tue Aug 02 2005 Lenz Grimmer + +- Fixed the Requires: tag for the server RPM (BUG 12233) + +* Fri Jul 15 2005 Lenz Grimmer + +- create a "mysql" user group and assign the mysql user account to that group + in the server postinstall section. (BUG 10984) + +* Tue Jun 14 2005 Lenz Grimmer + +- Do not build statically on i386 by default, only when adding either "--with + static" or "--define '_with_static 1'" to the RPM build options. Static + linking really only makes sense when linking against the specially patched + glibc 2.2.5. + +* Mon Jun 06 2005 Lenz Grimmer + +- added mysql_client_test to the "bench" subpackage (BUG 10676) +- added the libndbclient static and shared libraries (BUG 10676) + +* Wed Jun 01 2005 Lenz Grimmer + +- use "mysqldatadir" variable instead of hard-coding the path multiple times +- use the "mysqld_user" variable on all occasions a user name is referenced +- removed (incomplete) Brazilian translations +- removed redundant release tags from the subpackage descriptions + +* Wed May 25 2005 Joerg Bruehe + +- Added a "make clean" between separate calls to "BuildMySQL". + +* Thu May 12 2005 Guilhem Bichot + +- Removed the mysql_tableinfo script made obsolete by the information schema + +* Wed Apr 20 2005 Lenz Grimmer + +- Enabled the "blackhole" storage engine for the Max RPM + +* Wed Apr 13 2005 Lenz Grimmer + +- removed the MySQL manual files (html/ps/texi) - they have been removed + from the MySQL sources and are now available seperately. + +* Mon Apr 4 2005 Petr Chardin + +- old mysqlmanager, mysqlmanagerc and mysqlmanager-pwger renamed into + mysqltestmanager, mysqltestmanager and mysqltestmanager-pwgen respectively + +* Fri Mar 18 2005 Lenz Grimmer + +- Disabled RAID in the Max binaries once and for all (it has finally been + removed from the source tree) + +* Sun Feb 20 2005 Petr Chardin + +- Install MySQL Instance Manager together with mysqld, touch mysqlmanager + password file + +* Mon Feb 14 2005 Lenz Grimmer + +- Fixed the compilation comments and moved them into the separate build sections + for Max and Standard + +* Mon Feb 7 2005 Tomas Ulin + +- enabled the "Ndbcluster" storage engine for the max binary +- added extra make install in ndb subdir after Max build to get ndb binaries +- added packages for ndbcluster storage engine + +* Fri Jan 14 2005 Lenz Grimmer + +- replaced obsoleted "BuildPrereq" with "BuildRequires" instead + +* Thu Jan 13 2005 Lenz Grimmer + +- enabled the "Federated" storage engine for the max binary + +* Tue Jan 04 2005 Petr Chardin + +- ISAM and merge storage engines were purged. As well as appropriate + tools and manpages (isamchk and isamlog) + +* Fri Dec 31 2004 Lenz Grimmer + +- enabled the "Archive" storage engine for the max binary +- enabled the "CSV" storage engine for the max binary +- enabled the "Example" storage engine for the max binary + +* Thu Aug 26 2004 Lenz Grimmer + +- MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860) + +* Fri Aug 20 2004 Lenz Grimmer + +- do not link statically on IA64/AMD64 as these systems do not have + a patched glibc installed + +* Tue Aug 10 2004 Lenz Grimmer + +- Added libmygcc.a to the devel subpackage (required to link applications + against the the embedded server libmysqld.a) (BUG 4921) + +* Mon Aug 09 2004 Lenz Grimmer + +- Added EXCEPTIONS-CLIENT to the "devel" package + +* Thu Jul 29 2004 Lenz Grimmer + +- disabled OpenSSL in the Max binaries again (the RPM packages were the + only exception to this anyway) (BUG 1043) + +* Wed Jun 30 2004 Lenz Grimmer + +- fixed server postinstall (mysql_install_db was called with the wrong + parameter) + +* Thu Jun 24 2004 Lenz Grimmer + +- added mysql_tzinfo_to_sql to the server subpackage +- run "make clean" instead of "make distclean" + +* Mon Apr 05 2004 Lenz Grimmer + +- added ncurses-devel to the build prerequisites (BUG 3377) + +* Thu Feb 12 2004 Lenz Grimmer + +- when using gcc, _always_ use CXX=gcc +- replaced Copyright with License field (Copyright is obsolete) + +* Tue Feb 03 2004 Lenz Grimmer + +- added myisam_ftdump to the Server package + +* Tue Jan 13 2004 Lenz Grimmer + +- link the mysql client against libreadline instead of libedit (BUG 2289) + +* Mon Dec 22 2003 Lenz Grimmer + +- marked /etc/logrotate.d/mysql as a config file (BUG 2156) + +* Sat Dec 13 2003 Lenz Grimmer + +- fixed file permissions (BUG 1672) + +* Thu Dec 11 2003 Lenz Grimmer + +- made testing for gcc3 a bit more robust + +* Fri Dec 05 2003 Lenz Grimmer + +- added missing file mysql_create_system_tables to the server subpackage + +* Fri Nov 21 2003 Lenz Grimmer + +- removed dependency on MySQL-client from the MySQL-devel subpackage + as it is not really required. (BUG 1610) + +* Fri Aug 29 2003 Lenz Grimmer + +- Fixed BUG 1162 (removed macro names from the changelog) +- Really fixed BUG 998 (disable the checking for installed but + unpackaged files) + +* Tue Aug 05 2003 Lenz Grimmer + +- Fixed BUG 959 (libmysqld not being compiled properly) +- Fixed BUG 998 (RPM build errors): added missing files to the + distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow, + mysql_fix_privilege_tables.1), removed "-n" from install section. + +* Wed Jul 09 2003 Lenz Grimmer + +- removed the GIF Icon (file was not included in the sources anyway) +- removed unused variable shared_lib_version +- do not run automake before building the standard binary + (should not be necessary) +- add server suffix '-standard' to standard binary (to be in line + with the binary tarball distributions) +- Use more RPM macros (_exec_prefix, _sbindir, _libdir, _sysconfdir, + _datadir, _includedir) throughout the spec file. +- allow overriding CC and CXX (required when building with other compilers) + +* Fri May 16 2003 Lenz Grimmer + +- re-enabled RAID again + +* Wed Apr 30 2003 Lenz Grimmer + +- disabled MyISAM RAID (--with-raid) - it throws an assertion which + needs to be investigated first. + +* Mon Mar 10 2003 Lenz Grimmer + +- added missing file mysql_secure_installation to server subpackage + (BUG 141) + +* Tue Feb 11 2003 Lenz Grimmer + +- re-added missing pre- and post(un)install scripts to server subpackage +- added config file /etc/my.cnf to the file list (just for completeness) +- make sure to create the datadir with 755 permissions + +* Mon Jan 27 2003 Lenz Grimmer + +- removed unused CC and CXX variables +- CFLAGS and CXXFLAGS should honor RPM_OPT_FLAGS + +* Fri Jan 24 2003 Lenz Grimmer + +- renamed package "MySQL" to "MySQL-server" +- fixed Copyright tag +- added mysql_waitpid to client subpackage (required for mysql-test-run) + +* Wed Nov 27 2002 Lenz Grimmer + +- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of + Linux distributions now support this scheme as proposed by the LSB either + directly or via a compatibility symlink) +- Use new "restart" init script action instead of starting and stopping + separately +- Be more flexible in activating the automatic bootup - use insserv (on + older SuSE versions) or chkconfig (Red Hat, newer SuSE versions and + others) to create the respective symlinks + +* Wed Sep 25 2002 Lenz Grimmer + +- MySQL-Max now requires MySQL >= 4.0 to avoid version mismatches + (mixing 3.23 and 4.0 packages) + +* Fri Aug 09 2002 Lenz Grimmer + +- Turn off OpenSSL in MySQL-Max for now until it works properly again +- enable RAID for the Max binary instead +- added compatibility link: safe_mysqld -> mysqld_safe to ease the + transition from 3.23 + +* Thu Jul 18 2002 Lenz Grimmer + +- Reworked the build steps a little bit: the Max binary is supposed + to include OpenSSL, which cannot be linked statically, thus trying + to statically link against a special glibc is futile anyway +- because of this, it is not required to make yet another build run + just to compile the shared libs (saves a lot of time) +- updated package description of the Max subpackage +- clean up the BuildRoot directory afterwards + +* Mon Jul 15 2002 Lenz Grimmer + +- Updated Packager information +- Fixed the build options: the regular package is supposed to + include InnoDB and linked statically, while the Max package + should include BDB and SSL support + +* Fri May 03 2002 Lenz Grimmer + +- Use more RPM macros (e.g. infodir, mandir) to make the spec + file more portable +- reorganized the installation of documentation files: let RPM + take care of this +- reorganized the file list: actually install man pages along + with the binaries of the respective subpackage +- do not include libmysqld.a in the devel subpackage as well, if we + have a special "embedded" subpackage +- reworked the package descriptions + +* Mon Oct 8 2001 Monty + +- Added embedded server as a separate RPM + +* Fri Apr 13 2001 Monty + +- Added mysqld-max to the distribution + +* Tue Jan 2 2001 Monty + +- Added mysql-test to the bench package + +* Fri Aug 18 2000 Tim Smith + +- Added separate libmysql_r directory; now both a threaded + and non-threaded library is shipped. + +* Tue Sep 28 1999 David Axmark + +- Added the support-files/my-example.cnf to the docs directory. + +- Removed devel dependency on base since it is about client + development. + +* Wed Sep 8 1999 David Axmark + +- Cleaned up some for 3.23. + +* Thu Jul 1 1999 David Axmark + +- Added support for shared libraries in a separate sub + package. Original fix by David Fox (dsfox@cogsci.ucsd.edu) + +- The --enable-assembler switch is now automatically disables on + platforms there assembler code is unavailable. This should allow + building this RPM on non i386 systems. + +* Mon Feb 22 1999 David Axmark + +- Removed unportable cc switches from the spec file. The defaults can + now be overridden with environment variables. This feature is used + to compile the official RPM with optimal (but compiler version + specific) switches. + +- Removed the repetitive description parts for the sub rpms. Maybe add + again if RPM gets a multiline macro capability. + +- Added support for a pt_BR translation. Translation contributed by + Jorge Godoy . + +* Wed Nov 4 1998 David Axmark + +- A lot of changes in all the rpm and install scripts. This may even + be a working RPM :-) + +* Sun Aug 16 1998 David Axmark + +- A developers changelog for MySQL is available in the source RPM. And + there is a history of major user visible changed in the Reference + Manual. Only RPM specific changes will be documented here. diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/tests/mysql_client_test.c percona-xtradb-cluster-5.6-5.6.37-26.21/tests/mysql_client_test.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/tests/mysql_client_test.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/tests/mysql_client_test.c 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -6301,7 +6301,7 @@ /* Check values. */ DIE_UNLESS(bigint == 20011020101100LL); DIE_UNLESS(real == 20011020101059.5); - DIE_UNLESS(!strcmp(dec, "20011020101059.5")); + DIE_UNLESS(!strcmp(dec, "20011020101059.500000")); mysql_stmt_close(stmt); @@ -6345,7 +6345,7 @@ /* Check returned values */ DIE_UNLESS(bigint == 101100); DIE_UNLESS(real == 101059.5); - DIE_UNLESS(!strcmp(dec, "101059.5")); + DIE_UNLESS(!strcmp(dec, "101059.500000")); mysql_stmt_close(stmt); } @@ -14256,14 +14256,6 @@ 3: check that cursors to InnoDB tables are closed (for now) by COMMIT/ROLLBACK. */ - if (! have_innodb) - { - if (!opt_silent) - printf("Testing that cursors are closed at COMMIT/ROLLBACK requires " - "InnoDB.\n"); - } - else - { stmt_text= "select id from t1 order by 1"; rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); @@ -14292,7 +14284,6 @@ if (!opt_silent) printf("Got error (as expected): %s\n", mysql_error(mysql)); #endif - } mysql_stmt_close(stmt); rc= mysql_query(mysql, "drop table t1"); @@ -14680,13 +14671,6 @@ myheader("test_bug12243"); - if (! have_innodb) - { - if (!opt_silent) - printf("This test requires InnoDB.\n"); - return; - } - /* create tables */ mysql_query(mysql, "drop table if exists t1"); mysql_query(mysql, "create table t1 (a int) engine=InnoDB"); @@ -19573,6 +19557,96 @@ myquery(rc); } +/** + BUG#19894382 - SERVER SIDE PREPARED STATEMENTS LEADS TO POTENTIAL OFF-BY-SECOND + TIMESTAMP ON SLAVE +*/ +static void test_bug19894382() +{ + MYSQL_STMT *stmt1; + const char *stmt1_txt= "INSERT INTO client_test_db.bug19894382 VALUES" + " ('master', ?, ?, ?, ?, ?, ?);"; + my_bool is_null= 0; + MYSQL_BIND bind_val[6]; + MYSQL_TIME tm[6]; + MYSQL_TIME tm_common; + ulong length= sizeof(MYSQL_TIME); + int ind; + int rc; + + myheader("test_bug19894382"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS client_test_db.bug19894382;"); + myquery(rc); + rc= mysql_query(mysql, "CREATE TABLE client_test_db.bug19894382(f1 CHAR(64)," + " f2 TIME, f3 TIMESTAMP NULL, f4 DATETIME," + " f5 TIME(3), f6 TIMESTAMP(3) NULL," + " f7 DATETIME(3));"); + myquery(rc); + + stmt1 = mysql_stmt_init(mysql); + check_stmt(stmt1); + + // Prepare statement + rc= mysql_stmt_prepare(stmt1, stmt1_txt, strlen(stmt1_txt)); + check_execute(stmt1, rc); + + // Prepare and bind values. + tm_common.year= 2015; + tm_common.month= 4; + tm_common.day= 24; + tm_common.hour= 7; + tm_common.minute= 30; + tm_common.second= 30; + tm_common.second_part= 5010; + tm_common.neg= 0; + tm_common.time_type= MYSQL_TIMESTAMP_NONE; + + memset(bind_val, 0, sizeof(MYSQL_BIND) * 6); + for (ind= 0; ind < 6; ind++) + { + tm[ind]= tm_common; + bind_val[ind].buffer= (void *) &tm[ind]; + bind_val[ind].is_null= &is_null; + bind_val[ind].length= &length; + bind_val[ind].buffer_length= sizeof(MYSQL_TIME); + switch(ind%3) + { + case 0: + tm[ind].year= tm[ind].month= tm[ind].day= 0; + bind_val[ind].buffer_type= MYSQL_TYPE_TIME; + tm[ind].time_type= MYSQL_TIMESTAMP_TIME; + break; + case 1: + bind_val[ind].buffer_type= MYSQL_TYPE_TIMESTAMP; + tm[ind].time_type= MYSQL_TIMESTAMP_DATETIME; + break; + case 2: + bind_val[ind].buffer_type= MYSQL_TYPE_DATETIME; + tm[ind].time_type= MYSQL_TIMESTAMP_DATETIME; + break; + } + } + rc= mysql_stmt_bind_param(stmt1, bind_val); + check_execute(stmt1, rc); + + /* Execute the insert statement */ + rc= mysql_stmt_execute(stmt1); + check_execute(stmt1, rc); + for (ind= 0; ind < 6; ind++) + { + tm[ind].second_part= 501900; + } + /* Execute the insert statement */ + rc= mysql_stmt_execute(stmt1); + check_execute(stmt1, rc); + + rc= mysql_commit(mysql); + myquery(rc); + + mysql_stmt_close(stmt1); +} + static struct my_tests_st my_tests[]= { { "disable_query_logs", disable_query_logs }, { "test_view_sp_list_fields", test_view_sp_list_fields }, @@ -19851,6 +19925,7 @@ { "test_bug20810928", test_bug20810928 }, { "test_bug17883203", test_bug17883203 }, { "test_bug22559575", test_bug22559575 }, + { "test_bug19894382", test_bug19894382 }, { 0, 0 } }; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/bounded_queue-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/bounded_queue-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/bounded_queue-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/bounded_queue-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -21,6 +21,7 @@ #include "bounded_queue.h" #include "filesort_utils.h" +#include "thread_utils.h" #include "my_sys.h" namespace bounded_queue_unittest { @@ -160,7 +161,7 @@ { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; Test_element foo= 1; - EXPECT_DEATH_IF_SUPPORTED(m_queue.push(&foo), + MY_EXPECT_DEATH_IF_SUPPORTED(m_queue.push(&foo), ".*Assertion .*is_initialized.*"); } @@ -173,7 +174,7 @@ m_key_size, &test_keymaker, NULL, m_keys.key_ptrs)); ::testing::FLAGS_gtest_death_test_style = "threadsafe"; - EXPECT_DEATH_IF_SUPPORTED(m_queue.pop(), + MY_EXPECT_DEATH_IF_SUPPORTED(m_queue.pop(), ".*Assertion .*elements > 0.*"); } #endif // !defined(DBUG_OFF) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/bounds_checked_array-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/bounds_checked_array-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/bounds_checked_array-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/bounds_checked_array-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -16,6 +16,7 @@ // First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include +#include "thread_utils.h" #include "sql_array.h" @@ -78,7 +79,7 @@ { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; int_array= Int_array(c_array, 2); - EXPECT_DEATH_IF_SUPPORTED(some_integer= int_array[5], + MY_EXPECT_DEATH_IF_SUPPORTED(some_integer= int_array[5], ".*Assertion .*n < m_size.*"); } @@ -86,7 +87,7 @@ { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; int_array= Int_array(c_array, 2); - EXPECT_DEATH_IF_SUPPORTED(int_array[5]= some_integer, + MY_EXPECT_DEATH_IF_SUPPORTED(int_array[5]= some_integer, ".*Assertion .*n < m_size.*"); } @@ -95,7 +96,7 @@ ::testing::FLAGS_gtest_death_test_style = "threadsafe"; int_array= Int_array(c_array, 1); int_array.pop_front(); - EXPECT_DEATH_IF_SUPPORTED(int_array.pop_front(), + MY_EXPECT_DEATH_IF_SUPPORTED(int_array.pop_front(), ".*Assertion .*m_size > 0.*"); } @@ -103,7 +104,7 @@ { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; int_array= Int_array(c_array, 1); - EXPECT_DEATH_IF_SUPPORTED(int_array.resize(2), + MY_EXPECT_DEATH_IF_SUPPORTED(int_array.resize(2), ".*Assertion .*new_size <= m_size.*"); } @@ -113,7 +114,7 @@ int_array= Int_array(c_array, 2); int_array[1]= some_integer; int_array.resize(1); - EXPECT_DEATH_IF_SUPPORTED(int_array[1]= some_integer, + MY_EXPECT_DEATH_IF_SUPPORTED(int_array[1]= some_integer, ".*Assertion .*n < m_size.*"); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/CMakeLists.txt percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/CMakeLists.txt --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/CMakeLists.txt 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/CMakeLists.txt 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -# 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 @@ -13,35 +13,45 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# We want gmock-1.6.0.zip in order to build these unit tests. +# We want release-1.8.0.zip in order to build these unit tests. # If you have already downloaded it, -# invoke cmake with -DWITH_GMOCK=/path/to/gmock-1.6.0.zip +# invoke cmake with -DWITH_GMOCK=/path/to/release-1.8.0.zip # or -DWITH_GMOCK=/path/to # # Alternatively, set an environment variable -# export WITH_GMOCK=/path/to/gmock-1.6.0.zip +# export WITH_GMOCK=/path/to/release-1.8.0.zip # # You can also do cmake -DENABLE_DOWNLOADS=1 -# and we will download it from http://googlemock.googlecode.com +# and we will download it from https://github.com/google/googletest/archive/ # # Either way: we will unpack the zip, compile gmock-all.cc and gtest-all.cc # and link them into the executables. -# Where to download and build gmock/gtest. +# Disable googletest for Solaris Studio < 12.4 since it doesn't compile. +IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") + IF(${CC_MINOR_VERSION} LESS 13) + MESSAGE(WARNING "Googletest requires Solaris Studio 12.4 or newer.") + UNSET(GMOCK_FOUND) + UNSET(GMOCK_FOUND CACHE) + RETURN() + ENDIF() +ENDIF() + +# Default location for where to download and build gmock/gtest. IF(NOT DOWNLOAD_ROOT) SET(DOWNLOAD_ROOT ${CMAKE_SOURCE_DIR}/source_downloads) ENDIF() -IF(NOT EXISTS DOWNLOAD_ROOT) - MAKE_DIRECTORY(${DOWNLOAD_ROOT}) -ENDIF() -# We want googlemock version 1.6, which also contains googletest. -SET(GMOCK_PACKAGE_NAME "gmock-1.6.0") -SET(GMOCK_SOURCE_DIR ${DOWNLOAD_ROOT}/${GMOCK_PACKAGE_NAME}) -SET(GTEST_SOURCE_DIR ${DOWNLOAD_ROOT}/${GMOCK_PACKAGE_NAME}/gtest) +# We want googletest version 1.8, which also contains googlemock. +SET(GMOCK_PACKAGE_NAME "release-1.8.0") IF (DEFINED ENV{WITH_GMOCK} AND NOT DEFINED WITH_GMOCK) - SET(WITH_GMOCK "$ENV{WITH_GMOCK}") + FILE(TO_CMAKE_PATH "$ENV{WITH_GMOCK}" WITH_GMOCK) +ENDIF() + +IF(LOCAL_GMOCK_ZIP + AND NOT ${LOCAL_GMOCK_ZIP} MATCHES ".*${GMOCK_PACKAGE_NAME}\\.zip") + SET(LOCAL_GMOCK_ZIP 0) ENDIF() IF (WITH_GMOCK) @@ -54,21 +64,37 @@ PATHS ${GMOCK_DIR} NO_DEFAULT_PATH ) + ELSE() + ## Did we get a path name to the directory of the .zip file? + ## Check for both release-x.y.z.zip and googletest-release-x.y.z.zip + FIND_FILE(LOCAL_GMOCK_ZIP + NAMES "${GMOCK_PACKAGE_NAME}.zip" "googletest-${GMOCK_PACKAGE_NAME}.zip" + PATHS ${WITH_GMOCK} + NO_DEFAULT_PATH + ) + ## If WITH_GMOCK is a directory, use it for download. + SET(DOWNLOAD_ROOT ${WITH_GMOCK}) ENDIF() - ## Did we get a path name to the directory of the .zip file? - FIND_FILE(LOCAL_GMOCK_ZIP - NAMES "${GMOCK_PACKAGE_NAME}.zip" - PATHS ${WITH_GMOCK} - NO_DEFAULT_PATH - ) MESSAGE(STATUS "Local gmock zip ${LOCAL_GMOCK_ZIP}") ENDIF() +IF(NOT EXISTS DOWNLOAD_ROOT) + MAKE_DIRECTORY(${DOWNLOAD_ROOT}) +ENDIF() +SET(GMOCK_SOURCE_DIR ${DOWNLOAD_ROOT}/googletest-${GMOCK_PACKAGE_NAME}/googlemock) +SET(GTEST_SOURCE_DIR ${DOWNLOAD_ROOT}/googletest-${GMOCK_PACKAGE_NAME}/googletest) + # We may have downloaded gmock/gtest already, building in a different directory. -IF(EXISTS ${GMOCK_SOURCE_DIR}) +IF(EXISTS ${GMOCK_SOURCE_DIR} OR EXISTS ${LOCAL_GMOCK_ZIP}) MESSAGE(STATUS "GMOCK_SOURCE_DIR:${GMOCK_SOURCE_DIR}") SET(GMOCK_DOWNLOADED 1 CACHE INTERNAL "") SET(GMOCK_FOUND 1 CACHE INTERNAL "") +# If source dir does not exist, reset dependent variables (might be set from before). +ELSE() + SET(LOCAL_GMOCK_ZIP 0 CACHE INTERNAL "") + SET(GMOCK_DOWNLOADED 0 CACHE INTERNAL "") + SET(GMOCK_FOUND 0 CACHE INTERNAL "") + SET(GMOCK_INCLUDE_DIRS 0 CACHE INTERNAL "") ENDIF() @@ -86,37 +112,34 @@ OPTION(ENABLE_DOWNLOADS - "Download and build 3rd party source code components, e.g. google mock" + "Download and build 3rd party source code components, e.g. googletest" OFF) # While experimenting, use local URL rather than google. -SET(GMOCK_TARBALL "${GMOCK_PACKAGE_NAME}.zip") +SET(GMOCK_TARBALL "googletest-${GMOCK_PACKAGE_NAME}.zip") SET(GMOCK_DOWNLOAD_URL - "http://googlemock.googlecode.com/files/${GMOCK_TARBALL}" + "https://github.com/google/googletest/archive/${GMOCK_PACKAGE_NAME}.zip" ) MACRO(HTTP_PROXY_HINT) MESSAGE(STATUS - "If you are inside a firewall, you may need to use an http proxy: " - "export http_proxy=http://example.com:80") + "If you are inside a firewall, you may need to use an https proxy: " + "export https_proxy=http://example.com:80") ENDMACRO() IF(NOT GMOCK_FOUND) IF(NOT ENABLE_DOWNLOADS) - # Give one-time warning - IF(NOT ONETIME_GTEST_WARNING) - MESSAGE(STATUS - "Googlemock was not found. gtest-based unit tests will be disabled. " - "You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download " - "and build required components from source.") - HTTP_PROXY_HINT() - SET(ONETIME_GTEST_WARNING 1 CACHE INTERNAL "") - ENDIF() + # Give warning + MESSAGE(STATUS + "Googletest was not found. gtest-based unit tests will be disabled. " + "You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download " + "and build required components from source.") + HTTP_PROXY_HINT() RETURN() ENDIF() - # Download gmock source + # Download googletest source IF(NOT EXISTS ${GMOCK_SOURCE_DIR}) IF(NOT EXISTS ${DOWNLOAD_ROOT}/${GMOCK_TARBALL}) # Download the tarball @@ -136,7 +159,7 @@ "Successfully downloaded ${GMOCK_DOWNLOAD_URL} to ${DOWNLOAD_ROOT}") ELSE() MESSAGE(STATUS - "To enable google test, please download ${GMOCK_DOWNLOAD_URL} " + "To enable googletest, please download ${GMOCK_DOWNLOAD_URL} " "to the directory ${DOWNLOAD_ROOT}") HTTP_PROXY_HINT() RETURN() diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/dbug-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/dbug-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/dbug-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/dbug-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* 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 @@ -36,7 +36,7 @@ TEST(DebugDeathTest, Suicide) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; - EXPECT_DEATH_IF_SUPPORTED(DBUG_SUICIDE(), ""); + MY_EXPECT_DEATH_IF_SUPPORTED(DBUG_SUICIDE(), ""); } #endif @@ -80,23 +80,19 @@ int y= 0; // This DBUG_PRINT args should never be evaluated. - DBUG_PRINT("never",("%d",1/y)); + DBUG_PRINT("never",("%d", y+= 1)); + EXPECT_EQ(y, 0) << "DBUG_PRINT arg is evaluated."; } -TEST(DebugPrintDeathTest, PrintEval) +TEST(DebugPrintEvalTest, PrintEval) { int y= 0; - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; - DBUG_SET("+d,never"); - /* - The DBUG_PRINT would be evaluated resulting in floating point exception - killing the server. - */ - EXPECT_DEATH_IF_SUPPORTED(DBUG_PRINT("never",("%d",1/y)), ""); + DBUG_PRINT("never",("%d", y+= 1)); DBUG_SET(""); + EXPECT_GE(y, 1) << "DBUG_PRINT arg is not evaluated."; } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/fake_table.h percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/fake_table.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/fake_table.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/fake_table.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -58,7 +58,7 @@ write_set= &write_set_struct; read_set= NULL; next_number_field= NULL; // No autoinc column - + pos_in_table_list= NULL; EXPECT_EQ(0, bitmap_init(write_set, &write_set_buf, s->fields, false)); static const char *table_name= "Fake"; diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/field-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/field-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/field-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/field-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -369,7 +369,7 @@ 1, // packlength_arg tl, // typelib_arg &my_charset_latin1); // charset_arg - f->table= new Fake_TABLE(f); + f->table= ::new Fake_TABLE(f); return f; } @@ -400,8 +400,8 @@ // Copy_field DTOR is not invoked in all contexts, so we may leak memory. EXPECT_FALSE(cf->tmp.is_alloced()); - delete f_to->table; - delete f_from->table; + ::delete static_cast(f_to->table); + ::delete static_cast(f_from->table); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/get_diagnostics-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/get_diagnostics-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/get_diagnostics-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/get_diagnostics-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -170,7 +170,7 @@ info->set_which_da(Diagnostics_information::CURRENT_AREA); cmd= new (mem_root) Sql_cmd_get_diagnostics(info); - EXPECT_DEATH(cmd->execute(thd()), ".*Assertion.*srp.*"); + MY_EXPECT_DEATH(cmd->execute(thd()), ".*Assertion.*srp.*"); } #endif // GTEST_HAS_DEATH_TEST && !defined(DBUG_OFF) diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/mdl-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/mdl-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/mdl-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/mdl-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -266,7 +266,7 @@ MDL_TRANSACTION); EXPECT_FALSE(m_mdl_context.try_acquire_lock(&m_request)); - EXPECT_DEATH(m_mdl_context.destroy(), + MY_EXPECT_DEATH(m_mdl_context.destroy(), ".*Assertion.*MDL_TRANSACTION.*is_empty.*"); m_mdl_context.release_transactional_locks(); } @@ -1620,16 +1620,16 @@ "0123456789012345678901234567890123456789012345678901234567890123" "0123456789"; - EXPECT_DEATH(MDL_key key0(MDL_key::TABLE, too_long_name, ""), + MY_EXPECT_DEATH(MDL_key key0(MDL_key::TABLE, too_long_name, ""), ".*Assertion.*strlen.*"); - EXPECT_DEATH(MDL_key key1(MDL_key::TABLE, "", too_long_name), + MY_EXPECT_DEATH(MDL_key key1(MDL_key::TABLE, "", too_long_name), ".*Assertion.*strlen.*"); MDL_key key2; - EXPECT_DEATH(key2.mdl_key_init(MDL_key::TABLE, too_long_name, ""), + MY_EXPECT_DEATH(key2.mdl_key_init(MDL_key::TABLE, too_long_name, ""), ".*Assertion.*strlen.*"); - EXPECT_DEATH(key2.mdl_key_init(MDL_key::TABLE, "", too_long_name), + MY_EXPECT_DEATH(key2.mdl_key_init(MDL_key::TABLE, "", too_long_name), ".*Assertion.*strlen.*"); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/mock_field_timestampf.h percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/mock_field_timestampf.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/mock_field_timestampf.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/mock_field_timestampf.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ uchar null_byte; void initialize() { - table = new Fake_TABLE(this); + table = ::new Fake_TABLE(this); EXPECT_FALSE(table == NULL) << "Out of memory"; ptr= buffer; memset(buffer, 0, PACK_LENGTH); @@ -65,7 +65,7 @@ return Field_timestampf::store_timestamp_internal(tm); } - ~Mock_field_timestampf() { delete table; } + ~Mock_field_timestampf() { ::delete static_cast(table); } }; #endif // MOCK_FIELD_TIMESTAMPF_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/mock_field_timestamp.h percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/mock_field_timestamp.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/mock_field_timestamp.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/mock_field_timestamp.h 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ uchar null_byte; void initialize() { - table = new Fake_TABLE(this); + table = ::new Fake_TABLE(this); EXPECT_FALSE(table == NULL) << "Out of memory"; ptr= buffer; memset(buffer, 0, PACK_LENGTH); @@ -81,7 +81,7 @@ store_timestamp_called= true; } - ~Mock_field_timestamp() { delete table; } + ~Mock_field_timestamp() { ::delete static_cast(table); } }; #endif // MOCK_FIELD_TIMESTAMP_H diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/segfault-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/segfault-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/segfault-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/segfault-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,9 +44,9 @@ TEST_F(FatalSignalDeathTest, Abort) { #if defined(__WIN__) - EXPECT_DEATH_IF_SUPPORTED(abort(), ".* UTC - mysqld got exception.*"); + MY_EXPECT_DEATH_IF_SUPPORTED(abort(), ".* UTC - mysqld got exception.*"); #else - EXPECT_DEATH_IF_SUPPORTED(abort(), ".* UTC - mysqld got signal 6.*"); + MY_EXPECT_DEATH_IF_SUPPORTED(abort(), ".* UTC - mysqld got signal 6.*"); #endif } @@ -60,16 +60,16 @@ caught by handle_fatal_signal(). We get an empty error message from the gtest library instead. */ - EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ""); + MY_EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ""); #elif defined(__SANITIZE_ADDRESS__) - /* gcc 4.8.1 with '-fsanitize=address -O1' */ - EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ".*ASAN:SIGSEGV.*"); + /* AddressSanitizer */ + MY_EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ".*ASAN:(DEADLYSIGNAL|SIGSEGV).*"); #else /* On most platforms we get SIGSEGV == 11, but SIGBUS == 10 is also possible. And on Mac OsX we can get SIGILL == 4 (but only in optmized mode). */ - EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ".* UTC - mysqld got signal .*"); + MY_EXPECT_DEATH_IF_SUPPORTED(*pint= 42, ".* UTC - mysqld got signal .*"); #endif } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/string-tests.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/string-tests.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/string-tests.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/string-tests.cc 2017-10-19 04:25:29.000000000 +0000 @@ -52,7 +52,7 @@ tbl_name.append(String(table_name, system_charset_info)); // We now have eight characters, c_ptr() is not safe. #ifndef DBUG_OFF - EXPECT_DEATH_IF_SUPPORTED(tbl_name.c_ptr(), ".*Alloced_length >= .*"); + MY_EXPECT_DEATH_IF_SUPPORTED(tbl_name.c_ptr(), ".*Alloced_length >= .*"); #endif EXPECT_STREQ("aaaaaaa.", tbl_name.c_ptr_safe()); } diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/table_cache-t.cc percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/table_cache-t.cc --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/table_cache-t.cc 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/table_cache-t.cc 2017-10-19 04:25:29.000000000 +0000 @@ -194,7 +194,7 @@ // Cache should be not locked after creation #ifdef SAFE_MUTEX - EXPECT_DEATH_IF_SUPPORTED(table_cache.assert_owner(), + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache.assert_owner(), ".*Assertion.*count > 0.*pthread_equal.*"); #endif table_cache.destroy(); @@ -213,7 +213,7 @@ #ifdef SAFE_MUTEX // Cache should not be locked after creation - EXPECT_DEATH_IF_SUPPORTED(table_cache.assert_owner(), + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache.assert_owner(), ".*Assertion.*count > 0.*pthread_equal.*"); #endif @@ -224,7 +224,7 @@ // And get unlocked after we call its unlock() method table_cache.unlock(); #ifdef SAFE_MUTEX - EXPECT_DEATH_IF_SUPPORTED(table_cache.assert_owner(), + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache.assert_owner(), ".*Assertion.*count > 0.*pthread_equal.*"); #endif @@ -265,9 +265,9 @@ // And not locked #ifdef SAFE_MUTEX - EXPECT_DEATH_IF_SUPPORTED(cache_1->assert_owner(), + MY_EXPECT_DEATH_IF_SUPPORTED(cache_1->assert_owner(), ".*Assertion.*count > 0.*pthread_equal.*"); - EXPECT_DEATH_IF_SUPPORTED(cache_2->assert_owner(), + MY_EXPECT_DEATH_IF_SUPPORTED(cache_2->assert_owner(), ".*Assertion.*count > 0.*pthread_equal.*"); #endif @@ -736,9 +736,9 @@ { // Nor caches nor LOCK_open should not be locked after initialization #ifdef SAFE_MUTEX - EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all(), + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all(), ".*Assertion.*count > 0.*pthread_equal.*"); - EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all_and_tdc(), + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all_and_tdc(), ".*Assertion.*count > 0.*pthread_equal.*"); #endif @@ -760,9 +760,9 @@ table_cache_manager.unlock_all_and_tdc(); #ifdef SAFE_MUTEX - EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all(), + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all(), ".*Assertion.*count > 0.*pthread_equal.*"); - EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all_and_tdc(), + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.assert_owner_all_and_tdc(), ".*Assertion.*count > 0.*pthread_equal.*"); #endif } @@ -806,7 +806,7 @@ // to free all tables for share_1, while some tables // are in use. #ifndef DBUG_OFF - EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.free_table(thd_1, + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.free_table(thd_1, TDC_RT_REMOVE_ALL, &share_1), ".*Assertion.*is_empty.*"); @@ -840,7 +840,7 @@ // to free all not own TABLEs for share_1, while thd_2 // has a TABLE object for it in used #ifndef DBUG_OFF - EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.free_table(thd_1, + MY_EXPECT_DEATH_IF_SUPPORTED(table_cache_manager.free_table(thd_1, TDC_RT_REMOVE_NOT_OWN, &share_1), ".*Assertion.*0.*"); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/thread_utils.h percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/thread_utils.h --- percona-xtradb-cluster-5.6-5.6.34-26.19/unittest/gunit/thread_utils.h 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/unittest/gunit/thread_utils.h 2017-10-19 04:25:29.000000000 +0000 @@ -19,6 +19,9 @@ #include #include +#include +#include + namespace thread { class Thread_start_arg; @@ -115,4 +118,56 @@ } // namespace thread +class disable_core_dumps_in_scope +{ +private: + disable_core_dumps_in_scope(const disable_core_dumps_in_scope &); + disable_core_dumps_in_scope& operator = (const disable_core_dumps_in_scope &); + + struct rlimit saved_core_rlimit; + +public: + disable_core_dumps_in_scope() + { + int ret= getrlimit(RLIMIT_CORE, &saved_core_rlimit); + if (ret != 0) + { + perror("getrlimit(RLIMIT_CORE) failed"); + assert(ret == 0); + } + + struct rlimit disabled_core_rlimit= saved_core_rlimit; + disabled_core_rlimit.rlim_cur= 0; + + ret= setrlimit(RLIMIT_CORE, &disabled_core_rlimit); + if (ret != 0) + { + perror("setrlimit(RLIMIT_CORE) failed"); + assert(ret == 0); + } + } + + ~disable_core_dumps_in_scope() + { + int ret= setrlimit(RLIMIT_CORE, &saved_core_rlimit); + if (ret != 0) + { + perror("setrlimit(RLIMIT_CORE) failed"); + assert(ret == 0); + } + } +}; + +#define MY_EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ + do { \ + disable_core_dumps_in_scope disable_core_dumps; \ + EXPECT_DEATH_IF_SUPPORTED(statement, regex); \ + } while (0) + +#define MY_EXPECT_DEATH(statement, regex) \ + do { \ + disable_core_dumps_in_scope disable_core_dumps; \ + EXPECT_DEATH(statement, regex); \ + } while (0) + #endif // SQL_THREAD_INCLUDED diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/VERSION percona-xtradb-cluster-5.6-5.6.37-26.21/VERSION --- percona-xtradb-cluster-5.6-5.6.34-26.19/VERSION 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/VERSION 2017-10-19 04:25:29.000000000 +0000 @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=6 -MYSQL_VERSION_PATCH=34 -MYSQL_VERSION_EXTRA=-79.1 +MYSQL_VERSION_PATCH=37 +MYSQL_VERSION_EXTRA=-82.2 diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/vio/vio.c percona-xtradb-cluster-5.6-5.6.37-26.21/vio/vio.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/vio/vio.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/vio/vio.c 2017-10-19 04:25:29.000000000 +0000 @@ -395,7 +395,9 @@ yaSSL_CleanUp(); #elif defined(HAVE_OPENSSL) // This one is needed on the client side +#if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_remove_state(0); +#endif ERR_free_strings(); EVP_cleanup(); CRYPTO_cleanup_all_ex_data(); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/vio/viossl.c percona-xtradb-cluster-5.6-5.6.37-26.21/vio/viossl.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/vio/viossl.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/vio/viossl.c 2017-10-19 04:25:29.000000000 +0000 @@ -44,8 +44,7 @@ } if (ssl) - DBUG_PRINT("error", ("error: %s", - ERR_error_string(SSL_get_error(ssl, l), buf))); + DBUG_PRINT("error", ("SSL_get_error: %d", SSL_get_error(ssl, l))); DBUG_PRINT("info", ("socket_errno: %d", socket_errno)); DBUG_VOID_RETURN; @@ -132,6 +131,8 @@ /* Retrieve the result for the SSL I/O operation. */ ssl_error= SSL_get_error(ssl, ret); + *ssl_errno_holder= ERR_peek_error(); + /* Retrieve the result for the SSL I/O operation. */ switch (ssl_error) { @@ -156,8 +157,6 @@ break; } - *ssl_errno_holder= ssl_error; - return should_retry; } @@ -379,7 +378,8 @@ my_socket sd= mysql_socket_getfd(vio->mysql_socket); /* Declared here to make compiler happy */ -#if !defined(HAVE_YASSL) && !defined(DBUG_OFF) +#if !defined(HAVE_YASSL) && !defined(DBUG_OFF) && \ + (OPENSSL_VERSION_NUMBER < 0x10100000L) int j, n; #endif @@ -403,7 +403,9 @@ sk_SSL_COMP_zero(SSL_COMP_get_compression_methods()); #endif -#if !defined(HAVE_YASSL) && !defined(DBUG_OFF) +#if !defined(HAVE_YASSL) && !defined(DBUG_OFF) && \ + (OPENSSL_VERSION_NUMBER < 0x10100000L) + { STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; ssl_comp_methods = SSL_COMP_get_compression_methods(); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/vio/viosslfactories.c percona-xtradb-cluster-5.6-5.6.37-26.21/vio/viosslfactories.c --- percona-xtradb-cluster-5.6-5.6.34-26.19/vio/viosslfactories.c 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/vio/viosslfactories.c 2017-10-19 04:25:29.000000000 +0000 @@ -123,12 +123,18 @@ DH *dh; if ((dh=DH_new())) { - dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); - dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); + BIGNUM* p= BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); + BIGNUM* g= BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + dh->p= p; + dh->g= g; if (! dh->p || ! dh->g) +#else + if (!DH_set0_pqg(dh, p, NULL, g)) +#endif { DH_free(dh); - dh=0; + dh= NULL; } } return(dh); diff -Nru percona-xtradb-cluster-5.6-5.6.34-26.19/WSREP-REVISION percona-xtradb-cluster-5.6-5.6.37-26.21/WSREP-REVISION --- percona-xtradb-cluster-5.6-5.6.34-26.19/WSREP-REVISION 2016-12-08 15:01:29.000000000 +0000 +++ percona-xtradb-cluster-5.6-5.6.37-26.21/WSREP-REVISION 2017-10-19 04:25:29.000000000 +0000 @@ -1 +1 @@ -4c779b7 +c70c68b