From fd9a11d8a5b820f8d08b28fb2f198edc6f196342 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Mon, 6 Jan 2025 01:43:42 +0100 Subject: [PATCH 01/13] MDEV-35749: Add support for --use-memory option for SST with mariabackup Mariabackup (mariadb-backup) supports the --use-memory option that sets the buffer pool size for innodb. However, current SST scripts do not use this option. This commit adds support for this option, the value for which can be specified via the "use_memory" parameter in the configuration file in the [sst], [mariabackup] or [xtrabackup] sections (supported only for compatibility with old configurations). In addition, if the innodb_buffer_pool_size option is specified in the user configuration (in the main server configuration sections) or passed to the SST scripts or the server via arguments, its value is also passed to mariadb-backup as the value for the --use-memory option. A new section name [mariabackup] has also been added, which can be used instead of the deprecated [xtrabackup] (the section name "mariabackup" was specified in the documentation, but was not actually supported by SST scripts before this commit). --- .../galera_sst_mariabackup_use_memory.result | 13 +++++ .../t/galera_sst_mariabackup_use_memory.cnf | 8 +++ .../t/galera_sst_mariabackup_use_memory.test | 53 +++++++++++++++++++ scripts/wsrep_sst_common.sh | 24 +++++++-- scripts/wsrep_sst_mariabackup.sh | 40 +++++++++----- 5 files changed, 121 insertions(+), 17 deletions(-) create mode 100644 mysql-test/suite/galera/r/galera_sst_mariabackup_use_memory.result create mode 100644 mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.cnf create mode 100644 mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.test diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_use_memory.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_use_memory.result new file mode 100644 index 00000000000..1d631198990 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_use_memory.result @@ -0,0 +1,13 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_2; +Shutting down server ... +connection node_1; +Cleaning var directory ... +connection node_2; +Starting server ... +include/assert_grep.inc [mariabackup: Using 128974848 bytes for buffer pool \(set by --use-memory parameter\)] +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.cnf new file mode 100644 index 00000000000..05a647eb090 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.cnf @@ -0,0 +1,8 @@ +!include ../galera_2nodes.cnf + +[mysqld] +wsrep_sst_method=mariabackup +wsrep_sst_auth="root:" + +[mariabackup] +use_memory=123m diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.test new file mode 100644 index 00000000000..f6ba873976e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_use_memory.test @@ -0,0 +1,53 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_mariabackup.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +--connection node_2 + +--echo Shutting down server ... +--source include/shutdown_mysqld.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc + +# +# Force SST +# +--echo Cleaning var directory ... +--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data + +--connection node_2 + +--echo Starting server ... +let $restart_noprint=2; +--source include/start_mysqld.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc + +# Confirm that IST did not take place +--let $assert_text = mariabackup: Using 128974848 bytes for buffer pool \(set by --use-memory parameter\) +--let $assert_select = mariabackup: Using 128974848 bytes for buffer pool \(set by --use-memory parameter\) +--let $assert_count = 1 +--let $assert_file = $MYSQLTEST_VARDIR/mysqld.2/data/mariabackup.prepare.log +--let $assert_only_after = Starting InnoDB instance for recovery +--source include/assert_grep.inc + +# Restore original auto_increment_offset values. +--source include/auto_increment_offset_restore.inc + +--source include/galera_end.inc diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index ff4befa6680..550165b0c3a 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -209,6 +209,7 @@ INNODB_DATA_HOME_DIR=$(trim_dir "${INNODB_DATA_HOME_DIR:-}") INNODB_LOG_GROUP_HOME=$(trim_dir "${INNODB_LOG_GROUP_HOME:-}") INNODB_UNDO_DIR=$(trim_dir "${INNODB_UNDO_DIR:-}") INNODB_BUFFER_POOL="" +INNODB_BUFFER_POOL_SIZE="" INNODB_FORCE_RECOVERY="" INNOEXTRA="" @@ -329,6 +330,10 @@ case "$1" in readonly INNODB_BUFFER_POOL=$(trim_string "$2") shift ;; + '--innodb-buffer-pool-size') + readonly INNODB_BUFFER_POOL_SIZE=$(trim_string "$2") + shift + ;; '--defaults-file') file=$(trim_string "$2") readonly WSREP_SST_OPT_DEFAULT="$1=$file" @@ -607,6 +612,12 @@ case "$1" in fi skip_mysqld_arg=1 ;; + '--innodb-buffer-pool-size') + if [ -z "$INNODB_BUFFER_POOL_SIZE" ]; then + MYSQLD_OPT_INNODB_BUFFER_POOL_SIZE=$(trim_string "$value") + fi + skip_mysqld_arg=1 + ;; '--innodb-force-recovery') if [ -n "$value" -a "$value" != "0" ]; then INNODB_FORCE_RECOVERY=$(trim_string "$value") @@ -696,6 +707,10 @@ if [ -n "${MYSQLD_OPT_INNODB_BUFFER_POOL:-}" -a \ -z "$INNODB_BUFFER_POOL" ]; then readonly INNODB_BUFFER_POOL="$MYSQLD_OPT_INNODB_BUFFER_POOL" fi +if [ -n "${MYSQLD_OPT_INNODB_BUFFER_POOL_SIZE:-}" -a \ + -z "$INNODB_BUFFER_POOL_SIZE" ]; then + readonly INNODB_BUFFER_POOL_SIZE="$MYSQLD_OPT_INNODB_BUFFER_POOL_SIZE" +fi if [ -n "${MYSQLD_OPT_LOG_BIN:-}" -a \ -z "$WSREP_SST_OPT_BINLOG" ]; then readonly WSREP_SST_OPT_BINLOG="$MYSQLD_OPT_LOG_BIN" @@ -752,6 +767,9 @@ fi if [ -n "$INNODB_BUFFER_POOL" ]; then INNOEXTRA="$INNOEXTRA --innodb-buffer-pool-filename='$INNODB_BUFFER_POOL'" fi +if [ -n "$INNODB_BUFFER_POOL_SIZE" ]; then + INNOEXTRA="$INNOEXTRA --innodb-buffer-pool-size='$INNODB_BUFFER_POOL_SIZE'" +fi if [ -n "$WSREP_SST_OPT_BINLOG" ]; then INNOEXTRA="$INNOEXTRA --log-bin='$WSREP_SST_OPT_BINLOG'" if [ -n "$WSREP_SST_OPT_BINLOG_INDEX" ]; then @@ -1775,14 +1793,14 @@ simple_cleanup() create_data() { OLD_PWD="$(pwd)" + DATA_DIR="$OLD_PWD" if [ -n "$DATA" -a "$DATA" != '.' ]; then [ ! -d "$DATA" ] && mkdir -p "$DATA" cd "$DATA" + DATA_DIR="$(pwd)" + cd "$OLD_PWD" fi - DATA_DIR="$(pwd)" - - cd "$OLD_PWD" } create_dirs() diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index e50704b7cdc..3e13efb6c6d 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -540,7 +540,8 @@ adjust_progress() fi } -encgroups='--mysqld|sst|xtrabackup' +bkgroups='sst|xtrabackup|mariabackup' +encgroups="--mysqld|$bkgroups" read_cnf() { @@ -596,26 +597,34 @@ read_cnf() ssl_dhparams=$(parse_cnf "$encgroups" 'ssl-dhparams') fi - sockopt=$(parse_cnf sst sockopt "") - progress=$(parse_cnf sst progress "") + sockopt=$(parse_cnf sst sockopt) + progress=$(parse_cnf sst progress) ttime=$(parse_cnf sst time 0) cpat='.*\.pem$\|.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$' [ "$OS" = 'FreeBSD' ] && cpat=$(echo "$cpat" | sed 's/\\|/|/g') cpat=$(parse_cnf sst cpat "$cpat") - scomp=$(parse_cnf sst compressor "") - sdecomp=$(parse_cnf sst decompressor "") + scomp=$(parse_cnf sst compressor) + sdecomp=$(parse_cnf sst decompressor) - rlimit=$(parse_cnf sst rlimit "") + rlimit=$(parse_cnf sst rlimit) uextra=$(parse_cnf sst use-extra 0) - speciald=$(parse_cnf sst sst-special-dirs 1) - iopts=$(parse_cnf sst inno-backup-opts "") - iapts=$(parse_cnf sst inno-apply-opts "") - impts=$(parse_cnf sst inno-move-opts "") - stimeout=$(parse_cnf sst sst-initial-timeout 300) - ssyslog=$(parse_cnf sst sst-syslog 0) - ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}") + speciald=$(parse_cnf sst 'sst-special-dirs' 1) + iopts=$(parse_cnf "$bkgroups" 'inno-backup-opts') + iapts=$(parse_cnf "$bkgroups" 'inno-apply-opts') + impts=$(parse_cnf "$bkgroups" 'inno-move-opts') + use_memory=$(parse_cnf "$bkgroups" 'use-memory') + if [ -z "$use_memory" ]; then + if [ -n "$INNODB_BUFFER_POOL_SIZE" ]; then + use_memory="$INNODB_BUFFER_POOL_SIZE" + else + use_memory=$(parse_cnf '--mysqld' 'innodb-buffer-pool-size') + fi + fi + stimeout=$(parse_cnf sst 'sst-initial-timeout' 300) + ssyslog=$(parse_cnf sst 'sst-syslog' 0) + ssystag=$(parse_cnf mysqld_safe 'syslog-tag' "${SST_SYSLOG_TAG:-}") ssystag="$ssystag-" - sstlogarchive=$(parse_cnf sst sst-log-archive 1) + sstlogarchive=$(parse_cnf sst 'sst-log-archive' 1) sstlogarchivedir="" if [ $sstlogarchive -ne 0 ]; then sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir \ @@ -1053,6 +1062,9 @@ setup_commands() if [ -n "$INNODB_FORCE_RECOVERY" ]; then recovery=" --innodb-force-recovery=$INNODB_FORCE_RECOVERY" fi + if [ -n "$use_memory" ]; then + INNOEXTRA="$INNOEXTRA --use-memory=$use_memory" + fi INNOAPPLY="$BACKUP_BIN --prepare$disver$recovery${iapts:+ }$iapts$INNOEXTRA --target-dir='$DATA' --datadir='$DATA'$mysqld_args $INNOAPPLY" INNOMOVE="$BACKUP_BIN$WSREP_SST_OPT_CONF --move-back$disver${impts:+ }$impts$INNOEXTRA --galera-info --force-non-empty-directories --target-dir='$DATA' --datadir='${TDATA:-$DATA}' $INNOMOVE" INNOBACKUP="$BACKUP_BIN$WSREP_SST_OPT_CONF --backup$disver${iopts:+ }$iopts$tmpopts$INNOEXTRA --galera-info --stream=$sfmt --target-dir='$itmpdir' --datadir='$DATA'$mysqld_args $INNOBACKUP" From cc5d7389991616bd630f3e460f92cb81fcb0e416 Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 7 Jan 2025 12:12:24 +0200 Subject: [PATCH 02/13] Disable mmap usage in Aria and MyISAM when compiling with valgrind This removes a valgrind warning "cannot read program header" while it tries to search for memory leaks. --- storage/maria/ma_extra.c | 6 +++--- storage/myisam/mi_extra.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c index 6be1edbc5ce..3b562c26613 100644 --- a/storage/maria/ma_extra.c +++ b/storage/maria/ma_extra.c @@ -74,7 +74,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function, } if (info->s->file_map) /* Don't use cache if mmap */ break; -#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) +#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) && !defined(HAVE_valgrind) if ((share->options & HA_OPTION_COMPRESS_RECORD)) { mysql_mutex_lock(&share->intern_lock); @@ -162,7 +162,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function, error= end_io_cache(&info->rec_cache); /* Sergei will insert full text index caching here */ } -#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) +#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) && !defined(HAVE_valgrind) if (info->opt_flag & MEMMAP_USED) madvise((char*) share->file_map, share->state.state.data_file_length, MADV_RANDOM); @@ -456,7 +456,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function, maria_extra_keyflag(info, function); break; case HA_EXTRA_MMAP: -#ifdef HAVE_MMAP +#if defined(HAVE_MMAP) && !defined(HAVE_valgrind) if (block_records) break; /* Not supported */ mysql_mutex_lock(&share->intern_lock); diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index 4ce138e888c..453e8869f1e 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -69,7 +69,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) } if (info->s->file_map) /* Don't use cache if mmap */ break; -#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) +#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) && !defined(HAVE_valgrind) if ((share->options & HA_OPTION_COMPRESS_RECORD)) { mysql_mutex_lock(&share->intern_lock); @@ -155,7 +155,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) error=end_io_cache(&info->rec_cache); /* Sergei will insert full text index caching here */ } -#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) +#if defined(HAVE_MMAP) && defined(HAVE_MADVISE) && !defined(HAVE_valgrind) if (info->opt_flag & MEMMAP_USED) madvise((char*) share->file_map, share->state.state.data_file_length, MADV_RANDOM); @@ -320,7 +320,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) mi_extra_keyflag(info, function); break; case HA_EXTRA_MMAP: -#ifdef HAVE_MMAP +#if defined(HAVE_MMAP) && !defined(HAVE_valgrind) mysql_mutex_lock(&share->intern_lock); /* Memory map the data file if it is not already mapped. It is safe From a2f510fccff23e5011486c240587b8f1a98ecacc Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 23 Dec 2024 15:58:55 +0100 Subject: [PATCH 03/13] MDEV-33978 P_S.THREADS is not showing all server threads This patch only makes sure Linux getevents thread is shown in PS --- tpool/aio_linux.cc | 7 +++++-- tpool/aio_win.cc | 2 ++ tpool/tpool.h | 13 +++++++++---- tpool/tpool_generic.cc | 6 ++---- tpool/tpool_win.cc | 7 ++----- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc index 6997cbcccab..1f52e62bd07 100644 --- a/tpool/aio_linux.cc +++ b/tpool/aio_linux.cc @@ -102,6 +102,7 @@ class aio_linux final : public aio */ constexpr unsigned MAX_EVENTS= 256; + aio->m_pool->m_worker_init_callback(); io_event events[MAX_EVENTS]; for (;;) { @@ -110,14 +111,14 @@ class aio_linux final : public aio continue; case -EINVAL: if (shutdown_in_progress) - return; + goto end; /* fall through */ default: if (ret < 0) { fprintf(stderr, "io_getevents returned %d\n", ret); abort(); - return; + goto end; } for (int i= 0; i < ret; i++) { @@ -142,6 +143,8 @@ class aio_linux final : public aio } } } +end: + aio->m_pool->m_worker_destroy_callback(); } public: diff --git a/tpool/aio_win.cc b/tpool/aio_win.cc index eec37383152..f483e3ca1e1 100644 --- a/tpool/aio_win.cc +++ b/tpool/aio_win.cc @@ -92,7 +92,9 @@ public: static void aio_completion_thread_proc(tpool_generic_win_aio* aio) { + aio->m_pool->m_worker_init_callback(); aio->completion_thread_work(); + aio->m_pool->m_worker_destroy_callback(); } ~tpool_generic_win_aio() diff --git a/tpool/tpool.h b/tpool/tpool.h index 7ac6763ae23..a5dccca5e91 100644 --- a/tpool/tpool.h +++ b/tpool/tpool.h @@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/ #define NOMINMAX #endif #include +#include + /** Windows-specific native file handle struct. Apart from the actual handle, contains PTP_IO @@ -202,21 +204,24 @@ protected: std::unique_ptr m_aio; virtual aio *create_native_aio(int max_io)= 0; +public: /** Functions to be called at worker thread start/end can be used for example to set some TLS variables */ - void (*m_worker_init_callback)(void); - void (*m_worker_destroy_callback)(void); + void (*m_worker_init_callback)(void)= [] {}; + void (*m_worker_destroy_callback)(void)= [] {}; -public: - thread_pool() : m_aio(), m_worker_init_callback(), m_worker_destroy_callback() + thread_pool() + : m_aio() { } virtual void submit_task(task *t)= 0; virtual timer* create_timer(callback_func func, void *data=nullptr) = 0; void set_thread_callbacks(void (*init)(), void (*destroy)()) { + assert(init); + assert(destroy); m_worker_init_callback= init; m_worker_destroy_callback= destroy; } diff --git a/tpool/tpool_generic.cc b/tpool/tpool_generic.cc index 9697194e0b2..cd4dd5f0bde 100644 --- a/tpool/tpool_generic.cc +++ b/tpool/tpool_generic.cc @@ -571,8 +571,7 @@ void thread_pool_generic::worker_main(worker_data *thread_var) { task* task; set_tls_pool(this); - if(m_worker_init_callback) - m_worker_init_callback(); + m_worker_init_callback(); tls_worker_data = thread_var; @@ -581,8 +580,7 @@ void thread_pool_generic::worker_main(worker_data *thread_var) task->execute(); } - if (m_worker_destroy_callback) - m_worker_destroy_callback(); + m_worker_destroy_callback(); worker_end(thread_var); } diff --git a/tpool/tpool_win.cc b/tpool/tpool_win.cc index 2b413b8d1b6..c012c4b6408 100644 --- a/tpool/tpool_win.cc +++ b/tpool/tpool_win.cc @@ -45,9 +45,7 @@ class thread_pool_win : public thread_pool if (!m_pool) return; - if (m_pool->m_worker_destroy_callback) - m_pool->m_worker_destroy_callback(); - + m_pool->m_worker_destroy_callback(); m_pool->m_thread_count--; } /** This needs to be called before every IO or simple task callback.*/ @@ -63,8 +61,7 @@ class thread_pool_win : public thread_pool m_pool = pool; m_pool->m_thread_count++; // Call the thread init function. - if (m_pool->m_worker_init_callback) - m_pool->m_worker_init_callback(); + m_pool->m_worker_init_callback(); } }; From 4e9c7031a54e91ddada7dec7e16001f6b4944995 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 27 Dec 2024 13:07:04 +0100 Subject: [PATCH 04/13] MDEV-35575 Fix memory leak, when installing auth_gssapi plugin fails. Make sure to release memory, which was allocated by gss_import_name(). Also when plugin_init() fails. --- plugin/auth_gssapi/gssapi_server.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plugin/auth_gssapi/gssapi_server.cc b/plugin/auth_gssapi/gssapi_server.cc index db7bda9a6b4..8896c39859d 100644 --- a/plugin/auth_gssapi/gssapi_server.cc +++ b/plugin/auth_gssapi/gssapi_server.cc @@ -85,6 +85,15 @@ cleanup: return default_name; } +static void release_service_name() +{ + if (service_name != GSS_C_NO_NAME) + { + OM_uint32 minor; + gss_release_name(&minor, &service_name); + service_name= GSS_C_NO_NAME; + } +} int plugin_init() { @@ -127,6 +136,7 @@ int plugin_init() if (GSS_ERROR(major)) { log_error(major, minor, "gss_acquire_cred failed"); + release_service_name(); return -1; } gss_release_cred(&minor, &cred); @@ -136,11 +146,7 @@ int plugin_init() int plugin_deinit() { - if (service_name != GSS_C_NO_NAME) - { - OM_uint32 minor; - gss_release_name(&minor, &service_name); - } + release_service_name(); return 0; } From 680d461b5d5ba4ee6d69c11acde495950ce5d238 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 25 Oct 2024 13:41:28 +0200 Subject: [PATCH 05/13] MDEV-35239 Mariabackup incorrectly thinks we are on a multithreaded slave if slave_parallel_workers > 0 don't require GTID enabled for multi-threaded slave in MariaDB it's only needed for MySQL with it out-of-order commits. --- extra/mariabackup/backup_mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index d4fb6346bea..c0097fd3c45 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -614,7 +614,7 @@ detect_mysql_capabilities_for_backup() } if (opt_slave_info && have_multi_threaded_slave && - !have_gtid_slave) { + !have_gtid_slave && server_flavor != FLAVOR_MARIADB) { msg("The --slave-info option requires GTID enabled for a " "multi-threaded slave."); return(false); From 828b928fcecea727ca2aa29841575a663f7bdce7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 15 Dec 2024 20:14:16 +0100 Subject: [PATCH 06/13] MDEV-35651 NO_UNSIGNED_SUBTRACTION does not work for multiple unsigned integers restore correct unsigned-unsigned logic followup for 031f11717d9 --- mysql-test/main/func_math.result | 15 +++++++++++++-- mysql-test/main/func_math.test | 14 ++++++++------ sql/item_func.cc | 5 +++-- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result index 4296a983d71..c5896953664 100644 --- a/mysql-test/main/func_math.result +++ b/mysql-test/main/func_math.result @@ -1,4 +1,3 @@ -drop table if exists t1; select floor(5.5),floor(-5.5); floor(5.5) floor(-5.5) 5 -6 @@ -3632,5 +3631,17 @@ SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+ c1 NULL # -# End of 10.5 tests +# MDEV-35651 NO_UNSIGNED_SUBTRACTION does not work for multiple unsigned integers # +set sql_mode=no_unsigned_subtraction; +select cast(0 as unsigned) - 1; +cast(0 as unsigned) - 1 +-1 +select 2-cast(3 as unsigned); +2-cast(3 as unsigned) +-1 +select cast(1 as unsigned) - cast(2 as unsigned); +cast(1 as unsigned) - cast(2 as unsigned) +-1 +set sql_mode=default; +# End of 10.5 tests diff --git a/mysql-test/main/func_math.test b/mysql-test/main/func_math.test index d16fc3bc37b..938d7e00e14 100644 --- a/mysql-test/main/func_math.test +++ b/mysql-test/main/func_math.test @@ -4,10 +4,6 @@ --source include/default_charset.inc ---disable_warnings -drop table if exists t1; ---enable_warnings - select floor(5.5),floor(-5.5); explain extended select floor(5.5),floor(-5.5); select ceiling(5.5),ceiling(-5.5); @@ -1941,7 +1937,13 @@ SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) AS c1; SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1; SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1; +--echo # +--echo # MDEV-35651 NO_UNSIGNED_SUBTRACTION does not work for multiple unsigned integers +--echo # +set sql_mode=no_unsigned_subtraction; +select cast(0 as unsigned) - 1; +select 2-cast(3 as unsigned); +select cast(1 as unsigned) - cast(2 as unsigned); +set sql_mode=default; ---echo # --echo # End of 10.5 tests ---echo # diff --git a/sql/item_func.cc b/sql/item_func.cc index 34e4727681e..6a7b12ae4a0 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1316,9 +1316,10 @@ longlong Item_func_minus::int_op() { if (args[1]->unsigned_flag) { - if ((ulonglong) val0 < (ulonglong) val1) + if ((ulonglong) val0 >= (ulonglong) val1) + res_unsigned= TRUE; + else if ((ulonglong)val1 - (ulonglong)val0 > (ulonglong)LONGLONG_MAX) goto err; - res_unsigned= TRUE; } else { From b059f6051085657062fd1d3a5a6e5ff9cbf53050 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 23 Dec 2024 17:44:24 +0100 Subject: [PATCH 07/13] MDEV-35704 Error message mispelled when altering table engine to MEMORY reset progress report output before printing the error message. need to flush(stdout), because error message goes to stderr --- client/mysql.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/mysql.cc b/client/mysql.cc index 0d41ab928ec..e7e44c929d8 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -5122,6 +5122,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) } if (!opt_silent || info_type == INFO_ERROR) { + report_progress_end(); + fflush(stdout); + if (!inited) { #ifdef HAVE_SETUPTERM From 9f9072c3440a008c2cef84da1b77378892176999 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 23 Dec 2024 21:55:02 +0100 Subject: [PATCH 08/13] MDEV-34733 main.mysqld--help-aria test failure: feedback plugin: failed to retrieve the MAC address * replace the message away in the test result * remove "feedback plugin:" prefix, it's a server message, not plugin's * downgrade to the warning, because 1) it's not a failure, no operation was aborted, server still works 2) it's something actionable, so not a [Note] either --- mysql-test/main/mysqld--help-aria.test | 6 +++--- mysql-test/mysql-test-run.pl | 2 +- sql/mysqld.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/main/mysqld--help-aria.test b/mysql-test/main/mysqld--help-aria.test index 2bd332c1484..4f0da282040 100644 --- a/mysql-test/main/mysqld--help-aria.test +++ b/mysql-test/main/mysqld--help-aria.test @@ -6,7 +6,7 @@ flush tables; --let $args=--table-cache=5 --max-connections=10 --log-warnings=1 --silent-startup --lower-case-table-names=1 --help --verbose --exec $MYSQLD_CMD $args > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err ---replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // +--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /^.*failed to retrieve the MAC address\n// --cat_file $MYSQL_TMP_DIR/mysqld--help2.err --echo # @@ -14,7 +14,7 @@ flush tables; --echo # --exec $MYSQLD_CMD $args --datadir=$MYSQL_TMP_DIR/help > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err ---replace_regex /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // +--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /^.*failed to retrieve the MAC address\n// --cat_file $MYSQL_TMP_DIR/mysqld--help2.err --echo # @@ -23,7 +23,7 @@ flush tables; --mkdir $MYSQL_TMP_DIR/help --exec $MYSQLD_CMD $args --datadir=$MYSQL_TMP_DIR/help > $MYSQL_TMP_DIR/mysqld--help2.txt 2> $MYSQL_TMP_DIR/mysqld--help2.err ---replace_regex /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // +--replace_regex /mysqld/mariadbd/ /\d\d\d\d-\d*-\d* *\d*:\d*:\d* \d* // /^.*failed to retrieve the MAC address\n// --cat_file $MYSQL_TMP_DIR/mysqld--help2.err --list_files $MYSQL_TMP_DIR/help diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 83d5fe088f8..815eae1bb26 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4487,7 +4487,7 @@ sub extract_warning_lines ($$) { qr|InnoDB: io_setup\(\) failed with EAGAIN|, qr/InnoDB: Failed to set (O_DIRECT|DIRECTIO_ON) on file/, qr|setrlimit could not change the size of core files to 'infinity';|, - qr|feedback plugin: failed to retrieve the MAC address|, + qr|failed to retrieve the MAC address|, qr|Plugin 'FEEDBACK' init function returned error|, qr|Plugin 'FEEDBACK' registration as a INFORMATION SCHEMA failed|, qr|'log-bin-use-v1-row-events' is MySQL .* compatible option|, diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a9fa24c2064..31d9084f235 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9866,7 +9866,7 @@ static int calculate_server_uid(char *dest) int2store(rawbuf, mysqld_port); if (my_gethwaddr(rawbuf + 2)) { - sql_print_error("feedback plugin: failed to retrieve the MAC address"); + sql_print_warning("failed to retrieve the MAC address"); return 1; } From 0031f4a74fcf7c61493409af5da5ab2c90905113 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 24 Dec 2024 17:53:03 +0100 Subject: [PATCH 09/13] MDEV-35663 Sporadic connection failures during FLUSH PRIVILEGES during FLUSH PRIVILEGES, allow_all_hosts temporarily goes out of sync with acl_check_hosts and acl_wild_hosts. As it's tested in acl_check_host() without a mutex, let's re-test it under a mutex to make sure the value is correct. Note that it's just an optimization and it's ok to see outdated allow_all_hosts value here. --- sql/sql_acl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 949e9825dde..59980264741 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3948,7 +3948,8 @@ bool acl_check_host(const char *host, const char *ip) return 0; mysql_mutex_lock(&acl_cache->lock); - if ((host && my_hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) || + if (allow_all_hosts || + (host && my_hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) || (ip && my_hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip)))) { mysql_mutex_unlock(&acl_cache->lock); From 9508a44c376186b433b023b04cc5025860b2a52a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 28 Dec 2024 20:15:43 +0100 Subject: [PATCH 10/13] enforce no trailing \n in Diagnostic_area messages that is in my_error(), push_warning(), etc --- mysql-test/main/long_unique_debug.result | 26 --- .../binlog/r/binlog_max_extension.result | 1 - .../binlog/r/binlog_no_uniqfile_crash.result | 1 - ...binlog_show_binlog_event_random_pos.result | 1 - .../rpl_binlog_errors.result | 9 - .../binlog_encryption/rpl_checksum.result | 1 - .../suite/rpl/r/rpl_binlog_errors.result | 9 - mysql-test/suite/rpl/r/rpl_checksum.result | 1 - sql/share/errmsg-utf8.txt | 200 +++++++++--------- sql/sql_error.cc | 1 + sql/sql_repl.cc | 2 +- sql/table.cc | 2 +- storage/connect/domdoc.cpp | 6 +- storage/innobase/handler/ha_innodb.cc | 25 +-- storage/maria/ma_check.c | 4 +- storage/myisam/mi_check.c | 8 +- 16 files changed, 123 insertions(+), 174 deletions(-) diff --git a/mysql-test/main/long_unique_debug.result b/mysql-test/main/long_unique_debug.result index fb56a9d024b..01df77fc58b 100644 --- a/mysql-test/main/long_unique_debug.result +++ b/mysql-test/main/long_unique_debug.result @@ -90,13 +90,11 @@ table->field[0]->offset = 1 table->field[0]->field_length = 10 table->field[0]->null_pos wrt to record 0 = 0 table->field[0]->null_bit_pos = 1 - table->field[1]->field_name DB_ROW_HASH_1 table->field[1]->offset = 11 table->field[1]->field_length = 8 table->field[1]->null_pos wrt to record 0 = 0 table->field[1]->null_bit_pos = 2 - SET debug_dbug=""; drop table t1; SET debug_dbug="d,print_long_unique_internal_state"; @@ -182,37 +180,31 @@ table->field[0]->offset = 1 table->field[0]->field_length = 10 table->field[0]->null_pos wrt to record 0 = 0 table->field[0]->null_bit_pos = 1 - table->field[1]->field_name b table->field[1]->offset = 11 table->field[1]->field_length = 10 table->field[1]->null_pos wrt to record 0 = 0 table->field[1]->null_bit_pos = 2 - table->field[2]->field_name c table->field[2]->offset = 21 table->field[2]->field_length = 10 table->field[2]->null_pos wrt to record 0 = 0 table->field[2]->null_bit_pos = 4 - table->field[3]->field_name DB_ROW_HASH_1 table->field[3]->offset = 31 table->field[3]->field_length = 8 table->field[3]->null_pos wrt to record 0 = 0 table->field[3]->null_bit_pos = 8 - table->field[4]->field_name DB_ROW_HASH_2 table->field[4]->offset = 39 table->field[4]->field_length = 8 table->field[4]->null_pos wrt to record 0 = 0 table->field[4]->null_bit_pos = 16 - table->field[5]->field_name DB_ROW_HASH_3 table->field[5]->offset = 47 table->field[5]->field_length = 8 table->field[5]->null_pos wrt to record 0 = 0 table->field[5]->null_bit_pos = 32 - SET debug_dbug=""; drop table t1; SET debug_dbug="d,print_long_unique_internal_state"; @@ -290,37 +282,31 @@ table->field[0]->offset = 1 table->field[0]->field_length = 10 table->field[0]->null_pos wrt to record 0 = 0 table->field[0]->null_bit_pos = 1 - table->field[1]->field_name b table->field[1]->offset = 11 table->field[1]->field_length = 10 table->field[1]->null_pos wrt to record 0 = 0 table->field[1]->null_bit_pos = 2 - table->field[2]->field_name c table->field[2]->offset = 21 table->field[2]->field_length = 10 table->field[2]->null_pos wrt to record 0 = 0 table->field[2]->null_bit_pos = 4 - table->field[3]->field_name d table->field[3]->offset = 31 table->field[3]->field_length = 10 table->field[3]->null_pos wrt to record 0 = 0 table->field[3]->null_bit_pos = 8 - table->field[4]->field_name DB_ROW_HASH_1 table->field[4]->offset = 41 table->field[4]->field_length = 8 table->field[4]->null_pos wrt to record 0 = 0 table->field[4]->null_bit_pos = 16 - table->field[5]->field_name DB_ROW_HASH_2 table->field[5]->offset = 49 table->field[5]->field_length = 8 table->field[5]->null_pos wrt to record 0 = 0 table->field[5]->null_bit_pos = 32 - SET debug_dbug=""; drop table t1; SET debug_dbug="d,print_long_unique_internal_state"; @@ -406,31 +392,26 @@ table->field[0]->offset = 1 table->field[0]->field_length = 4 table->field[0]->null_pos wrt to record 0 = -1 table->field[0]->null_bit_pos = 0 - table->field[1]->field_name b table->field[1]->offset = 5 table->field[1]->field_length = 10 table->field[1]->null_pos wrt to record 0 = 0 table->field[1]->null_bit_pos = 1 - table->field[2]->field_name c table->field[2]->offset = 15 table->field[2]->field_length = 10 table->field[2]->null_pos wrt to record 0 = -1 table->field[2]->null_bit_pos = 0 - table->field[3]->field_name DB_ROW_HASH_1 table->field[3]->offset = 25 table->field[3]->field_length = 8 table->field[3]->null_pos wrt to record 0 = 0 table->field[3]->null_bit_pos = 2 - table->field[4]->field_name DB_ROW_HASH_2 table->field[4]->offset = 33 table->field[4]->field_length = 8 table->field[4]->null_pos wrt to record 0 = -1 table->field[4]->null_bit_pos = 0 - SET debug_dbug=""; drop table t1; ##Using hash @@ -487,25 +468,21 @@ table->field[0]->offset = 1 table->field[0]->field_length = 4 table->field[0]->null_pos wrt to record 0 = 0 table->field[0]->null_bit_pos = 2 - table->field[1]->field_name b table->field[1]->offset = 5 table->field[1]->field_length = 4 table->field[1]->null_pos wrt to record 0 = 0 table->field[1]->null_bit_pos = 4 - table->field[2]->field_name c table->field[2]->offset = 9 table->field[2]->field_length = 4 table->field[2]->null_pos wrt to record 0 = 0 table->field[2]->null_bit_pos = 8 - table->field[3]->field_name DB_ROW_HASH_1 table->field[3]->offset = 13 table->field[3]->field_length = 8 table->field[3]->null_pos wrt to record 0 = 0 table->field[3]->null_bit_pos = 16 - SET debug_dbug=""; drop table t1; ##Using hash but with memory engine so no long unique column @@ -562,18 +539,15 @@ table->field[0]->offset = 1 table->field[0]->field_length = 4 table->field[0]->null_pos wrt to record 0 = 0 table->field[0]->null_bit_pos = 2 - table->field[1]->field_name b table->field[1]->offset = 5 table->field[1]->field_length = 4 table->field[1]->null_pos wrt to record 0 = 0 table->field[1]->null_bit_pos = 4 - table->field[2]->field_name c table->field[2]->offset = 9 table->field[2]->field_length = 4 table->field[2]->null_pos wrt to record 0 = 0 table->field[2]->null_bit_pos = 8 - SET debug_dbug=""; drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_max_extension.result b/mysql-test/suite/binlog/r/binlog_max_extension.result index f69ffcce16a..f353b071589 100644 --- a/mysql-test/suite/binlog/r/binlog_max_extension.result +++ b/mysql-test/suite/binlog/r/binlog_max_extension.result @@ -4,4 +4,3 @@ call mtr.add_suppression("Can't generate a unique log-filename"); RESET MASTER; FLUSH LOGS; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - diff --git a/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result b/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result index 88ed236a528..bd3d699a74a 100644 --- a/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result +++ b/mysql-test/suite/binlog/r/binlog_no_uniqfile_crash.result @@ -16,7 +16,6 @@ master-bin.2147483647 # Gtid # # GTID #-#-# master-bin.2147483647 # Query # # CREATE DATABASE db1 RESET MASTER TO 2147483648; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - FOUND 1 /Turning logging off for the whole duration of the MariaDB server process/ in mysqld.1.err "Following CREATE DATABSE db2 command will not be present in binary log" "as binary log got closed due to ER_NO_UNIQUE_LOGFILE error." diff --git a/mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result b/mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result index c2e634ebe82..014019a3294 100644 --- a/mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result +++ b/mysql-test/suite/binlog/r/binlog_show_binlog_event_random_pos.result @@ -11,5 +11,4 @@ UPDATE t1 SET c1=repeat('b',255); INSERT INTO t1 VALUES (repeat('a', 255), repeat('a', 255),repeat('a', 255),repeat('a', 255),repeat('a', 255)); SHOW BINLOG EVENTS FROM POS; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Invalid pos specified. Requested from pos:POS is greater than actual file size:MAX_POS - DROP TABLE t1; diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result index 4c667bd7f5a..a4228c6e781 100644 --- a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result +++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.result @@ -26,7 +26,6 @@ RESET MASTER; SET @@global.debug_dbug="d,error_unique_log_filename"; FLUSH LOGS; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show one binlog show binary logs; Log_name File_size @@ -52,7 +51,6 @@ RESET MASTER; SET @@global.debug_dbug="d,error_unique_log_filename"; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show one entry SELECT count(*) FROM t2; count(*) @@ -78,7 +76,6 @@ LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; INSERT INTO t2 VALUES ('muse'); COMMIT; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show three entries SELECT count(*) FROM t2; count(*) @@ -95,7 +92,6 @@ count(*) 0 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show 1 entry SELECT count(*) FROM t4; count(*) @@ -118,13 +114,10 @@ count(*) 0 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'); ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # INFO: Count(*) Before Offending DELETEs # assert: must show 1 entry SELECT count(*) FROM t4; @@ -136,10 +129,8 @@ count(*) 4 DELETE FROM t4; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - DELETE FROM t2; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # INFO: Count(*) After Offending DELETEs # assert: must show zero entries SELECT count(*) FROM t4; diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.result b/mysql-test/suite/binlog_encryption/rpl_checksum.result index 22220b8e9fb..bfc4c4e831c 100644 --- a/mysql-test/suite/binlog_encryption/rpl_checksum.result +++ b/mysql-test/suite/binlog_encryption/rpl_checksum.result @@ -171,7 +171,6 @@ SET @old_dbug= @@GLOBAL.debug_dbug; SET debug_dbug= '+d,binlog_inject_new_name_error'; FLUSH LOGS; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - SET debug_dbug= @old_dbug; INSERT INTO t4 VALUES (2); connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result index 4c667bd7f5a..a4228c6e781 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_errors.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result @@ -26,7 +26,6 @@ RESET MASTER; SET @@global.debug_dbug="d,error_unique_log_filename"; FLUSH LOGS; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show one binlog show binary logs; Log_name File_size @@ -52,7 +51,6 @@ RESET MASTER; SET @@global.debug_dbug="d,error_unique_log_filename"; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show one entry SELECT count(*) FROM t2; count(*) @@ -78,7 +76,6 @@ LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; INSERT INTO t2 VALUES ('muse'); COMMIT; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show three entries SELECT count(*) FROM t2; count(*) @@ -95,7 +92,6 @@ count(*) 0 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # assert: must show 1 entry SELECT count(*) FROM t4; count(*) @@ -118,13 +114,10 @@ count(*) 0 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'); ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # INFO: Count(*) Before Offending DELETEs # assert: must show 1 entry SELECT count(*) FROM t4; @@ -136,10 +129,8 @@ count(*) 4 DELETE FROM t4; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - DELETE FROM t2; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - # INFO: Count(*) After Offending DELETEs # assert: must show zero entries SELECT count(*) FROM t4; diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result index 21d8ca22feb..94f119016c5 100644 --- a/mysql-test/suite/rpl/r/rpl_checksum.result +++ b/mysql-test/suite/rpl/r/rpl_checksum.result @@ -171,7 +171,6 @@ SET @old_dbug= @@GLOBAL.debug_dbug; SET debug_dbug= '+d,binlog_inject_new_name_error'; FLUSH LOGS; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) - SET debug_dbug= @old_dbug; INSERT INTO t4 VALUES (2); connection slave; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 5be526dbece..87cf8938c90 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -1903,83 +1903,83 @@ ER_NORMAL_SHUTDOWN swe "%s (%s): Normal avslutning" ukr "%s (%s): Нормальне завершення" ER_GOT_SIGNAL - chi "%s: 收到信号 %d. 强行中止!\n" - cze "%s: přijat signal %d, končím\n" - dan "%s: Fangede signal %d. Afslutter!!\n" - eng "%s: Got signal %d. Aborting!\n" - est "%s: sain signaali %d. Lõpetan!\n" - fre "%s: Reçu le signal %d. Abandonne!\n" - ger "%s: Signal %d erhalten. Abbruch!\n" - greek "%s: Ελήφθη το μήνυμα %d. Η διαδικασία εγκαταλείπεται!\n" - hindi "%s: सिग्नल %d मिलने के कारण सिस्टम बंद किया जा रहा है!\n" - hun "%s: %d jelzes. Megszakitva!\n" - ita "%s: Ricevuto segnale %d. Interruzione!\n" - jpn "%s: シグナル %d を受信しました。強制終了します!\n" - kor "%s: %d 신호가 들어왔음. 중지!\n" - nla "%s: Signaal %d. Systeem breekt af!\n" - nor "%s: Oppdaget signal %d. Avslutter!\n" - norwegian-ny "%s: Oppdaga signal %d. Avsluttar!\n" - pol "%s: Otrzymano sygnał %d. Kończenie działania!\n" - por "%s: Obteve sinal %d. Abortando!\n" - rum "%s: Semnal %d obtinut. Aborting!\n" - rus "%s: Получен сигнал %d. Прекращаем!\n" - serbian "%s: Dobio signal %d. Prekidam!\n" - slo "%s: prijatý signál %d, ukončenie (Abort)!\n" - spa "%s: Recibiendo signal %d. Abortando!\n" - swe "%s: Fick signal %d. Avslutar!\n" - ukr "%s: Отримано сигнал %d. Перериваюсь!\n" + chi "%s: 收到信号 %d. 强行中止!" + cze "%s: přijat signal %d, končím" + dan "%s: Fangede signal %d. Afslutter!!" + eng "%s: Got signal %d. Aborting!" + est "%s: sain signaali %d. Lõpetan!" + fre "%s: Reçu le signal %d. Abandonne!" + ger "%s: Signal %d erhalten. Abbruch!" + greek "%s: Ελήφθη το μήνυμα %d. Η διαδικασία εγκαταλείπεται!" + hindi "%s: सिग्नल %d मिलने के कारण सिस्टम बंद किया जा रहा है!" + hun "%s: %d jelzes. Megszakitva!" + ita "%s: Ricevuto segnale %d. Interruzione!" + jpn "%s: シグナル %d を受信しました。強制終了します!" + kor "%s: %d 신호가 들어왔음. 중지!" + nla "%s: Signaal %d. Systeem breekt af!" + nor "%s: Oppdaget signal %d. Avslutter!" + norwegian-ny "%s: Oppdaga signal %d. Avsluttar!" + pol "%s: Otrzymano sygnał %d. Kończenie działania!" + por "%s: Obteve sinal %d. Abortando!" + rum "%s: Semnal %d obtinut. Aborting!" + rus "%s: Получен сигнал %d. Прекращаем!" + serbian "%s: Dobio signal %d. Prekidam!" + slo "%s: prijatý signál %d, ukončenie (Abort)!" + spa "%s: Recibiendo signal %d. Abortando!" + swe "%s: Fick signal %d. Avslutar!" + ukr "%s: Отримано сигнал %d. Перериваюсь!" ER_SHUTDOWN_COMPLETE - chi "%s:关闭完成\n" - cze "%s: ukončení práce hotovo\n" - dan "%s: Server lukket\n" - eng "%s: Shutdown complete\n" - est "%s: Lõpp\n" - fre "%s: Arrêt du serveur terminé\n" - ger "%s: Herunterfahren beendet\n" - greek "%s: Η διαδικασία Shutdown ολοκληρώθηκε\n" - hindi "%s: शटडाउन पूर्ण\n" - hun "%s: A leallitas kesz\n" - ita "%s: Shutdown completato\n" - jpn "%s: シャットダウン完了\n" - kor "%s: Shutdown 이 완료됨!\n" - nla "%s: Afsluiten afgerond\n" - nor "%s: Avslutning komplett\n" - norwegian-ny "%s: Nedkopling komplett\n" - pol "%s: Zakończenie działania wykonane\n" - por "%s: 'Shutdown' completo\n" - rum "%s: Terminare completa\n" - rus "%s: Остановка завершена\n" - serbian "%s: Gašenje završeno\n" - slo "%s: práca ukončená\n" - spa "%s: Apagado completado\n" - swe "%s: Avslutning klar\n" - ukr "%s: Роботу завершено\n" + chi "%s:关闭完成" + cze "%s: ukončení práce hotovo" + dan "%s: Server lukket" + eng "%s: Shutdown complete" + est "%s: Lõpp" + fre "%s: Arrêt du serveur terminé" + ger "%s: Herunterfahren beendet" + greek "%s: Η διαδικασία Shutdown ολοκληρώθηκε" + hindi "%s: शटडाउन पूर्ण" + hun "%s: A leallitas kesz" + ita "%s: Shutdown completato" + jpn "%s: シャットダウン完了" + kor "%s: Shutdown 이 완료됨!" + nla "%s: Afsluiten afgerond" + nor "%s: Avslutning komplett" + norwegian-ny "%s: Nedkopling komplett" + pol "%s: Zakończenie działania wykonane" + por "%s: 'Shutdown' completo" + rum "%s: Terminare completa" + rus "%s: Остановка завершена" + serbian "%s: Gašenje završeno" + slo "%s: práca ukončená" + spa "%s: Apagado completado" + swe "%s: Avslutning klar" + ukr "%s: Роботу завершено" ER_FORCING_CLOSE 08S01 - chi "%s: 强行关闭线程 %ld 用户: '%-.48s'\n" - cze "%s: násilné uzavření threadu %ld uživatele '%-.48s'\n" - dan "%s: Forceret nedlukning af tråd: %ld bruger: '%-.48s'\n" - eng "%s: Forcing close of thread %ld user: '%-.48s'\n" - est "%s: Sulgen jõuga lõime %ld kasutaja: '%-.48s'\n" - fre "%s: Arrêt forcé de la tâche (thread) %ld utilisateur: '%-.48s'\n" - ger "%s: Thread %ld zwangsweise beendet. Benutzer: '%-.48s'\n" - greek "%s: Το thread θα κλείσει %ld user: '%-.48s'\n" - hindi "%s: %ld थ्रेड बंद किया जा रहा है (यूज़र: '%-.48s')\n" - hun "%s: A(z) %ld thread kenyszeritett zarasa. Felhasznalo: '%-.48s'\n" - ita "%s: Forzata la chiusura del thread %ld utente: '%-.48s'\n" - jpn "%s: スレッド %ld を強制終了します (ユーザー: '%-.48s')\n" - kor "%s: thread %ld의 강제 종료 user: '%-.48s'\n" - nla "%s: Afsluiten afgedwongen van thread %ld gebruiker: '%-.48s'\n" - nor "%s: Påtvinget avslutning av tråd %ld bruker: '%-.48s'\n" - norwegian-ny "%s: Påtvinga avslutning av tråd %ld brukar: '%-.48s'\n" - pol "%s: Wymuszenie zamknięcia w?tku %ld użytkownik: '%-.48s'\n" - por "%s: Forçando finalização da 'thread' %ld - usuário '%-.48s'\n" - rum "%s: Terminare fortata a thread-ului %ld utilizatorului: '%-.48s'\n" - rus "%s: Принудительно закрываем поток %ld пользователя: '%-.48s'\n" - serbian "%s: Usiljeno gašenje thread-a %ld koji pripada korisniku: '%-.48s'\n" - slo "%s: násilné ukončenie vlákna %ld užívateľa '%-.48s'\n" - spa "%s: Forzando a cerrar el thread %ld usuario: '%-.48s'\n" - swe "%s: Stänger av tråd %ld; användare: '%-.48s'\n" - ukr "%s: Прискорюю закриття гілки %ld користувача: '%-.48s'\n" + chi "%s: 强行关闭线程 %ld 用户: '%-.48s'" + cze "%s: násilné uzavření threadu %ld uživatele '%-.48s'" + dan "%s: Forceret nedlukning af tråd: %ld bruger: '%-.48s'" + eng "%s: Forcing close of thread %ld user: '%-.48s'" + est "%s: Sulgen jõuga lõime %ld kasutaja: '%-.48s'" + fre "%s: Arrêt forcé de la tâche (thread) %ld utilisateur: '%-.48s'" + ger "%s: Thread %ld zwangsweise beendet. Benutzer: '%-.48s'" + greek "%s: Το thread θα κλείσει %ld user: '%-.48s'" + hindi "%s: %ld थ्रेड बंद किया जा रहा है (यूज़र: '%-.48s')" + hun "%s: A(z) %ld thread kenyszeritett zarasa. Felhasznalo: '%-.48s'" + ita "%s: Forzata la chiusura del thread %ld utente: '%-.48s'" + jpn "%s: スレッド %ld を強制終了します (ユーザー: '%-.48s')" + kor "%s: thread %ld의 강제 종료 user: '%-.48s'" + nla "%s: Afsluiten afgedwongen van thread %ld gebruiker: '%-.48s'" + nor "%s: Påtvinget avslutning av tråd %ld bruker: '%-.48s'" + norwegian-ny "%s: Påtvinga avslutning av tråd %ld brukar: '%-.48s'" + pol "%s: Wymuszenie zamknięcia w?tku %ld użytkownik: '%-.48s'" + por "%s: Forçando finalização da 'thread' %ld - usuário '%-.48s'" + rum "%s: Terminare fortata a thread-ului %ld utilizatorului: '%-.48s'" + rus "%s: Принудительно закрываем поток %ld пользователя: '%-.48s'" + serbian "%s: Usiljeno gašenje thread-a %ld koji pripada korisniku: '%-.48s'" + slo "%s: násilné ukončenie vlákna %ld užívateľa '%-.48s'" + spa "%s: Forzando a cerrar el thread %ld usuario: '%-.48s'" + swe "%s: Stänger av tråd %ld; användare: '%-.48s'" + ukr "%s: Прискорюю закриття гілки %ld користувача: '%-.48s'" ER_IPSOCK_ERROR 08S01 chi "无法创建IP插口" cze "Nemohu vytvořit IP socket" @@ -2398,31 +2398,31 @@ ER_TOO_BIG_SET swe "För många alternativ till kolumn %-.192s för SET" ukr "Забагато строк для стовбця %-.192s та SET" ER_NO_UNIQUE_LOGFILE - chi "无法生成唯一的log-filename%-.200s.(1-999)\ n" - cze "Nemohu vytvořit jednoznačné jméno logovacího souboru %-.200s.(1-999)\n" - dan "Kan ikke lave unikt log-filnavn %-.200s.(1-999)\n" - eng "Can't generate a unique log-filename %-.200s.(1-999)\n" - est "Ei suuda luua unikaalset logifaili nime %-.200s.(1-999)\n" - fre "Ne peut générer un unique nom de journal %-.200s.(1-999)\n" - ger "Kann keinen eindeutigen Dateinamen für die Logdatei %-.200s(1-999) erzeugen\n" - greek "Αδύνατη η δημιουργία unique log-filename %-.200s.(1-999)\n" - hindi "एक अनूठा लॉग-फ़ाइल नाम %-.200s.(1-999) उत्पन्न नहीं कर सके\n" - hun "Egyedi log-filenev nem generalhato: %-.200s.(1-999)\n" - ita "Impossibile generare un nome del file log unico %-.200s.(1-999)\n" - jpn "一意なログファイル名 %-.200s.(1-999) を生成できません。\n" - kor "Unique 로그화일 '%-.200s'를 만들수 없습니다.(1-999)\n" - nla "Het is niet mogelijk een unieke naam te maken voor de logfile %-.200s.(1-999)\n" - nor "Kan ikke lage unikt loggfilnavn %-.200s.(1-999)\n" - norwegian-ny "Kan ikkje lage unikt loggfilnavn %-.200s.(1-999)\n" - pol "Nie można stworzyć unikalnej nazwy pliku z logiem %-.200s.(1-999)\n" - por "Não pode gerar um nome de arquivo de 'log' único '%-.200s'.(1-999)\n" - rum "Nu pot sa generez un nume de log unic %-.200s.(1-999)\n" - rus "Невозможно создать уникальное имя файла журнала %-.200s.(1-999)\n" - serbian "Ne mogu da generišem jedinstveno ime log-file-a: '%-.200s.(1-999)'\n" - slo "Nemôžem vytvoriť unikátne meno log-súboru %-.200s.(1-999)\n" - spa "No puede crear un unico archivo log %-.200s.(1-999)\n" - swe "Kan inte generera ett unikt filnamn %-.200s.(1-999)\n" - ukr "Не можу згенерувати унікальне ім'я log-файлу %-.200s.(1-999)\n" + chi "无法生成唯一的log-filename%-.200s.(1-999)" + cze "Nemohu vytvořit jednoznačné jméno logovacího souboru %-.200s.(1-999)" + dan "Kan ikke lave unikt log-filnavn %-.200s.(1-999)" + eng "Can't generate a unique log-filename %-.200s.(1-999)" + est "Ei suuda luua unikaalset logifaili nime %-.200s.(1-999)" + fre "Ne peut générer un unique nom de journal %-.200s.(1-999)" + ger "Kann keinen eindeutigen Dateinamen für die Logdatei %-.200s(1-999) erzeugen" + greek "Αδύνατη η δημιουργία unique log-filename %-.200s.(1-999)" + hindi "एक अनूठा लॉग-फ़ाइल नाम %-.200s.(1-999) उत्पन्न नहीं कर सके" + hun "Egyedi log-filenev nem generalhato: %-.200s.(1-999)" + ita "Impossibile generare un nome del file log unico %-.200s.(1-999)" + jpn "一意なログファイル名 %-.200s.(1-999) を生成できません。" + kor "Unique 로그화일 '%-.200s'를 만들수 없습니다.(1-999)" + nla "Het is niet mogelijk een unieke naam te maken voor de logfile %-.200s.(1-999)" + nor "Kan ikke lage unikt loggfilnavn %-.200s.(1-999)" + norwegian-ny "Kan ikkje lage unikt loggfilnavn %-.200s.(1-999)" + pol "Nie można stworzyć unikalnej nazwy pliku z logiem %-.200s.(1-999)" + por "Não pode gerar um nome de arquivo de 'log' único '%-.200s'.(1-999)" + rum "Nu pot sa generez un nume de log unic %-.200s.(1-999)" + rus "Невозможно создать уникальное имя файла журнала %-.200s.(1-999)" + serbian "Ne mogu da generišem jedinstveno ime log-file-a: '%-.200s.(1-999)'" + slo "Nemôžem vytvoriť unikátne meno log-súboru %-.200s.(1-999)" + spa "No puede crear un unico archivo log %-.200s.(1-999)" + swe "Kan inte generera ett unikt filnamn %-.200s.(1-999)" + ukr "Не можу згенерувати унікальне ім'я log-файлу %-.200s.(1-999)" ER_TABLE_NOT_LOCKED_FOR_WRITE chi "表 '%-.192s' 有 READ 锁,无法更新" cze "Tabulka '%-.192s' byla zamčena s READ a nemůže být změněna" diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 6a3730ed3df..e40a9a70f26 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -692,6 +692,7 @@ Sql_condition *Warning_info::push_warning(THD *thd, const char *msg) { Sql_condition *cond= NULL; + DBUG_ASSERT(msg[strlen(msg)-1] != '\n'); if (! m_read_only) { diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 54290cff242..6ad5159737c 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -4114,7 +4114,7 @@ bool mysql_show_binlog_events(THD* thd) if (lex_mi->pos > binlog_size) { snprintf(errmsg_buf, sizeof(errmsg_buf), "Invalid pos specified. Requested from pos:%llu is " - "greater than actual file size:%lu\n", lex_mi->pos, + "greater than actual file size:%lu", lex_mi->pos, (ulong)s.st_size); errmsg= errmsg_buf; goto err; diff --git a/sql/table.cc b/sql/table.cc index 1333cbff397..aaec593df76 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3891,7 +3891,7 @@ static void print_long_unique_table(TABLE *table) "table->field[%u]->offset = %" PRIdPTR "\n" // `%td` not available "table->field[%u]->field_length = %d\n" "table->field[%u]->null_pos wrt to record 0 = %" PRIdPTR "\n" - "table->field[%u]->null_bit_pos = %d\n", + "table->field[%u]->null_bit_pos = %d", i, field->field_name.str, i, field->ptr- table->record[0], i, field->pack_length(), diff --git a/storage/connect/domdoc.cpp b/storage/connect/domdoc.cpp index b881a10628e..13f3180a59c 100644 --- a/storage/connect/domdoc.cpp +++ b/storage/connect/domdoc.cpp @@ -243,8 +243,10 @@ int DOMDOC::DumpDoc(PGLOBAL g, char *ofn) try { Docp->save(ofn); } catch(_com_error e) { - snprintf(g->Message, sizeof(g->Message), "%s: %s", MSG(COM_ERROR), - _com_util::ConvertBSTRToString(e.Description())); + int i = snprintf(g->Message, sizeof(g->Message), "%s: %s", MSG(COM_ERROR), + _com_util::ConvertBSTRToString(e.Description())); + for (i--; i >= 0 && g->Message[i] == '\n'; i--) + g->Message[i] = 0; rc = -1; } catch(...) {} diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ad0f894f924..c2341aa667a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12684,7 +12684,7 @@ int create_table_info_t::create_table(bool create_fk) " on table %s. Please check" " the index definition to" " make sure it is of correct" - " type\n", + " type", FTS_DOC_ID_INDEX_NAME, m_table->name.m_name); @@ -12753,7 +12753,7 @@ int create_table_info_t::create_table(bool create_fk) "Create table '%s' with foreign key constraint" " failed. There is no index in the referenced" " table where the referenced columns appear" - " as the first columns.\n", m_table_name); + " as the first columns.", m_table_name); break; case DB_CHILD_NO_INDEX: @@ -12763,7 +12763,7 @@ int create_table_info_t::create_table(bool create_fk) "Create table '%s' with foreign key constraint" " failed. There is no index in the referencing" " table where referencing columns appear" - " as the first columns.\n", m_table_name); + " as the first columns.", m_table_name); break; case DB_NO_FK_ON_S_BASE_COL: push_warning_printf( @@ -12772,7 +12772,7 @@ int create_table_info_t::create_table(bool create_fk) "Create table '%s' with foreign key constraint" " failed. Cannot add foreign key constraint" " placed on the base column of stored" - " column. \n", + " column. ", m_table_name); default: break; @@ -14868,7 +14868,7 @@ ha_innobase::optimize( } else { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, uint(err), - "InnoDB: Cannot defragment table %s: returned error code %d\n", + "InnoDB: Cannot defragment table %s: returned error code %d", m_prebuilt->table->name.m_name, err); if(err == ER_SP_ALREADY_EXISTS) { @@ -21376,8 +21376,7 @@ innodb_compression_algorithm_validate( if (compression_algorithm == PAGE_LZ4_ALGORITHM) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED, - "InnoDB: innodb_compression_algorithm = %lu unsupported.\n" - "InnoDB: liblz4 is not installed. \n", + "InnoDB: innodb_compression_algorithm = %lu unsupported. liblz4 is not installed.", compression_algorithm); DBUG_RETURN(1); } @@ -21387,8 +21386,7 @@ innodb_compression_algorithm_validate( if (compression_algorithm == PAGE_LZO_ALGORITHM) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED, - "InnoDB: innodb_compression_algorithm = %lu unsupported.\n" - "InnoDB: liblzo is not installed. \n", + "InnoDB: innodb_compression_algorithm = %lu unsupported. liblzo is not installed.", compression_algorithm); DBUG_RETURN(1); } @@ -21398,8 +21396,7 @@ innodb_compression_algorithm_validate( if (compression_algorithm == PAGE_LZMA_ALGORITHM) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED, - "InnoDB: innodb_compression_algorithm = %lu unsupported.\n" - "InnoDB: liblzma is not installed. \n", + "InnoDB: innodb_compression_algorithm = %lu unsupported. liblzma is not installed.", compression_algorithm); DBUG_RETURN(1); } @@ -21409,8 +21406,7 @@ innodb_compression_algorithm_validate( if (compression_algorithm == PAGE_BZIP2_ALGORITHM) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED, - "InnoDB: innodb_compression_algorithm = %lu unsupported.\n" - "InnoDB: libbz2 is not installed. \n", + "InnoDB: innodb_compression_algorithm = %lu unsupported. libbz2 is not installed.", compression_algorithm); DBUG_RETURN(1); } @@ -21420,8 +21416,7 @@ innodb_compression_algorithm_validate( if (compression_algorithm == PAGE_SNAPPY_ALGORITHM) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_UNSUPPORTED, - "InnoDB: innodb_compression_algorithm = %lu unsupported.\n" - "InnoDB: libsnappy is not installed. \n", + "InnoDB: innodb_compression_algorithm = %lu unsupported. libsnappy is not installed.", compression_algorithm); DBUG_RETURN(1); } diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 761ad0b7443..121f2056b55 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -5429,7 +5429,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param) if (! searching) _ma_check_print_info(param, "Found block with wrong recordlength: %lu " - "at %s\n", + "at %s", block_info.rec_len, llstr(sort_param->pos,llbuff)); continue; @@ -6429,7 +6429,7 @@ void _ma_update_auto_increment_key(HA_CHECK *param, MARIA_HA *info, { if (!(param->testflag & T_VERY_SILENT)) _ma_check_print_info(param, - "Table: %s doesn't have an auto increment key\n", + "Table: %s doesn't have an auto increment key", param->isam_file_name); DBUG_VOID_RETURN; } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 2bf400d08f3..e46dc35f861 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1272,7 +1272,7 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend) (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))) { mi_check_print_warning(param, - "Record checksum is not the same as checksum stored in the index file\n"); + "Record checksum is not the same as checksum stored in the index file"); error=1; } else if (!extend) @@ -3625,7 +3625,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) block_info.rec_len > (uint) share->max_pack_length) { if (! searching) - mi_check_print_info(param,"Found block with wrong recordlength: %ld at %s\n", + mi_check_print_info(param,"Found block with wrong recordlength: %ld at %s", block_info.rec_len, llstr(sort_param->pos,llbuff)); continue; @@ -4135,7 +4135,7 @@ static int sort_delete_record(MI_SORT_PARAM *sort_param) if (info->s->options & HA_OPTION_COMPRESS_RECORD) { mi_check_print_error(param, - "Recover aborted; Can't run standard recovery on compressed tables with errors in data-file. Use switch 'myisamchk --safe-recover' to fix it\n"); + "Recover aborted; Can't run standard recovery on compressed tables with errors in data-file. Use switch 'myisamchk --safe-recover' to fix it"); DBUG_RETURN(1); } @@ -4537,7 +4537,7 @@ void update_auto_increment_key(HA_CHECK *param, MI_INFO *info, { if (!(param->testflag & T_VERY_SILENT)) mi_check_print_info(param, - "Table: %s doesn't have an auto increment key\n", + "Table: %s doesn't have an auto increment key", param->isam_file_name); DBUG_VOID_RETURN; } From 3bf8b60cafb6f78759fbf06eab70f23a8ba546a9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 28 Dec 2024 20:16:22 +0100 Subject: [PATCH 11/13] clarify the message when filesort is aborted by LIMIT ROWS EXAMINED --- mysql-test/main/information_schema.result | 2 +- mysql-test/main/limit_rows_examined.result | 4 ++-- sql/filesort.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index ebc1aeffce4..502373c8bef 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -2240,7 +2240,7 @@ drop database dummy; USE test; CREATE VIEW v AS SELECT table_schema AS object_schema, table_name AS object_name, table_type AS object_type FROM information_schema.tables ORDER BY object_schema; SELECT * FROM v LIMIT ROWS EXAMINED 9; -ERROR HY000: Sort aborted: +ERROR HY000: Sort aborted: LIMIT ROWS EXAMINED DROP VIEW v; # # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset diff --git a/mysql-test/main/limit_rows_examined.result b/mysql-test/main/limit_rows_examined.result index 7bea8862c18..99c48dba454 100644 --- a/mysql-test/main/limit_rows_examined.result +++ b/mysql-test/main/limit_rows_examined.result @@ -608,7 +608,7 @@ select c1, c2 from t3 order by c2, c1 LIMIT ROWS EXAMINED 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 5 Using filesort select c1, c2 from t3 order by c2, c1 LIMIT ROWS EXAMINED 2; -ERROR HY000: Sort aborted: +ERROR HY000: Sort aborted: LIMIT ROWS EXAMINED explain select c1, c2 from t3i order by c2, c1 LIMIT ROWS EXAMINED 2; id select_type table type possible_keys key key_len ref rows Extra @@ -624,7 +624,7 @@ select c1, c2 from t3i order by c2, c1 desc LIMIT ROWS EXAMINED 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3i index NULL it3j 8 NULL 5 Using index; Using filesort select c1, c2 from t3i order by c2, c1 desc LIMIT ROWS EXAMINED 2; -ERROR HY000: Sort aborted: +ERROR HY000: Sort aborted: LIMIT ROWS EXAMINED drop table t3,t3i; ========================================================================= INSERT/DELETE/UPDATE diff --git a/sql/filesort.cc b/sql/filesort.cc index 6f7513275bd..822c52700a6 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -474,7 +474,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, MYF(0), ER_THD(thd, ER_FILSORT_ABORT), kill_errno ? ER_THD(thd, kill_errno) : - thd->killed == ABORT_QUERY ? "" : + thd->killed == ABORT_QUERY ? "LIMIT ROWS EXAMINED" : thd->get_stmt_da()->message()); if (global_system_variables.log_warnings > 1) From 1d6f857534eeadd1b6aaa37d8e27c081421d2ffa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 29 Dec 2024 16:20:19 +0100 Subject: [PATCH 12/13] MDEV-35607 Compile error with gcc-15 (signal returns) set policy CMP0067 to NEW, this will make try_compile to use project-wide CMAKE_C_STANDARD and CMAKE_CXX_STANDARD settings --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36b6a91068d..642f7b39b99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ ENDIF() # in RPM's: #set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true") -FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0074 CMP0075 CMP0069 CMP0135) +FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0067 CMP0074 CMP0075 CMP0069 CMP0135) IF(POLICY ${p}) CMAKE_POLICY(SET ${p} NEW) ENDIF() From 3bbbeae792433e87a88b9b5773eade4486a7504b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 7 Jan 2025 16:46:32 +0100 Subject: [PATCH 13/13] fix a memory leak --- sql/sql_window.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/sql_window.cc b/sql/sql_window.cc index 565a1b964b5..3f3b63e53ed 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -2730,7 +2730,10 @@ bool get_window_functions_required_cursors( item_win_func->requires_special_cursors()) { if (add_special_frame_cursors(thd, cursor_manager, item_win_func)) + { + delete cursor_manager; return true; + } cursor_managers->push_back(cursor_manager); continue; }